27 "Define a turbulence model for a incompressible or weakly-compressible Navier Stokes "
28 "flow with a finite volume discretization");
32 "mixing_length_name",
"mixing_length",
"Name of the mixing length auxiliary variable");
40 "The scaling factor for the turbulent kinetic energy equation.");
45 "The scaling factor for the turbulent kinetic energy dissipation equation.");
48 params.
addParam<
bool>(
"linearize_sink_sources",
false,
"Whether to linearize the source term");
51 "neglect_advection_derivatives",
53 "Whether to remove the off-diagonal velocity term in the TKE and TKED advection term");
54 MooseEnum coeff_interp_method(
"average harmonic",
"harmonic");
57 "Face interpolation method for the turbulent viscosity");
60 "turbulent_viscosity_interp_method linearize_sink_sources",
61 "K-Epsilon model numerical");
68 _mixing_length_name(getParam<AuxVariableName>(
"mixing_length_name"))
78 {
"mixing_length_delta",
79 "mixing_length_aux_execute_on",
82 "mixing_length_two_term_bc_expansion"});
103 {
"system_names",
"tke_scaling",
"tke_face_interpolation",
"tke_two_term_bc_expansion"},
104 "INSFVEnergyVariable");
108 params.
set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"tke_scaling")};
109 params.set<
MooseEnum>(
"face_interp_method") = getParam<MooseEnum>(
"tke_face_interpolation");
110 params.set<
bool>(
"two_term_boundary_expansion") = getParam<bool>(
"tke_two_term_bc_expansion");
115 paramError(
"turbulence_kinetic_energy_variable",
117 ") supplied to the WCNSFVTurbulencePhysics does not exist!");
122 {
"system_names",
"tked_scaling",
"tked_face_interpolation",
"tked_two_term_bc_expansion"},
123 "INSFVEnergyVariable");
127 params.
set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"tked_scaling")};
128 params.set<
MooseEnum>(
"face_interp_method") = getParam<MooseEnum>(
"tked_face_interpolation");
129 params.set<
bool>(
"two_term_boundary_expansion") =
130 getParam<bool>(
"tked_two_term_bc_expansion");
134 paramError(
"turbulence_kinetic_energy_dissipation_variable",
136 ") supplied to the WCNSFVTurbulencePhysics does not exist!");
146 if (
isParamValid(
"mixing_length_two_term_bc_expansion"))
147 params.
set<
bool>(
"two_term_boundary_expansion") =
148 getParam<bool>(
"mixing_length_two_term_bc_expansion");
151 "MooseVariableFVReal");
188 const std::string u_names[3] = {
"u",
"v",
"w"};
189 const std::string kernel_type =
"INSFVMixingLengthReynoldsStress";
195 std::string kernel_name =
prefix() +
"ins_momentum_mixing_length_reynolds_stress_";
197 kernel_name =
prefix() +
"pins_momentum_mixing_length_reynolds_stress_";
200 for (
const auto dim_i : make_range(
dimension()))
219 "Regular fluid viscosity 'mu' should be used for the momentum diffusion term. You are "
220 "currently using: " +
223 const std::string u_names[3] = {
"u",
"v",
"w"};
224 const std::string kernel_type =
"INSFVMomentumDiffusion";
229 getParam<MooseEnum>(
"turbulent_viscosity_interp_method");
232 params.
set<
bool>(
"complete_expansion") =
true;
234 params.
set<
bool>(
"include_isotropic_viscous_stress") =
true;
236 std::string kernel_name =
prefix() +
"ins_momentum_k_epsilon_reynolds_stress_";
238 kernel_name =
prefix() +
"pins_momentum_k_epsilon_reynolds_stress_";
241 for (
const auto dim_i : make_range(
dimension()))
270 if (rz_blocks.empty())
273 const auto radial_index =
281 params.
set<
bool>(
"complete_expansion") =
283 params.
set<NonlinearVariableName>(
"variable") =
287 prefix() +
"ins_momentum_turbulent_viscous_source_rz_" +
297 const std::string u_names[3] = {
"u",
"v",
"w"};
298 const std::string kernel_type =
"WCNSFVMixingLengthEnergyDiffusion";
304 params.
set<Real>(
"schmidt_number") = getParam<Real>(
"turbulent_prandtl");
305 params.
set<NonlinearVariableName>(
"variable") =
308 for (
const auto dim_i : make_range(
dimension()))
313 kernel_type,
prefix() +
"pins_energy_mixing_length_diffusion", params);
316 kernel_type,
prefix() +
"ins_energy_mixing_length_diffusion", params);
320 const std::string kernel_type =
"FVDiffusion";
324 params.
set<NonlinearVariableName>(
"variable") = T_fluid_name;
334 const auto & passive_scalar_schmidt_number = getParam<std::vector<Real>>(
"Sc_t");
335 if (passive_scalar_schmidt_number.size() != passive_scalar_names.size() &&
336 passive_scalar_schmidt_number.size() != 1)
339 "The number of turbulent Schmidt numbers defined is not equal to the number of passive "
344 const std::string u_names[3] = {
"u",
"v",
"w"};
345 const std::string kernel_type =
"INSFVMixingLengthScalarDiffusion";
349 for (
const auto dim_i : make_range(
dimension()))
352 for (
const auto & name_i : index_range(passive_scalar_names))
354 params.
set<NonlinearVariableName>(
"variable") = passive_scalar_names[name_i];
355 if (passive_scalar_schmidt_number.size() > 1)
356 params.
set<Real>(
"schmidt_number") = passive_scalar_schmidt_number[name_i];
357 else if (passive_scalar_schmidt_number.size() == 1)
358 params.
set<Real>(
"schmidt_number") = passive_scalar_schmidt_number[0];
360 params.
set<Real>(
"schmidt_number") = 1.0;
363 kernel_type,
prefix() + passive_scalar_names[name_i] +
"_mixing_length", params);
368 const std::string kernel_type =
"FVDiffusion";
372 for (
const auto & name_i : index_range(passive_scalar_names))
374 params.
set<NonlinearVariableName>(
"variable") = passive_scalar_names[name_i];
377 kernel_type,
prefix() + passive_scalar_names[name_i] +
"_turbulent_diffusion", params);
385 const std::string kernel_type =
"FVFunctorTimeKernel";
389 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
400 const std::string kernel_type =
"INSFVTurbulentAdvection";
408 params.
set<
bool>(
"neglect_advection_derivatives") =
409 getParam<bool>(
"neglect_advection_derivatives");
412 getParam<MooseEnum>(
"tke_advection_interpolation");
413 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
418 getParam<MooseEnum>(
"tked_advection_interpolation");
426 const std::string kernel_type =
"INSFVTurbulentDiffusion";
430 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
440 const std::string kernel_type =
"INSFVTurbulentDiffusion";
444 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
446 params.
set<MooseFunctorName>(
"scaling_coef") = getParam<MooseFunctorName>(
"sigma_k");
448 getParam<MooseEnum>(
"turbulent_viscosity_interp_method");
453 params.
set<MooseFunctorName>(
"scaling_coef") = getParam<MooseFunctorName>(
"sigma_eps");
461 const std::string u_names[3] = {
"u",
"v",
"w"};
463 const std::string kernel_type =
"INSFVTKESourceSink";
466 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
471 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
472 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
473 params.
set<
bool>(
"linearized_model") = getParam<bool>(
"linearize_sink_sources");
477 params.
set<
bool>(
"newton_solve") =
true;
484 const std::string kernel_type =
"INSFVTKEDSourceSink";
492 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
493 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
494 params.
set<
bool>(
"linearized_model") = getParam<bool>(
"linearize_sink_sources");
497 params.
set<MooseFunctorName>(
"C1_eps") = getParam<MooseFunctorName>(
"C1_eps");
498 params.
set<MooseFunctorName>(
"C2_eps") = getParam<MooseFunctorName>(
"C2_eps");
500 params.
set<
bool>(
"newton_solve") =
true;
515 const std::string ml_kernel_type =
"WallDistanceMixingLengthAux";
522 getParam<ExecFlagEnum>(
"mixing_length_aux_execute_on");
525 ml_params.
set<MooseFunctorName>(
"von_karman_const") =
526 getParam<MooseFunctorName>(
"von_karman_const");
527 ml_params.
set<MooseFunctorName>(
"von_karman_const_0") =
528 getParam<MooseFunctorName>(
"von_karman_const_0");
529 ml_params.
set<MooseFunctorName>(
"delta") = getParam<MooseFunctorName>(
"mixing_length_delta");
538 const std::string u_names[3] = {
"u",
"v",
"w"};
543 const std::string bc_type =
"INSFVTurbulentViscosityWallFunction";
551 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
568 const std::string u_names[3] = {
"u",
"v",
"w"};
581 prefix() +
"mixing_length_material",
593 ghost_layers = std::max(ghost_layers, (
unsigned short)3);
const ExecFlagType EXEC_TIMESTEP_END
const ExecFlagType EXEC_INITIAL
registerWCNSFVTurbulenceBaseTasks("NavierStokesApp", WCNSFVTurbulencePhysics)
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
virtual MooseMesh & mesh() override
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
const InputParameters & parameters() const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
unsigned int getAxisymmetricRadialCoord() const
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 ¶ms)
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)
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 WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
const std::vector< std::string > _velocity_names
Velocity names.
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const MooseEnum _velocity_interpolation
The velocity / momentum face interpolation method for advecting other quantities.
const MooseFunctorName _density_name
Name of the density material property.
bool hasFlowEquations() const
Whether the physics is actually creating the flow equations.
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
bool includeIsotropicStress() const
Whether to include the isotropic viscous stress contribution.
std::vector< SubdomainName > getAxisymmetricRZBlocks() const
Return the set of blocks restricted to an RZ coordinate system.
const NonlinearVariableName & getFluidTemperatureName() const
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.
const MooseEnum & getMomentumFaceInterpolationMethod() const
Get the face interpolation method for momentum (mostly used in the stress terms)
bool addAxisymmetricViscousSourceEnabled() const
Whether the cylindrical viscous source helper is enabled.
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const MooseFunctorName & densityName() const
Return the name of the density functor.
bool includeSymmetrizedViscousStress() const
Whether to include the symmetrized contribution in the viscous stress.
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
const std::vector< NonlinearVariableName > & getAdvectedScalarNames() const
Get the names of the advected scalar quantity variables.
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()
bool _has_scalar_equations
bool _has_energy_equation
const VariableName _tke_name
Name of the turbulent kinetic energy.
virtual void addMaterials() override
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.
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...
WCNSFVTurbulencePhysics(const InputParameters ¶meters)
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
virtual void addSolverVariables() override
void addKEpsilonAdvection()
void addKEpsilonTimeDerivatives()
Functions adding kernels for the k-epsilon to the k-epsilon equations.
virtual void addAuxiliaryKernels() override
void addKEpsilonDiffusion()
virtual void addMaterials() override
virtual void initializePhysicsAdditional() override
void addFlowTurbulenceKernels()
Functions adding kernels for turbulence in the other equation(s)
void addScalarAdvectionTurbulenceKernels()
static InputParameters validParams()
virtual void addAuxiliaryVariables() override
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of ghosting layers needed.
void addFluidEnergyTurbulenceKernels()
virtual void addFVBCs() override
virtual void addFVKernels() override
void addAxisymmetricTurbulentViscousSource()
static const std::string mixing_length
static const std::string density
static const std::string TKED
static const std::string cp
static const std::string mu_t
static const std::string k_eff_t
static const std::string mu_t_passive_scalar
static const std::string mu
static const std::string TKE
static const std::string directions[3]