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

The inviscid energy BC term with specified normal flow. More...

#include <NSEnergyWeakStagnationBC.h>

Inheritance diagram for NSEnergyWeakStagnationBC:
[legend]

Public Member Functions

 NSEnergyWeakStagnationBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
void staticValues (Real &T_s, Real &p_s, Real &rho_s)
 
Real rhoStatic ()
 
Real velmag2 ()
 
Real sdotn ()
 
bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

Real _stagnation_pressure
 Must be implemented in derived classes. More...
 
Real _stagnation_temperature
 
Real _sx
 
Real _sy
 
Real _sz
 
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

The inviscid energy BC term with specified normal flow.

Definition at line 21 of file NSEnergyWeakStagnationBC.h.

Constructor & Destructor Documentation

NSEnergyWeakStagnationBC::NSEnergyWeakStagnationBC ( const InputParameters &  parameters)

Definition at line 21 of file NSEnergyWeakStagnationBC.C.

22  : NSWeakStagnationBaseBC(parameters)
23 {
24 }
NSWeakStagnationBaseBC(const InputParameters &parameters)

Member Function Documentation

Real NSEnergyWeakStagnationBC::computeQpJacobian ( )
protectedvirtual

Definition at line 47 of file NSEnergyWeakStagnationBC.C.

48 {
49  // TODO
50  return 0.0;
51 }
Real NSEnergyWeakStagnationBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 54 of file NSEnergyWeakStagnationBC.C.

55 {
56  // TODO
57  return 0.0;
58 }
Real NSEnergyWeakStagnationBC::computeQpResidual ( )
protectedvirtual

Definition at line 27 of file NSEnergyWeakStagnationBC.C.

28 {
29  // Compute stagnation values
30  Real T_s = 0.0, p_s = 0.0, rho_s = 0.0;
31  staticValues(T_s, p_s, rho_s);
32 
33  // And get velocity magnitude, squared
34  Real velmag2 = this->velmag2();
35 
36  // Compute static total energy, E_s
37  Real E_s = _fp.cv() * T_s + 0.5 * velmag2;
38 
39  // Compute the product rho_s * H_s (H_s = static enthalpy)
40  Real rhoH_s = rho_s * E_s + p_s;
41 
42  // rho_s * H_s * |u| * (s.n) * phi_i
43  return rhoH_s * std::sqrt(velmag2) * this->sdotn() * _test[_i][_qp];
44 }
virtual Real cv(Real v=0., Real u=0.) const override
Isochoric specific heat.
const IdealGasFluidProperties & _fp
void staticValues(Real &T_s, Real &p_s, Real &rho_s)
bool NSIntegratedBC::isNSVariable ( unsigned  var)
protectedinherited
unsigned NSIntegratedBC::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 87 of file NSIntegratedBC.C.

Referenced by NSEnergyInviscidSpecifiedBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidNoPressureImplicitFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedPressureBC::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
Real NSWeakStagnationBaseBC::rhoStatic ( )
protectedinherited

Definition at line 56 of file NSWeakStagnationBaseBC.C.

Referenced by NSMassWeakStagnationBC::computeQpResidual().

57 {
58  Real T_s = 0., p_s = 0., rho_s = 0.;
59  staticValues(T_s, p_s, rho_s);
60  return rho_s;
61 }
void staticValues(Real &T_s, Real &p_s, Real &rho_s)
Real NSWeakStagnationBaseBC::sdotn ( )
protectedinherited
void NSWeakStagnationBaseBC::staticValues ( Real &  T_s,
Real &  p_s,
Real &  rho_s 
)
protectedinherited

Definition at line 39 of file NSWeakStagnationBaseBC.C.

Referenced by computeQpResidual(), NSMomentumConvectiveWeakStagnationBC::computeQpResidual(), NSMomentumPressureWeakStagnationBC::computeQpResidual(), and NSWeakStagnationBaseBC::rhoStatic().

40 {
41  // T_s = T_0 - |u|^2/2/cp
42  T_s = _stagnation_temperature - 0.5 * this->velmag2() / _fp.cp();
43 
44  if (T_s < 0.)
45  mooseError("Negative temperature detected in NSWeakStagnationBaseBC!");
46 
47  // p_s = p_0 * (T_0/T)^(-gam/(gam-1))
48  p_s = _stagnation_pressure *
49  std::pow(_stagnation_temperature / T_s, -_fp.gamma() / (_fp.gamma() - 1.));
50 
51  // Compute static rho from static pressure and temperature using equation of state.
52  rho_s = _fp.rho(p_s, T_s);
53 }
Real _stagnation_pressure
Must be implemented in derived classes.
virtual Real rho(Real pressure, Real temperature) const override
Computes density from pressure and temperature.
virtual Real cp(Real v=0., Real u=0.) const override
Specific heat.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const IdealGasFluidProperties & _fp
virtual Real gamma(Real v=0., Real u=0.) const override
Compute the ratio of specific heats.
Real NSWeakStagnationBaseBC::velmag2 ( )
protectedinherited

Definition at line 64 of file NSWeakStagnationBaseBC.C.

Referenced by computeQpResidual(), NSMassWeakStagnationBC::computeQpResidual(), NSMomentumConvectiveWeakStagnationBC::computeQpResidual(), and NSWeakStagnationBaseBC::staticValues().

65 {
66  return _u_vel[_qp] * _u_vel[_qp] + _v_vel[_qp] * _v_vel[_qp] + _w_vel[_qp] * _w_vel[_qp];
67 }
const VariableValue & _w_vel
const VariableValue & _v_vel
const VariableValue & _u_vel

Member Data Documentation

const MaterialProperty<Real>& NSIntegratedBC::_dynamic_viscosity
protectedinherited

Definition at line 56 of file NSIntegratedBC.h.

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

Definition at line 43 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_E
protectedinherited

Definition at line 47 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_u
protectedinherited

Definition at line 44 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_v
protectedinherited

Definition at line 45 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

const VariableGradient& NSIntegratedBC::_grad_rho_w
protectedinherited

Definition at line 46 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

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

Definition at line 49 of file NSIntegratedBC.h.

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

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

Definition at line 53 of file NSIntegratedBC.h.

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

unsigned NSIntegratedBC::_rhou_var_number
protectedinherited

Definition at line 50 of file NSIntegratedBC.h.

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

unsigned NSIntegratedBC::_rhov_var_number
protectedinherited

Definition at line 51 of file NSIntegratedBC.h.

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

unsigned NSIntegratedBC::_rhow_var_number
protectedinherited

Definition at line 52 of file NSIntegratedBC.h.

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

Real NSWeakStagnationBaseBC::_stagnation_pressure
protectedinherited

Must be implemented in derived classes.

Definition at line 43 of file NSWeakStagnationBaseBC.h.

Referenced by NSWeakStagnationBaseBC::staticValues().

Real NSWeakStagnationBaseBC::_stagnation_temperature
protectedinherited

Definition at line 44 of file NSWeakStagnationBaseBC.h.

Referenced by NSWeakStagnationBaseBC::staticValues().

Real NSWeakStagnationBaseBC::_sx
protectedinherited
Real NSWeakStagnationBaseBC::_sy
protectedinherited
Real NSWeakStagnationBaseBC::_sz
protectedinherited
const VariableValue& NSIntegratedBC::_u_vel
protectedinherited
const VariableValue& NSIntegratedBC::_v_vel
protectedinherited
const MaterialProperty<RealTensorValue>& NSIntegratedBC::_viscous_stress_tensor
protectedinherited
const VariableValue& NSIntegratedBC::_w_vel
protectedinherited

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