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

Viscous flux terms in energy equation. More...

#include <NSEnergyViscousFlux.h>

Inheritance diagram for NSEnergyViscousFlux:
[legend]

Public Member Functions

 NSEnergyViscousFlux (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

NSViscStressTensorDerivs< NSEnergyViscousFlux_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

Viscous flux terms in energy equation.

Definition at line 22 of file NSEnergyViscousFlux.h.

Constructor & Destructor Documentation

NSEnergyViscousFlux::NSEnergyViscousFlux ( const InputParameters &  parameters)

Definition at line 18 of file NSEnergyViscousFlux.C.

19  : NSKernel(parameters), _vst_derivs(*this)
20 {
21 }
NSViscStressTensorDerivs< NSEnergyViscousFlux > _vst_derivs
NSKernel(const InputParameters &parameters)
Definition: NSKernel.C:39

Member Function Documentation

Real NSEnergyViscousFlux::computeQpJacobian ( )
protectedvirtual

Definition at line 34 of file NSEnergyViscousFlux.C.

35 {
36  // No dependence of this term on U_4!
37  return 0.0;
38 }
Real NSEnergyViscousFlux::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 41 of file NSEnergyViscousFlux.C.

42 {
43  if (isNSVariable(jvar))
44  {
45 
46  // Convenience variables
47  const RealTensorValue & tau = _viscous_stress_tensor[_qp];
48 
49  Real rho = _rho[_qp];
50  Real phij = _phi[_j][_qp];
51  RealVectorValue U(_rho_u[_qp], _rho_v[_qp], _rho_w[_qp]);
52 
53  // Map jvar into the variable m for our problem, regardless of
54  // how Moose has numbered things.
55  unsigned m = mapVarNumber(jvar);
56 
57  // Compute Jacobian terms based on the value of m
58  switch (m)
59  {
60  case 0: // Density
61  {
62  // Return value
63  Real value = 0.0;
64 
65  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
66  {
67  Real intermediate_value = 0.0;
68 
69  for (unsigned ell = 0; ell < LIBMESH_DIM; ++ell)
70  intermediate_value +=
71  (U(ell) / rho * (-tau(k, ell) * phij / rho + _vst_derivs.dtau(k, ell, 0)));
72 
73  // Hit accumulated value with test function
74  value += intermediate_value * _grad_test[_i][_qp](k);
75  } // end for k
76 
77  return value;
78  }
79 
80  case 1:
81  case 2:
82  case 3: // Momentums
83  {
84  // Return value
85  Real value = 0.0;
86 
87  // "local" version of m, mapped to 0, 1, 2, for indexing
88  // into Point objects.
89  const unsigned int m_local = m - 1;
90 
91  for (unsigned int k = 0; k < LIBMESH_DIM; ++k)
92  {
93  Real intermediate_value = tau(k, m_local) * phij / rho;
94 
95  for (unsigned int ell = 0; ell < LIBMESH_DIM; ++ell)
96  intermediate_value += _vst_derivs.dtau(k, ell, m) * U(ell) /
97  rho; // Note: pass 'm' to dtau, it will convert it internally
98 
99  // Hit accumulated value with test function
100  value += intermediate_value * _grad_test[_i][_qp](k);
101  } // end for k
102 
103  return value;
104  }
105 
106  default:
107  return 0.0;
108  } // end switch (m)
109  }
110  else
111  return 0.0;
112 }
const VariableValue & _rho_u
Definition: NSKernel.h:39
const VariableValue & _rho
Definition: NSKernel.h:38
Real dtau(unsigned k, unsigned ell, unsigned m)
The primary interface for computing viscous stress tensor derivatives.
const VariableValue & _rho_v
Definition: NSKernel.h:40
bool isNSVariable(unsigned var)
Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compres...
Definition: NSKernel.C:76
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
Definition: NSKernel.h:60
NSViscStressTensorDerivs< NSEnergyViscousFlux > _vst_derivs
const VariableValue & _rho_w
Definition: NSKernel.h:41
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:86
Real NSEnergyViscousFlux::computeQpResidual ( )
protectedvirtual

Definition at line 24 of file NSEnergyViscousFlux.C.

25 {
26  // (tau * u) * grad(phi)
27  RealVectorValue velocity(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
28  RealVectorValue vec = _viscous_stress_tensor[_qp] * velocity;
29 
30  return vec * _grad_test[_i][_qp];
31 }
const VariableValue & _w_vel
Definition: NSKernel.h:36
const MaterialProperty< RealTensorValue > & _viscous_stress_tensor
Definition: NSKernel.h:60
const VariableValue & _u_vel
Definition: NSKernel.h:34
const VariableValue & _v_vel
Definition: NSKernel.h:35
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(), computeQpOffDiagJacobian(), NSMomentumViscousFlux::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(), computeQpOffDiagJacobian(), NSMomentumViscousFlux::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 38 of file NSEnergyViscousFlux.h.

Member Data Documentation

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

Definition at line 39 of file NSKernel.h.

Referenced by computeQpOffDiagJacobian(), and NSMassInviscidFlux::computeQpResidual().

const VariableValue& NSKernel::_rho_v
protectedinherited

Definition at line 40 of file NSKernel.h.

Referenced by computeQpOffDiagJacobian(), and NSMassInviscidFlux::computeQpResidual().

unsigned NSKernel::_rho_var_number
protectedinherited
const VariableValue& NSKernel::_rho_w
protectedinherited

Definition at line 41 of file NSKernel.h.

Referenced by computeQpOffDiagJacobian(), and NSMassInviscidFlux::computeQpResidual().

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<NSEnergyViscousFlux> NSEnergyViscousFlux::_vst_derivs
protected

Definition at line 34 of file NSEnergyViscousFlux.h.

Referenced by computeQpOffDiagJacobian().

const VariableValue& NSKernel::_w_vel
protectedinherited

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