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

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

#include <NSEnergyInviscidUnspecifiedBC.h>

Inheritance diagram for NSEnergyInviscidUnspecifiedBC:
[legend]

Public Member Functions

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

const VariableValue & _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 NSEnergyInviscidUnspecifiedBC.h.

Constructor & Destructor Documentation

◆ NSEnergyInviscidUnspecifiedBC()

NSEnergyInviscidUnspecifiedBC::NSEnergyInviscidUnspecifiedBC ( const InputParameters &  parameters)

Definition at line 25 of file NSEnergyInviscidUnspecifiedBC.C.

26  : NSEnergyInviscidBC(parameters), _pressure(coupledValue(NS::pressure))
27 {
28 }
NSEnergyInviscidBC(const InputParameters &parameters)
const std::string pressure
Definition: NS.h:26

Member Function Documentation

◆ computeJacobianHelper()

Real NSEnergyInviscidUnspecifiedBC::computeJacobianHelper ( unsigned  var_number)
private

Definition at line 58 of file NSEnergyInviscidUnspecifiedBC.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

59 {
60  // Velocity vector object
61  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
62 
63  // Normal component of velocity
64  Real un = vel * _normals[_qp];
65 
66  // When both u.n and pressure are unspecified, all 3 Jacobian terms apply.
67  // See base class for details.
68  return qpJacobianTermA(var_number, _pressure[_qp]) + qpJacobianTermB(var_number, un) +
69  qpJacobianTermC(var_number, un);
70 }
const VariableValue & _w_vel
Real qpJacobianTermC(unsigned var_number, Real un)
const VariableValue & _v_vel
Real qpJacobianTermA(unsigned var_number, Real pressure)
Real qpJacobianTermB(unsigned var_number, Real un)
const VariableValue & _u_vel

◆ computeQpJacobian()

Real NSEnergyInviscidUnspecifiedBC::computeQpJacobian ( )
protectedvirtual

Definition at line 43 of file NSEnergyInviscidUnspecifiedBC.C.

44 {
45  return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
46 }
Real computeJacobianHelper(unsigned var_number)

◆ computeQpOffDiagJacobian()

Real NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 49 of file NSEnergyInviscidUnspecifiedBC.C.

50 {
51  if (isNSVariable(jvar))
52  return computeJacobianHelper(mapVarNumber(jvar));
53  else
54  return 0.0;
55 }
bool isNSVariable(unsigned var)
unsigned mapVarNumber(unsigned var)
Real computeJacobianHelper(unsigned var_number)

◆ computeQpResidual()

Real NSEnergyInviscidUnspecifiedBC::computeQpResidual ( )
protectedvirtual

Definition at line 31 of file NSEnergyInviscidUnspecifiedBC.C.

32 {
33  // Velocity vector object
34  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
35 
36  // Normal component
37  Real un = vel * _normals[_qp];
38 
39  return qpResidualHelper(_pressure[_qp], un);
40 }
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(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), 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

◆ qpJacobianTermA()

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

Definition at line 55 of file NSEnergyInviscidBC.C.

Referenced by NSEnergyInviscidSpecifiedPressureBC::computeJacobianHelper(), and 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 NSEnergyInviscidSpecifiedPressureBC::computeJacobianHelper(), 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 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

const VariableValue& NSEnergyInviscidUnspecifiedBC::_pressure
protected

Definition at line 35 of file NSEnergyInviscidUnspecifiedBC.h.

Referenced by computeJacobianHelper(), and computeQpResidual().

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

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