21#include "libmesh/quadrature.h"
31 "This is the base class of all materials should use if you are trying to "
32 "use the Navier-Stokes Kernels.");
46 "The name of the user object for fluid properties");
52 _mesh_dimension(_mesh.dimension()),
53 _grad_u(coupledGradient(
nms::velocity_x)),
54 _grad_v(_mesh_dimension >= 2 ? coupledGradient(
nms::velocity_y) : _grad_zero),
55 _grad_w(_mesh_dimension == 3 ? coupledGradient(
nms::velocity_z) : _grad_zero),
57 _viscous_stress_tensor(declareProperty<RealTensorValue>(
"viscous_stress_tensor")),
58 _thermal_conductivity(declareProperty<Real>(
"thermal_conductivity")),
62 _dynamic_viscosity(declareProperty<Real>(
"dynamic_viscosity")),
65 _calA(declareProperty<
std::vector<RealTensorValue>>(
"calA")),
68 _calC(declareProperty<
std::vector<RealTensorValue>>(
"calC")),
71 _calE(declareProperty<
std::vector<
std::vector<RealTensorValue>>>(
"calE")),
77 _w_vel(_mesh.dimension() == 3 ? coupledValue(
nms::velocity_z) : _zero),
79 _temperature(coupledValue(
nms::temperature)),
80 _specific_total_enthalpy(coupledValue(
nms::specific_total_enthalpy)),
83 _rho(coupledValue(
nms::density)),
84 _rho_u(coupledValue(
nms::momentum_x)),
85 _rho_v(_mesh.dimension() >= 2 ? coupledValue(
nms::momentum_y) : _zero),
86 _rho_w(_mesh.dimension() == 3 ? coupledValue(
nms::momentum_z) : _zero),
87 _rho_et(coupledValue(
nms::total_energy_density)),
90 _drho_dt(coupledDot(
nms::density)),
91 _drhou_dt(coupledDot(
nms::momentum_x)),
92 _drhov_dt(_mesh.dimension() >= 2 ? coupledDot(
nms::momentum_y) : _zero),
93 _drhow_dt(_mesh.dimension() == 3 ? coupledDot(
nms::momentum_z) : _zero),
94 _drhoE_dt(coupledDot(
nms::total_energy_density)),
97 _grad_rho(coupledGradient(
nms::density)),
98 _grad_rho_u(coupledGradient(
nms::momentum_x)),
99 _grad_rho_v(_mesh.dimension() >= 2 ? coupledGradient(
nms::momentum_y) : _grad_zero),
100 _grad_rho_w(_mesh.dimension() == 3 ? coupledGradient(
nms::momentum_z) : _grad_zero),
101 _grad_rho_et(coupledGradient(
nms::total_energy_density)),
104 _hsupg(declareProperty<Real>(
"hsupg")),
105 _tauc(declareProperty<Real>(
"tauc")),
106 _taum(declareProperty<Real>(
"taum")),
107 _taue(declareProperty<Real>(
"taue")),
108 _strong_residuals(declareProperty<
std::vector<Real>>(
"strong_residuals")),
119 for (
unsigned int qp = 0; qp <
_qrule->n_points(); ++qp)
126 grad_outer_u += grad_outer_u.transpose();
129 for (
unsigned int i = 0; i < 3; ++i)
133 for (
unsigned int i = 0; i < 3; ++i)
134 grad_outer_u(i, i) -= 2.0 / 3.0 * div_vel;
154 const Real Pr = 0.71;
339 Real sqrt_term = 4. /
_dt /
_dt + velmag * velmag / h2;
342 _tauc[qp] = 1. / std::sqrt(sqrt_term);
343 _taum[qp] = 1. / std::sqrt(sqrt_term + visc_term * visc_term);
344 _taue[qp] = 1. / std::sqrt(sqrt_term + k_term * k_term);
371 RealVectorValue zero(0., 0., 0.);
374 Real velmag2 = vel.norm_sq();
392 for (
unsigned int i = 0; i < 3; ++i)
411 RealTensorValue calS =
_calC[qp][0] *
_calC[qp][0].transpose();
419 0.5 * (
_fp.
gamma() - 1.0) * velmag2;
420 _calA[qp][0] -= calS;
422 for (
unsigned int m = 1; m <= 3; ++m)
425 unsigned int m_local = m - 1;
432 _calA[qp][m] +=
_calC[qp][m_local].transpose();
443 for (
unsigned int k = 0; k < 3; ++k)
450 RealTensorValue Ck_T =
_calC[qp][k].transpose();
453 _calE[qp][k][0].zero();
456 for (
unsigned int m = 1; m <= 3; ++m)
459 unsigned int m_local = m - 1;
462 _calE[qp][k][m].zero();
468 _calE[qp][k][4].zero();
Ideal gas fluid properties Default parameters are for air at atmospheric pressure and temperature.
virtual Real gamma() const
virtual void resize(const std::size_t size) override final
static InputParameters validParams()
const Elem *const & _current_elem
const QBase *const & _qrule
MaterialProperty< std::vector< RealTensorValue > > & _calC
const VariableGradient & _grad_rho_et
MaterialProperty< Real > & _taum
const VariableValue & _specific_total_enthalpy
MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _calE
const IdealGasFluidProperties & _fp
static InputParameters validParams()
const VariableGradient & _grad_rho_u
const VariableValue & _w_vel
MaterialProperty< Real > & _taue
const VariableGradient & _grad_rho_w
void computeHSUPG(unsigned int qp)
const VariableGradient & _grad_rho
MaterialProperty< Real > & _tauc
const VariableValue & _drhow_dt
const VariableValue & _drho_dt
const VariableGradient & _grad_w
std::vector< const VariableGradient * > _vel_grads
const unsigned int _mesh_dimension
const VariableGradient & _grad_rho_v
MaterialProperty< std::vector< RealTensorValue > > & _calA
MaterialProperty< std::vector< Real > > & _strong_residuals
void computeStrongResiduals(unsigned int qp)
const VariableValue & _v_vel
const VariableValue & _rho
const VariableValue & _u_vel
const VariableValue & _drhou_dt
MaterialProperty< Real > & _hsupg
const VariableGradient & _grad_v
const VariableValue & _drhoE_dt
NavierStokesMaterial(const InputParameters ¶meters)
MaterialProperty< RealTensorValue > & _viscous_stress_tensor
MaterialProperty< Real > & _thermal_conductivity
virtual void computeProperties()
Must be called after the child class computes dynamic_viscocity.
void computeTau(unsigned int qp)
const VariableValue & _drhov_dt
MaterialProperty< Real > & _dynamic_viscosity
const VariableGradient & _grad_u
static const std::string density
static const std::string velocity_y
static const std::string temperature
static const std::string total_energy_density
static const std::string momentum_x
static const std::string velocity_z
static const std::string momentum_y
static const std::string specific_total_enthalpy
static const std::string velocity_x
static const std::string momentum_z