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

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

#include <NSEnergyInviscidSpecifiedNormalFlowBC.h>

Inheritance diagram for NSEnergyInviscidSpecifiedNormalFlowBC:
[legend]

Public Member Functions

 NSEnergyInviscidSpecifiedNormalFlowBC (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 Real _un
 
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 normal flow.

Definition at line 24 of file NSEnergyInviscidSpecifiedNormalFlowBC.h.

Constructor & Destructor Documentation

◆ NSEnergyInviscidSpecifiedNormalFlowBC()

NSEnergyInviscidSpecifiedNormalFlowBC::NSEnergyInviscidSpecifiedNormalFlowBC ( const InputParameters &  parameters)

Definition at line 26 of file NSEnergyInviscidSpecifiedNormalFlowBC.C.

28  : NSEnergyInviscidBC(parameters), _pressure(coupledValue(NS::pressure)), _un(getParam<Real>("un"))
29 {
30 }
NSEnergyInviscidBC(const InputParameters &parameters)
const std::string pressure
Definition: NS.h:26

Member Function Documentation

◆ computeJacobianHelper()

Real NSEnergyInviscidSpecifiedNormalFlowBC::computeJacobianHelper ( unsigned  var_number)
private

Definition at line 54 of file NSEnergyInviscidSpecifiedNormalFlowBC.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

55 {
56  // For specified u.n, term "A" is zero, see base class for details.
57  return qpJacobianTermB(var_number, _un) + qpJacobianTermC(var_number, _un);
58 }
Real qpJacobianTermC(unsigned var_number, Real un)
Real qpJacobianTermB(unsigned var_number, Real un)

◆ computeQpJacobian()

Real NSEnergyInviscidSpecifiedNormalFlowBC::computeQpJacobian ( )
protectedvirtual

Definition at line 39 of file NSEnergyInviscidSpecifiedNormalFlowBC.C.

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

◆ computeQpOffDiagJacobian()

Real NSEnergyInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 45 of file NSEnergyInviscidSpecifiedNormalFlowBC.C.

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

◆ computeQpResidual()

Real NSEnergyInviscidSpecifiedNormalFlowBC::computeQpResidual ( )
protectedvirtual

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

◆ qpJacobianTermA()

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

Definition at line 55 of file NSEnergyInviscidBC.C.

Referenced by NSEnergyInviscidSpecifiedPressureBC::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 NSEnergyInviscidSpecifiedPressureBC::computeJacobianHelper(), NSEnergyInviscidUnspecifiedBC::computeJacobianHelper(), NSEnergyInviscidSpecifiedBC::computeJacobianHelper(), and 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 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& NSEnergyInviscidSpecifiedNormalFlowBC::_pressure
protected

Definition at line 35 of file NSEnergyInviscidSpecifiedNormalFlowBC.h.

Referenced by 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

◆ _un

const Real NSEnergyInviscidSpecifiedNormalFlowBC::_un
protected

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