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

This class couples together all the variables for the compressible Navier-Stokes equations to allow them to be used in derived IntegratedBC classes. More...

#include <NSIntegratedBC.h>

Inheritance diagram for NSIntegratedBC:
[legend]

Public Member Functions

 NSIntegratedBC (const InputParameters &parameters)
 

Protected Member Functions

bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

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 couples together all the variables for the compressible Navier-Stokes equations to allow them to be used in derived IntegratedBC classes.

This prevents duplication of lines of code between e.g. the momentum and energy equations, since they have a lot in common.

Definition at line 30 of file NSIntegratedBC.h.

Constructor & Destructor Documentation

◆ NSIntegratedBC()

NSIntegratedBC::NSIntegratedBC ( const InputParameters &  parameters)

Definition at line 46 of file NSIntegratedBC.C.

47  : IntegratedBC(parameters),
48  _u_vel(coupledValue(NS::velocity_x)),
49  _v_vel(_mesh.dimension() >= 2 ? coupledValue(NS::velocity_y) : _zero),
50  _w_vel(_mesh.dimension() == 3 ? coupledValue(NS::velocity_z) : _zero),
51 
52  _rho(coupledValue(NS::density)),
53  _rho_u(coupledValue(NS::momentum_x)),
54  _rho_v(_mesh.dimension() >= 2 ? coupledValue(NS::momentum_y) : _zero),
55  _rho_w(_mesh.dimension() == 3 ? coupledValue(NS::momentum_z) : _zero),
56  _rho_E(coupledValue(NS::total_energy)),
57 
58  _grad_rho(coupledGradient(NS::density)),
59  _grad_rho_u(coupledGradient(NS::momentum_x)),
60  _grad_rho_v(_mesh.dimension() >= 2 ? coupledGradient(NS::momentum_y) : _grad_zero),
61  _grad_rho_w(_mesh.dimension() == 3 ? coupledGradient(NS::momentum_z) : _grad_zero),
62  _grad_rho_E(coupledGradient(NS::total_energy)),
63 
64  // Variable numberings
65  _rho_var_number(coupled(NS::density)),
66  _rhou_var_number(coupled(NS::momentum_x)),
67  _rhov_var_number(_mesh.dimension() >= 2 ? coupled(NS::momentum_y) : libMesh::invalid_uint),
68  _rhow_var_number(_mesh.dimension() == 3 ? coupled(NS::momentum_z) : libMesh::invalid_uint),
69  _rhoE_var_number(coupled(NS::total_energy)),
70 
71  _dynamic_viscosity(getMaterialProperty<Real>("dynamic_viscosity")),
72  _viscous_stress_tensor(getMaterialProperty<RealTensorValue>("viscous_stress_tensor")),
73 
74  // FluidProperties UserObject
75  _fp(getUserObject<IdealGasFluidProperties>("fluid_properties"))
76 {
77 }
unsigned _rhov_var_number
Definition: NS.h:15
const std::string momentum_x
Definition: NS.h:18
const VariableGradient & _grad_rho_w
const VariableValue & _rho_E
const VariableValue & _rho_w
const std::string velocity_z
Definition: NS.h:25
const VariableValue & _w_vel
const VariableValue & _rho
const std::string density
Definition: NS.h:17
unsigned _rhou_var_number
const VariableGradient & _grad_rho_u
const std::string velocity_x
Definition: NS.h:23
const VariableGradient & _grad_rho_v
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
unsigned _rhow_var_number
unsigned _rho_var_number
unsigned _rhoE_var_number
const MaterialProperty< Real > & _dynamic_viscosity
const std::string velocity_y
Definition: NS.h:24
const VariableGradient & _grad_rho_E
const std::string momentum_y
Definition: NS.h:19
const VariableValue & _v_vel
const IdealGasFluidProperties & _fp
const std::string total_energy
Definition: NS.h:21
const VariableValue & _rho_u
const std::string momentum_z
Definition: NS.h:20
const VariableGradient & _grad_rho
Ideal gas fluid properties.
const VariableValue & _u_vel
const VariableValue & _rho_v

Member Function Documentation

◆ isNSVariable()

bool NSIntegratedBC::isNSVariable ( unsigned  var)
protected

◆ mapVarNumber()

unsigned NSIntegratedBC::mapVarNumber ( unsigned  var)
protected

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

Member Data Documentation

◆ _dynamic_viscosity

const MaterialProperty<Real>& NSIntegratedBC::_dynamic_viscosity
protected

Definition at line 59 of file NSIntegratedBC.h.

◆ _fp

const IdealGasFluidProperties& NSIntegratedBC::_fp
protected

◆ _grad_rho

const VariableGradient& NSIntegratedBC::_grad_rho
protected

Definition at line 46 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_E

const VariableGradient& NSIntegratedBC::_grad_rho_E
protected

Definition at line 50 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_u

const VariableGradient& NSIntegratedBC::_grad_rho_u
protected

Definition at line 47 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_v

const VariableGradient& NSIntegratedBC::_grad_rho_v
protected

Definition at line 48 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_w

const VariableGradient& NSIntegratedBC::_grad_rho_w
protected

Definition at line 49 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _rho

const VariableValue& NSIntegratedBC::_rho
protected

◆ _rho_E

const VariableValue& NSIntegratedBC::_rho_E
protected

◆ _rho_u

const VariableValue& NSIntegratedBC::_rho_u
protected

◆ _rho_v

const VariableValue& NSIntegratedBC::_rho_v
protected

◆ _rho_var_number

unsigned NSIntegratedBC::_rho_var_number
protected

Definition at line 52 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

◆ _rho_w

const VariableValue& NSIntegratedBC::_rho_w
protected

◆ _rhoE_var_number

unsigned NSIntegratedBC::_rhoE_var_number
protected

Definition at line 56 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

◆ _rhou_var_number

unsigned NSIntegratedBC::_rhou_var_number
protected

Definition at line 53 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

◆ _rhov_var_number

unsigned NSIntegratedBC::_rhov_var_number
protected

Definition at line 54 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

◆ _rhow_var_number

unsigned NSIntegratedBC::_rhow_var_number
protected

Definition at line 55 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

◆ _u_vel

const VariableValue& NSIntegratedBC::_u_vel
protected

◆ _v_vel

const VariableValue& NSIntegratedBC::_v_vel
protected

◆ _viscous_stress_tensor

const MaterialProperty<RealTensorValue>& NSIntegratedBC::_viscous_stress_tensor
protected

◆ _w_vel

const VariableValue& NSIntegratedBC::_w_vel
protected

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