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

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

#include <NSEnergyInviscidSpecifiedBC.h>

Inheritance diagram for NSEnergyInviscidSpecifiedBC:
[legend]

Public Member Functions

 NSEnergyInviscidSpecifiedBC (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 Real _specified_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 pressure.

Definition at line 21 of file NSEnergyInviscidSpecifiedBC.h.

Constructor & Destructor Documentation

NSEnergyInviscidSpecifiedBC::NSEnergyInviscidSpecifiedBC ( const InputParameters &  parameters)

Definition at line 19 of file NSEnergyInviscidSpecifiedBC.C.

20  : NSEnergyInviscidBC(parameters),
21  _specified_pressure(getParam<Real>("specified_pressure")),
22  _un(getParam<Real>("un"))
23 {
24 }
NSEnergyInviscidBC(const InputParameters &parameters)

Member Function Documentation

Real NSEnergyInviscidSpecifiedBC::computeJacobianHelper ( unsigned  var_number)
private

Definition at line 48 of file NSEnergyInviscidSpecifiedBC.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

49 {
50  // When both pressure and u.n are specified, only term B of the Jacobian is non-zero.
51  return qpJacobianTermB(var_number, _un);
52 }
Real qpJacobianTermB(unsigned var_number, Real un)
Real NSEnergyInviscidSpecifiedBC::computeQpJacobian ( )
protectedvirtual

Definition at line 33 of file NSEnergyInviscidSpecifiedBC.C.

34 {
35  return this->computeJacobianHelper(/*on-diagonal variable is energy=*/4);
36 }
Real computeJacobianHelper(unsigned var_number)
Real NSEnergyInviscidSpecifiedBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 39 of file NSEnergyInviscidSpecifiedBC.C.

40 {
41  if (isNSVariable(jvar))
42  return computeJacobianHelper(mapVarNumber(jvar));
43  else
44  return 0.0;
45 }
bool isNSVariable(unsigned var)
Real computeJacobianHelper(unsigned var_number)
unsigned mapVarNumber(unsigned var)
Real NSEnergyInviscidSpecifiedBC::computeQpResidual ( )
protectedvirtual

Definition at line 27 of file NSEnergyInviscidSpecifiedBC.C.

bool NSIntegratedBC::isNSVariable ( unsigned  var)
protectedinherited
unsigned NSIntegratedBC::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 87 of file NSIntegratedBC.C.

Referenced by 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 NSEnergyInviscidBC::qpJacobianTermA ( unsigned  var_number,
Real  pressure 
)
protectedinherited

Definition at line 53 of file NSEnergyInviscidBC.C.

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

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

Definition at line 90 of file NSEnergyInviscidBC.C.

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

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

Definition at line 120 of file NSEnergyInviscidBC.C.

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

121 {
122  return _pressure_derivs.get_grad(var_number) * _phi[_j][_qp] * un * _test[_i][_qp];
123 }
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
NSPressureDerivs< NSEnergyInviscidBC > _pressure_derivs
Real NSEnergyInviscidBC::qpResidualHelper ( Real  pressure,
Real  un 
)
protectedinherited
Real NSEnergyInviscidBC::qpResidualHelper ( Real  rho,
RealVectorValue  u,
Real  pressure 
)
protectedinherited

Definition at line 41 of file NSEnergyInviscidBC.C.

42 {
43  // return (rho*(cv*_temperature[_qp] + 0.5*u.norm_sq()) + pressure) * (u*_normals[_qp]) *
44  // _test[_i][_qp];
45  // We can also expand pressure in terms of rho... does this make a difference?
46  // Then we don't use the input pressure value.
47  return rho * (_fp.gamma() * _fp.cv() * _temperature[_qp] + 0.5 * u.norm_sq()) *
48  (u * _normals[_qp]) * _test[_i][_qp];
49 }
virtual Real cv(Real v=0., Real u=0.) const override
Isochoric specific heat.
const IdealGasFluidProperties & _fp
virtual Real gamma(Real v=0., Real u=0.) const override
Compute the ratio of specific heats.
const VariableValue & _temperature

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

NSPressureDerivs<NSEnergyInviscidBC> NSEnergyInviscidBC::_pressure_derivs
protectedinherited

Definition at line 45 of file NSEnergyInviscidBC.h.

Referenced by NSEnergyInviscidBC::qpJacobianTermC().

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

const Real NSEnergyInviscidSpecifiedBC::_specified_pressure
protected

Definition at line 32 of file NSEnergyInviscidSpecifiedBC.h.

Referenced by computeQpResidual().

const VariableValue& NSEnergyInviscidBC::_temperature
protectedinherited

Definition at line 41 of file NSEnergyInviscidBC.h.

Referenced by NSEnergyInviscidBC::qpResidualHelper().

const VariableValue& NSIntegratedBC::_u_vel
protectedinherited
const Real NSEnergyInviscidSpecifiedBC::_un
protected

Definition at line 33 of file NSEnergyInviscidSpecifiedBC.h.

Referenced by computeJacobianHelper(), and computeQpResidual().

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: