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

Momentum equation boundary condition in which pressure is specified (given) and the value of the convective part is allowed to vary (is computed implicitly). More...

#include <NSMomentumInviscidSpecifiedNormalFlowBC.h>

Inheritance diagram for NSMomentumInviscidSpecifiedNormalFlowBC:
[legend]

Public Member Functions

 NSMomentumInviscidSpecifiedNormalFlowBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
Real pressureQpResidualHelper (Real pressure)
 
Real pressureQpJacobianHelper (unsigned var_number)
 
Real convectiveQpResidualHelper (Real rhou_udotn)
 
Real convectiveQpJacobianHelper (unsigned var_number)
 
bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

const VariableValue & _pressure
 
const Real _rhou_udotn
 
const unsigned _component
 
NSPressureDerivs< NSMomentumInviscidBC_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

Momentum equation boundary condition in which pressure is specified (given) and the value of the convective part is allowed to vary (is computed implicitly).

Definition at line 25 of file NSMomentumInviscidSpecifiedNormalFlowBC.h.

Constructor & Destructor Documentation

◆ NSMomentumInviscidSpecifiedNormalFlowBC()

NSMomentumInviscidSpecifiedNormalFlowBC::NSMomentumInviscidSpecifiedNormalFlowBC ( const InputParameters &  parameters)

Definition at line 30 of file NSMomentumInviscidSpecifiedNormalFlowBC.C.

32  : NSMomentumInviscidBC(parameters),
33  _pressure(coupledValue(NS::pressure)),
34  _rhou_udotn(getParam<Real>("rhou_udotn"))
35 {
36 }
NSMomentumInviscidBC(const InputParameters &parameters)
const std::string pressure
Definition: NS.h:26

Member Function Documentation

◆ computeQpJacobian()

Real NSMomentumInviscidSpecifiedNormalFlowBC::computeQpJacobian ( )
protectedvirtual

Definition at line 45 of file NSMomentumInviscidSpecifiedNormalFlowBC.C.

46 {
47  // There is no Jacobian for the convective term when (rho*u)(u.n) is specified,
48  // so all we have left is the pressure jacobian. The on-diagonal variable number
49  // is _component+1
51 }
Real pressureQpJacobianHelper(unsigned var_number)

◆ computeQpOffDiagJacobian()

Real NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 54 of file NSMomentumInviscidSpecifiedNormalFlowBC.C.

55 {
56  if (isNSVariable(jvar))
58  else
59  return 0.0;
60 }
bool isNSVariable(unsigned var)
Real pressureQpJacobianHelper(unsigned var_number)
unsigned mapVarNumber(unsigned var)

◆ computeQpResidual()

Real NSMomentumInviscidSpecifiedNormalFlowBC::computeQpResidual ( )
protectedvirtual

◆ convectiveQpJacobianHelper()

Real NSMomentumInviscidBC::convectiveQpJacobianHelper ( unsigned  var_number)
protectedinherited

Definition at line 64 of file NSMomentumInviscidBC.C.

Referenced by NSMomentumInviscidNoPressureImplicitFlowBC::computeQpJacobian(), NSMomentumInviscidSpecifiedPressureBC::computeQpJacobian(), NSMomentumInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), and NSMomentumInviscidNoPressureImplicitFlowBC::computeQpOffDiagJacobian().

65 {
66  // Velocity vector object
67  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
68 
69  // Variable to store convective contribution to boundary integral.
70  Real conv_term = 0.0;
71 
72  // Inviscid components
73  switch (var_number)
74  {
75  case 0: // density
76  // Note: the minus sign here is correct, it comes from differentiating wrt U_0
77  // (rho) which is in the denominator.
78  conv_term = -vel(_component) * (vel * _normals[_qp]) * _phi[_j][_qp] * _test[_i][_qp];
79  break;
80 
81  case 1:
82  case 2:
83  case 3: // momentums
84  if (var_number - 1 == _component)
85  // See Eqn. (68) from the notes for the inviscid boundary terms
86  conv_term = ((vel * _normals[_qp]) + vel(_component) * _normals[_qp](_component)) *
87  _phi[_j][_qp] * _test[_i][_qp];
88  else
89  // off-diagonal
90  conv_term =
91  vel(_component) * _normals[_qp](var_number - 1) * _phi[_j][_qp] * _test[_i][_qp];
92  break;
93 
94  case 4: // energy
95  // No derivative wrt energy
96  conv_term = 0.0;
97  break;
98 
99  default:
100  mooseError("Shouldn't get here!");
101  break;
102  }
103 
104  // Return the result. We could return it directly from the switch statement, but this is
105  // convenient for printing...
106  return conv_term;
107 }
const VariableValue & _w_vel
const VariableValue & _v_vel
const VariableValue & _u_vel

◆ convectiveQpResidualHelper()

Real NSMomentumInviscidBC::convectiveQpResidualHelper ( Real  rhou_udotn)
protectedinherited

Definition at line 52 of file NSMomentumInviscidBC.C.

Referenced by computeQpResidual(), NSMomentumInviscidSpecifiedPressureBC::computeQpResidual(), and NSMomentumInviscidNoPressureImplicitFlowBC::computeQpResidual().

53 {
54  // n . (rho*uu) . v = rho*(u.n)*(u.v) = (rho*u)(u.n) . v
55 
56  // The "inviscid" contribution: (rho*u)(u.n) . v
57  Real conv_term = rhou_udotn * _test[_i][_qp];
58 
59  // Return value, or print it first if debugging...
60  return conv_term;
61 }

◆ 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(), NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), computeQpOffDiagJacobian(), NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSMomentumInviscidNoPressureImplicitFlowBC::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

◆ pressureQpJacobianHelper()

Real NSMomentumInviscidBC::pressureQpJacobianHelper ( unsigned  var_number)
protectedinherited

Definition at line 45 of file NSMomentumInviscidBC.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

46 {
47  return _normals[_qp](_component) * _pressure_derivs.get_grad(var_number) * _phi[_j][_qp] *
48  _test[_i][_qp];
49 }
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
NSPressureDerivs< NSMomentumInviscidBC > _pressure_derivs

◆ pressureQpResidualHelper()

Real NSMomentumInviscidBC::pressureQpResidualHelper ( Real  pressure)
protectedinherited

Definition at line 33 of file NSMomentumInviscidBC.C.

Referenced by computeQpResidual(), and NSMomentumInviscidSpecifiedPressureBC::computeQpResidual().

34 {
35  // n . (Ip) . v
36 
37  // The pressure contribution: p * n(component) * phi_i
38  Real press_term = pressure * _normals[_qp](_component) * _test[_i][_qp];
39 
40  // Return value, or print it first if debugging...
41  return press_term;
42 }
const std::string pressure
Definition: NS.h:26

Member Data Documentation

◆ _component

const unsigned NSMomentumInviscidBC::_component
protectedinherited

◆ _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& NSMomentumInviscidSpecifiedNormalFlowBC::_pressure
protected

Definition at line 35 of file NSMomentumInviscidSpecifiedNormalFlowBC.h.

Referenced by computeQpResidual().

◆ _pressure_derivs

NSPressureDerivs<NSMomentumInviscidBC> NSMomentumInviscidBC::_pressure_derivs
protectedinherited

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

const Real NSMomentumInviscidSpecifiedNormalFlowBC::_rhou_udotn
protected

Definition at line 36 of file NSMomentumInviscidSpecifiedNormalFlowBC.h.

Referenced by computeQpResidual().

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

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