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

This class implements the mass equation boundary term with a specified value of rho*(u.n) imposed weakly. More...

#include <NSMassSpecifiedNormalFlowBC.h>

Inheritance diagram for NSMassSpecifiedNormalFlowBC:
[legend]

Public Member Functions

 NSMassSpecifiedNormalFlowBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
Real qpResidualHelper (Real rhoun)
 Compute the residual contribution for a given value of rho*(u.n). More...
 
Real qpJacobianHelper (unsigned var_number)
 Compute the Jacobian contribution due to variable number 'var_number'. More...
 
bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

const Real _rhoun
 
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
 

Detailed Description

This class implements the mass equation boundary term with a specified value of rho*(u.n) imposed weakly.

Note: if you wish to impose rho*(u.n) = 0 weakly, you don't actually need this class, that is the natural boundary condition.

Definition at line 28 of file NSMassSpecifiedNormalFlowBC.h.

Constructor & Destructor Documentation

◆ NSMassSpecifiedNormalFlowBC()

NSMassSpecifiedNormalFlowBC::NSMassSpecifiedNormalFlowBC ( const InputParameters &  parameters)

Definition at line 25 of file NSMassSpecifiedNormalFlowBC.C.

26  : NSMassBC(parameters), _rhoun(getParam<Real>("rhoun"))
27 {
28 }
NSMassBC(const InputParameters &parameters)
Definition: NSMassBC.C:22

Member Function Documentation

◆ computeQpJacobian()

Real NSMassSpecifiedNormalFlowBC::computeQpJacobian ( )
protectedvirtual

Definition at line 37 of file NSMassSpecifiedNormalFlowBC.C.

38 {
39  return 0.0;
40 }

◆ computeQpOffDiagJacobian()

Real NSMassSpecifiedNormalFlowBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 43 of file NSMassSpecifiedNormalFlowBC.C.

44 {
45  return 0.0;
46 }

◆ computeQpResidual()

Real NSMassSpecifiedNormalFlowBC::computeQpResidual ( )
protectedvirtual

Definition at line 31 of file NSMassSpecifiedNormalFlowBC.C.

32 {
33  return qpResidualHelper(_rhoun);
34 }
Real qpResidualHelper(Real rhoun)
Compute the residual contribution for a given value of rho*(u.n).
Definition: NSMassBC.C:25

◆ 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(), NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSMomentumInviscidNoPressureImplicitFlowBC::computeQpOffDiagJacobian(), NSPressureNeumannBC::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

◆ qpJacobianHelper()

Real NSMassBC::qpJacobianHelper ( unsigned  var_number)
protectedinherited

Compute the Jacobian contribution due to variable number 'var_number'.

Note: if this is a specified normal flow boundary, the Jacobian will be zero.

Definition at line 31 of file NSMassBC.C.

Referenced by NSMassUnspecifiedNormalFlowBC::computeQpJacobian(), and NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian().

32 {
33  switch (var_number)
34  {
35  case 0: // density
36  case 4: // energy
37  return 0.0;
38 
39  case 1:
40  case 2:
41  case 3: // momentums
42  // If one of the momentums, the derivative is a mass
43  // matrix times that normal component...
44  return _phi[_j][_qp] * _test[_i][_qp] * _normals[_qp](var_number - 1);
45 
46  default:
47  mooseError("Should not get here!");
48  break;
49  }
50 }

◆ qpResidualHelper()

Real NSMassBC::qpResidualHelper ( Real  rhoun)
protectedinherited

Compute the residual contribution for a given value of rho*(u.n).

This value may come from the current nonlinear solution or be specified, depending on the derived class.

Definition at line 25 of file NSMassBC.C.

Referenced by NSMassUnspecifiedNormalFlowBC::computeQpResidual(), and computeQpResidual().

26 {
27  return rhoun * _test[_i][_qp];
28 }

Member Data Documentation

◆ _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().

◆ _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().

◆ _rhoun

const Real NSMassSpecifiedNormalFlowBC::_rhoun
protected

Definition at line 39 of file NSMassSpecifiedNormalFlowBC.h.

Referenced by computeQpResidual().

◆ _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: