www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
NSPressureNeumannBC Class Reference

This kernel is appropriate for use with a "zero normal flow" boundary condition in the context of the Euler equations. More...

#include <NSPressureNeumannBC.h>

Inheritance diagram for NSPressureNeumannBC:
[legend]

Public Member Functions

 NSPressureNeumannBC (const InputParameters &parameters)
 
virtual ~NSPressureNeumannBC ()
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

const VariableValue & _pressure
 
unsigned _component
 
NSPressureDerivs< NSPressureNeumannBC_pressure_derivs
 
const VariableValue & _u_vel
 
const VariableValue & _v_vel
 
const VariableValue & _w_vel
 
const VariableValue & _rho
 
const VariableValue & _rho_u
 
const VariableValue & _rho_v
 
const VariableValue & _rho_w
 
const VariableValue & _rho_E
 
const VariableGradient & _grad_rho
 
const VariableGradient & _grad_rho_u
 
const VariableGradient & _grad_rho_v
 
const VariableGradient & _grad_rho_w
 
const VariableGradient & _grad_rho_E
 
unsigned _rho_var_number
 
unsigned _rhou_var_number
 
unsigned _rhov_var_number
 
unsigned _rhow_var_number
 
unsigned _rhoE_var_number
 
const MaterialProperty< Real > & _dynamic_viscosity
 
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
 
const IdealGasFluidProperties_fp
 

Private Member Functions

Real computeJacobianHelper (unsigned m)
 

Friends

template<class U >
class NSPressureDerivs
 

Detailed Description

This kernel is appropriate for use with a "zero normal flow" boundary condition in the context of the Euler equations.

In this situation, the convective term is integrated by parts and the (rho*u)(u.n) term is zero since u.n=0. Thus all we are left with is the pressure times the normal.

For the Navier-Stokes equations, a no-slip boundary condition is probably what you want instead of this... for that use NSImposedVelocityBC instead.

Definition at line 33 of file NSPressureNeumannBC.h.

Constructor & Destructor Documentation

◆ NSPressureNeumannBC()

NSPressureNeumannBC::NSPressureNeumannBC ( const InputParameters &  parameters)

Definition at line 31 of file NSPressureNeumannBC.C.

32  : NSIntegratedBC(parameters),
33  _pressure(coupledValue(NS::pressure)),
34  _component(getParam<unsigned>("component")),
35  _pressure_derivs(*this)
36 {
37 }
NSIntegratedBC(const InputParameters &parameters)
const VariableValue & _pressure
const std::string pressure
Definition: NS.h:26
NSPressureDerivs< NSPressureNeumannBC > _pressure_derivs

◆ ~NSPressureNeumannBC()

virtual NSPressureNeumannBC::~NSPressureNeumannBC ( )
inlinevirtual

Definition at line 38 of file NSPressureNeumannBC.h.

38 {}

Member Function Documentation

◆ computeJacobianHelper()

Real NSPressureNeumannBC::computeJacobianHelper ( unsigned  m)
private

Definition at line 62 of file NSPressureNeumannBC.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

63 {
64  return _normals[_qp](_component) * _pressure_derivs.get_grad(m) * _phi[_j][_qp] * _test[_i][_qp];
65 }
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
NSPressureDerivs< NSPressureNeumannBC > _pressure_derivs

◆ computeQpJacobian()

Real NSPressureNeumannBC::computeQpJacobian ( )
protectedvirtual

Definition at line 46 of file NSPressureNeumannBC.C.

47 {
49  1); // <-- the on-diagonal variable number is _component+1
50 }
Real computeJacobianHelper(unsigned m)

◆ computeQpOffDiagJacobian()

Real NSPressureNeumannBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 53 of file NSPressureNeumannBC.C.

54 {
55  if (isNSVariable(jvar))
56  return computeJacobianHelper(mapVarNumber(jvar));
57  else
58  return 0.0;
59 }
bool isNSVariable(unsigned var)
unsigned mapVarNumber(unsigned var)
Real computeJacobianHelper(unsigned m)

◆ computeQpResidual()

Real NSPressureNeumannBC::computeQpResidual ( )
protectedvirtual

Definition at line 40 of file NSPressureNeumannBC.C.

41 {
42  return _pressure[_qp] * _normals[_qp](_component) * _test[_i][_qp];
43 }
const VariableValue & _pressure

◆ isNSVariable()

bool NSIntegratedBC::isNSVariable ( unsigned  var)
protectedinherited

◆ mapVarNumber()

unsigned NSIntegratedBC::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 90 of file NSIntegratedBC.C.

Referenced by NSEnergyInviscidSpecifiedBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidNoPressureImplicitFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), computeQpOffDiagJacobian(), NSMomentumViscousBC::computeQpOffDiagJacobian(), and NSEnergyViscousBC::computeQpOffDiagJacobian().

91 {
92  // Convert the Moose numbering to:
93  // 0 for rho
94  // 1 for rho*u
95  // 2 for rho*v
96  // 3 for rho*w
97  // 4 for rho*e
98  // regardless of the problem dimension, etc.
99  unsigned int mapped_var_number;
100 
101  if (var == _rho_var_number)
102  mapped_var_number = 0;
103  else if (var == _rhou_var_number)
104  mapped_var_number = 1;
105  else if (var == _rhov_var_number)
106  mapped_var_number = 2;
107  else if (var == _rhow_var_number)
108  mapped_var_number = 3;
109  else if (var == _rhoE_var_number)
110  mapped_var_number = 4;
111  else
112  mooseError("Invalid var!");
113 
114  return mapped_var_number;
115 }
unsigned _rhov_var_number
unsigned _rhou_var_number
unsigned _rhow_var_number
unsigned _rho_var_number
unsigned _rhoE_var_number

Friends And Related Function Documentation

◆ NSPressureDerivs

template<class U >
friend class NSPressureDerivs
friend

Definition at line 57 of file NSPressureNeumannBC.h.

Member Data Documentation

◆ _component

unsigned NSPressureNeumannBC::_component
protected

◆ _dynamic_viscosity

const MaterialProperty<Real>& NSIntegratedBC::_dynamic_viscosity
protectedinherited

Definition at line 59 of file NSIntegratedBC.h.

◆ _fp

const IdealGasFluidProperties& NSIntegratedBC::_fp
protectedinherited

◆ _grad_rho

const VariableGradient& NSIntegratedBC::_grad_rho
protectedinherited

Definition at line 46 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_E

const VariableGradient& NSIntegratedBC::_grad_rho_E
protectedinherited

Definition at line 50 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_u

const VariableGradient& NSIntegratedBC::_grad_rho_u
protectedinherited

Definition at line 47 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_v

const VariableGradient& NSIntegratedBC::_grad_rho_v
protectedinherited

Definition at line 48 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_w

const VariableGradient& NSIntegratedBC::_grad_rho_w
protectedinherited

Definition at line 49 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _pressure

const VariableValue& NSPressureNeumannBC::_pressure
protected

Definition at line 46 of file NSPressureNeumannBC.h.

Referenced by computeQpResidual().

◆ _pressure_derivs

NSPressureDerivs<NSPressureNeumannBC> NSPressureNeumannBC::_pressure_derivs
protected

Definition at line 53 of file NSPressureNeumannBC.h.

Referenced by computeJacobianHelper().

◆ _rho

const VariableValue& NSIntegratedBC::_rho
protectedinherited

◆ _rho_E

const VariableValue& NSIntegratedBC::_rho_E
protectedinherited

◆ _rho_u

const VariableValue& NSIntegratedBC::_rho_u
protectedinherited

◆ _rho_v

const VariableValue& NSIntegratedBC::_rho_v
protectedinherited

◆ _rho_var_number

unsigned NSIntegratedBC::_rho_var_number
protectedinherited

Definition at line 52 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rho_w

const VariableValue& NSIntegratedBC::_rho_w
protectedinherited

◆ _rhoE_var_number

unsigned NSIntegratedBC::_rhoE_var_number
protectedinherited

Definition at line 56 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rhou_var_number

unsigned NSIntegratedBC::_rhou_var_number
protectedinherited

Definition at line 53 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rhov_var_number

unsigned NSIntegratedBC::_rhov_var_number
protectedinherited

Definition at line 54 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rhow_var_number

unsigned NSIntegratedBC::_rhow_var_number
protectedinherited

Definition at line 55 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _u_vel

const VariableValue& NSIntegratedBC::_u_vel
protectedinherited

◆ _v_vel

const VariableValue& NSIntegratedBC::_v_vel
protectedinherited

◆ _viscous_stress_tensor

const MaterialProperty<RealTensorValue>& NSIntegratedBC::_viscous_stress_tensor
protectedinherited

◆ _w_vel

const VariableValue& NSIntegratedBC::_w_vel
protectedinherited

The documentation for this class was generated from the following files: