22 "add_interpolation_method_physics");
30 "Define a turbulence model for an incompressible or weakly-compressible Navier Stokes "
31 "flow with a linear finite volume discretization");
33 params.
addParam<std::vector<SolverSystemName>>(
35 {
"TKE_system",
"TKED_system"},
36 "Names of the linear solver systems for each equation. Default is set for K-Epsilon and "
37 "should be adapted for other models");
40 params.
addParam<
bool>(
"mu_t_as_aux_variable",
42 "Whether to use an auxiliary variable instead of a functor material "
43 "property for the turbulent viscosity");
58 "use_nonorthogonal_correction",
60 "Whether to use a non-orthogonal correction. This can potentially slow down convergence "
61 ", but reduces numerical dispersion on non-orthogonal meshes. Can be safely turned off on "
62 "orthogonal meshes.");
64 params.
addParam<InterpolationMethodName>(
65 "tke_advection_interpolation_method_name",
66 "Name of an externally defined FVInterpolationMethod to use for turbulent kinetic energy "
67 "advection. When provided, this overrides 'tke_advection_interpolation'.");
68 params.
addParam<InterpolationMethodName>(
69 "tked_advection_interpolation_method_name",
70 "Name of an externally defined FVInterpolationMethod to use for turbulent kinetic energy "
71 "dissipation advection. When provided, this overrides 'tked_advection_interpolation'.");
73 "tke_advection_interpolation_method_name tked_advection_interpolation_method_name",
74 "K-Epsilon model numerical");
87 "Mixing length is not implemented for the linear finite volume discretization");
96 if (!
isParamValid(
"tke_advection_interpolation_method_name"))
98 if (!
isParamValid(
"tked_advection_interpolation_method_name"))
117 "include_deviatoric_stress",
"This should be set to true when using a turbulence model");
133 std::string variable_type =
"MooseLinearVariableFVReal";
142 paramError(
"turbulence_kinetic_energy_variable",
144 ") supplied to the WCNSLinearFVTurbulencePhysics does not exist!");
151 std::string variable_type =
"MooseLinearVariableFVReal";
160 paramError(
"turbulence_kinetic_energy_dissipation_variable",
162 ") supplied to the WCNSLinearFVTurbulencePhysics does not exist!");
191 const std::string kernel_type =
"LinearFVTimeDerivative";
207 const auto tke_method_name =
209 ? getParam<InterpolationMethodName>(
"tke_advection_interpolation_method_name")
210 : InterpolationMethodName(
211 std::string(getParam<MooseEnum>(
"tke_advection_interpolation")));
212 const auto tked_method_name =
213 isParamValid(
"tked_advection_interpolation_method_name")
214 ? getParam<InterpolationMethodName>(
"tked_advection_interpolation_method_name")
215 : InterpolationMethodName(
216 std::string(getParam<MooseEnum>(
"tked_advection_interpolation")));
218 const std::string kernel_type =
"LinearFVTurbulentAdvection";
224 params.
set<InterpolationMethodName>(
"advected_interp_method_name") = tke_method_name;
229 params.
set<InterpolationMethodName>(
"advected_interp_method_name") = tked_method_name;
237 const std::string kernel_type =
"LinearFVTurbulentDiffusion";
240 params.
set<
bool>(
"use_nonorthogonal_correction") =
241 getParam<bool>(
"use_nonorthogonal_correction");
246 params.
set<MooseFunctorName>(
"diffusion_coeff") =
"mu_eff_tke";
251 params.
set<MooseFunctorName>(
"diffusion_coeff") =
"mu_eff_tked";
259 const std::string u_names[3] = {
"u",
"v",
"w"};
261 const std::string kernel_type =
"LinearFVTKESourceSink";
269 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
270 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
279 const std::string kernel_type =
"LinearFVTKEDSourceSink";
289 params.
set<MooseFunctorName>(
"C1_eps") = getParam<MooseFunctorName>(
"C1_eps");
290 params.
set<MooseFunctorName>(
"C2_eps") = getParam<MooseFunctorName>(
"C2_eps");
291 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
292 params.
set<Real>(
"C_pl") = getParam<Real>(
"C_pl");
302 const std::string u_names[3] = {
"u",
"v",
"w"};
307 const std::string bc_type =
"LinearFVTurbulentViscosityWallFunctionBC";
314 params.
set<Real>(
"C_mu") = getParam<Real>(
"C_mu");
333 const std::string mat_type =
"FunctorEffectiveDynamicViscosity";
336 params.
set<MooseFunctorName>(
"property_name") =
"mu_eff_tke";
339 params.
set<MooseFunctorName>(
NS::mu_t +
"_inverse_factor") =
340 getParam<MooseFunctorName>(
"sigma_k");
343 params.
set<MooseFunctorName>(
"property_name") =
"mu_eff_tked";
344 params.
set<MooseFunctorName>(
NS::mu_t +
"_inverse_factor") =
345 getParam<MooseFunctorName>(
"sigma_eps");
registerWCNSFVTurbulenceBaseTasks("NavierStokesApp", WCNSLinearFVTurbulencePhysics)
registerMooseAction("NavierStokesApp", WCNSLinearFVTurbulencePhysics, "add_interpolation_method_physics")
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters ¶meters)
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 addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters ¶meters)
InputParameters getValidParams(const std::string &name) const
void paramWarning(const std::string ¶m, Args... args) const
void paramError(const std::string ¶m, Args... args) const
const T & getParam(const std::string &name) const
bool isParamValid(const std::string &name) const
bool _define_variables
Whether to define variables if they do not exist.
void addFVAdvectedInterpolationMethod(const MooseEnum &interpolation_method)
Add the FVInterpolationMethod object for an advected interpolation method if absent.
virtual void checkIntegrity() const
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
bool shouldCreateVariable(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
std::vector< SubdomainName > _blocks
void addRequiredPhysicsTask(const std::string &task)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const std::vector< std::string > _velocity_names
Velocity names.
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.
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const MooseFunctorName & densityName() const
Return the name of the density functor.
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()
const VariableName _tke_name
Name of the turbulent kinetic energy.
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)
Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible N...
virtual void checkIntegrity() const override
virtual void initializePhysicsAdditional() override
WCNSLinearFVTurbulencePhysics(const InputParameters ¶meters)
void addKEpsilonAdvection()
virtual void addFVBCs() override
void addKEpsilonTimeDerivatives()
Functions adding kernels for the k-epsilon to the k-epsilon equations.
void addKEpsilonDiffusion()
static InputParameters validParams()
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of ghosting layers needed.
virtual void addSolverVariables() override
virtual void addFunctorMaterials() override
virtual void addFVInterpolationMethods() override
virtual void addFVKernels() override
static const std::string density
static const std::string TKED
static const std::string mu_t
static const std::string mu
static const std::string TKE