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");
109 params.set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"tke_scaling")};
110 params.set<
MooseEnum>(
"face_interp_method") = getParam<MooseEnum>(
"tke_face_interpolation");
111 params.set<
bool>(
"two_term_boundary_expansion") = getParam<bool>(
"tke_two_term_bc_expansion");
117 paramError(
"turbulence_kinetic_energy_variable",
119 ") supplied to the WCNSFVTurbulencePhysics does not exist!");
124 {
"system_names",
"tked_scaling",
"tked_face_interpolation",
"tked_two_term_bc_expansion"},
125 "INSFVEnergyVariable");
130 params.set<std::vector<Real>>(
"scaling") = {getParam<Real>(
"tked_scaling")};
131 params.set<
MooseEnum>(
"face_interp_method") = getParam<MooseEnum>(
"tked_face_interpolation");
132 params.set<
bool>(
"two_term_boundary_expansion") =
133 getParam<bool>(
"tked_two_term_bc_expansion");
138 paramError(
"turbulence_kinetic_energy_dissipation_variable",
140 ") supplied to the WCNSFVTurbulencePhysics does not exist!");
151 if (
isParamValid(
"mixing_length_two_term_bc_expansion"))
152 params.set<
bool>(
"two_term_boundary_expansion") =
153 getParam<bool>(
"mixing_length_two_term_bc_expansion");
156 "MooseVariableFVReal");
193 const std::string u_names[3] = {
"u",
"v",
"w"};
194 const std::string kernel_type =
"INSFVMixingLengthReynoldsStress";
200 std::string kernel_name =
prefix() +
"ins_momentum_mixing_length_reynolds_stress_";
202 kernel_name =
prefix() +
"pins_momentum_mixing_length_reynolds_stress_";
205 for (
const auto dim_i : make_range(
dimension()))
224 "Regular fluid viscosity 'mu' should be used for the momentum diffusion term. You are "
225 "currently using: " +
228 const std::string u_names[3] = {
"u",
"v",
"w"};
229 const std::string kernel_type =
"INSFVMomentumDiffusion";
234 getParam<MooseEnum>(
"turbulent_viscosity_interp_method");
237 params.
set<
bool>(
"complete_expansion") =
true;
239 params.
set<
bool>(
"include_isotropic_viscous_stress") =
true;
241 std::string kernel_name =
prefix() +
"ins_momentum_k_epsilon_reynolds_stress_";
243 kernel_name =
prefix() +
"pins_momentum_k_epsilon_reynolds_stress_";
246 for (
const auto dim_i : make_range(
dimension()))
275 if (rz_blocks.empty())
278 const auto radial_index =
286 params.
set<
bool>(
"complete_expansion") =
288 params.
set<NonlinearVariableName>(
"variable") =
292 prefix() +
"ins_momentum_turbulent_viscous_source_rz_" +
302 const std::string u_names[3] = {
"u",
"v",
"w"};
303 const std::string kernel_type =
"WCNSFVMixingLengthEnergyDiffusion";
309 params.
set<Real>(
"schmidt_number") = getParam<Real>(
"turbulent_prandtl");
310 params.
set<NonlinearVariableName>(
"variable") =
313 for (
const auto dim_i : make_range(
dimension()))
318 kernel_type,
prefix() +
"pins_energy_mixing_length_diffusion", params);
321 kernel_type,
prefix() +
"ins_energy_mixing_length_diffusion", params);
325 const std::string kernel_type =
"FVDiffusion";
329 params.
set<NonlinearVariableName>(
"variable") = T_fluid_name;
330 params.
set<MooseFunctorName>(
"coeff") =
NS::k_t;
339 const auto & passive_scalar_schmidt_number = getParam<std::vector<Real>>(
"Sc_t");
340 if (passive_scalar_schmidt_number.size() != passive_scalar_names.size() &&
341 passive_scalar_schmidt_number.size() != 1)
344 "The number of turbulent Schmidt numbers defined is not equal to the number of passive "
349 const std::string u_names[3] = {
"u",
"v",
"w"};
350 const std::string kernel_type =
"INSFVMixingLengthScalarDiffusion";
354 for (
const auto dim_i : make_range(
dimension()))
357 for (
const auto & name_i : index_range(passive_scalar_names))
359 params.
set<NonlinearVariableName>(
"variable") = passive_scalar_names[name_i];
360 if (passive_scalar_schmidt_number.size() > 1)
361 params.
set<Real>(
"schmidt_number") = passive_scalar_schmidt_number[name_i];
362 else if (passive_scalar_schmidt_number.size() == 1)
363 params.
set<Real>(
"schmidt_number") = passive_scalar_schmidt_number[0];
365 params.
set<Real>(
"schmidt_number") = 1.0;
368 kernel_type,
prefix() + passive_scalar_names[name_i] +
"_mixing_length", params);
373 const std::string kernel_type =
"FVDiffusion";
377 for (
const auto & name_i : index_range(passive_scalar_names))
379 params.
set<NonlinearVariableName>(
"variable") = passive_scalar_names[name_i];
382 kernel_type,
prefix() + passive_scalar_names[name_i] +
"_turbulent_diffusion", params);
390 const std::string kernel_type =
"FVFunctorTimeKernel";
394 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
405 const std::string kernel_type =
"INSFVTurbulentAdvection";
413 params.
set<
bool>(
"neglect_advection_derivatives") =
414 getParam<bool>(
"neglect_advection_derivatives");
417 getParam<MooseEnum>(
"tke_advection_interpolation");
418 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
423 getParam<MooseEnum>(
"tked_advection_interpolation");
431 const std::string kernel_type =
"INSFVTurbulentDiffusion";
435 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
445 const std::string kernel_type =
"INSFVTurbulentDiffusion";
449 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
451 params.
set<MooseFunctorName>(
"scaling_coef") = getParam<MooseFunctorName>(
"sigma_k");
453 getParam<MooseEnum>(
"turbulent_viscosity_interp_method");
458 params.
set<MooseFunctorName>(
"scaling_coef") = getParam<MooseFunctorName>(
"sigma_eps");
466 const std::string u_names[3] = {
"u",
"v",
"w"};
468 const std::string kernel_type =
"INSFVTKESourceSink";
471 params.
set<NonlinearVariableName>(
"variable") =
_tke_name;
476 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
477 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
478 params.
set<
bool>(
"linearized_model") = getParam<bool>(
"linearize_sink_sources");
482 params.
set<
bool>(
"newton_solve") =
true;
489 const std::string kernel_type =
"INSFVTKEDSourceSink";
497 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
498 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
499 params.
set<
bool>(
"linearized_model") = getParam<bool>(
"linearize_sink_sources");
502 params.
set<MooseFunctorName>(
"C1_eps") = getParam<MooseFunctorName>(
"C1_eps");
503 params.
set<MooseFunctorName>(
"C2_eps") = getParam<MooseFunctorName>(
"C2_eps");
505 params.
set<
bool>(
"newton_solve") =
true;
520 const std::string ml_kernel_type =
"WallDistanceMixingLengthAux";
527 getParam<ExecFlagEnum>(
"mixing_length_aux_execute_on");
530 ml_params.
set<MooseFunctorName>(
"von_karman_const") =
531 getParam<MooseFunctorName>(
"von_karman_const");
532 ml_params.
set<MooseFunctorName>(
"von_karman_const_0") =
533 getParam<MooseFunctorName>(
"von_karman_const_0");
534 ml_params.
set<MooseFunctorName>(
"delta") = getParam<MooseFunctorName>(
"mixing_length_delta");
543 const std::string u_names[3] = {
"u",
"v",
"w"};
548 const std::string bc_type =
"INSFVTurbulentViscosityWallFunction";
556 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
573 const std::string u_names[3] = {
"u",
"v",
"w"};
586 prefix() +
"mixing_length_material",
598 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 addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
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 addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
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.
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
const SolverSystemName & getSolverSystem(unsigned int variable_index) 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 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 mu_t_passive_scalar
static const std::string mu
static const std::string TKE
static const std::string k_t
static const std::string directions[3]