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

Compute residual and Jacobian terms form the SUPG terms in the mass equation. More...

#include <NSSUPGMass.h>

Inheritance diagram for NSSUPGMass:
[legend]

Public Member Functions

 NSSUPGMass (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 MaterialProperty< RealTensorValue > & _viscous_stress_tensor
 
const MaterialProperty< Real > & _dynamic_viscosity
 
const MaterialProperty< Real > & _thermal_conductivity
 
const MaterialProperty< Real > & _hsupg
 
const MaterialProperty< Real > & _tauc
 
const MaterialProperty< Real > & _taum
 
const MaterialProperty< Real > & _taue
 
const MaterialProperty< std::vector< Real > > & _strong_residuals
 
const MaterialProperty< std::vector< RealTensorValue > > & _calA
 
const MaterialProperty< std::vector< RealTensorValue > > & _calC
 
const MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _calE
 
const VariableValue & _d_rhodot_du
 
const VariableValue & _d_rhoudot_du
 
const VariableValue & _d_rhovdot_du
 
const VariableValue & _d_rhowdot_du
 
const VariableValue & _d_rhoEdot_du
 
const VariableValue & _temperature
 
const VariableValue & _enthalpy
 
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 IdealGasFluidProperties_fp
 

Private Member Functions

Real computeJacobianHelper (unsigned var)
 

Detailed Description

Compute residual and Jacobian terms form the SUPG terms in the mass equation.

Definition at line 22 of file NSSUPGMass.h.

Constructor & Destructor Documentation

NSSUPGMass::NSSUPGMass ( const InputParameters &  parameters)

Definition at line 20 of file NSSUPGMass.C.

20 : NSSUPGBase(parameters) {}
NSSUPGBase(const InputParameters &parameters)
Definition: NSSUPGBase.C:26

Member Function Documentation

Real NSSUPGMass::computeJacobianHelper ( unsigned  var)
private

Definition at line 54 of file NSSUPGMass.C.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

55 {
56  if (isNSVariable(var))
57  {
58 
59  // Convert the Moose numbering to canonical NS variable numbering.
60  unsigned m = mapVarNumber(var);
61 
62  // Time derivative contributions only for momentum
63  Real time_part = 0.;
64 
65  // The derivative of "udot" wrt u for each of the momentum variables.
66  // This is always 1/dt unless you are using BDF2...
67  Real d_udot_du[3] = {_d_rhoudot_du[_qp], _d_rhovdot_du[_qp], _d_rhowdot_du[_qp]};
68 
69  switch (m)
70  {
71  case 1:
72  case 2:
73  case 3:
74  // time_part = _grad_test[_i][_qp](m-1) * (_phi[_j][_qp]/_subproblem.parent()->dt());
75  time_part = _grad_test[_i][_qp](m - 1) * (_phi[_j][_qp] * d_udot_du[m - 1]);
76  break;
77  }
78 
79  // Store result so we can print it before returning
80  Real result =
81  _taum[_qp] * (time_part + _grad_test[_i][_qp] * (_calA[_qp][m] * _grad_phi[_j][_qp]));
82 
83  return result;
84  }
85  else
86  return 0.0;
87 }
const VariableValue & _d_rhoudot_du
Definition: NSSUPGBase.h:60
const VariableValue & _d_rhowdot_du
Definition: NSSUPGBase.h:62
bool isNSVariable(unsigned var)
Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compres...
Definition: NSKernel.C:76
const MaterialProperty< Real > & _taum
Definition: NSSUPGBase.h:37
const MaterialProperty< std::vector< RealTensorValue > > & _calA
Definition: NSSUPGBase.h:42
const VariableValue & _d_rhovdot_du
Definition: NSSUPGBase.h:61
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:86
Real NSSUPGMass::computeQpJacobian ( )
protectedvirtual

Definition at line 41 of file NSSUPGMass.C.

42 {
43  // This is the density equation, so pass the on-diagonal variable number
45 }
unsigned _rho_var_number
Definition: NSKernel.h:52
Real computeJacobianHelper(unsigned var)
Definition: NSSUPGMass.C:54
Real NSSUPGMass::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 48 of file NSSUPGMass.C.

49 {
50  return computeJacobianHelper(jvar);
51 }
Real computeJacobianHelper(unsigned var)
Definition: NSSUPGMass.C:54
Real NSSUPGMass::computeQpResidual ( )
protectedvirtual

Definition at line 23 of file NSSUPGMass.C.

24 {
25  // From "Component SUPG contributions" section of the notes,
26  // the mass equation is stabilized by taum and the gradient of
27  // phi_i dotted with the momentum equation strong residuals.
28  // Note that the momentum equation strong residuals are stored
29  // in entries 1,2,3 of the "_strong_residuals" vector, regardless
30  // of what dimension we're solving in.
31  RealVectorValue Ru(
32  _strong_residuals[_qp][1], _strong_residuals[_qp][2], _strong_residuals[_qp][3]);
33 
34  // Separate variable just for printing purposes...
35  Real result = _taum[_qp] * (Ru * _grad_test[_i][_qp]);
36 
37  return result;
38 }
const MaterialProperty< Real > & _taum
Definition: NSSUPGBase.h:37
const MaterialProperty< std::vector< Real > > & _strong_residuals
Definition: NSSUPGBase.h:39
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(), computeJacobianHelper(), NSSUPGMomentum::computeJacobianHelper(), NSMassInviscidFlux::computeQpOffDiagJacobian(), NSEnergyInviscidFlux::computeQpOffDiagJacobian(), NSMomentumInviscidFluxWithGradP::computeQpOffDiagJacobian(), NSMomentumInviscidFlux::computeQpOffDiagJacobian(), NSEnergyViscousFlux::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(), computeJacobianHelper(), NSSUPGMomentum::computeJacobianHelper(), NSMassInviscidFlux::computeQpOffDiagJacobian(), NSMomentumInviscidFluxWithGradP::computeQpOffDiagJacobian(), NSEnergyViscousFlux::computeQpOffDiagJacobian(), NSMomentumInviscidFlux::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

Member Data Documentation

const MaterialProperty<std::vector<RealTensorValue> >& NSSUPGBase::_calA
protectedinherited
const MaterialProperty<std::vector<RealTensorValue> >& NSSUPGBase::_calC
protectedinherited
const MaterialProperty<std::vector<std::vector<RealTensorValue> > >& NSSUPGBase::_calE
protectedinherited
const VariableValue& NSSUPGBase::_d_rhodot_du
protectedinherited

Definition at line 59 of file NSSUPGBase.h.

const VariableValue& NSSUPGBase::_d_rhoEdot_du
protectedinherited

Definition at line 63 of file NSSUPGBase.h.

const VariableValue& NSSUPGBase::_d_rhoudot_du
protectedinherited

Definition at line 60 of file NSSUPGBase.h.

Referenced by computeJacobianHelper().

const VariableValue& NSSUPGBase::_d_rhovdot_du
protectedinherited

Definition at line 61 of file NSSUPGBase.h.

Referenced by computeJacobianHelper().

const VariableValue& NSSUPGBase::_d_rhowdot_du
protectedinherited

Definition at line 62 of file NSSUPGBase.h.

Referenced by computeJacobianHelper().

const MaterialProperty<Real>& NSSUPGBase::_dynamic_viscosity
protectedinherited

Definition at line 31 of file NSSUPGBase.h.

const VariableValue& NSSUPGBase::_enthalpy
protectedinherited
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 MaterialProperty<Real>& NSSUPGBase::_hsupg
protectedinherited

Definition at line 35 of file NSSUPGBase.h.

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 MaterialProperty<std::vector<Real> >& NSSUPGBase::_strong_residuals
protectedinherited
const MaterialProperty<Real>& NSSUPGBase::_tauc
protectedinherited
const MaterialProperty<Real>& NSSUPGBase::_taue
protectedinherited
const MaterialProperty<Real>& NSSUPGBase::_taum
protectedinherited
const VariableValue& NSSUPGBase::_temperature
protectedinherited

Definition at line 66 of file NSSUPGBase.h.

const MaterialProperty<Real>& NSSUPGBase::_thermal_conductivity
protectedinherited

Definition at line 32 of file NSSUPGBase.h.

const VariableValue& NSKernel::_u_vel
protectedinherited
const VariableValue& NSKernel::_v_vel
protectedinherited
const MaterialProperty<RealTensorValue>& NSSUPGBase::_viscous_stress_tensor
protectedinherited

Definition at line 30 of file NSSUPGBase.h.

const VariableValue& NSKernel::_w_vel
protectedinherited

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