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

The inviscid energy BC term with specified pressure. More...

#include <NSEnergyInviscidSpecifiedPressureBC.h>

Inheritance diagram for NSEnergyInviscidSpecifiedPressureBC:
[legend]

Public Member Functions

 NSEnergyInviscidSpecifiedPressureBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
Real qpResidualHelper (Real pressure, Real un)
 
Real qpResidualHelper (Real rho, RealVectorValue u, Real pressure)
 
Real qpJacobianTermA (unsigned var_number, Real pressure)
 
Real qpJacobianTermB (unsigned var_number, Real un)
 
Real qpJacobianTermC (unsigned var_number, Real un)
 
bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

Real _specified_pressure
 
const VariableValue & _temperature
 
NSPressureDerivs< NSEnergyInviscidBC_pressure_derivs
 
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
 

Private Member Functions

Real computeJacobianHelper (unsigned var_number)
 

Detailed Description

The inviscid energy BC term with specified pressure.

Definition at line 24 of file NSEnergyInviscidSpecifiedPressureBC.h.

Constructor & Destructor Documentation

◆ NSEnergyInviscidSpecifiedPressureBC()

NSEnergyInviscidSpecifiedPressureBC::NSEnergyInviscidSpecifiedPressureBC ( const InputParameters &  parameters)

Definition at line 22 of file NSEnergyInviscidSpecifiedPressureBC.C.

24  : NSEnergyInviscidBC(parameters), _specified_pressure(getParam<Real>("specified_pressure"))
25 {
26 }
NSEnergyInviscidBC(const InputParameters &parameters)

Member Function Documentation

◆ computeJacobianHelper()

Real NSEnergyInviscidSpecifiedPressureBC::computeJacobianHelper ( unsigned  var_number)
private

Definition at line 56 of file NSEnergyInviscidSpecifiedPressureBC.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

57 {
58  // Velocity vector object
59  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
60 
61  // Normal component of velocity
62  Real un = vel * _normals[_qp];
63 
64  // For specified pressure, term "C" is zero, see base class for details.
65  return qpJacobianTermA(var_number, _specified_pressure) + qpJacobianTermB(var_number, un);
66 }
const VariableValue & _w_vel
const VariableValue & _v_vel
Real qpJacobianTermA(unsigned var_number, Real pressure)
Real qpJacobianTermB(unsigned var_number, Real un)
const VariableValue & _u_vel

◆ computeQpJacobian()

Real NSEnergyInviscidSpecifiedPressureBC::computeQpJacobian ( )
protectedvirtual

Definition at line 41 of file NSEnergyInviscidSpecifiedPressureBC.C.

42 {
43  return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
44 }

◆ computeQpOffDiagJacobian()

Real NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 47 of file NSEnergyInviscidSpecifiedPressureBC.C.

48 {
49  if (isNSVariable(jvar))
50  return computeJacobianHelper(mapVarNumber(jvar));
51  else
52  return 0.0;
53 }
bool isNSVariable(unsigned var)
unsigned mapVarNumber(unsigned var)

◆ computeQpResidual()

Real NSEnergyInviscidSpecifiedPressureBC::computeQpResidual ( )
protectedvirtual

Definition at line 29 of file NSEnergyInviscidSpecifiedPressureBC.C.

30 {
31  // Velocity vector object
32  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
33 
34  // Normal component
35  Real un = vel * _normals[_qp];
36 
38 }
const VariableValue & _w_vel
Real qpResidualHelper(Real pressure, Real un)
const VariableValue & _v_vel
const VariableValue & _u_vel

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

◆ qpJacobianTermA()

Real NSEnergyInviscidBC::qpJacobianTermA ( unsigned  var_number,
Real  pressure 
)
protectedinherited

Definition at line 55 of file NSEnergyInviscidBC.C.

Referenced by computeJacobianHelper(), and NSEnergyInviscidUnspecifiedBC::computeJacobianHelper().

56 {
57  Real result = 0.0;
58 
59  switch (var_number)
60  {
61  case 0: // density
62  {
63  // Velocity vector object
64  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
65 
66  result = -(vel * _normals[_qp]);
67  break;
68  }
69 
70  case 1:
71  case 2:
72  case 3: // momentums
73  result = _normals[_qp](var_number - 1);
74  break;
75 
76  case 4: // energy
77  result = 0.;
78  break;
79 
80  default:
81  mooseError("Shouldn't get here!");
82  break;
83  }
84 
85  // Notice the division by _rho[_qp] here. This comes from taking the
86  // derivative wrt to either density or momentum.
87  return (_rho_E[_qp] + pressure) / _rho[_qp] * result * _phi[_j][_qp] * _test[_i][_qp];
88 }
const VariableValue & _rho_E
const VariableValue & _w_vel
const VariableValue & _rho
const VariableValue & _v_vel
const std::string pressure
Definition: NS.h:26
const VariableValue & _u_vel

◆ qpJacobianTermB()

Real NSEnergyInviscidBC::qpJacobianTermB ( unsigned  var_number,
Real  un 
)
protectedinherited

Definition at line 92 of file NSEnergyInviscidBC.C.

Referenced by computeJacobianHelper(), NSEnergyInviscidUnspecifiedBC::computeJacobianHelper(), NSEnergyInviscidSpecifiedBC::computeJacobianHelper(), and NSEnergyInviscidSpecifiedNormalFlowBC::computeJacobianHelper().

93 {
94  Real result = 0.0;
95  switch (var_number)
96  {
97  case 0: // density
98  case 1:
99  case 2:
100  case 3: // momentums
101  {
102  result = 0.;
103  break;
104  }
105 
106  case 4: // energy
107  {
108  result = _phi[_j][_qp] * un * _test[_i][_qp];
109  break;
110  }
111 
112  default:
113  mooseError("Shouldn't get here!");
114  break;
115  }
116 
117  return result;
118 }

◆ qpJacobianTermC()

Real NSEnergyInviscidBC::qpJacobianTermC ( unsigned  var_number,
Real  un 
)
protectedinherited

Definition at line 122 of file NSEnergyInviscidBC.C.

Referenced by NSEnergyInviscidUnspecifiedBC::computeJacobianHelper(), and NSEnergyInviscidSpecifiedNormalFlowBC::computeJacobianHelper().

123 {
124  return _pressure_derivs.get_grad(var_number) * _phi[_j][_qp] * un * _test[_i][_qp];
125 }
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
NSPressureDerivs< NSEnergyInviscidBC > _pressure_derivs

◆ qpResidualHelper() [1/2]

Real NSEnergyInviscidBC::qpResidualHelper ( Real  pressure,
Real  un 
)
protectedinherited

◆ qpResidualHelper() [2/2]

Real NSEnergyInviscidBC::qpResidualHelper ( Real  rho,
RealVectorValue  u,
Real  pressure 
)
protectedinherited

Definition at line 43 of file NSEnergyInviscidBC.C.

44 {
45  // return (rho*(cv*_temperature[_qp] + 0.5*u.norm_sq()) + pressure) * (u*_normals[_qp]) *
46  // _test[_i][_qp];
47  // We can also expand pressure in terms of rho... does this make a difference?
48  // Then we don't use the input pressure value.
49  return rho * (_fp.gamma() * _fp.cv() * _temperature[_qp] + 0.5 * u.norm_sq()) *
50  (u * _normals[_qp]) * _test[_i][_qp];
51 }
const IdealGasFluidProperties & _fp
const VariableValue & _temperature

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

◆ _pressure_derivs

NSPressureDerivs<NSEnergyInviscidBC> NSEnergyInviscidBC::_pressure_derivs
protectedinherited

Definition at line 48 of file NSEnergyInviscidBC.h.

Referenced by NSEnergyInviscidBC::qpJacobianTermC().

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

◆ _specified_pressure

Real NSEnergyInviscidSpecifiedPressureBC::_specified_pressure
protected

◆ _temperature

const VariableValue& NSEnergyInviscidBC::_temperature
protectedinherited

Definition at line 44 of file NSEnergyInviscidBC.h.

Referenced by NSEnergyInviscidBC::qpResidualHelper().

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