https://mooseframework.inl.gov
INSADStabilized3Eqn.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 // Navier-Stokes includes
11 #include "INSADStabilized3Eqn.h"
12 
13 registerMooseObject("NavierStokesApp", INSADStabilized3Eqn);
14 
17 {
19  params.addClassDescription("This is the material class used to compute the stabilization "
20  "parameter tau for momentum and tau_energy for the energy equation.");
21  params.addParam<MaterialPropertyName>(
22  "k_name", "k", "the name of the thermal conductivity material property");
23  params.addParam<MaterialPropertyName>(
24  "grad_k_name",
25  "grad_k",
26  "the name of the gradient of the thermal conductivity material property");
27  return params;
28 }
29 
31  : INSADTauMaterialTempl<INSAD3Eqn>(parameters),
32  _second_temperature(adCoupledSecond("temperature")),
33  _k(getADMaterialProperty<Real>("k_name")),
34  _grad_k(hasADMaterialProperty<RealVectorValue>("grad_k_name")
35  ? &getADMaterialProperty<RealVectorValue>("grad_k_name")
36  : nullptr),
37  _tau_energy(declareADProperty<Real>("tau_energy")),
38  _temperature_strong_residual(declareADProperty<Real>("temperature_strong_residual"))
39 {
40 }
41 
42 void
44 {
46 
47  const auto dissipation_coefficient = _k[_qp] / (_rho[_qp] * _cp[_qp]);
48  const auto transient_part = _has_energy_transient ? 4. / (_dt * _dt) : 0.;
49  _tau_energy[_qp] =
50  _alpha / std::sqrt(transient_part + (2. * _speed / _hmax) * (2. * _speed / _hmax) +
51  9. * (4. * dissipation_coefficient / (_hmax * _hmax)) *
52  (4. * dissipation_coefficient / (_hmax * _hmax)));
53 
54  // Start with the conductive term
56  if (_grad_k)
58 
59  // advective
61 
64 
67 
68  if (_has_heat_source)
70 
73 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
const ADMaterialProperty< Real > & _cp
Definition: INSAD3Eqn.h:33
Computes properties needed for stabilized formulations of the mass, momentum, and energy equations...
Definition: INSAD3Eqn.h:18
ADMaterialProperty< Real > & _tau_energy
static InputParameters validParams()
Real & _dt
virtual void computeQpProperties() override
const ADMaterialProperty< RealVectorValue > *const _grad_k
const ADMaterialProperty< Real > & _k
INSADStabilized3Eqn(const InputParameters &parameters)
unsigned int _qp
virtual void computeQpProperties() override
ADMaterialProperty< Real > & _temperature_source_strong_residual
Definition: INSAD3Eqn.h:38
ADReal _speed
The speed of the medium.
const ADVariableSecond & _second_temperature
ADMaterialProperty< Real > & _temperature_ambient_convection_strong_residual
Definition: INSAD3Eqn.h:37
ADMaterialProperty< Real > & _temperature_td_strong_residual
Definition: INSAD3Eqn.h:36
registerMooseObject("NavierStokesApp", INSADStabilized3Eqn)
ADMaterialProperty< Real > & _temperature_advective_strong_residual
Definition: INSAD3Eqn.h:35
bool _has_ambient_convection
Definition: INSAD3Eqn.h:44
const ADVariableGradient & _grad_temperature
Definition: INSAD3Eqn.h:31
static InputParameters validParams()
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
bool _has_energy_transient
Whether the energy equation is transient.
Definition: INSAD3Eqn.h:52
void addClassDescription(const std::string &doc_string)
bool _has_advected_mesh
Whether we have mesh convection.
ADMaterialProperty< Real > & _temperature_strong_residual
const ADMaterialProperty< Real > & _rho
density
Definition: INSADMaterial.h:43
bool _has_heat_source
Definition: INSAD3Eqn.h:47
ADMaterialProperty< Real > & _temperature_advected_mesh_strong_residual
The strong residual for the temperature transport term corresponding to mesh velocity in an ALE simul...
Definition: INSAD3Eqn.h:42