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 20 of file NSMassInviscidFlux.h.

Constructor & Destructor Documentation

◆ NSMassInviscidFlux()

NSMassInviscidFlux::NSMassInviscidFlux ( const InputParameters &  parameters)

Definition at line 23 of file NSMassInviscidFlux.C.

23 : NSKernel(parameters) {}

Member Function Documentation

◆ computeQpJacobian()

Real NSMassInviscidFlux::computeQpJacobian ( )
protectedvirtual

Definition at line 35 of file NSMassInviscidFlux.C.

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

◆ computeQpOffDiagJacobian()

Real NSMassInviscidFlux::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

Definition at line 55 of file NSMassInviscidFlux.C.

56 {
57  if (isNSVariable(jvar))
58  {
59  // Map jvar into the variable m for our problem, regardless of
60  // how Moose has numbered things.
61  unsigned int m = mapVarNumber(jvar);
62 
63  switch (m)
64  {
65  // Don't handle the on-diagonal case here
66  // case 0: // density
67  case 1:
68  case 2:
69  case 3: // momentums
70  return -_phi[_j][_qp] * _grad_test[_i][_qp](m - 1);
71 
72  case 4: // energy
73  return 0.0;
74 
75  default:
76  mooseError("Should not get here!");
77  break;
78  }
79  }
80  else
81  return 0.0;
82 }

◆ computeQpResidual()

Real NSMassInviscidFlux::computeQpResidual ( )
protectedvirtual

Definition at line 26 of file NSMassInviscidFlux.C.

27 {
28  const RealVectorValue mom(_rho_u[_qp], _rho_v[_qp], _rho_w[_qp]);
29 
30  // -(rho*U) * grad(phi), negative sign comes from integration-by-parts
31  return -(mom * _grad_test[_i][_qp]);
32 }

◆ 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(), NSSUPGMass::computeJacobianHelper(), NSSUPGMomentum::computeJacobianHelper(), computeQpOffDiagJacobian(), NSMomentumInviscidFluxWithGradP::computeQpOffDiagJacobian(), NSEnergyViscousFlux::computeQpOffDiagJacobian(), NSMomentumInviscidFlux::computeQpOffDiagJacobian(), NSMomentumViscousFlux::computeQpOffDiagJacobian(), and NSEnergyThermalFlux::computeQpOffDiagJacobian().

Member Data Documentation

◆ _dynamic_viscosity

const MaterialProperty<Real>& NSKernel::_dynamic_viscosity
protectedinherited

Definition at line 61 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 44 of file NSKernel.h.

◆ _rho_u

const VariableValue& NSKernel::_rho_u
protectedinherited

Definition at line 41 of file NSKernel.h.

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

◆ _rho_v

const VariableValue& NSKernel::_rho_v
protectedinherited

Definition at line 42 of file NSKernel.h.

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

◆ _rho_var_number

unsigned NSKernel::_rho_var_number
protectedinherited

◆ _rho_w

const VariableValue& NSKernel::_rho_w
protectedinherited

Definition at line 43 of file NSKernel.h.

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

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

◆ _w_vel

const VariableValue& NSKernel::_w_vel
protectedinherited

The documentation for this class was generated from the following files:
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
NSKernel::_rho_w
const VariableValue & _rho_w
Definition: NSKernel.h:43
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
NSKernel::_rho_u
const VariableValue & _rho_u
Definition: NSKernel.h:41
NSKernel::_rho_v
const VariableValue & _rho_v
Definition: NSKernel.h:42
NSKernel::NSKernel
NSKernel(const InputParameters &parameters)
Definition: NSKernel.C:41
NSKernel::_rho_var_number
unsigned _rho_var_number
Definition: NSKernel.h:54
NSKernel::mapVarNumber
unsigned mapVarNumber(unsigned var)
Definition: NSKernel.C:88