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 26 of file NSMomentumViscousFlux.h.

Constructor & Destructor Documentation

◆ NSMomentumViscousFlux()

NSMomentumViscousFlux::NSMomentumViscousFlux ( const InputParameters &  parameters)

Definition at line 25 of file NSMomentumViscousFlux.C.

26  : NSKernel(parameters), _component(getParam<unsigned int>("component")), _vst_derivs(*this)
27 {
28 }
const unsigned int _component
NSViscStressTensorDerivs< NSMomentumViscousFlux > _vst_derivs
NSKernel(const InputParameters &parameters)
Definition: NSKernel.C:41

Member Function Documentation

◆ computeQpJacobian()

Real NSMomentumViscousFlux::computeQpJacobian ( )
protectedvirtual

Definition at line 44 of file NSMomentumViscousFlux.C.

45 {
46  Real value = 0.0;
47 
48  // Set variable names as in the notes
49  const unsigned k = _component;
50  const unsigned m = _component + 1; // _component = 0,1,2 -> m = 1,2,3 global variable number
51 
52  // Use external templated friend class for common viscous stress
53  // tensor derivative computations.
54  for (unsigned int ell = 0; ell < LIBMESH_DIM; ++ell)
55  value += _vst_derivs.dtau(k, ell, m) * _grad_test[_i][_qp](ell);
56 
57  return value;
58 }
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

◆ computeQpOffDiagJacobian()

Real NSMomentumViscousFlux::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 61 of file NSMomentumViscousFlux.C.

62 {
63  if (isNSVariable(jvar))
64  {
65  Real value = 0.0;
66 
67  // Set variable names as in the notes
68  const unsigned int k = _component;
69 
70  // Map jvar into the variable m for our problem, regardless of
71  // how Moose has numbered things.
72  unsigned int m = mapVarNumber(jvar);
73 
74  for (unsigned ell = 0; ell < LIBMESH_DIM; ++ell)
75  value += _vst_derivs.dtau(k, ell, m) * _grad_test[_i][_qp](ell);
76 
77  return value;
78  }
79  else
80  return 0.0;
81 }
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:78
NSViscStressTensorDerivs< NSMomentumViscousFlux > _vst_derivs
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:88

◆ computeQpResidual()

Real NSMomentumViscousFlux::computeQpResidual ( )
protectedvirtual

Definition at line 31 of file NSMomentumViscousFlux.C.

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

◆ isNSVariable()

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 78 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().

79 {
80  if (var == _rho_var_number || var == _rhou_var_number || var == _rhov_var_number ||
81  var == _rhow_var_number || var == _rhoE_var_number)
82  return true;
83  else
84  return false;
85 }
unsigned _rhov_var_number
Definition: NSKernel.h:57
unsigned _rho_var_number
Definition: NSKernel.h:55
unsigned _rhow_var_number
Definition: NSKernel.h:58
unsigned _rhoE_var_number
Definition: NSKernel.h:59
unsigned _rhou_var_number
Definition: NSKernel.h:56

◆ mapVarNumber()

unsigned NSKernel::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 88 of file NSKernel.C.

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

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

Friends And Related Function Documentation

◆ NSViscStressTensorDerivs

template<class U >
friend class NSViscStressTensorDerivs
friend

Definition at line 45 of file NSMomentumViscousFlux.h.

Member Data Documentation

◆ _component

const unsigned int NSMomentumViscousFlux::_component
protected

◆ _dynamic_viscosity

const MaterialProperty<Real>& NSKernel::_dynamic_viscosity
protectedinherited

Definition at line 62 of file NSKernel.h.

◆ _fp

const IdealGasFluidProperties& NSKernel::_fp
protectedinherited

◆ _grad_rho

const VariableGradient& NSKernel::_grad_rho
protectedinherited

◆ _grad_rho_E

const VariableGradient& NSKernel::_grad_rho_E
protectedinherited

◆ _grad_rho_u

const VariableGradient& NSKernel::_grad_rho_u
protectedinherited

◆ _grad_rho_v

const VariableGradient& NSKernel::_grad_rho_v
protectedinherited

◆ _grad_rho_w

const VariableGradient& NSKernel::_grad_rho_w
protectedinherited

◆ _rho

const VariableValue& NSKernel::_rho
protectedinherited

◆ _rho_E

const VariableValue& NSKernel::_rho_E
protectedinherited

Definition at line 45 of file NSKernel.h.

◆ _rho_u

const VariableValue& NSKernel::_rho_u
protectedinherited

◆ _rho_v

const VariableValue& NSKernel::_rho_v
protectedinherited

◆ _rho_var_number

unsigned NSKernel::_rho_var_number
protectedinherited

◆ _rho_w

const VariableValue& NSKernel::_rho_w
protectedinherited

◆ _rhoE_var_number

unsigned NSKernel::_rhoE_var_number
protectedinherited

◆ _rhou_var_number

unsigned NSKernel::_rhou_var_number
protectedinherited

◆ _rhov_var_number

unsigned NSKernel::_rhov_var_number
protectedinherited

◆ _rhow_var_number

unsigned NSKernel::_rhow_var_number
protectedinherited

◆ _u_vel

const VariableValue& NSKernel::_u_vel
protectedinherited

◆ _v_vel

const VariableValue& NSKernel::_v_vel
protectedinherited

◆ _viscous_stress_tensor

const MaterialProperty<RealTensorValue>& NSKernel::_viscous_stress_tensor
protectedinherited

◆ _vst_derivs

NSViscStressTensorDerivs<NSMomentumViscousFlux> NSMomentumViscousFlux::_vst_derivs
protected

Definition at line 41 of file NSMomentumViscousFlux.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ _w_vel

const VariableValue& NSKernel::_w_vel
protectedinherited

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