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

This class corresponds to the inviscid part of the "natural" boundary condition for the energy equation, i.e. More...

#include <NSEnergyInviscidBC.h>

Inheritance diagram for NSEnergyInviscidBC:
[legend]

Public Member Functions

 NSEnergyInviscidBC (const InputParameters &parameters)
 

Protected Member Functions

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 & _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
 

Friends

template<class U >
class NSPressureDerivs
 

Detailed Description

This class corresponds to the inviscid part of the "natural" boundary condition for the energy equation, i.e.

int_{Gamma} n . (rho*Hu) v

While this class implements the residual and jacobian values for this term, it does not itself implement any of the computeQp* functions. For that, use one of the derived classes: 1.) NSEnergyInviscidSpecifiedPressureBC 2.) NSEnergyInviscidSpecifiedNormalFlowBC 3.) NSEnergyInviscidUnspecifiedBC 4.) NSEnergyInviscidSpecifiedBC 5.) NSEnergyInviscidSpecifiedDensityAndVelocityBC

Definition at line 34 of file NSEnergyInviscidBC.h.

Constructor & Destructor Documentation

NSEnergyInviscidBC::NSEnergyInviscidBC ( const InputParameters &  parameters)

Definition at line 26 of file NSEnergyInviscidBC.C.

27  : NSIntegratedBC(parameters),
28  _temperature(coupledValue(NS::temperature)),
29  // Object for computing deriviatives of pressure
30  _pressure_derivs(*this)
31 {
32 }
const std::string temperature
Definition: NS.h:25
NSIntegratedBC(const InputParameters &parameters)
NSPressureDerivs< NSEnergyInviscidBC > _pressure_derivs
const VariableValue & _temperature

Member Function Documentation

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

Definition at line 87 of file NSIntegratedBC.C.

Referenced by NSEnergyInviscidSpecifiedBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSMomentumInviscidNoPressureImplicitFlowBC::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 
)
protected

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 
)
protected

Definition at line 90 of file NSEnergyInviscidBC.C.

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

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 
)
protected
Real NSEnergyInviscidBC::qpResidualHelper ( Real  rho,
RealVectorValue  u,
Real  pressure 
)
protected

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

Friends And Related Function Documentation

template<class U >
friend class NSPressureDerivs
friend

Definition at line 49 of file NSEnergyInviscidBC.h.

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
protected

Definition at line 45 of file NSEnergyInviscidBC.h.

Referenced by qpJacobianTermC().

const VariableValue& NSIntegratedBC::_rho
protectedinherited
const VariableValue& NSIntegratedBC::_rho_E
protectedinherited

Definition at line 41 of file NSIntegratedBC.h.

Referenced by qpJacobianTermA(), and qpResidualHelper().

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 VariableValue& NSEnergyInviscidBC::_temperature
protected

Definition at line 41 of file NSEnergyInviscidBC.h.

Referenced by qpResidualHelper().

const VariableValue& NSIntegratedBC::_u_vel
protectedinherited
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: