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_";
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_";
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") =
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";
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);
std::string prefix() const
static InputParameters validParams()
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.
virtual void initializePhysicsAdditional() override
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
Base class for a Physics that creates all the objects needed to add a turbulence model to an incompre...
static const std::string mu_t
void assignBlocks(InputParameters ¶ms, const std::vector< SubdomainName > &blocks) const
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible N...
const MooseFunctorName & dynamicViscosityName() const
Return the name of the dynamic viscosity functor.
bool includeIsotropicStress() const
Whether to include the isotropic viscous stress contribution.
const MooseFunctorName _density_name
Name of the density material property.
void paramError(const std::string ¶m, Args... args) const
WCNSFVTurbulencePhysics(const InputParameters ¶meters)
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
static const std::string mixing_length
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters ¶meters)
const InputParameters & parameters() const
void addFlowTurbulenceKernels()
Functions adding kernels for turbulence in the other equation(s)
void addKEpsilonDiffusion()
static const std::string density
InputParameters getValidParams(const std::string &name) const
static const std::string TKE
void reportPotentiallyMissedParameters(const std::vector< std::string > ¶m_names, const std::string &object_type, const std::string &object_name="") const
void addScalarAdvectionTurbulenceKernels()
void addAxisymmetricTurbulentViscousSource()
const ExecFlagType EXEC_TIMESTEP_END
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
const MooseFunctorName & densityName() const
Return the name of the density functor.
bool includeSymmetrizedViscousStress() const
Whether to include the symmetrized contribution in the viscous stress.
static const std::string directions[3]
virtual void addFVBCs() override
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
void saveAuxVariableName(const VariableName &var_name)
virtual FEProblemBase & getProblem()
virtual void addAuxiliaryKernels() override
bool _has_energy_equation
static const std::string cp
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
void addKEpsilonTimeDerivatives()
Functions adding kernels for the k-epsilon to the k-epsilon equations.
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
const NonlinearVariableName & getFluidTemperatureName() const
virtual void addMaterials() override
unsigned int getAxisymmetricRadialCoord() const
static const std::string mu
static InputParameters validParams()
std::vector< SubdomainName > getAxisymmetricRZBlocks() const
Return the set of blocks restricted to an RZ coordinate system.
const VariableName _tke_name
Name of the turbulent kinetic energy.
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const MooseEnum & getMomentumFaceInterpolationMethod() const
Get the face interpolation method for momentum (mostly used in the stress terms)
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
registerWCNSFVTurbulenceBaseTasks("NavierStokesApp", WCNSFVTurbulencePhysics)
const WCNSFVFluidHeatTransferPhysicsBase * _fluid_energy_physics
The heat advection physics to add turbulent mixing for.
virtual void addMaterials() override
virtual void addFVKernels() override
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters ¶ms)
bool _define_variables
Whether to define variables if they do not exist.
const std::vector< std::string > _velocity_names
Velocity names.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
bool addAxisymmetricViscousSourceEnabled() const
Whether the cylindrical viscous source helper is enabled.
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of ghosting layers needed.
void addFluidEnergyTurbulenceKernels()
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
IntRange< T > make_range(T beg, T end)
static const std::string TKED
virtual MooseMesh & mesh() override
void mooseError(Args &&... args) const
void addKEpsilonAdvection()
const std::vector< NonlinearVariableName > & getAdvectedScalarNames() const
Get the names of the advected scalar quantity variables.
const WCNSFVScalarTransportPhysicsBase * _scalar_transport_physics
The scalar advection physics to add turbulent mixing for.
bool isParamValid(const std::string &name) const
virtual void addAuxiliaryKernels() override
static const std::string mu_t_passive_scalar
static const std::string k_t
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
static InputParameters validParams()
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
MooseEnum _wall_treatment_eps
Turbulence wall treatment for epsilon (same for all walls currently)
virtual void addSolverVariables() override
virtual void addAuxiliaryVariables() override
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
auto index_range(const T &sizable)
virtual void addAuxiliaryVariables() override
const MooseEnum _velocity_interpolation
The velocity / momentum face interpolation method for advecting other quantities. ...
bool _has_scalar_equations
const ExecFlagType EXEC_INITIAL