https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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
42void
44{
45 using std::sqrt;
46
48
49 const auto dissipation_coefficient = _k[_qp] / (_rho[_qp] * _cp[_qp]);
50 const auto transient_part = _has_energy_transient ? 4. / (_dt * _dt) : 0.;
51 _tau_energy[_qp] = _alpha / sqrt(transient_part + (2. * _speed / _hmax) * (2. * _speed / _hmax) +
52 9. * (4. * dissipation_coefficient / (_hmax * _hmax)) *
53 (4. * dissipation_coefficient / (_hmax * _hmax)));
54
55 // Start with the conductive term
57 if (_grad_k)
59
60 // advective
62
65
68
71
74}
registerMooseObject("NavierStokesApp", INSADStabilized3Eqn)
Computes properties needed for stabilized formulations of the mass, momentum, and energy equations.
Definition INSAD3Eqn.h:19
ADMaterialProperty< Real > & _temperature_advective_strong_residual
Definition INSAD3Eqn.h:35
ADMaterialProperty< Real > & _temperature_td_strong_residual
Definition INSAD3Eqn.h:36
ADMaterialProperty< Real > & _temperature_source_strong_residual
Definition INSAD3Eqn.h:38
bool _has_ambient_convection
Definition INSAD3Eqn.h:44
const ADVariableGradient & _grad_temperature
Definition INSAD3Eqn.h:31
bool _has_energy_transient
Whether the energy equation is transient.
Definition INSAD3Eqn.h:52
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
ADMaterialProperty< Real > & _temperature_ambient_convection_strong_residual
Definition INSAD3Eqn.h:37
bool _has_heat_source
Definition INSAD3Eqn.h:47
const ADMaterialProperty< Real > & _cp
Definition INSAD3Eqn.h:33
bool _has_advected_mesh
Whether we have mesh convection.
const ADMaterialProperty< Real > & _rho
density
const ADMaterialProperty< Real > & _k
const ADMaterialProperty< RealVectorValue > *const _grad_k
INSADStabilized3Eqn(const InputParameters &parameters)
ADMaterialProperty< Real > & _tau_energy
const ADVariableSecond & _second_temperature
virtual void computeQpProperties() override
static InputParameters validParams()
ADMaterialProperty< Real > & _temperature_strong_residual
virtual void computeQpProperties() override
ADReal _speed
The speed of the medium.
static InputParameters validParams()
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
Real & _dt