https://mooseframework.inl.gov
Loading...
Searching...
No Matches
WCNSFVTurbulencePhysicsBase.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
17#include "INSFVTKESourceSink.h"
19#include "NSFVUtils.h"
20#include "NSFVBase.h"
21
24{
28 "Define a turbulence model for a incompressible or weakly-compressible Navier Stokes "
29 "flow with a finite volume discretization");
30
31 MooseEnum turbulence_type("mixing-length k-epsilon none", "none");
32 params.addParam<MooseEnum>(
33 "turbulence_handling",
34 turbulence_type,
35 "The way turbulent diffusivities are determined in the turbulent regime.");
37
38 params.deprecateParam("mixing_length_walls", "turbulence_walls", "");
39
40 // Not implemented, re-enable with k-epsilon
41 params.suppressParameter<MooseEnum>("preconditioning");
42
43 // K-Epsilon parameters
44 params.addParam<MooseFunctorName>(
45 "tke_name", NS::TKE, "Name of the turbulent kinetic energy variable");
46 params.addParam<MooseFunctorName>(
47 "tked_name", NS::TKED, "Name of the turbulent kinetic energy dissipation variable");
48 params.addParam<FunctionName>(
49 "initial_tke", "0", "Initial value for the turbulence kinetic energy");
50 params.addParam<FunctionName>(
51 "initial_tked", "0", "Initial value for the turbulence kinetic energy dissipation");
52 params.addParam<FunctionName>("initial_mu_t", "Initial value for the turbulence viscosity");
53
54 params.addParam<MooseFunctorName>(
55 "C1_eps", "C1 coefficient for the turbulent kinetic energy dissipation equation");
56 params.addParam<MooseFunctorName>(
57 "C2_eps", "C2 coefficient for the turbulent kinetic energy dissipation equation");
58 params.addParam<MooseFunctorName>(
59 "sigma_k", "Scaling coefficient for the turbulent kinetic energy diffusion term");
60 params.addParam<MooseFunctorName>(
61 "sigma_eps",
62 "Scaling coefficient for the turbulent kinetic energy dissipation diffusion term");
63 params.addParam<MooseFunctorName>(
64 NS::turbulent_Prandtl, NS::turbulent_Prandtl, "Turbulent Prandtl number");
65 params.transferParam<Real>(INSFVTKESourceSink::validParams(), "C_pl");
66 params.transferParam<Real>(kEpsilonViscosityAux::validParams(), "mu_t_ratio_max");
67
68 // Boundary parameters
69 params.addParam<bool>("bulk_wall_treatment", true, "Whether to treat the wall cell as bulk");
70 MooseEnum wall_treatment("eq_newton eq_incremental eq_linearized neq", "neq");
71 params.addParam<MooseEnum>("wall_treatment_eps",
72 wall_treatment,
73 "The method used for computing the epsilon wall functions and the "
74 "turbulence viscosity wall functions");
75 params.addParam<MooseEnum>("wall_treatment_T",
76 wall_treatment,
77 "The method used for computing the temperature wall functions");
79
80 // K-Epsilon numerical scheme parameters
81 MooseEnum face_interpol_types("average skewness-corrected", "average");
83 params.addParam<MooseEnum>("tke_face_interpolation",
84 face_interpol_types,
85 "The numerical scheme to interpolate the TKE to the "
86 "face (separate from the advected quantity interpolation).");
87 params.addParam<MooseEnum>("tke_advection_interpolation",
88 adv_interpol_types,
89 "The numerical scheme to interpolate the TKE to the "
90 "face when in the advection kernel.");
91 params.addParam<bool>(
92 "tke_two_term_bc_expansion",
93 false,
94 "If a two-term Taylor expansion is needed for the determination of the boundary values"
95 "of the turbulent kinetic energy.");
96
97 params.addParam<MooseEnum>("tked_face_interpolation",
98 face_interpol_types,
99 "The numerical scheme to interpolate the TKED to the "
100 "face (separate from the advected quantity interpolation).");
101 params.addParam<MooseEnum>("tked_advection_interpolation",
102 adv_interpol_types,
103 "The numerical scheme to interpolate the TKED to the "
104 "face when in the advection kernel.");
105 params.addParam<bool>(
106 "tked_two_term_bc_expansion",
107 false,
108 "If a two-term Taylor expansion is needed for the determination of the boundary values"
109 "of the turbulent kinetic energy dissipation.");
110 params.addParam<bool>(
111 "turbulent_viscosity_two_term_bc_expansion",
112 true,
113 "If a two-term Taylor expansion is needed for the determination of the boundary values"
114 "of the turbulent viscosity.");
115 params.addParam<bool>("mu_t_as_aux_variable",
116 false,
117 "Whether to use an auxiliary variable instead of a functor material "
118 "property for the turbulent viscosity");
119 params.addParam<bool>("output_mu_t", true, "Whether to add mu_t to the field outputs");
120 params.addParam<bool>(
121 "k_t_as_aux_variable",
122 false,
123 "Whether to use an auxiliary variable for the effective turbulent conductivity");
124 params.renameParam("k_t_as_aux_variable", "k_eff_t_as_aux_variable", "");
125
126 // Add the coupled physics
127 // TODO Remove the defaults once NavierStokesFV action is removed
128 // It is a little risky right now because the user could forget to pass the parameter and
129 // be missing the influence of turbulence on either of these physics. There is a check in the
130 // constructor to present this from happening
131 params.addParam<PhysicsName>(
132 "fluid_heat_transfer_physics",
133 "NavierStokesFV",
134 "WCNS(Linear)FVFluidHeatTransferPhysics generating the heat advection equations");
135 params.addParam<PhysicsName>(
136 "scalar_transport_physics",
137 "NavierStokesFV",
138 "WCNS(Linear)FVScalarTransportPhysics generating the scalar advection equations");
139
140 // Parameter groups
141 params.addParamNamesToGroup("fluid_heat_transfer_physics turbulent_prandtl "
142 "scalar_transport_physics Sc_t",
143 "Coupled Physics");
144 params.addParamNamesToGroup("initial_tke initial_tked C1_eps C2_eps sigma_k sigma_eps",
145 "K-Epsilon model");
146 params.addParamNamesToGroup("C_mu bulk_wall_treatment wall_treatment_eps wall_treatment_T",
147 "K-Epsilon wall function");
148 params.addParamNamesToGroup("tke_face_interpolation tke_two_term_bc_expansion "
149 "tked_face_interpolation tked_two_term_bc_expansion "
150 "turbulent_viscosity_two_term_bc_expansion "
151 "mu_t_as_aux_variable k_eff_t_as_aux_variable",
152 "K-Epsilon model numerical");
153
154 return params;
155}
156
158 : NavierStokesPhysicsBase(parameters),
160 _turbulence_model(getParam<MooseEnum>("turbulence_handling")),
161 _turbulence_walls(getParam<std::vector<BoundaryName>>("turbulence_walls")),
162 _wall_treatment_eps(getParam<MooseEnum>("wall_treatment_eps")),
163 _wall_treatment_temp(getParam<MooseEnum>("wall_treatment_T")),
164 _tke_name(getParam<MooseFunctorName>("tke_name")),
165 _tked_name(getParam<MooseFunctorName>("tked_name"))
166{
167 if (_verbose && _turbulence_model != "none")
168 _console << "Creating a " << std::string(_turbulence_model) << " turbulence model."
169 << std::endl;
170
171 // Keep track of the variable names, for loading variables from files notably
172 if (_turbulence_model == "k-epsilon")
173 {
176 if (getParam<bool>("mu_t_as_aux_variable"))
178 if (getParam<bool>("k_eff_t_as_aux_variable"))
180 }
181
182 // Parameter checks
183 if (_turbulence_model == "none")
184 errorInconsistentDependentParameter("turbulence_handling", "none", {"turbulence_walls"});
185 if (_turbulence_model != "k-epsilon")
186 {
187 errorDependentParameter("turbulence_handling",
188 "k-epsilon",
189 {"C_mu",
190 "C1_eps",
191 "C2_eps",
192 "bulk_wall_treatment",
193 "tke_scaling",
194 "tke_face_interpolation",
195 "tke_two_term_bc_expansion",
196 "tked_scaling",
197 "tked_face_interpolation",
198 "tked_two_term_bc_expansion",
199 "turbulent_viscosity_two_term_bc_expansion"});
200 checkSecondParamSetOnlyIfFirstOneTrue("mu_t_as_aux_variable", "initial_mu_t");
201 }
202}
203
204void
206{
207 // Other Physics may not exist or be initialized at construction time, so
208 // we retrieve them now, on this task which occurs after 'init_physics'
209 if (_current_task == "get_turbulence_physics")
211}
212
213void
215{
216 // _flow_equations_physics is initialized by 'WCNSFVCoupledAdvectionPhysicsHelper'
218 _has_flow_equations = true;
219 else
220 _has_flow_equations = false;
221
222 // Sanity check for interaction for fluid heat transfer physics
223 if (isParamValid("fluid_heat_transfer_physics") && _turbulence_model != "none")
224 {
225 _fluid_energy_physics = getCoupledPhysics<WCNSFVFluidHeatTransferPhysicsBase>(
226 getParam<PhysicsName>("fluid_heat_transfer_physics"), true);
227 // Check for a missing parameter / do not support isolated physics for now
229 !getCoupledPhysics<const WCNSFVFluidHeatTransferPhysicsBase>(true).empty())
230 paramError("fluid_heat_transfer_physics",
231 "We currently do not support creating both turbulence physics and fluid heat "
232 "transfer physics that are not coupled together. Use "
233 "'fluid_heat_transfer_physics' to explicitly specify the coupling");
236 else
237 _has_energy_equation = false;
238 }
239 else
240 {
241 _has_energy_equation = false;
242 _fluid_energy_physics = nullptr;
243 }
244
245 // Sanity check for interaction with scalar transport physics
246 if (isParamValid("scalar_transport_physics") && _turbulence_model != "none")
247 {
248 _scalar_transport_physics = getCoupledPhysics<WCNSFVScalarTransportPhysicsBase>(
249 getParam<PhysicsName>("scalar_transport_physics"), true);
251 !getCoupledPhysics<const WCNSFVScalarTransportPhysicsBase>(true).empty())
253 "scalar_transport_physics",
254 "We currently do not support creating both turbulence physics and scalar transport "
255 "physics that are not coupled together");
258 else
259 _has_scalar_equations = false;
260 }
261 else
262 {
263 _has_scalar_equations = false;
265 }
266
267 // To help remediate the danger of the parameter setup
268 if (_verbose)
269 {
271 mooseInfoRepeated("Coupling turbulence physics with fluid heat transfer physics " +
273 else
274 mooseInfoRepeated("No fluid heat transfer equation considered by this turbulence "
275 "physics.");
277 mooseInfoRepeated("Coupling turbulence physics with scalar transport physics " +
279 else
280 mooseInfoRepeated("No scalar transport equations considered by this turbulence physics.");
281 }
282}
283
284void
286{
287 if (_turbulence_model == "mixing-length" || _turbulence_model == "none")
288 return;
289 const std::string ic_type = "FVFunctionIC";
290 InputParameters params = getFactory().getValidParams(ic_type);
291
292 // Parameter checking: error if initial conditions are provided but not going to be used
293 if ((getParam<bool>("initialize_variables_from_mesh_file") || !_define_variables) &&
294 ((getParam<bool>("mu_t_as_aux_variable") && isParamValid("initial_mu_t")) ||
295 isParamSetByUser("initial_tke") || isParamSetByUser("initial_tked")))
296 mooseError("inital_mu_t/tke/tked should not be provided if we are restarting from a mesh file "
297 "or not defining variables in the Physics");
298
299 // do not set initial conditions if we are not defining variables
301 return;
302 // on regular restarts (from checkpoint), we obey the user specification of initial conditions
303
304 if (getParam<bool>("mu_t_as_aux_variable"))
305 {
306 const auto rho_name = _flow_equations_physics->densityName();
307 // If the user provided an initial value, we use that
308 if (isParamValid("initial_mu_t"))
309 params.set<FunctionName>("function") = getParam<FunctionName>("initial_mu_t");
310 // If we can compute the initialization value from the user parameters, we do that
311 else if (MooseUtils::isFloat(rho_name) &&
312 MooseUtils::isFloat(getParam<FunctionName>("initial_tke")) &&
313 MooseUtils::isFloat(getParam<FunctionName>("initial_tked")))
314 params.set<FunctionName>("function") =
315 std::to_string(std::atof(rho_name.c_str()) * getParam<Real>("C_mu") *
316 std::pow(std::atof(getParam<FunctionName>("initial_tke").c_str()), 2) /
317 std::atof(getParam<FunctionName>("initial_tked").c_str()));
318 else
319 paramError("initial_mu_t",
320 "Initial turbulent viscosity should be provided. A sensible value is "
321 "rho * C_mu TKE_initial^2 / TKED_initial");
322
323 params.set<VariableName>("variable") = _turbulent_viscosity_name;
324 // Always obey the user specification of an initial condition
326 _blocks,
327 /*whether IC is a default*/ !isParamSetByUser("initial_mu_t"),
328 /*error if already an IC*/ isParamSetByUser("initial_mu_t")))
329 getProblem().addFVInitialCondition(ic_type, prefix() + "initial_mu_turb", params);
330 }
331 else if (isParamSetByUser("initial_mu_t"))
332 paramError("initial_mu_t",
333 "This parameter can only be specified if 'mu_t_as_aux_variable=true'");
334
335 params.set<VariableName>("variable") = _tke_name;
336 params.set<FunctionName>("function") = getParam<FunctionName>("initial_tke");
338 _blocks,
339 /*whether IC is a default*/ !isParamSetByUser("initial_tke"),
340 /*error if already an IC*/ isParamSetByUser("initial_tke")))
341 getProblem().addFVInitialCondition(ic_type, prefix() + "initial_tke", params);
342 params.set<VariableName>("variable") = _tked_name;
343 params.set<FunctionName>("function") = getParam<FunctionName>("initial_tked");
345 _blocks,
346 /*whether IC is a default*/ !isParamSetByUser("initial_tked"),
347 /*error if already an IC*/ isParamSetByUser("initial_tked")))
348 getProblem().addFVInitialCondition(ic_type, prefix() + "initial_tked", params);
349}
350
351void
353{
354 // Not future-proof
355 const bool is_linear = dynamic_cast<WCNSLinearFVTurbulencePhysics *>(this);
356 const auto var_type = is_linear ? "MooseLinearVariableFVReal" : "MooseVariableFVReal";
357
358 if (_turbulence_model == "k-epsilon" && getParam<bool>("mu_t_as_aux_variable"))
359 {
360 auto params = getFactory().getValidParams(var_type);
361 if (!is_linear && isParamValid("turbulent_viscosity_two_term_bc_expansion"))
362 params.set<bool>("two_term_boundary_expansion") =
363 getParam<bool>("turbulent_viscosity_two_term_bc_expansion");
364 if (!shouldCreateVariable(_turbulent_viscosity_name, _blocks, /*error if aux*/ false))
365 reportPotentiallyMissedParameters({"turbulent_viscosity_two_term_bc_expansion"}, var_type);
366 else
368 }
369 if (_turbulence_model == "k-epsilon" && getParam<bool>("k_eff_t_as_aux_variable"))
370 {
371 auto params = getFactory().getValidParams(var_type);
372 if (shouldCreateVariable(NS::k_eff_t, _blocks, /*error if aux*/ false))
373 addSharedAuxVariable(var_type, NS::k_eff_t, params);
374 }
375}
376
377void
379{
380 const std::string u_names[3] = {"u", "v", "w"};
381 // Not future-proof
382 const bool is_linear = dynamic_cast<WCNSLinearFVTurbulencePhysics *>(this);
383
384 if (_turbulence_model == "k-epsilon" && getParam<bool>("mu_t_as_aux_variable"))
385 {
386 auto params = getFactory().getValidParams("kEpsilonViscosityAux");
387 assignBlocks(params, _blocks);
388
389 params.set<AuxVariableName>("variable") = _turbulent_viscosity_name;
390 params.set<MooseFunctorName>(NS::density) = _flow_equations_physics->densityName();
391 params.set<MooseFunctorName>(NS::mu) = _flow_equations_physics->dynamicViscosityName();
392 params.set<MooseFunctorName>(NS::TKE) = _tke_name;
393 params.set<MooseFunctorName>(NS::TKED) = _tked_name;
394 params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
395 params.set<MooseEnum>("wall_treatment") = _wall_treatment_eps;
396 for (const auto d : make_range(dimension()))
397 params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
398
399 params.set<bool>("newton_solve") = !is_linear;
400 params.applySpecificParameters(parameters(), {"C_mu", "bulk_wall_treatment", "mu_t_ratio_max"});
401 params.set<ExecFlagEnum>("execute_on") = {EXEC_NONLINEAR};
402
403 getProblem().addAuxKernel("kEpsilonViscosityAux", name() + "_viscosity_aux", params);
404 }
405 if (_turbulence_model == "k-epsilon" && _has_energy_equation &&
406 getParam<bool>("k_eff_t_as_aux_variable"))
407 {
408 auto params = getFactory().getValidParams("EffectiveTurbulentThermalConductivityAux");
409 assignBlocks(params, _blocks);
410 params.set<AuxVariableName>("variable") = NS::k_eff_t;
411 params.set<MooseFunctorName>(NS::cp) = _fluid_energy_physics->getSpecificHeatName();
412 params.set<MooseFunctorName>(NS::mu_t) = _turbulent_viscosity_name;
413 params.set<ExecFlagEnum>("execute_on") = {EXEC_NONLINEAR};
414
415 const auto & k_names = _fluid_energy_physics->getThermalConductivityName();
416 if (k_names.size() != 1)
417 paramError("thermal_conductivity_name",
418 "Thermal conductivity vector is not currently supported for obtaining "
419 "the effective thermal conductivity");
420
421 params.set<MooseFunctorName>(NS::k) = k_names[0];
422
423 params.applySpecificParameters(parameters(), {"Pr_t"});
425 "EffectiveTurbulentThermalConductivityAux", name() + "_thermal_conductivity_aux", params);
426 }
427}
428
429void
431{
432 // Not future-proof
433 const bool is_linear = dynamic_cast<WCNSLinearFVTurbulencePhysics *>(this);
434 if (_turbulence_model == "k-epsilon")
435 {
436 if (!getProblem().hasFunctor(NS::mu_eff, /*thread_id=*/0))
437 {
438 const auto mat_type =
439 is_linear ? "FunctorEffectiveDynamicViscosity" : "ADFunctorEffectiveDynamicViscosity";
440 InputParameters params = getFactory().getValidParams(mat_type);
441 assignBlocks(params, _blocks);
442 params.set<MooseFunctorName>("property_name") = NS::mu_eff;
443 params.set<MooseFunctorName>(NS::mu) = _flow_equations_physics->dynamicViscosityName();
444 params.set<MooseFunctorName>(NS::mu_t) = _turbulent_viscosity_name;
445 params.set<MooseFunctorName>(NS::mu_t + "_inverse_factor") = "1";
446 getProblem().addMaterial(mat_type, prefix() + "effective_viscosity", params);
447 }
448 if (!getParam<bool>("mu_t_as_aux_variable"))
449 {
450 InputParameters params = getFactory().getValidParams("INSFVkEpsilonViscosityFunctorMaterial");
451 params.set<MooseFunctorName>(NS::TKE) = _tke_name;
452 params.set<MooseFunctorName>(NS::TKED) = _tked_name;
453 params.set<MooseFunctorName>(NS::density) = _density_name;
454 params.set<ExecFlagEnum>("execute_on") = {EXEC_NONLINEAR};
455 if (getParam<bool>("output_mu_t"))
456 params.set<std::vector<OutputName>>("outputs") = {"all"};
458 "INSFVkEpsilonViscosityFunctorMaterial", prefix() + "compute_mu_t", params);
459 }
460
461 if (_has_energy_equation && !getProblem().hasFunctor(NS::k_eff_t, /*thread_id=*/0))
462 {
463 mooseAssert(!getParam<bool>("k_eff_t_as_aux_variable"), "k_eff_t should not exist");
464 const auto object_type = is_linear ? "ParsedFunctorMaterial" : "ADParsedFunctorMaterial";
465 InputParameters params = getFactory().getValidParams(object_type);
466 assignBlocks(params, _blocks);
467 const auto mu_t_name = NS::mu_t;
468 const auto & cp_name = _fluid_energy_physics->getSpecificHeatName();
469
470 const auto & k_names = _fluid_energy_physics->getThermalConductivityName();
471 if (k_names.size() != 1)
472 _fluid_energy_physics->paramError("thermal_conductivity_name",
473 "Specifying multiple block-restricted thermal "
474 "conductivities is not currently supported for obtaining "
475 "the effective thermal conductivity");
476 const auto & k_name = k_names[0];
477
478 const auto & Pr_t_name = getParam<MooseFunctorName>("Pr_t");
479
480 // Avoid defining floats as functors in the parsed expression
481 if (!MooseUtils::isFloat(cp_name) && !MooseUtils::isFloat(Pr_t_name))
482 params.set<std::vector<std::string>>("functor_names") = {cp_name, Pr_t_name, mu_t_name};
483 else if (MooseUtils::isFloat(cp_name) && !MooseUtils::isFloat(Pr_t_name))
484 params.set<std::vector<std::string>>("functor_names") = {Pr_t_name, mu_t_name};
485 else if (!MooseUtils::isFloat(cp_name) && MooseUtils::isFloat(Pr_t_name))
486 params.set<std::vector<std::string>>("functor_names") = {cp_name, mu_t_name};
487 else
488 params.set<std::vector<std::string>>("functor_names") = {mu_t_name};
489
490 params.set<std::string>("expression") =
491 k_name + "+" + mu_t_name + "*" + cp_name + "/" + Pr_t_name;
492 params.set<std::string>("property_name") = NS::k_eff_t;
493 params.set<ExecFlagEnum>("execute_on") = {EXEC_NONLINEAR};
494 params.set<std::vector<OutputName>>("outputs") = {"all"};
495 getProblem().addMaterial(object_type, prefix() + "turbulent_heat_eff_conductivity", params);
496 }
497
499 {
500 const auto scalar_diffs = _scalar_transport_physics->getParam<std::vector<MooseFunctorName>>(
501 "passive_scalar_diffusivity");
502 const auto mat_type =
503 is_linear ? "FunctorEffectiveDynamicViscosity" : "ADFunctorEffectiveDynamicViscosity";
504 InputParameters params = getFactory().getValidParams(mat_type);
505 params.set<MooseFunctorName>(NS::mu) = _flow_equations_physics->dynamicViscosityName();
506 params.set<MooseFunctorName>(NS::mu_t) = _turbulent_viscosity_name;
507 const auto & rho_name = _flow_equations_physics->densityName();
508 params.set<MooseFunctorName>(NS::mu_t + "_inverse_factor") = rho_name;
509 const auto turbulent_schmidt_number = getParam<std::vector<Real>>("Sc_t");
510 assignBlocks(params, _blocks);
511 // LinearFV can only use 1 diffusion kernel per equation, so we create N_scalars mu_effs
512 if (is_linear)
513 for (const auto i : index_range(scalar_diffs))
514 {
515 if (!getProblem().hasFunctor(scalar_diffs[i] + "_eff", /*thread_id=*/0))
516 {
517 params.set<MooseFunctorName>("property_name") = scalar_diffs[i] + "_plus_mut/Sc_t";
518 params.set<bool>("add_dynamic_viscosity") = true;
519 params.set<Real>(NS::mu_t + "_extra_inverse_factor") =
520 (turbulent_schmidt_number.size() == 1 ? turbulent_schmidt_number[0]
521 : turbulent_schmidt_number[i]);
523 mat_type, prefix() + "mu_eff_passive_scalar_" + std::to_string(i), params);
524 }
525 }
526 // WCNSFV can add multiple diffusion kernels
527 else
528 {
529 params.set<MooseFunctorName>("property_name") = "mu_t_passive_scalar";
530 params.set<bool>("add_dynamic_viscosity") = false;
531 if (turbulent_schmidt_number.size() != 1)
532 paramError("passive_scalar_schmidt_number",
533 "A single passive scalar turbulent Schmidt number can and must be specified "
534 "with k-epsilon and the WCNSFV discretization.");
535 params.set<Real>(NS::mu_t + "_extra_inverse_factor") = turbulent_schmidt_number[0];
536 getProblem().addMaterial(mat_type, prefix() + "mu_t_passive_scalars", params);
537 }
538 }
539 }
540}
void mooseInfoRepeated(Args &&... args)
const ExecFlagType EXEC_NONLINEAR
const std::string & _current_task
const ConsoleStream _console
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
static InputParameters validParams()
void errorDependentParameter(const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
void errorInconsistentDependentParameter(const std::string &param1, const std::string &value_set, const std::vector< std::string > &dependent_params) const
void checkSecondParamSetOnlyIfFirstOneTrue(const std::string &param1, const std::string &param2) const
void suppressParameter(const std::string &name)
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
void renameParam(const std::string &old_name, const std::string &new_name, const std::string &new_docstring)
void transferParam(const InputParameters &source_param, const std::string &name, const std::string &new_name="", const std::string &new_description="")
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)
void deprecateParam(const std::string &old_name, const std::string &new_name, const std::string &removal_date)
T & set(const std::string &name, bool quiet_mode=false)
const InputParameters & parameters() const
const std::string & name() const
void paramError(const std::string &param, Args... args) const
bool isParamSetByUser(const std::string &name) const
void mooseError(Args &&... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
static InputParameters commonTurbulenceParams()
Definition NSFVBase.C:338
Base class to hold common parameters and utilities between all the weakly compressible Navier Stokes-...
static InputParameters validParams()
bool _define_variables
Whether to define variables if they do not exist.
void addSharedAuxVariable(const std::string &var_type, const VariableName &var_name, const InputParameters &params)
virtual FEProblemBase & getProblem()
Factory & getFactory()
bool shouldCreateIC(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
unsigned int dimension() const
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") const
void saveSolverVariableName(const VariableName &var_name)
std::string prefix() const
void saveAuxVariableName(const VariableName &var_name)
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
std::vector< SubdomainName > _blocks
const bool _verbose
bool hasFunctor(const std::string &name, const THREAD_ID tid) const
Helper class to interact with a flow and turbulence physics for a Physics that solves an advection pr...
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const std::vector< std::string > _velocity_names
Velocity names.
const MooseFunctorName _density_name
Name of the density material property.
bool hasFlowEquations() const
Whether the physics is actually creating the flow equations.
const MooseFunctorName & dynamicViscosityName() const
Return the name of the dynamic viscosity functor.
const MooseFunctorName & densityName() const
Return the name of the density functor.
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
const std::vector< MooseFunctorName > & getThermalConductivityName() const
bool hasEnergyEquation() const
Whether the physics is actually creating the heat equation.
bool hasScalarEquations() const
Whether the physics is actually creating the scalar advection equations.
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
const VariableName _tke_name
Name of the turbulent kinetic energy.
virtual void addInitialConditions() override
virtual void actOnAdditionalTasks() override
void retrieveCoupledPhysics()
Retrieve the other WCNSFVPhysics at play in the simulation to be able to add the relevant terms (turb...
virtual void addAuxiliaryVariables() override
const WCNSFVScalarTransportPhysicsBase * _scalar_transport_physics
The scalar advection physics to add turbulent mixing for.
const WCNSFVFluidHeatTransferPhysicsBase * _fluid_energy_physics
The heat advection physics to add turbulent mixing for.
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.
WCNSFVTurbulencePhysicsBase(const InputParameters &parameters)
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
virtual void addAuxiliaryKernels() override
Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible N...
static InputParameters validParams()
static const std::string density
Definition NS.h:34
static const std::string TKED
Definition NS.h:182
static const std::string cp
Definition NS.h:125
static const std::string turbulent_Prandtl
Definition NS.h:143
static const std::string mu_t
Definition NS.h:129
static const std::string k_eff_t
Definition NS.h:137
static const std::string mu
Definition NS.h:127
static const std::string TKE
Definition NS.h:181
static const std::string k
Definition NS.h:134
static const std::string mu_eff
Definition NS.h:133
MooseEnum fvAdvectedInterpolationMethods()
Enum of the advected interpolation methods supported by FVInterpolationMethod objects.
Definition NSFVUtils.C:61