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

Derived instance of the NSViscousFluxBase class for the momentum equations. More...

#include <NSMomentumViscousFlux.h>

Inheritance diagram for NSMomentumViscousFlux:
[legend]

Public Member Functions

 NSMomentumViscousFlux (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 
bool isNSVariable (unsigned var)
 Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compressible NS equations. More...
 
unsigned mapVarNumber (unsigned var)
 

Protected Attributes

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

Derived instance of the NSViscousFluxBase class for the momentum equations.

Definition at line 23 of file NSMomentumViscousFlux.h.

Constructor & Destructor Documentation

NSMomentumViscousFlux::NSMomentumViscousFlux ( const InputParameters &  parameters)

Definition at line 20 of file NSMomentumViscousFlux.C.

21  : NSKernel(parameters), _component(getParam<unsigned int>("component")), _vst_derivs(*this)
22 {
23 }
const unsigned int _component
NSViscStressTensorDerivs< NSMomentumViscousFlux > _vst_derivs
NSKernel(const InputParameters &parameters)
Definition: NSKernel.C:39

Member Function Documentation

Real NSMomentumViscousFlux::computeQpJacobian ( )
protectedvirtual

Definition at line 39 of file NSMomentumViscousFlux.C.

40 {
41  Real value = 0.0;
42 
43  // Set variable names as in the notes
44  const unsigned k = _component;
45  const unsigned m = _component + 1; // _component = 0,1,2 -> m = 1,2,3 global variable number
46 
47  // Use external templated friend class for common viscous stress
48  // tensor derivative computations.
49  for (unsigned int ell = 0; ell < LIBMESH_DIM; ++ell)
50  value += _vst_derivs.dtau(k, ell, m) * _grad_test[_i][_qp](ell);
51 
52  return value;
53 }
const unsigned int _component
Real dtau(unsigned k, unsigned ell, unsigned m)
The primary interface for computing viscous stress tensor derivatives.
NSViscStressTensorDerivs< NSMomentumViscousFlux > _vst_derivs
Real NSMomentumViscousFlux::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 56 of file NSMomentumViscousFlux.C.

57 {
58  if (isNSVariable(jvar))
59  {
60  Real value = 0.0;
61 
62  // Set variable names as in the notes
63  const unsigned int k = _component;
64 
65  // Map jvar into the variable m for our problem, regardless of
66  // how Moose has numbered things.
67  unsigned int m = mapVarNumber(jvar);
68 
69  for (unsigned ell = 0; ell < LIBMESH_DIM; ++ell)
70  value += _vst_derivs.dtau(k, ell, m) * _grad_test[_i][_qp](ell);
71 
72  return value;
73  }
74  else
75  return 0.0;
76 }
const unsigned int _component
Real dtau(unsigned k, unsigned ell, unsigned m)
The primary interface for computing viscous stress tensor derivatives.
bool isNSVariable(unsigned var)
Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compres...
Definition: NSKernel.C:76
NSViscStressTensorDerivs< NSMomentumViscousFlux > _vst_derivs
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:86
Real NSMomentumViscousFlux::computeQpResidual ( )
protectedvirtual

Definition at line 26 of file NSMomentumViscousFlux.C.

27 {
28  // Yay for less typing!
29  const RealTensorValue & vst = _viscous_stress_tensor[_qp];
30 
31  // _component'th column of vst...
32  RealVectorValue vec(vst(0, _component), vst(1, _component), vst(2, _component));
33 
34  // ... dotted with grad(phi), note: sign is positive as this term was -div(tau) on the lhs
35  return vec * _grad_test[_i][_qp];
36 }
const unsigned int _component
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
Definition: NSKernel.h:60
bool NSKernel::isNSVariable ( unsigned  var)
protectedinherited

Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compressible NS equations.

Definition at line 76 of file NSKernel.C.

Referenced by NSSUPGEnergy::computeJacobianHelper(), NSSUPGMass::computeJacobianHelper(), NSSUPGMomentum::computeJacobianHelper(), NSMassInviscidFlux::computeQpOffDiagJacobian(), NSEnergyInviscidFlux::computeQpOffDiagJacobian(), NSMomentumInviscidFluxWithGradP::computeQpOffDiagJacobian(), NSMomentumInviscidFlux::computeQpOffDiagJacobian(), NSEnergyViscousFlux::computeQpOffDiagJacobian(), computeQpOffDiagJacobian(), and NSEnergyThermalFlux::computeQpOffDiagJacobian().

77 {
78  if (var == _rho_var_number || var == _rhou_var_number || var == _rhov_var_number ||
79  var == _rhow_var_number || var == _rhoE_var_number)
80  return true;
81  else
82  return false;
83 }
unsigned _rhov_var_number
Definition: NSKernel.h:54
unsigned _rho_var_number
Definition: NSKernel.h:52
unsigned _rhow_var_number
Definition: NSKernel.h:55
unsigned _rhoE_var_number
Definition: NSKernel.h:56
unsigned _rhou_var_number
Definition: NSKernel.h:53
unsigned NSKernel::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 86 of file NSKernel.C.

Referenced by NSSUPGEnergy::computeJacobianHelper(), NSSUPGMass::computeJacobianHelper(), NSSUPGMomentum::computeJacobianHelper(), NSMassInviscidFlux::computeQpOffDiagJacobian(), NSMomentumInviscidFluxWithGradP::computeQpOffDiagJacobian(), NSMomentumInviscidFlux::computeQpOffDiagJacobian(), NSEnergyViscousFlux::computeQpOffDiagJacobian(), computeQpOffDiagJacobian(), and NSEnergyThermalFlux::computeQpOffDiagJacobian().

87 {
88  // Convert the Moose numbering to:
89  // 0 for rho
90  // 1 for rho*u
91  // 2 for rho*v
92  // 3 for rho*w
93  // 4 for rho*e
94  // regardless of the problem dimension, etc.
95  unsigned mapped_var_number = 99;
96 
97  if (var == _rho_var_number)
98  mapped_var_number = 0;
99  else if (var == _rhou_var_number)
100  mapped_var_number = 1;
101  else if (var == _rhov_var_number)
102  mapped_var_number = 2;
103  else if (var == _rhow_var_number)
104  mapped_var_number = 3;
105  else if (var == _rhoE_var_number)
106  mapped_var_number = 4;
107  else
108  mooseError("Invalid var!");
109 
110  return mapped_var_number;
111 }
unsigned _rhov_var_number
Definition: NSKernel.h:54
unsigned _rho_var_number
Definition: NSKernel.h:52
unsigned _rhow_var_number
Definition: NSKernel.h:55
unsigned _rhoE_var_number
Definition: NSKernel.h:56
unsigned _rhou_var_number
Definition: NSKernel.h:53

Friends And Related Function Documentation

template<class U >
friend class NSViscStressTensorDerivs
friend

Definition at line 42 of file NSMomentumViscousFlux.h.

Member Data Documentation

const unsigned int NSMomentumViscousFlux::_component
protected
const MaterialProperty<Real>& NSKernel::_dynamic_viscosity
protectedinherited

Definition at line 59 of file NSKernel.h.

const IdealGasFluidProperties& NSKernel::_fp
protectedinherited
const VariableGradient& NSKernel::_grad_rho
protectedinherited
const VariableGradient& NSKernel::_grad_rho_E
protectedinherited
const VariableGradient& NSKernel::_grad_rho_u
protectedinherited
const VariableGradient& NSKernel::_grad_rho_v
protectedinherited
const VariableGradient& NSKernel::_grad_rho_w
protectedinherited
const VariableValue& NSKernel::_rho
protectedinherited
const VariableValue& NSKernel::_rho_E
protectedinherited

Definition at line 42 of file NSKernel.h.

const VariableValue& NSKernel::_rho_u
protectedinherited
const VariableValue& NSKernel::_rho_v
protectedinherited
unsigned NSKernel::_rho_var_number
protectedinherited
const VariableValue& NSKernel::_rho_w
protectedinherited
unsigned NSKernel::_rhoE_var_number
protectedinherited
unsigned NSKernel::_rhou_var_number
protectedinherited
unsigned NSKernel::_rhov_var_number
protectedinherited
unsigned NSKernel::_rhow_var_number
protectedinherited
const VariableValue& NSKernel::_u_vel
protectedinherited
const VariableValue& NSKernel::_v_vel
protectedinherited
const MaterialProperty<RealTensorValue>& NSKernel::_viscous_stress_tensor
protectedinherited
NSViscStressTensorDerivs<NSMomentumViscousFlux> NSMomentumViscousFlux::_vst_derivs
protected

Definition at line 38 of file NSMomentumViscousFlux.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const VariableValue& NSKernel::_w_vel
protectedinherited

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