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

A material kernel for the CNS equations. More...

#include <CNSFVMaterial.h>

Inheritance diagram for CNSFVMaterial:
[legend]

Public Member Functions

 CNSFVMaterial (const InputParameters &parameters)
 
virtual ~CNSFVMaterial ()
 

Protected Member Functions

virtual void computeQpProperties ()
 

Protected Attributes

const VariableValue & _rhoc
 density More...
 
const VariableValue & _rhouc
 x-component of momentum More...
 
const VariableValue & _rhovc
 y-component of momentum More...
 
const VariableValue & _rhowc
 z-component pf momentum More...
 
const VariableValue & _rhoec
 total energy More...
 
const SlopeLimitingBase_lslope
 slope limiting More...
 
const SinglePhaseFluidProperties_fp
 fluid properties More...
 
MaterialProperty< Real > & _rho
 rho More...
 
MaterialProperty< Real > & _rhou
 rhou More...
 
MaterialProperty< Real > & _rhov
 rhov More...
 
MaterialProperty< Real > & _rhow
 rhow More...
 
MaterialProperty< Real > & _rhoe
 rhoe More...
 
MaterialProperty< Real > & _vmag
 velocity magnitude More...
 
MaterialProperty< Real > & _pres
 pressure More...
 
MaterialProperty< Real > & _temp
 temperature More...
 
MaterialProperty< Real > & _enth
 specific total enthalpy More...
 
MaterialProperty< Real > & _csou
 speed of sound More...
 
MaterialProperty< Real > & _mach
 Mach number. More...
 
MaterialProperty< Real > & _uadv
 x-velocity More...
 
MaterialProperty< Real > & _vadv
 y-velocity More...
 
MaterialProperty< Real > & _wadv
 z-velocity More...
 
MaterialProperty< Real > & _gamma
 gamma More...
 

Detailed Description

A material kernel for the CNS equations.

Notes:

  1. This material kernel is responsible for invoking the in-cell slope reconstruction and slope limiting based on the cell-average variable values.
  2. The reconstructed/limited linear polynomial variable in each element is then interpolated to the center of each side that surrounds an element.
  3. If a system of governing equations is being solved, the reconstructed/limited vector of variable gradients is only calculated once when the first equation is dealt with, and then cached for use for the rest of the equations.
  4. If reconstruction/limiting scheme is not turned on, the cell-average constant variable is used for flux calculations, which is first-order accurate in space and absolutely stable

Definition at line 42 of file CNSFVMaterial.h.

Constructor & Destructor Documentation

CNSFVMaterial::CNSFVMaterial ( const InputParameters &  parameters)

Definition at line 39 of file CNSFVMaterial.C.

40  : Material(parameters),
41  _rhoc(coupledValue("rho")),
42  _rhouc(coupledValue("rhou")),
43  _rhovc(isCoupled("rhov") ? coupledValue("rhov") : _zero),
44  _rhowc(isCoupled("rhow") ? coupledValue("rhow") : _zero),
45  _rhoec(coupledValue("rhoe")),
46  _lslope(getUserObject<SlopeLimitingBase>("slope_limiting")),
47  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties")),
48  _rho(declareProperty<Real>("rho")),
49  _rhou(declareProperty<Real>("rhou")),
50  _rhov(declareProperty<Real>("rhov")),
51  _rhow(declareProperty<Real>("rhow")),
52  _rhoe(declareProperty<Real>("rhoe")),
53  _vmag(declareProperty<Real>("velocity_magnitude")),
54  _pres(declareProperty<Real>("pressure")),
55  _temp(declareProperty<Real>("temperature")),
56  _enth(declareProperty<Real>("enthalpy")),
57  _csou(declareProperty<Real>("speed_of_sound")),
58  _mach(declareProperty<Real>("mach_number")),
59  _uadv(declareProperty<Real>("vel_x")),
60  _vadv(declareProperty<Real>("vel_y")),
61  _wadv(declareProperty<Real>("vel_z")),
62  _gamma(declareProperty<Real>("gamma"))
63 {
64 }
MaterialProperty< Real > & _wadv
z-velocity
MaterialProperty< Real > & _rho
rho
Definition: CNSFVMaterial.h:74
MaterialProperty< Real > & _rhov
rhov
Definition: CNSFVMaterial.h:78
MaterialProperty< Real > & _csou
speed of sound
Definition: CNSFVMaterial.h:92
MaterialProperty< Real > & _pres
pressure
Definition: CNSFVMaterial.h:86
const VariableValue & _rhovc
y-component of momentum
Definition: CNSFVMaterial.h:58
MaterialProperty< Real > & _rhow
rhow
Definition: CNSFVMaterial.h:80
MaterialProperty< Real > & _rhoe
rhoe
Definition: CNSFVMaterial.h:82
MaterialProperty< Real > & _rhou
rhou
Definition: CNSFVMaterial.h:76
const VariableValue & _rhoec
total energy
Definition: CNSFVMaterial.h:62
const VariableValue & _rhouc
x-component of momentum
Definition: CNSFVMaterial.h:56
MaterialProperty< Real > & _gamma
gamma
MaterialProperty< Real > & _enth
specific total enthalpy
Definition: CNSFVMaterial.h:90
MaterialProperty< Real > & _vadv
y-velocity
Definition: CNSFVMaterial.h:98
const VariableValue & _rhowc
z-component pf momentum
Definition: CNSFVMaterial.h:60
MaterialProperty< Real > & _vmag
velocity magnitude
Definition: CNSFVMaterial.h:84
MaterialProperty< Real > & _mach
Mach number.
Definition: CNSFVMaterial.h:94
const SinglePhaseFluidProperties & _fp
fluid properties
Definition: CNSFVMaterial.h:69
MaterialProperty< Real > & _temp
temperature
Definition: CNSFVMaterial.h:88
const VariableValue & _rhoc
density
Definition: CNSFVMaterial.h:54
MaterialProperty< Real > & _uadv
x-velocity
Definition: CNSFVMaterial.h:96
const SlopeLimitingBase & _lslope
slope limiting
Definition: CNSFVMaterial.h:67
CNSFVMaterial::~CNSFVMaterial ( )
virtual

Definition at line 66 of file CNSFVMaterial.C.

66 {}

Member Function Documentation

void CNSFVMaterial::computeQpProperties ( )
protectedvirtual

initialize the conserved variables: rho, rhou, rhov, rhow, rhoe

calculate the primitive variables: pres, uadv, vadv, wadv, temp

interpolate variable values at face center

reconstruct the slopes of primitive variables

get the directional vector from cell center to face center

calculate the conserved variables at face center

clear the temporary vectors

calculations only for elemental output

Definition at line 69 of file CNSFVMaterial.C.

70 {
72  _rho[_qp] = _rhoc[_qp];
73  _rhou[_qp] = _rhouc[_qp];
74  _rhov[_qp] = _rhovc[_qp];
75  _rhow[_qp] = _rhowc[_qp];
76  _rhoe[_qp] = _rhoec[_qp];
77 
79  _uadv[_qp] = _rhou[_qp] / _rho[_qp];
80  _vadv[_qp] = _rhov[_qp] / _rho[_qp];
81  _wadv[_qp] = _rhow[_qp] / _rho[_qp];
82 
83  Real vdov = _uadv[_qp] * _uadv[_qp] + _vadv[_qp] * _vadv[_qp] + _wadv[_qp] * _wadv[_qp];
84 
85  Real v = 1. / _rho[_qp];
86  Real e = _rhoe[_qp] / _rho[_qp] - 0.5 * vdov;
87 
88  _pres[_qp] = _fp.pressure(v, e);
89  _temp[_qp] = _fp.temperature(v, e);
90  _gamma[_qp] = _fp.gamma(v, e);
91 
93  if (_bnd)
94  {
96 
97  unsigned int nvars = 5;
98  std::vector<RealGradient> ugrad(nvars, RealGradient(0., 0., 0.));
99  ugrad = _lslope.getElementSlope(_current_elem->id());
100 
102 
103  RealGradient dvec = _q_point[_qp] - _current_elem->centroid();
104 
106 
107  _pres[_qp] += ugrad[0] * dvec;
108  _uadv[_qp] += ugrad[1] * dvec;
109  _vadv[_qp] += ugrad[2] * dvec;
110  _wadv[_qp] += ugrad[3] * dvec;
111  _temp[_qp] += ugrad[4] * dvec;
112 
113  _rho[_qp] = _fp.rho(_pres[_qp], _temp[_qp]);
114 
115  _rhou[_qp] = _rho[_qp] * _uadv[_qp];
116 
117  _rhov[_qp] = _rho[_qp] * _vadv[_qp];
118 
119  _rhow[_qp] = _rho[_qp] * _wadv[_qp];
120 
121  _rhoe[_qp] = _rho[_qp] * _fp.e(_pres[_qp], _rho[_qp]) +
122  _rho[_qp] * 0.5 *
123  (_uadv[_qp] * _uadv[_qp] + _vadv[_qp] * _vadv[_qp] + _wadv[_qp] * _wadv[_qp]);
124 
126 
127  ugrad.clear();
128  }
129 
131  else if (!_bnd)
132  {
133  _vmag[_qp] = std::sqrt(vdov);
134 
135  _csou[_qp] = _fp.c(v, e);
136 
137  _enth[_qp] = (_rhoe[_qp] + _pres[_qp]) / _rho[_qp];
138 
139  _mach[_qp] = std::sqrt(vdov) / _csou[_qp];
140  }
141 }
MaterialProperty< Real > & _wadv
z-velocity
MaterialProperty< Real > & _rho
rho
Definition: CNSFVMaterial.h:74
MaterialProperty< Real > & _rhov
rhov
Definition: CNSFVMaterial.h:78
MaterialProperty< Real > & _csou
speed of sound
Definition: CNSFVMaterial.h:92
MaterialProperty< Real > & _pres
pressure
Definition: CNSFVMaterial.h:86
const VariableValue & _rhovc
y-component of momentum
Definition: CNSFVMaterial.h:58
MaterialProperty< Real > & _rhow
rhow
Definition: CNSFVMaterial.h:80
MaterialProperty< Real > & _rhoe
rhoe
Definition: CNSFVMaterial.h:82
virtual Real temperature(Real v, Real u) const =0
Temperature as a function of specific internal energy and specific volume.
MaterialProperty< Real > & _rhou
rhou
Definition: CNSFVMaterial.h:76
virtual Real c(Real v, Real u) const =0
Sound speed.
const VariableValue & _rhoec
total energy
Definition: CNSFVMaterial.h:62
const VariableValue & _rhouc
x-component of momentum
Definition: CNSFVMaterial.h:56
MaterialProperty< Real > & _gamma
gamma
virtual const std::vector< RealGradient > & getElementSlope(dof_id_type elementid) const
accessor function call
virtual Real rho(Real pressure, Real temperature) const =0
Computes density from pressure and temperature.
MaterialProperty< Real > & _enth
specific total enthalpy
Definition: CNSFVMaterial.h:90
MaterialProperty< Real > & _vadv
y-velocity
Definition: CNSFVMaterial.h:98
const VariableValue & _rhowc
z-component pf momentum
Definition: CNSFVMaterial.h:60
MaterialProperty< Real > & _vmag
velocity magnitude
Definition: CNSFVMaterial.h:84
MaterialProperty< Real > & _mach
Mach number.
Definition: CNSFVMaterial.h:94
const SinglePhaseFluidProperties & _fp
fluid properties
Definition: CNSFVMaterial.h:69
MaterialProperty< Real > & _temp
temperature
Definition: CNSFVMaterial.h:88
const VariableValue & _rhoc
density
Definition: CNSFVMaterial.h:54
virtual Real gamma(Real v, Real u) const
Compute the ratio of specific heats.
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.
MaterialProperty< Real > & _uadv
x-velocity
Definition: CNSFVMaterial.h:96
const SlopeLimitingBase & _lslope
slope limiting
Definition: CNSFVMaterial.h:67
virtual Real e(Real pressure, Real rho) const =0
Computes internal energy from pressure and density.

Member Data Documentation

MaterialProperty<Real>& CNSFVMaterial::_csou
protected

speed of sound

Definition at line 92 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_enth
protected

specific total enthalpy

Definition at line 90 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const SinglePhaseFluidProperties& CNSFVMaterial::_fp
protected

fluid properties

Definition at line 69 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_gamma
protected

gamma

Definition at line 102 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const SlopeLimitingBase& CNSFVMaterial::_lslope
protected

slope limiting

Definition at line 67 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_mach
protected

Mach number.

Definition at line 94 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_pres
protected

pressure

Definition at line 86 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_rho
protected

rho

Definition at line 74 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const VariableValue& CNSFVMaterial::_rhoc
protected

density

Definition at line 54 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_rhoe
protected

rhoe

Definition at line 82 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const VariableValue& CNSFVMaterial::_rhoec
protected

total energy

Definition at line 62 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_rhou
protected

rhou

Definition at line 76 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const VariableValue& CNSFVMaterial::_rhouc
protected

x-component of momentum

Definition at line 56 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_rhov
protected

rhov

Definition at line 78 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const VariableValue& CNSFVMaterial::_rhovc
protected

y-component of momentum

Definition at line 58 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_rhow
protected

rhow

Definition at line 80 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

const VariableValue& CNSFVMaterial::_rhowc
protected

z-component pf momentum

Definition at line 60 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_temp
protected

temperature

Definition at line 88 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_uadv
protected

x-velocity

Definition at line 96 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_vadv
protected

y-velocity

Definition at line 98 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_vmag
protected

velocity magnitude

Definition at line 84 of file CNSFVMaterial.h.

Referenced by computeQpProperties().

MaterialProperty<Real>& CNSFVMaterial::_wadv
protected

z-velocity

Definition at line 100 of file CNSFVMaterial.h.

Referenced by computeQpProperties().


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