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 27 of file NSIntegratedBC.h.

Constructor & Destructor Documentation

NSIntegratedBC::NSIntegratedBC ( const InputParameters &  parameters)

Definition at line 43 of file NSIntegratedBC.C.

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

Member Function Documentation

bool NSIntegratedBC::isNSVariable ( unsigned  var)
protected
unsigned NSIntegratedBC::mapVarNumber ( unsigned  var)
protected

Definition at line 87 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().

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

Member Data Documentation

const MaterialProperty<Real>& NSIntegratedBC::_dynamic_viscosity
protected

Definition at line 56 of file NSIntegratedBC.h.

const IdealGasFluidProperties& NSIntegratedBC::_fp
protected
const VariableGradient& NSIntegratedBC::_grad_rho
protected

Definition at line 43 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_E
protected

Definition at line 47 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_u
protected

Definition at line 44 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_v
protected

Definition at line 45 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_w
protected

Definition at line 46 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableValue& NSIntegratedBC::_rho
protected
const VariableValue& NSIntegratedBC::_rho_E
protected
const VariableValue& NSIntegratedBC::_rho_u
protected
const VariableValue& NSIntegratedBC::_rho_v
protected
unsigned NSIntegratedBC::_rho_var_number
protected

Definition at line 49 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

const VariableValue& NSIntegratedBC::_rho_w
protected
unsigned NSIntegratedBC::_rhoE_var_number
protected

Definition at line 53 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

unsigned NSIntegratedBC::_rhou_var_number
protected

Definition at line 50 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

unsigned NSIntegratedBC::_rhov_var_number
protected

Definition at line 51 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

unsigned NSIntegratedBC::_rhow_var_number
protected

Definition at line 52 of file NSIntegratedBC.h.

Referenced by isNSVariable(), and mapVarNumber().

const VariableValue& NSIntegratedBC::_u_vel
protected
const VariableValue& NSIntegratedBC::_v_vel
protected
const MaterialProperty<RealTensorValue>& NSIntegratedBC::_viscous_stress_tensor
protected
const VariableValue& NSIntegratedBC::_w_vel
protected

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