22 "add_interpolation_method_physics");
30 "Define a turbulence model for an incompressible or weakly-compressible Navier Stokes "
31 "flow with a linear finite volume discretization");
33 params.
addParam<std::vector<SolverSystemName>>(
35 {
"TKE_system",
"TKED_system"},
36 "Names of the linear solver systems for each equation. Default is set for K-Epsilon and "
37 "should be adapted for other models");
40 params.
addParam<
bool>(
"mu_t_as_aux_variable",
42 "Whether to use an auxiliary variable instead of a functor material "
43 "property for the turbulent viscosity");
58 "use_nonorthogonal_correction",
60 "Whether to use a non-orthogonal correction. This can potentially slow down convergence "
61 ", but reduces numerical dispersion on non-orthogonal meshes. Can be safely turned off on "
62 "orthogonal meshes.");
64 params.
addParam<InterpolationMethodName>(
65 "tke_advection_interpolation_method_name",
66 "Name of an externally defined FVInterpolationMethod to use for turbulent kinetic energy "
67 "advection. When provided, this overrides 'tke_advection_interpolation'.");
68 params.
addParam<InterpolationMethodName>(
69 "tked_advection_interpolation_method_name",
70 "Name of an externally defined FVInterpolationMethod to use for turbulent kinetic energy "
71 "dissipation advection. When provided, this overrides 'tked_advection_interpolation'.");
73 "tke_advection_interpolation_method_name tked_advection_interpolation_method_name",
74 "K-Epsilon model numerical");
87 "Mixing length is not implemented for the linear finite volume discretization");
96 if (!
isParamValid(
"tke_advection_interpolation_method_name"))
98 if (!
isParamValid(
"tked_advection_interpolation_method_name"))
117 "include_deviatoric_stress",
"This should be set to true when using a turbulence model");
133 std::string variable_type =
"MooseLinearVariableFVReal";
140 paramError(
"turbulence_kinetic_energy_variable",
142 ") supplied to the WCNSLinearFVTurbulencePhysics does not exist!");
149 std::string variable_type =
"MooseLinearVariableFVReal";
156 paramError(
"turbulence_kinetic_energy_dissipation_variable",
158 ") supplied to the WCNSLinearFVTurbulencePhysics does not exist!");
187 const std::string kernel_type =
"LinearFVTurbulentTimeDerivative";
204 const auto tke_method_name =
206 ? getParam<InterpolationMethodName>(
"tke_advection_interpolation_method_name")
207 : InterpolationMethodName(
208 std::string(getParam<MooseEnum>(
"tke_advection_interpolation")));
209 const auto tked_method_name =
210 isParamValid(
"tked_advection_interpolation_method_name")
211 ? getParam<InterpolationMethodName>(
"tked_advection_interpolation_method_name")
212 : InterpolationMethodName(
213 std::string(getParam<MooseEnum>(
"tked_advection_interpolation")));
215 const std::string kernel_type =
"LinearFVTurbulentAdvection";
221 params.
set<InterpolationMethodName>(
"advected_interp_method_name") = tke_method_name;
226 params.
set<InterpolationMethodName>(
"advected_interp_method_name") = tked_method_name;
234 const std::string kernel_type =
"LinearFVTurbulentDiffusion";
237 params.
set<
bool>(
"use_nonorthogonal_correction") =
238 getParam<bool>(
"use_nonorthogonal_correction");
243 params.
set<MooseFunctorName>(
"diffusion_coeff") =
"mu_eff_tke";
248 params.
set<MooseFunctorName>(
"diffusion_coeff") =
"mu_eff_tked";
256 const std::string u_names[3] = {
"u",
"v",
"w"};
258 const std::string kernel_type =
"LinearFVTKESourceSink";
266 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
267 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
276 const std::string kernel_type =
"LinearFVTKEDSourceSink";
286 params.
set<MooseFunctorName>(
"C1_eps") = getParam<MooseFunctorName>(
"C1_eps");
287 params.
set<MooseFunctorName>(
"C2_eps") = getParam<MooseFunctorName>(
"C2_eps");
288 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
289 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
299 const std::string u_names[3] = {
"u",
"v",
"w"};
304 const std::string bc_type =
"LinearFVTurbulentViscosityWallFunctionBC";
311 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
330 const std::string mat_type =
"FunctorEffectiveDynamicViscosity";
333 params.
set<MooseFunctorName>(
"property_name") =
"mu_eff_tke";
336 params.
set<MooseFunctorName>(
NS::mu_t +
"_inverse_factor") =
337 getParam<MooseFunctorName>(
"sigma_k");
340 params.
set<MooseFunctorName>(
"property_name") =
"mu_eff_tked";
341 params.
set<MooseFunctorName>(
NS::mu_t +
"_inverse_factor") =
342 getParam<MooseFunctorName>(
"sigma_eps");
registerWCNSFVTurbulenceBaseTasks("NavierStokesApp", WCNSLinearFVTurbulencePhysics)
registerMooseAction("NavierStokesApp", WCNSLinearFVTurbulencePhysics, "add_interpolation_method_physics")
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
void paramWarning(const std::string ¶m, Args... args) const
void paramError(const std::string ¶m, Args... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
bool _define_variables
Whether to define variables if they do not exist.
void addFVAdvectedInterpolationMethod(const MooseEnum &interpolation_method)
Add the FVInterpolationMethod object for an advected interpolation method if absent.
virtual void checkIntegrity() const
virtual FEProblemBase & getProblem()
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
unsigned int dimension() const
void reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type, const std::string &object_name="") const
std::string prefix() const
void addSharedSolverVariable(const std::string &var_type, const VariableName &var_name, InputParameters params)
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
std::vector< SubdomainName > _blocks
void addRequiredPhysicsTask(const std::string &task)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const std::vector< std::string > _velocity_names
Velocity names.
const MooseFunctorName & dynamicViscosityName() const
Return the name of the dynamic viscosity functor.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const MooseFunctorName & densityName() const
Return the name of the density functor.
Base class for a Physics that creates all the objects needed to add a turbulence model to an incompre...
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
static InputParameters validParams()
const VariableName _tke_name
Name of the turbulent kinetic energy.
MooseEnum _wall_treatment_eps
Turbulence wall treatment for epsilon (same for all walls currently)
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible N...
virtual void checkIntegrity() const override
virtual void initializePhysicsAdditional() override
WCNSLinearFVTurbulencePhysics(const InputParameters ¶meters)
void addKEpsilonAdvection()
virtual void addFVBCs() override
void addKEpsilonTimeDerivatives()
Functions adding kernels for the k-epsilon to the k-epsilon equations.
void addKEpsilonDiffusion()
static InputParameters validParams()
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of ghosting layers needed.
virtual void addSolverVariables() override
virtual void addFunctorMaterials() override
virtual void addFVInterpolationMethods() override
virtual void addFVKernels() override
static const std::string density
static const std::string TKED
static const std::string mu_t
static const std::string mu
static const std::string TKE