www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
NSMomentumInviscidSpecifiedPressureBC 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 <NSMomentumInviscidSpecifiedPressureBC.h>

Inheritance diagram for NSMomentumInviscidSpecifiedPressureBC:
[legend]

Public Member Functions

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

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

Real _specified_pressure
 
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 22 of file NSMomentumInviscidSpecifiedPressureBC.h.

Constructor & Destructor Documentation

NSMomentumInviscidSpecifiedPressureBC::NSMomentumInviscidSpecifiedPressureBC ( const InputParameters &  parameters)

Definition at line 21 of file NSMomentumInviscidSpecifiedPressureBC.C.

23  : NSMomentumInviscidBC(parameters), _specified_pressure(getParam<Real>("specified_pressure"))
24 {
25 }
NSMomentumInviscidBC(const InputParameters &parameters)
virtual NSMomentumInviscidSpecifiedPressureBC::~NSMomentumInviscidSpecifiedPressureBC ( )
inlinevirtual

Definition at line 27 of file NSMomentumInviscidSpecifiedPressureBC.h.

27 {}

Member Function Documentation

Real NSMomentumInviscidSpecifiedPressureBC::computeQpJacobian ( )
protectedvirtual

Definition at line 44 of file NSMomentumInviscidSpecifiedPressureBC.C.

Referenced by ~NSMomentumInviscidSpecifiedPressureBC().

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

Definition at line 53 of file NSMomentumInviscidSpecifiedPressureBC.C.

Referenced by ~NSMomentumInviscidSpecifiedPressureBC().

54 {
55  if (isNSVariable(jvar))
57  else
58  return 0.0;
59 }
bool isNSVariable(unsigned var)
Real convectiveQpJacobianHelper(unsigned var_number)
unsigned mapVarNumber(unsigned var)
Real NSMomentumInviscidSpecifiedPressureBC::computeQpResidual ( )
protectedvirtual

Definition at line 28 of file NSMomentumInviscidSpecifiedPressureBC.C.

Referenced by ~NSMomentumInviscidSpecifiedPressureBC().

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

Definition at line 61 of file NSMomentumInviscidBC.C.

Referenced by NSMomentumInviscidNoPressureImplicitFlowBC::computeQpJacobian(), computeQpJacobian(), computeQpOffDiagJacobian(), and NSMomentumInviscidNoPressureImplicitFlowBC::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(), NSMomentumInviscidNoPressureImplicitFlowBC::computeQpResidual(), and 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(), NSMomentumInviscidNoPressureImplicitFlowBC::computeQpOffDiagJacobian(), 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 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().

Real NSMomentumInviscidSpecifiedPressureBC::_specified_pressure
protected

Definition at line 36 of file NSMomentumInviscidSpecifiedPressureBC.h.

Referenced by computeQpResidual().

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: