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

The convective part (sans pressure term) of the momentum equation boundary integral evaluated at specified stagnation temperature, stagnation pressure, and flow direction values. More...

#include <NSMomentumConvectiveWeakStagnationBC.h>

Inheritance diagram for NSMomentumConvectiveWeakStagnationBC:
[legend]

Public Member Functions

 NSMomentumConvectiveWeakStagnationBC (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

const unsigned int _component
 
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 convective part (sans pressure term) of the momentum equation boundary integral evaluated at specified stagnation temperature, stagnation pressure, and flow direction values.

Definition at line 26 of file NSMomentumConvectiveWeakStagnationBC.h.

Constructor & Destructor Documentation

◆ NSMomentumConvectiveWeakStagnationBC()

NSMomentumConvectiveWeakStagnationBC::NSMomentumConvectiveWeakStagnationBC ( const InputParameters &  parameters)

Definition at line 27 of file NSMomentumConvectiveWeakStagnationBC.C.

29  : NSWeakStagnationBaseBC(parameters), _component(getParam<unsigned>("component"))
30 {
31 }
NSWeakStagnationBaseBC(const InputParameters &parameters)

Member Function Documentation

◆ computeQpJacobian()

Real NSMomentumConvectiveWeakStagnationBC::computeQpJacobian ( )
protectedvirtual

Definition at line 48 of file NSMomentumConvectiveWeakStagnationBC.C.

49 {
50  // TODO
51  return 0.0;
52 }

◆ computeQpOffDiagJacobian()

Real NSMomentumConvectiveWeakStagnationBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 55 of file NSMomentumConvectiveWeakStagnationBC.C.

56 {
57  // TODO
58  return 0.0;
59 }

◆ computeQpResidual()

Real NSMomentumConvectiveWeakStagnationBC::computeQpResidual ( )
protectedvirtual

Definition at line 34 of file NSMomentumConvectiveWeakStagnationBC.C.

35 {
36  // Compute stagnation values
37  Real T_s = 0.0, p_s = 0.0, rho_s = 0.0;
38  staticValues(T_s, p_s, rho_s);
39 
40  // The specified flow direction, as a vector
41  RealVectorValue s(_sx, _sy, _sz);
42 
43  // (rho_s * |u|^2 * s_k * (s.n)) * phi_i
44  return (rho_s * this->velmag2() * s(_component) * this->sdotn()) * _test[_i][_qp];
45 }
void staticValues(Real &T_s, Real &p_s, Real &rho_s)

◆ 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(), 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

◆ rhoStatic()

Real NSWeakStagnationBaseBC::rhoStatic ( )
protectedinherited

Definition at line 59 of file NSWeakStagnationBaseBC.C.

Referenced by NSMassWeakStagnationBC::computeQpResidual().

60 {
61  Real T_s = 0., p_s = 0., rho_s = 0.;
62  staticValues(T_s, p_s, rho_s);
63  return rho_s;
64 }
void staticValues(Real &T_s, Real &p_s, Real &rho_s)

◆ sdotn()

Real NSWeakStagnationBaseBC::sdotn ( )
protectedinherited

Definition at line 73 of file NSWeakStagnationBaseBC.C.

Referenced by NSEnergyWeakStagnationBC::computeQpResidual(), NSMassWeakStagnationBC::computeQpResidual(), and computeQpResidual().

74 {
75  return _sx * _normals[_qp](0) + _sy * _normals[_qp](1) + _sz * _normals[_qp](2);
76 }

◆ staticValues()

void NSWeakStagnationBaseBC::staticValues ( Real &  T_s,
Real &  p_s,
Real &  rho_s 
)
protectedinherited

Definition at line 42 of file NSWeakStagnationBaseBC.C.

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

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

◆ velmag2()

Real NSWeakStagnationBaseBC::velmag2 ( )
protectedinherited

Definition at line 67 of file NSWeakStagnationBaseBC.C.

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

68 {
69  return _u_vel[_qp] * _u_vel[_qp] + _v_vel[_qp] * _v_vel[_qp] + _w_vel[_qp] * _w_vel[_qp];
70 }
const VariableValue & _w_vel
const VariableValue & _v_vel
const VariableValue & _u_vel

Member Data Documentation

◆ _component

const unsigned int NSMomentumConvectiveWeakStagnationBC::_component
protected

Definition at line 37 of file NSMomentumConvectiveWeakStagnationBC.h.

Referenced by computeQpResidual().

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

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

◆ _stagnation_pressure

Real NSWeakStagnationBaseBC::_stagnation_pressure
protectedinherited

Must be implemented in derived classes.

Definition at line 46 of file NSWeakStagnationBaseBC.h.

Referenced by NSWeakStagnationBaseBC::staticValues().

◆ _stagnation_temperature

Real NSWeakStagnationBaseBC::_stagnation_temperature
protectedinherited

Definition at line 47 of file NSWeakStagnationBaseBC.h.

Referenced by NSWeakStagnationBaseBC::staticValues().

◆ _sx

Real NSWeakStagnationBaseBC::_sx
protectedinherited

Definition at line 52 of file NSWeakStagnationBaseBC.h.

Referenced by computeQpResidual(), and NSWeakStagnationBaseBC::sdotn().

◆ _sy

Real NSWeakStagnationBaseBC::_sy
protectedinherited

Definition at line 53 of file NSWeakStagnationBaseBC.h.

Referenced by computeQpResidual(), and NSWeakStagnationBaseBC::sdotn().

◆ _sz

Real NSWeakStagnationBaseBC::_sz
protectedinherited

Definition at line 54 of file NSWeakStagnationBaseBC.h.

Referenced by computeQpResidual(), and NSWeakStagnationBaseBC::sdotn().

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