www.mooseframework.org
NavierStokesMaterial.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 #ifndef NAVIERSTOKESMATERIAL_H
8 #define NAVIERSTOKESMATERIAL_H
9 
10 #include "Material.h"
11 
12 // Forward Declarations
15 
16 template <>
17 InputParameters validParams<NavierStokesMaterial>();
18 
34 class NavierStokesMaterial : public Material
35 {
36 public:
37  NavierStokesMaterial(const InputParameters & parameters);
38 
39 protected:
43  virtual void computeProperties();
44 
45  const unsigned int _mesh_dimension;
46 
47  const VariableGradient & _grad_u;
48  const VariableGradient & _grad_v;
49  const VariableGradient & _grad_w;
50 
51  MaterialProperty<RealTensorValue> & _viscous_stress_tensor;
52  MaterialProperty<Real> & _thermal_conductivity;
53  MaterialProperty<Real> & _dynamic_viscosity;
54 
55  // Also store the "cal A" matrices at each quadrature point as material
56  // poperties. These are defined in the compns notes and are needed for
57  // computing strong and weak residual values and Jacobian entries, so it's
58  // good if we reuse them...
59  MaterialProperty<std::vector<RealTensorValue>> & _calA;
60 
61  // The "velocity column" matrices. _calC[_qp][k] is a tensor with the
62  // velocity vector in the k'th column. See notes for additional details.
63  MaterialProperty<std::vector<RealTensorValue>> & _calC;
64 
65  // The energy equation inviscid flux matrix components. There are n_vars of
66  // these for each dimension, so in 3D, 3*5=15 different matrices.
67  // See notes for additional details.
68  MaterialProperty<std::vector<std::vector<RealTensorValue>>> & _calE;
69 
70  // Convenient storage for all of the velocity gradient components so
71  // we can refer to them in a loop.
72  std::vector<const VariableGradient *> _vel_grads;
73 
74  // Coupled values needed to compute strong form residuals
75  // for SUPG stabilization...
76  const VariableValue & _u_vel;
77  const VariableValue & _v_vel;
78  const VariableValue & _w_vel;
79 
80  // Temperature is needed to compute speed of sound
81  const VariableValue & _temperature;
82 
83  // Enthalpy is needed in computing energy equation strong residuals
84  const VariableValue & _enthalpy;
85 
86  // Main solution variables are all needed for computing strong residuals
87  const VariableValue & _rho;
88  const VariableValue & _rho_u;
89  const VariableValue & _rho_v;
90  const VariableValue & _rho_w;
91  const VariableValue & _rho_E;
92 
93  // Time derivative values for dependent variables
94  const VariableValue & _drho_dt;
95  const VariableValue & _drhou_dt;
96  const VariableValue & _drhov_dt;
97  const VariableValue & _drhow_dt;
98  const VariableValue & _drhoE_dt;
99 
100  // Gradients
101  const VariableGradient & _grad_rho;
102  const VariableGradient & _grad_rho_u;
103  const VariableGradient & _grad_rho_v;
104  const VariableGradient & _grad_rho_w;
105  const VariableGradient & _grad_rho_E;
106 
107  // The real-valued material properties representing the element stabilization
108  // parameters for each of the equations.
109  MaterialProperty<Real> & _hsupg;
110  MaterialProperty<Real> & _tauc;
111  MaterialProperty<Real> & _taum;
112  MaterialProperty<Real> & _taue;
113 
114  // The (vector-valued) material property which is the strong-form
115  // residual at each quadrature point.
116  MaterialProperty<std::vector<Real>> & _strong_residuals;
117 
118  // Fluid properties
120 
121 private:
122  // To be called from computeProperties() function to compute _hsupg
123  void computeHSUPG(unsigned int qp);
124 
125  // To be called from computeProperties() function to compute _tauc, _taum, _taue
126  void computeTau(unsigned int qp);
127 
128  // To be called from computeProperties() function to compute the strong residual of each equation.
129  void computeStrongResiduals(unsigned int qp);
130 };
131 
132 #endif // NAVIERSTOKESMATERIAL_H
MaterialProperty< Real > & _dynamic_viscosity
MaterialProperty< Real > & _hsupg
const unsigned int _mesh_dimension
void computeTau(unsigned int qp)
const VariableValue & _drhow_dt
MaterialProperty< std::vector< RealTensorValue > > & _calC
void computeHSUPG(unsigned int qp)
const VariableGradient & _grad_rho_v
const VariableValue & _u_vel
MaterialProperty< Real > & _tauc
const VariableGradient & _grad_rho_w
MaterialProperty< Real > & _taue
void computeStrongResiduals(unsigned int qp)
MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _calE
std::vector< const VariableGradient * > _vel_grads
const VariableValue & _enthalpy
MaterialProperty< std::vector< RealTensorValue > > & _calA
const VariableValue & _v_vel
MaterialProperty< std::vector< Real > > & _strong_residuals
const VariableGradient & _grad_rho_E
const VariableGradient & _grad_rho_u
NavierStokesMaterial(const InputParameters &parameters)
const VariableValue & _drhou_dt
const VariableGradient & _grad_rho
const VariableValue & _rho_w
const VariableValue & _w_vel
const VariableGradient & _grad_u
MaterialProperty< RealTensorValue > & _viscous_stress_tensor
const VariableValue & _drhoE_dt
MaterialProperty< Real > & _thermal_conductivity
This is the base class all materials should use if you are trying to use the Navier-Stokes Kernels...
const VariableGradient & _grad_v
Ideal gas fluid properties.
virtual void computeProperties()
Must be called after the child class computes dynamic_viscocity.
const VariableValue & _drhov_dt
const IdealGasFluidProperties & _fp
const VariableValue & _drho_dt
const VariableValue & _rho_u
const VariableValue & _rho_E
const VariableValue & _temperature
const VariableValue & _rho_v
const VariableGradient & _grad_w
const VariableValue & _rho
MaterialProperty< Real > & _taum