https://mooseframework.inl.gov
Loading...
Searching...
No Matches
INSFVkEpsilonViscosityFunctorMaterial.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
11#include "MooseMesh.h"
12#include "NS.h"
13
15 INSFVkEpsilonViscosityMaterial,
16 "02/01/2025 00:00",
19
22{
24 params.addClassDescription("Computes the turbulent dynamic viscosity given k and epsilon.");
25 params.addRequiredParam<MooseFunctorName>(NS::density, "The liquid density.");
26 params.addRequiredParam<MooseFunctorName>(NS::TKE, "The turbulence kinetic energy.");
27 params.addRequiredParam<MooseFunctorName>(NS::TKED,
28 "The turbulent kinetic energy dissipation rate.");
29 params.addParam<MooseFunctorName>("C_mu", 0.09, "C_mu closure parameter");
30 return params;
31}
32
34 const InputParameters & parameters)
35 : FunctorMaterial(parameters),
36 _rho(getFunctor<ADReal>(NS::density)),
37 _k(getFunctor<ADReal>(NS::TKE)),
38 _epsilon(getFunctor<ADReal>(NS::TKED)),
39 _C_mu(getFunctor<ADReal>("C_mu")),
40 _preserve_sparsity_pattern(_fe_problem.preserveMatrixSparsityPattern())
41{
42 addFunctorProperty<ADReal>(NS::mu_t,
43 [this](const auto & r, const auto & t) -> ADReal
44 {
45 using std::max;
46
48 return max(NS::mu_t_low_limit + 0 * _k(r, t) * _epsilon(r, t),
49 _C_mu(r, t) * _rho(r, t) * Utility::pow<2>(_k(r, t)) /
51 else
52 return max(NS::mu_t_low_limit,
53 _C_mu(r, t) * _rho(r, t) * Utility::pow<2>(_k(r, t)) /
55 });
56}
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObjectRenamed("NavierStokesApp", INSFVkEpsilonViscosityMaterial, "02/01/2025 00:00", INSFVkEpsilonViscosityFunctorMaterial)
registerMooseObject("NavierStokesApp", INSFVkEpsilonViscosityFunctorMaterial)
static InputParameters validParams()
This is the material class used to compute the viscosity of the kEpsilon model.
const Moose::Functor< ADReal > & _epsilon
The turbulent kinetic energy dissipation rate.
const Moose::Functor< ADReal > & _C_mu
The C_mu.
INSFVkEpsilonViscosityFunctorMaterial(const InputParameters &parameters)
const bool _preserve_sparsity_pattern
Whether to preserve the sparsity pattern between iterations (needed for Newton solvers)
const Moose::Functor< ADReal > & _rho
The density.
const Moose::Functor< ADReal > & _k
The turbulent kinetic energy.
void addRequiredParam(const std::string &name, const std::string &doc_string)
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)
static constexpr Real mu_t_low_limit
Definition NS.h:208
static const std::string density
Definition NS.h:34
static constexpr Real epsilon_low_limit
Definition NS.h:210
static const std::string TKED
Definition NS.h:181
static const std::string mu_t
Definition NS.h:129
static const std::string TKE
Definition NS.h:180