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