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

The inviscid energy BC term with specified density and velocity components. More...

#include <NSEnergyInviscidSpecifiedDensityAndVelocityBC.h>

Inheritance diagram for NSEnergyInviscidSpecifiedDensityAndVelocityBC:
[legend]

Public Member Functions

 NSEnergyInviscidSpecifiedDensityAndVelocityBC (const InputParameters &parameters)
 
virtual ~NSEnergyInviscidSpecifiedDensityAndVelocityBC ()
 

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
 
Real _specified_density
 
Real _specified_u
 
Real _specified_v
 
Real _specified_w
 
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
 

Detailed Description

The inviscid energy BC term with specified density and velocity components.

This was experimental code and did not really work out, do not use!

Definition at line 24 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

Constructor & Destructor Documentation

◆ NSEnergyInviscidSpecifiedDensityAndVelocityBC()

NSEnergyInviscidSpecifiedDensityAndVelocityBC::NSEnergyInviscidSpecifiedDensityAndVelocityBC ( const InputParameters &  parameters)

Definition at line 40 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.C.

42  : NSEnergyInviscidBC(parameters),
43  _pressure(coupledValue(NS::pressure)),
44  _specified_density(getParam<Real>("specified_density")),
45  _specified_u(getParam<Real>("specified_u")),
46  _specified_v(getParam<Real>("specified_v")),
47  _specified_w(getParam<Real>("specified_w"))
48 {
49 }

◆ ~NSEnergyInviscidSpecifiedDensityAndVelocityBC()

virtual NSEnergyInviscidSpecifiedDensityAndVelocityBC::~NSEnergyInviscidSpecifiedDensityAndVelocityBC ( )
inlinevirtual

Definition at line 29 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

29 {}

Member Function Documentation

◆ computeQpJacobian()

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::computeQpJacobian ( )
protectedvirtual

Definition at line 60 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.C.

61 {
62  // TODO
63  // return computeJacobianHelper(/*on-diagonal variable is energy=*/4);
64  return 0.;
65 }

◆ computeQpOffDiagJacobian()

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 68 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.C.

69 {
70  // TODO
71  // return computeJacobianHelper(mapVarNumber(jvar));
72  return 0.;
73 }

◆ computeQpResidual()

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::computeQpResidual ( )
protectedvirtual

Definition at line 52 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.C.

53 {
55  RealVectorValue(_specified_u, _specified_v, _specified_w),
56  _pressure[_qp]);
57 }

◆ isNSVariable()

bool NSIntegratedBC::isNSVariable ( unsigned  var)
protectedinherited

◆ mapVarNumber()

unsigned NSIntegratedBC::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 90 of file NSIntegratedBC.C.

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 }

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

◆ qpJacobianTermA()

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

Definition at line 55 of file NSEnergyInviscidBC.C.

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 }

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

◆ qpJacobianTermB()

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

Definition at line 92 of file NSEnergyInviscidBC.C.

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 }

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

◆ qpJacobianTermC()

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

Definition at line 122 of file NSEnergyInviscidBC.C.

123 {
124  return _pressure_derivs.get_grad(var_number) * _phi[_j][_qp] * un * _test[_i][_qp];
125 }

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

◆ 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 }

Member Data Documentation

◆ _dynamic_viscosity

const MaterialProperty<Real>& NSIntegratedBC::_dynamic_viscosity
protectedinherited

Definition at line 58 of file NSIntegratedBC.h.

◆ _fp

const IdealGasFluidProperties& NSIntegratedBC::_fp
protectedinherited

◆ _grad_rho

const VariableGradient& NSIntegratedBC::_grad_rho
protectedinherited

Definition at line 45 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_E

const VariableGradient& NSIntegratedBC::_grad_rho_E
protectedinherited

Definition at line 49 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_u

const VariableGradient& NSIntegratedBC::_grad_rho_u
protectedinherited

Definition at line 46 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_v

const VariableGradient& NSIntegratedBC::_grad_rho_v
protectedinherited

Definition at line 47 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _grad_rho_w

const VariableGradient& NSIntegratedBC::_grad_rho_w
protectedinherited

Definition at line 48 of file NSIntegratedBC.h.

Referenced by NSEnergyViscousBC::NSEnergyViscousBC().

◆ _pressure

const VariableValue& NSEnergyInviscidSpecifiedDensityAndVelocityBC::_pressure
protected

Definition at line 37 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

Referenced by computeQpResidual().

◆ _pressure_derivs

NSPressureDerivs<NSEnergyInviscidBC> NSEnergyInviscidBC::_pressure_derivs
protectedinherited

Definition at line 47 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 51 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 55 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rhou_var_number

unsigned NSIntegratedBC::_rhou_var_number
protectedinherited

Definition at line 52 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rhov_var_number

unsigned NSIntegratedBC::_rhov_var_number
protectedinherited

Definition at line 53 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _rhow_var_number

unsigned NSIntegratedBC::_rhow_var_number
protectedinherited

Definition at line 54 of file NSIntegratedBC.h.

Referenced by NSIntegratedBC::isNSVariable(), and NSIntegratedBC::mapVarNumber().

◆ _specified_density

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_density
protected

Definition at line 40 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

Referenced by computeQpResidual().

◆ _specified_u

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_u
protected

Definition at line 42 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

Referenced by computeQpResidual().

◆ _specified_v

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_v
protected

Definition at line 43 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

Referenced by computeQpResidual().

◆ _specified_w

Real NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_w
protected

Definition at line 44 of file NSEnergyInviscidSpecifiedDensityAndVelocityBC.h.

Referenced by computeQpResidual().

◆ _temperature

const VariableValue& NSEnergyInviscidBC::_temperature
protectedinherited

Definition at line 43 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:
NSEnergyInviscidBC::_pressure_derivs
NSPressureDerivs< NSEnergyInviscidBC > _pressure_derivs
Definition: NSEnergyInviscidBC.h:47
NSIntegratedBC::_rhov_var_number
unsigned _rhov_var_number
Definition: NSIntegratedBC.h:53
NSIntegratedBC::_w_vel
const VariableValue & _w_vel
Definition: NSIntegratedBC.h:37
NSPressureDerivs::get_grad
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
Definition: NSPressureDerivs.h:49
IdealGasFluidProperties::gamma
virtual Real gamma() const
Definition: IdealGasFluidProperties.h:117
NSEnergyInviscidBC::qpResidualHelper
Real qpResidualHelper(Real pressure, Real un)
Definition: NSEnergyInviscidBC.C:37
NSIntegratedBC::_rho_var_number
unsigned _rho_var_number
Definition: NSIntegratedBC.h:51
NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_u
Real _specified_u
Definition: NSEnergyInviscidSpecifiedDensityAndVelocityBC.h:42
NSIntegratedBC::_v_vel
const VariableValue & _v_vel
Definition: NSIntegratedBC.h:36
NSIntegratedBC::_u_vel
const VariableValue & _u_vel
Definition: NSIntegratedBC.h:35
NSIntegratedBC::_rhoE_var_number
unsigned _rhoE_var_number
Definition: NSIntegratedBC.h:55
NSIntegratedBC::_rho
const VariableValue & _rho
Definition: NSIntegratedBC.h:39
NSIntegratedBC::_rhou_var_number
unsigned _rhou_var_number
Definition: NSIntegratedBC.h:52
NSEnergyInviscidBC::_temperature
const VariableValue & _temperature
Definition: NSEnergyInviscidBC.h:43
NSIntegratedBC::_rhow_var_number
unsigned _rhow_var_number
Definition: NSIntegratedBC.h:54
IdealGasFluidProperties::cv
virtual Real cv() const
Definition: IdealGasFluidProperties.h:118
NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_density
Real _specified_density
Definition: NSEnergyInviscidSpecifiedDensityAndVelocityBC.h:40
NSEnergyInviscidBC::NSEnergyInviscidBC
NSEnergyInviscidBC(const InputParameters &parameters)
Definition: NSEnergyInviscidBC.C:28
NSIntegratedBC::_fp
const IdealGasFluidProperties & _fp
Definition: NSIntegratedBC.h:62
NSIntegratedBC::_rho_E
const VariableValue & _rho_E
Definition: NSIntegratedBC.h:43
NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_v
Real _specified_v
Definition: NSEnergyInviscidSpecifiedDensityAndVelocityBC.h:43
NSEnergyInviscidSpecifiedDensityAndVelocityBC::_specified_w
Real _specified_w
Definition: NSEnergyInviscidSpecifiedDensityAndVelocityBC.h:44
NSEnergyInviscidSpecifiedDensityAndVelocityBC::_pressure
const VariableValue & _pressure
Definition: NSEnergyInviscidSpecifiedDensityAndVelocityBC.h:37
NS::pressure
const std::string pressure
Definition: NS.h:25