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

This class corresponds to the viscous part of the "natural" boundary condition for the momentum equations, i.e. More...

#include <NSMomentumViscousBC.h>

Inheritance diagram for NSMomentumViscousBC:
[legend]

Public Member Functions

 NSMomentumViscousBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 Just like other kernels, we must overload the Residual and Jacobian contributions... More...
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned jvar)
 
bool isNSVariable (unsigned var)
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

const unsigned _component
 
NSViscStressTensorDerivs< NSMomentumViscousBC_vst_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 NSViscStressTensorDerivs
 

Detailed Description

This class corresponds to the viscous part of the "natural" boundary condition for the momentum equations, i.e.

int_{Gamma} n . (-tau) . v

A typical use for this kernel would be a subsonic outflow BC in which one physical value must be specified. In this case, the residual and Jacobian contrbutions of the n.tau.v term is computed and added to the matrix/rhs.

Definition at line 30 of file NSMomentumViscousBC.h.

Constructor & Destructor Documentation

NSMomentumViscousBC::NSMomentumViscousBC ( const InputParameters &  parameters)

Definition at line 21 of file NSMomentumViscousBC.C.

22  : NSIntegratedBC(parameters),
23  _component(getParam<unsigned>("component")),
24  // Derivative computing object
25  _vst_derivs(*this)
26 {
27 }
const unsigned _component
NSViscStressTensorDerivs< NSMomentumViscousBC > _vst_derivs
NSIntegratedBC(const InputParameters &parameters)

Member Function Documentation

Real NSMomentumViscousBC::computeQpJacobian ( )
protectedvirtual

Definition at line 46 of file NSMomentumViscousBC.C.

47 {
48  // See Eqns. (41)--(43) from the notes for the viscous boundary term contributions
49  Real visc_term = 0.0;
50 
51  // Set variable names as in the notes
52  const unsigned int k = _component;
53  const unsigned int m = _component + 1; // _component = 0,1,2 -> m = 1,2,3 global variable number
54 
55  // FIXME: attempt calling shared dtau function
56  for (unsigned int ell = 0; ell < LIBMESH_DIM; ++ell)
57  visc_term += _vst_derivs.dtau(k, ell, m) * _normals[_qp](ell);
58 
59  // Multiply visc_term by test function
60  visc_term *= _test[_i][_qp];
61 
62  // Note the sign...
63  return -visc_term;
64 }
const unsigned _component
NSViscStressTensorDerivs< NSMomentumViscousBC > _vst_derivs
Real dtau(unsigned k, unsigned ell, unsigned m)
The primary interface for computing viscous stress tensor derivatives.
Real NSMomentumViscousBC::computeQpOffDiagJacobian ( unsigned  jvar)
protectedvirtual

Definition at line 67 of file NSMomentumViscousBC.C.

68 {
69  if (isNSVariable(jvar))
70  {
71 
72  // See Eqns. (41)--(43) from the notes for the viscous boundary
73  // term contributions.
74 
75  // Map jvar into the variable m for our problem, regardless of
76  // how Moose has numbered things.
77  unsigned m = mapVarNumber(jvar);
78 
79  // Now compute viscous contribution
80  Real visc_term = 0.0;
81 
82  // Set variable names as in the notes
83  const unsigned int k = _component;
84 
85  for (unsigned int ell = 0; ell < LIBMESH_DIM; ++ell)
86  visc_term += _vst_derivs.dtau(k, ell, m) * _normals[_qp](ell);
87 
88  // Multiply visc_term by test function
89  visc_term *= _test[_i][_qp];
90 
91  // Note the sign...
92  return -visc_term;
93  }
94  else
95  return 0.0;
96 }
bool isNSVariable(unsigned var)
const unsigned _component
NSViscStressTensorDerivs< NSMomentumViscousBC > _vst_derivs
Real dtau(unsigned k, unsigned ell, unsigned m)
The primary interface for computing viscous stress tensor derivatives.
unsigned mapVarNumber(unsigned var)
Real NSMomentumViscousBC::computeQpResidual ( )
protectedvirtual

Just like other kernels, we must overload the Residual and Jacobian contributions...

Definition at line 30 of file NSMomentumViscousBC.C.

31 {
32  // n . (-tau) . v
33 
34  // Vector-valued test function
35  RealVectorValue v_test;
36  v_test(_component) = _test[_i][_qp];
37 
38  // The viscous contribution: n . tau . v
39  Real visc_term = _normals[_qp] * (_viscous_stress_tensor[_qp] * v_test);
40 
41  // Note the sign...
42  return -visc_term;
43 }
const unsigned _component
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
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(), NSMomentumInviscidSpecifiedPressureBC::computeQpOffDiagJacobian(), NSPressureNeumannBC::computeQpOffDiagJacobian(), 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

Friends And Related Function Documentation

template<class U >
friend class NSViscStressTensorDerivs
friend

Definition at line 53 of file NSMomentumViscousBC.h.

Member Data Documentation

const unsigned NSMomentumViscousBC::_component
protected
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().

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
NSViscStressTensorDerivs<NSMomentumViscousBC> NSMomentumViscousBC::_vst_derivs
protected

Definition at line 49 of file NSMomentumViscousBC.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const VariableValue& NSIntegratedBC::_w_vel
protectedinherited

The documentation for this class was generated from the following files: