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

#include <NSMassInviscidFlux.h>

Inheritance diagram for NSMassInviscidFlux:
[legend]

Public Member Functions

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

Detailed Description

Definition at line 18 of file NSMassInviscidFlux.h.

Constructor & Destructor Documentation

NSMassInviscidFlux::NSMassInviscidFlux ( const InputParameters &  parameters)

Definition at line 18 of file NSMassInviscidFlux.C.

18 : NSKernel(parameters) {}
NSKernel(const InputParameters &parameters)
Definition: NSKernel.C:39

Member Function Documentation

Real NSMassInviscidFlux::computeQpJacobian ( )
protectedvirtual

Definition at line 30 of file NSMassInviscidFlux.C.

31 {
32  // This seems weird at first glance, but remember we have to differentiate
33  // wrt the *conserved* variables
34  //
35  // [ U_0 ] = [ rho ]
36  // [ U_1 ] = [ rho * u_1 ]
37  // [ U_2 ] = [ rho * u_2 ]
38  // [ U_3 ] = [ rho * u_3 ]
39  // [ U_4 ] = [ rho * E ]
40  //
41  // and the inviscid mass flux residual, in terms of these variables, is:
42  //
43  // f(U) = ( U_k * dphi_i/dx_k ), summation over k=1,2,3
44  //
45  // ie. does not depend on U_0, the on-diagonal Jacobian component.
46  return 0.0;
47 }
Real NSMassInviscidFlux::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 50 of file NSMassInviscidFlux.C.

51 {
52  if (isNSVariable(jvar))
53  {
54  // Map jvar into the variable m for our problem, regardless of
55  // how Moose has numbered things.
56  unsigned int m = mapVarNumber(jvar);
57 
58  switch (m)
59  {
60  // Don't handle the on-diagonal case here
61  // case 0: // density
62  case 1:
63  case 2:
64  case 3: // momentums
65  return -_phi[_j][_qp] * _grad_test[_i][_qp](m - 1);
66 
67  case 4: // energy
68  return 0.0;
69 
70  default:
71  mooseError("Should not get here!");
72  break;
73  }
74  }
75  else
76  return 0.0;
77 }
bool isNSVariable(unsigned var)
Helper functions for mapping Moose variable numberings into the "canonical" numbering for the compres...
Definition: NSKernel.C:76
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:86
Real NSMassInviscidFlux::computeQpResidual ( )
protectedvirtual

Definition at line 21 of file NSMassInviscidFlux.C.

22 {
23  const RealVectorValue mom(_rho_u[_qp], _rho_v[_qp], _rho_w[_qp]);
24 
25  // -(rho*U) * grad(phi), negative sign comes from integration-by-parts
26  return -(mom * _grad_test[_i][_qp]);
27 }
const VariableValue & _rho_u
Definition: NSKernel.h:39
const VariableValue & _rho_v
Definition: NSKernel.h:40
const VariableValue & _rho_w
Definition: NSKernel.h:41
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(), 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(), NSSUPGMass::computeJacobianHelper(), NSSUPGMomentum::computeJacobianHelper(), 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<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 NSEnergyViscousFlux::computeQpOffDiagJacobian(), and computeQpResidual().

const VariableValue& NSKernel::_rho_v
protectedinherited

Definition at line 40 of file NSKernel.h.

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

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

Definition at line 41 of file NSKernel.h.

Referenced by NSEnergyViscousFlux::computeQpOffDiagJacobian(), and 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
const VariableValue& NSKernel::_w_vel
protectedinherited

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