13 #include "libmesh/quadrature.h" 23 params.
addClassDescription(
"Computes generic material properties related to simulation of fluid " 31 params.
addRequiredParam<UserObjectName>(
"eos",
"The name of equation of state object to use.");
32 params.
addParam<
Real>(
"scaling_velocity",
"Global scaling velocity");
35 "compute_turbulence_viscosity",
false,
"If turbulent viscosity will be computed.");
36 params.
addParam<FunctionName>(
"mixing_length",
37 "Prandtl mixing length to compute turbulent viscosity.");
39 "An aux variable turbulence_viscosity will be computed from.");
45 _mesh_dimension(_mesh.dimension()),
46 _u_vel(coupledValue(
"u")),
47 _v_vel(_mesh_dimension >= 2 ? coupledValue(
"v") : _zero),
48 _w_vel(_mesh_dimension == 3 ? coupledValue(
"w") : _zero),
49 _temperature(coupledValue(
"temperature")),
50 _pressure(coupledValue(
"pressure")),
52 _grad_u(coupledGradient(
"u")),
53 _grad_v(_mesh_dimension >= 2 ? coupledGradient(
"v") : _grad_zero),
54 _grad_w(_mesh_dimension == 3 ? coupledGradient(
"w") : _grad_zero),
56 _viscous_stress_tensor(declareProperty<
RealTensorValue>(
"viscous_stress_tensor")),
57 _dynamic_viscosity(declareProperty<
Real>(
"dynamic_viscosity")),
58 _turbulence_viscosity(declareProperty<
Real>(
"turbulence_viscosity")),
59 _inertia_resistance_coeff(declareProperty<
RealTensorValue>(
"inertia_resistance_coeff")),
60 _viscous_resistance_coeff(declareProperty<
RealTensorValue>(
"viscous_resistance_coeff")),
61 _k(declareProperty<
Real>(
"k_fluid")),
62 _k_turbulence(declareProperty<
Real>(
"k_turbulence")),
63 _k_elem(declareProperty<
Real>(
"k_fluid_elem")),
64 _cp(declareProperty<
Real>(
"cp_fluid")),
65 _rho(declareProperty<
Real>(
"rho_fluid")),
66 _hsupg(declareProperty<
Real>(
"hsupg")),
67 _tauc(declareProperty<
Real>(
"tauc")),
68 _taum(declareProperty<
Real>(
"taum")),
69 _taue(declareProperty<
Real>(
"taue")),
70 _compute_visc_turbulenc(getParam<bool>(
"compute_turbulence_viscosity")),
71 _has_turb_visc_auxvar(isParamValid(
"turbulence_viscosity_var")),
73 _turb_visc_auxvar(_has_turb_visc_auxvar ? coupledValue(
"turbulence_viscosity_var") : _zero),
74 _has_scale_vel(isParamValid(
"scaling_velocity")),
75 _scaling_velocity(_has_scale_vel ? getParam<
Real>(
"scaling_velocity") : 1.),
88 "please provide either 'mixing_length' or 'turbulence_viscosity_var'");
129 grad_vel += grad_vel.transpose();
140 Real strain_rate_mag = 0.0;
141 for (
unsigned int i = 0; i < 3; i++)
142 for (
unsigned int j = 0;
j < 3;
j++)
143 strain_rate_mag += 0.5 * grad_vel(i,
j) * grad_vel(i,
j);
157 for (
unsigned int i = 0; i < 3; i++)
158 grad_vel(i, i) -= 2.0 / 3.0 * div_vel;
194 Real sqrt_term_pspg = 0.;
198 sqrt_term_pspg = sqrt_term_supg;
202 sqrt_term_supg += 4. /
_dt /
_dt;
203 sqrt_term_pspg += 4. /
_dt /
_dt;
207 Real visc_term = 4 * vu / h2;
210 Real diff_term = 4 * diffusivity / h2;
212 _tauc[
_qp] = 1. / std::sqrt(sqrt_term_pspg);
213 _taum[
_qp] = 1. / std::sqrt(sqrt_term_supg + visc_term * visc_term);
214 _taue[
_qp] = 1. / std::sqrt(sqrt_term_supg + diff_term * diff_term);
const MooseArray< Point > & _q_point
MaterialProperty< Real > & _k_elem
MaterialProperty< Real > & _k
const QBase *const & _qrule
MaterialProperty< Real > & _tauc
MaterialProperty< RealTensorValue > & _viscous_stress_tensor
const VariableGradient & _grad_w
MaterialProperty< Real > & _taum
MaterialProperty< Real > & _cp
const Function & getFunction(const std::string &name) const
registerMooseObjectRenamed("NavierStokesApp", MDFluidMaterial, "02/01/2024 00:00", INSFEMaterial)
virtual void computeProperties() override
const VariableValue & _w_vel
const VariableGradient & _grad_v
MaterialProperty< Real > & _rho
virtual void computeQpProperties() override
const VariableValue & _temperature
void computeFluidProperties()
const VariableValue & _v_vel
static InputParameters validParams()
const VariableGradient & _grad_u
const VariableValue & _pressure
bool isParamValid(const std::string &name) const
registerMooseObject("NavierStokesApp", INSFEMaterial)
TensorValue< Real > RealTensorValue
MaterialProperty< Real > & _k_turbulence
const VariableValue & _turb_visc_auxvar
static InputParameters validParams()
bool _has_turb_visc_auxvar
const SinglePhaseFluidProperties & _eos
scaling velocity
MaterialProperty< RealTensorValue > & _inertia_resistance_coeff
Common class for single phase fluid properties.
const Function * _mixing_length
Executioner * getExecutioner() const
Fluid materials for 3D fluid model.
MaterialProperty< Real > & _dynamic_viscosity
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue & _u_vel
INSFEMaterial(const InputParameters ¶meters)
bool _compute_visc_turbulenc
void mooseError(Args &&... args) const
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
MaterialProperty< Real > & _turbulence_viscosity
MaterialProperty< Real > & _hsupg
virtual Real value(Real t, const Point &p) const
MaterialProperty< RealTensorValue > & _viscous_resistance_coeff
MaterialProperty< Real > & _taue
const Elem *const & _current_elem