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 24 of file NSSUPGMass.h.

Constructor & Destructor Documentation

◆ NSSUPGMass()

NSSUPGMass::NSSUPGMass ( const InputParameters &  parameters)

Definition at line 25 of file NSSUPGMass.C.

25 : NSSUPGBase(parameters) {}

Member Function Documentation

◆ computeJacobianHelper()

Real NSSUPGMass::computeJacobianHelper ( unsigned  var)
private

Definition at line 59 of file NSSUPGMass.C.

60 {
61  if (isNSVariable(var))
62  {
63 
64  // Convert the Moose numbering to canonical NS variable numbering.
65  unsigned m = mapVarNumber(var);
66 
67  // Time derivative contributions only for momentum
68  Real time_part = 0.;
69 
70  // The derivative of "udot" wrt u for each of the momentum variables.
71  // This is always 1/dt unless you are using BDF2...
72  Real d_udot_du[3] = {_d_rhoudot_du[_qp], _d_rhovdot_du[_qp], _d_rhowdot_du[_qp]};
73 
74  switch (m)
75  {
76  case 1:
77  case 2:
78  case 3:
79  // time_part = _grad_test[_i][_qp](m-1) * (_phi[_j][_qp]/_subproblem.parent()->dt());
80  time_part = _grad_test[_i][_qp](m - 1) * (_phi[_j][_qp] * d_udot_du[m - 1]);
81  break;
82  }
83 
84  // Store result so we can print it before returning
85  Real result =
86  _taum[_qp] * (time_part + _grad_test[_i][_qp] * (_calA[_qp][m] * _grad_phi[_j][_qp]));
87 
88  return result;
89  }
90  else
91  return 0.0;
92 }

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

◆ computeQpJacobian()

Real NSSUPGMass::computeQpJacobian ( )
protectedvirtual

Definition at line 46 of file NSSUPGMass.C.

47 {
48  // This is the density equation, so pass the on-diagonal variable number
50 }

◆ computeQpOffDiagJacobian()

Real NSSUPGMass::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 53 of file NSSUPGMass.C.

54 {
55  return computeJacobianHelper(jvar);
56 }

◆ computeQpResidual()

Real NSSUPGMass::computeQpResidual ( )
protectedvirtual

Definition at line 28 of file NSSUPGMass.C.

29 {
30  // From "Component SUPG contributions" section of the notes,
31  // the mass equation is stabilized by taum and the gradient of
32  // phi_i dotted with the momentum equation strong residuals.
33  // Note that the momentum equation strong residuals are stored
34  // in entries 1,2,3 of the "_strong_residuals" vector, regardless
35  // of what dimension we're solving in.
36  RealVectorValue Ru(
37  _strong_residuals[_qp][1], _strong_residuals[_qp][2], _strong_residuals[_qp][3]);
38 
39  // Separate variable just for printing purposes...
40  Real result = _taum[_qp] * (Ru * _grad_test[_i][_qp]);
41 
42  return result;
43 }

◆ isNSVariable()

bool NSKernel::isNSVariable ( unsigned  var)
protectedinherited

◆ mapVarNumber()

unsigned NSKernel::mapVarNumber ( unsigned  var)
protectedinherited

Definition at line 88 of file NSKernel.C.

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 }

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

Member Data Documentation

◆ _calA

const MaterialProperty<std::vector<RealTensorValue> >& NSSUPGBase::_calA
protectedinherited

◆ _calC

const MaterialProperty<std::vector<RealTensorValue> >& NSSUPGBase::_calC
protectedinherited

◆ _calE

const MaterialProperty<std::vector<std::vector<RealTensorValue> > >& NSSUPGBase::_calE
protectedinherited

◆ _d_rhodot_du

const VariableValue& NSSUPGBase::_d_rhodot_du
protectedinherited

Definition at line 61 of file NSSUPGBase.h.

◆ _d_rhoEdot_du

const VariableValue& NSSUPGBase::_d_rhoEdot_du
protectedinherited

Definition at line 65 of file NSSUPGBase.h.

◆ _d_rhoudot_du

const VariableValue& NSSUPGBase::_d_rhoudot_du
protectedinherited

Definition at line 62 of file NSSUPGBase.h.

Referenced by computeJacobianHelper().

◆ _d_rhovdot_du

const VariableValue& NSSUPGBase::_d_rhovdot_du
protectedinherited

Definition at line 63 of file NSSUPGBase.h.

Referenced by computeJacobianHelper().

◆ _d_rhowdot_du

const VariableValue& NSSUPGBase::_d_rhowdot_du
protectedinherited

Definition at line 64 of file NSSUPGBase.h.

Referenced by computeJacobianHelper().

◆ _dynamic_viscosity

const MaterialProperty<Real>& NSSUPGBase::_dynamic_viscosity
protectedinherited

Definition at line 33 of file NSSUPGBase.h.

◆ _enthalpy

const VariableValue& NSSUPGBase::_enthalpy
protectedinherited

◆ _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

◆ _hsupg

const MaterialProperty<Real>& NSSUPGBase::_hsupg
protectedinherited

Definition at line 37 of file NSSUPGBase.h.

◆ _rho

const VariableValue& NSKernel::_rho
protectedinherited

◆ _rho_E

const VariableValue& NSKernel::_rho_E
protectedinherited

Definition at line 44 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

◆ _strong_residuals

const MaterialProperty<std::vector<Real> >& NSSUPGBase::_strong_residuals
protectedinherited

◆ _tauc

const MaterialProperty<Real>& NSSUPGBase::_tauc
protectedinherited

◆ _taue

const MaterialProperty<Real>& NSSUPGBase::_taue
protectedinherited

◆ _taum

const MaterialProperty<Real>& NSSUPGBase::_taum
protectedinherited

◆ _temperature

const VariableValue& NSSUPGBase::_temperature
protectedinherited

Definition at line 68 of file NSSUPGBase.h.

◆ _thermal_conductivity

const MaterialProperty<Real>& NSSUPGBase::_thermal_conductivity
protectedinherited

Definition at line 34 of file NSSUPGBase.h.

◆ _u_vel

const VariableValue& NSKernel::_u_vel
protectedinherited

◆ _v_vel

const VariableValue& NSKernel::_v_vel
protectedinherited

◆ _viscous_stress_tensor

const MaterialProperty<RealTensorValue>& NSSUPGBase::_viscous_stress_tensor
protectedinherited

Definition at line 32 of file NSSUPGBase.h.

◆ _w_vel

const VariableValue& NSKernel::_w_vel
protectedinherited

The documentation for this class was generated from the following files:
NSSUPGMass::computeJacobianHelper
Real computeJacobianHelper(unsigned var)
Definition: NSSUPGMass.C:59
NSKernel::isNSVariable
bool isNSVariable(unsigned var)
Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compres...
Definition: NSKernel.C:78
NSKernel::_rhou_var_number
unsigned _rhou_var_number
Definition: NSKernel.h:55
NSSUPGBase::_taum
const MaterialProperty< Real > & _taum
Definition: NSSUPGBase.h:39
NSSUPGBase::_calA
const MaterialProperty< std::vector< RealTensorValue > > & _calA
Definition: NSSUPGBase.h:44
NSKernel::_rhoE_var_number
unsigned _rhoE_var_number
Definition: NSKernel.h:58
NSKernel::_rhow_var_number
unsigned _rhow_var_number
Definition: NSKernel.h:57
NSKernel::_rhov_var_number
unsigned _rhov_var_number
Definition: NSKernel.h:56
NSSUPGBase::_d_rhoudot_du
const VariableValue & _d_rhoudot_du
Definition: NSSUPGBase.h:62
NSSUPGBase::_strong_residuals
const MaterialProperty< std::vector< Real > > & _strong_residuals
Definition: NSSUPGBase.h:41
NSKernel::_rho_var_number
unsigned _rho_var_number
Definition: NSKernel.h:54
NSSUPGBase::_d_rhowdot_du
const VariableValue & _d_rhowdot_du
Definition: NSSUPGBase.h:64
NSSUPGBase::NSSUPGBase
NSSUPGBase(const InputParameters &parameters)
Definition: NSSUPGBase.C:28
NSKernel::mapVarNumber
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:88
NSSUPGBase::_d_rhovdot_du
const VariableValue & _d_rhovdot_du
Definition: NSSUPGBase.h:63