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

Momentum equation boundary condition used when pressure is not integrated by parts, i.e. More...

#include <NSMomentumInviscidNoPressureImplicitFlowBC.h>

Inheritance diagram for NSMomentumInviscidNoPressureImplicitFlowBC:
[legend]

Public Member Functions

 NSMomentumInviscidNoPressureImplicitFlowBC (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 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 used when pressure is not integrated by parts, i.e.

when there is "no pressure" term on the boundary. In this case the flow is not specified either, so that the entire term is handled implicitly.

Definition at line 24 of file NSMomentumInviscidNoPressureImplicitFlowBC.h.

Constructor & Destructor Documentation

NSMomentumInviscidNoPressureImplicitFlowBC::NSMomentumInviscidNoPressureImplicitFlowBC ( const InputParameters &  parameters)

Definition at line 19 of file NSMomentumInviscidNoPressureImplicitFlowBC.C.

21  : NSMomentumInviscidBC(parameters)
22 {
23 }
NSMomentumInviscidBC(const InputParameters &parameters)

Member Function Documentation

Real NSMomentumInviscidNoPressureImplicitFlowBC::computeQpJacobian ( )
protectedvirtual

Definition at line 41 of file NSMomentumInviscidNoPressureImplicitFlowBC.C.

42 {
43  // There is no Jacobian for the pressure term when the pressure is specified,
44  // so all we have left is the convective part. The on-diagonal variable number
45  // is _component+1
47 }
Real convectiveQpJacobianHelper(unsigned var_number)
Real NSMomentumInviscidNoPressureImplicitFlowBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 50 of file NSMomentumInviscidNoPressureImplicitFlowBC.C.

51 {
52  if (isNSVariable(jvar))
54  else
55  return 0.0;
56 }
bool isNSVariable(unsigned var)
Real convectiveQpJacobianHelper(unsigned var_number)
unsigned mapVarNumber(unsigned var)
Real NSMomentumInviscidNoPressureImplicitFlowBC::computeQpResidual ( )
protectedvirtual

Definition at line 26 of file NSMomentumInviscidNoPressureImplicitFlowBC.C.

27 {
28  // Velocity vector object
29  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
30 
31  // Velocity vector dotted with normal
32  Real u_dot_n = vel * _normals[_qp];
33 
34  // The current value of the vector (rho*u)(u.n)
35  RealVectorValue rhou_udotn = u_dot_n * _rho[_qp] * vel;
36 
37  return convectiveQpResidualHelper(rhou_udotn(_component));
38 }
Real convectiveQpResidualHelper(Real rhou_udotn)
const VariableValue & _w_vel
const VariableValue & _rho
const VariableValue & _v_vel
const VariableValue & _u_vel
Real NSMomentumInviscidBC::convectiveQpJacobianHelper ( unsigned  var_number)
protectedinherited

Definition at line 61 of file NSMomentumInviscidBC.C.

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

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

Definition at line 49 of file NSMomentumInviscidBC.C.

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

50 {
51  // n . (rho*uu) . v = rho*(u.n)*(u.v) = (rho*u)(u.n) . v
52 
53  // The "inviscid" contribution: (rho*u)(u.n) . v
54  Real conv_term = rhou_udotn * _test[_i][_qp];
55 
56  // Return value, or print it first if debugging...
57  return conv_term;
58 }
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(), NSEnergyInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSEnergyInviscidUnspecifiedBC::computeQpOffDiagJacobian(), NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian(), NSMassUnspecifiedNormalFlowBC::computeQpOffDiagJacobian(), 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 NSMomentumInviscidBC::pressureQpJacobianHelper ( unsigned  var_number)
protectedinherited

Definition at line 42 of file NSMomentumInviscidBC.C.

Referenced by NSMomentumInviscidSpecifiedNormalFlowBC::computeQpJacobian(), and NSMomentumInviscidSpecifiedNormalFlowBC::computeQpOffDiagJacobian().

43 {
44  return _normals[_qp](_component) * _pressure_derivs.get_grad(var_number) * _phi[_j][_qp] *
45  _test[_i][_qp];
46 }
Real get_grad(unsigned i)
The primary interfaces for computing pressure derivatives.
NSPressureDerivs< NSMomentumInviscidBC > _pressure_derivs
Real NSMomentumInviscidBC::pressureQpResidualHelper ( Real  pressure)
protectedinherited

Definition at line 30 of file NSMomentumInviscidBC.C.

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

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

Member Data Documentation

const unsigned NSMomentumInviscidBC::_component
protectedinherited
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<NSMomentumInviscidBC> NSMomentumInviscidBC::_pressure_derivs
protectedinherited
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 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: