https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
WCNSFVTurbulencePhysics Class Referencefinal

Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible Navier Stokes finite volume flow simulation. More...

#include <WCNSFVTurbulencePhysics.h>

Inheritance diagram for WCNSFVTurbulencePhysics:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 WCNSFVTurbulencePhysics (const InputParameters &parameters)
 
bool hasTurbulenceModel () const
 Whether a turbulence model is in use. More...
 
std::vector< BoundaryName > turbulenceWalls () const
 The names of the boundaries with turbulence wall functions. More...
 
MooseEnum turbulenceEpsilonWallTreatment () const
 The turbulence epsilon wall treatment (same for all turbulence walls currently) More...
 
MooseEnum turbulenceTemperatureWallTreatment () const
 The turbulence temperature wall treatment (same for all turbulence walls currently) More...
 
MooseFunctorName tkeName () const
 The name of the turbulent kinetic energy variable. More...
 
virtual void act () override final
 
void addBlocks (const std::vector< SubdomainName > &blocks)
 
void addBlocksById (const std::vector< SubdomainID > &block_ids)
 
const std::vector< SubdomainName > & blocks () const
 
bool checkBlockRestrictionIdentical (const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
 
bool hasBlocks (const std::vector< SubdomainName > &blocks) const
 
const TgetCoupledPhysics (const PhysicsName &phys_name, const bool allow_fail=false) const
 
const std::vector< T *> getCoupledPhysics (const bool allow_fail=false) const
 
unsigned int dimension () const
 
const ActionComponentgetActionComponent (const ComponentName &comp_name) const
 
void checkComponentType (const ActionComponent &component) const
 
virtual void addComponent (const ActionComponent &component)
 
const std::vector< VariableName > & solverVariableNames () const
 
const std::vector< VariableName > & auxVariableNames () const
 
void timedAct ()
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool haveParameter (const std::string &name) const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
void assertParamDefined (const std::string &libmesh_dbg_var(param)) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
const WCNSFVFlowPhysicsBasegetCoupledFlowPhysics () const
 
const WCNSFVTurbulencePhysicsBasegetCoupledTurbulencePhysics () const
 
MooseFunctorName getPorosityFunctorName (bool smoothed) const
 Return the porosity functor name. More...
 
const MooseFunctorName & densityName () const
 
const MooseFunctorName & dynamicViscosityName () const
 

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string unique_action_name_param
 
static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

virtual void initializePhysicsAdditional () override
 
unsigned short getNumberAlgebraicGhostingLayersNeeded () const override
 Return the number of ghosting layers needed. More...
 
virtual void actOnAdditionalTasks () override
 
void retrieveCoupledPhysics ()
 Retrieve the other WCNSFVPhysics at play in the simulation to be able to add the relevant terms (turbulent diffusion notably) More...
 
virtual void addInitialConditions () override
 
bool usingNavierStokesFVSyntax () const
 Detects if we are using the new Physics syntax or the old NavierStokesFV action. More...
 
InputParameters getAdditionalRMParams () const override
 Parameters to change or add relationship managers. More...
 
void assertParamDefined (const std::string &param) const
 
bool isTransient () const
 
FactorygetFactory ()
 
FactorygetFactory () const
 
virtual FEProblemBasegetProblem ()
 
virtual const FEProblemBasegetProblem () const
 
void prepareCopyVariablesFromMesh () const
 
void copyVariablesFromMesh (const std::vector< VariableName > &variables_to_copy, bool are_nonlinear=true)
 
std::string prefix () const
 
void saveSolverVariableName (const VariableName &var_name)
 
void saveAuxVariableName (const VariableName &var_name)
 
bool variableExists (const VariableName &var_name, bool error_if_aux) const
 
bool solverVariableExists (const VariableName &var_name) const
 
const SolverSystemName & getSolverSystem (unsigned int variable_index) const
 
const SolverSystemName & getSolverSystem (const VariableName &variable_name) const
 
void addRequiredPhysicsTask (const std::string &task)
 
void assignBlocks (InputParameters &params, const std::vector< SubdomainName > &blocks) const
 
bool allMeshBlocks (const std::vector< SubdomainName > &blocks) const
 
bool allMeshBlocks (const std::set< SubdomainName > &blocks) const
 
std::set< SubdomainIDgetSubdomainIDs (const std::set< SubdomainName > &blocks) const
 
std::vector< std::string > getSubdomainNamesAndIDs (const std::set< SubdomainID > &blocks) const
 
void addPetscPairsToPetscOptions (const std::vector< std::pair< MooseEnumItem, std::string >> &petsc_pair_options)
 
bool isVariableFV (const VariableName &var_name) const
 
bool isVariableScalar (const VariableName &var_name) const
 
bool shouldCreateVariable (const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_aux)
 
bool shouldCreateIC (const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
 
bool shouldCreateTimeDerivative (const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
 
void reportPotentiallyMissedParameters (const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") const
 
virtual void checkIntegrity () const
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
void checkParamsBothSetOrNotSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneTrue (const std::string &param1, const std::string &param2) const
 
void checkSecondParamSetOnlyIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkSecondParamNotSetIfFirstOneSet (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamAndMultiMooseEnumLength (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamsSameLength (const std::string &param1, const std::string &param2) const
 
void checkVectorParamsNoOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamsNoRespectiveOverlap (const std::vector< std::string > &param_vecs) const
 
void checkTwoDVectorParamInnerSameLengthAsOneDVector (const std::string &param1, const std::string &param2) const
 
void checkTwoDVectorParamMultiMooseEnumSameLength (const std::string &param1, const std::string &param2, const bool error_for_param2) const
 
void checkVectorParamNotEmpty (const std::string &param1) const
 
void checkVectorParamsSameLengthIfSet (const std::string &param1, const std::string &param2, const bool ignore_empty_default_param2=false) const
 
void checkVectorParamLengthSameAsCombinedOthers (const std::string &param1, const std::string &param2, const std::string &param3) const
 
void checkBlockwiseConsistency (const std::string &block_param_name, const std::vector< std::string > &parameter_names) const
 
bool parameterConsistent (const InputParameters &other_param, const std::string &param_name) const
 
void warnInconsistent (const InputParameters &parameters, const std::string &param_name) const
 
void errorDependentParameter (const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
 
void errorInconsistentDependentParameter (const std::string &param1, const std::string &value_set, const std::vector< std::string > &dependent_params) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const MooseEnum _turbulence_model
 Turbulence model to create the equation(s) for. More...
 
bool _has_flow_equations
 
bool _has_energy_equation
 
bool _has_scalar_equations
 
const WCNSFVFluidHeatTransferPhysicsBase_fluid_energy_physics
 The heat advection physics to add turbulent mixing for. More...
 
const WCNSFVScalarTransportPhysicsBase_scalar_transport_physics
 The scalar advection physics to add turbulent mixing for. More...
 
std::vector< BoundaryName > _turbulence_walls
 List of boundaries to act as walls for turbulence models. More...
 
MooseEnum _wall_treatment_eps
 Turbulence wall treatment for epsilon (same for all walls currently) More...
 
MooseEnum _wall_treatment_temp
 Turbulence wall treatment for temperature (same for all walls currently) More...
 
const VariableName _tke_name
 Name of the turbulent kinetic energy. More...
 
const VariableName _tked_name
 Name of the turbulent kinetic energy dissipation. More...
 
const VariableName _turbulent_viscosity_name = NS::mu_t
 Name of the turbulence viscosity auxiliary variable (or property) More...
 
bool _define_variables
 Whether to define variables if they do not exist. More...
 
std::vector< SolverSystemName > _system_names
 
std::vector< unsigned int_system_numbers
 
const bool _verbose
 
const MooseEnum_preconditioning
 
std::vector< SubdomainName > _blocks
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 
const NavierStokesPhysicsBase_advection_physics
 The Physics class using this helper. More...
 
const WCNSFVFlowPhysicsBase_flow_equations_physics
 Flow physics. More...
 
const WCNSFVTurbulencePhysicsBase_turbulence_physics
 Turbulence. More...
 
bool _has_turbulence_model
 Because of the Modules/navierStokesFV syntax, a turbulence physics often exists without a model we save (_turbulence_physics && _turbulence_physics->hasTurbulenceModel()) in this attribute. More...
 
const MooseEnum _compressibility
 Compressibility type, can be compressible, incompressible or weakly-compressible. More...
 
const bool _porous_medium_treatment
 Switch to show if porous medium treatment is requested or not. More...
 
const std::vector< std::string > _velocity_names
 Velocity names. More...
 
const NonlinearVariableName _pressure_name
 Pressure name. More...
 
const MooseFunctorName _density_name
 Name of the density material property. More...
 
const MooseFunctorName _dynamic_viscosity_name
 Name of the dynamic viscosity material property. More...
 
const MooseEnum _velocity_interpolation
 The velocity / momentum face interpolation method for advecting other quantities. More...
 

Private Member Functions

virtual void addSolverVariables () override
 
virtual void addAuxiliaryVariables () override
 
virtual void addFVKernels () override
 
virtual void addFVBCs () override
 
virtual void addAuxiliaryKernels () override
 
virtual void addMaterials () override
 
void addFlowTurbulenceKernels ()
 Functions adding kernels for turbulence in the other equation(s) More...
 
void addFluidEnergyTurbulenceKernels ()
 
void addScalarAdvectionTurbulenceKernels ()
 
void addAxisymmetricTurbulentViscousSource ()
 
void addKEpsilonTimeDerivatives ()
 Functions adding kernels for the k-epsilon to the k-epsilon equations. More...
 
void addKEpsilonAdvection ()
 
void addKEpsilonDiffusion ()
 
void addKEpsilonSink ()
 

Private Attributes

const VariableName _mixing_length_name
 Name of the mixing length auxiliary variable. More...
 

Detailed Description

Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible Navier Stokes finite volume flow simulation.

Definition at line 19 of file WCNSFVTurbulencePhysics.h.

Constructor & Destructor Documentation

◆ WCNSFVTurbulencePhysics()

WCNSFVTurbulencePhysics::WCNSFVTurbulencePhysics ( const InputParameters parameters)

Definition at line 66 of file WCNSFVTurbulencePhysics.C.

68  _mixing_length_name(getParam<AuxVariableName>("mixing_length_name"))
69 {
70  // Keep track of the variable names, for loading variables from files notably
71  if (_turbulence_model == "mixing-length")
73 
74  // Parameter checks
75  if (_turbulence_model != "mixing-length")
76  errorDependentParameter("turbulence_handling",
77  "mixing-length",
78  {"mixing_length_delta",
79  "mixing_length_aux_execute_on",
80  "von_karman_const",
81  "von_karman_const_0",
82  "mixing_length_two_term_bc_expansion"});
83 }
const InputParameters & parameters() const
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
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)
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
WCNSFVTurbulencePhysicsBase(const InputParameters &parameters)

Member Function Documentation

◆ actOnAdditionalTasks()

void WCNSFVTurbulencePhysicsBase::actOnAdditionalTasks ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 202 of file WCNSFVTurbulencePhysicsBase.C.

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 }
void retrieveCoupledPhysics()
Retrieve the other WCNSFVPhysics at play in the simulation to be able to add the relevant terms (turb...
const std::string & _current_task

◆ addAuxiliaryKernels()

void WCNSFVTurbulencePhysics::addAuxiliaryKernels ( )
overrideprivatevirtual

Reimplemented from WCNSFVTurbulencePhysicsBase.

Definition at line 513 of file WCNSFVTurbulencePhysics.C.

514 {
516 
517  // Note that if we are restarting this will overwrite the restarted mixing-length
518  if (_turbulence_model == "mixing-length")
519  {
520  const std::string ml_kernel_type = "WallDistanceMixingLengthAux";
521  InputParameters ml_params = getFactory().getValidParams(ml_kernel_type);
522  assignBlocks(ml_params, _blocks);
523  ml_params.set<AuxVariableName>("variable") = _mixing_length_name;
524  ml_params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
525  if (parameters().isParamValid("mixing_length_aux_execute_on"))
526  ml_params.set<ExecFlagEnum>("execute_on") =
527  getParam<ExecFlagEnum>("mixing_length_aux_execute_on");
528  else
529  ml_params.set<ExecFlagEnum>("execute_on") = {EXEC_INITIAL, EXEC_TIMESTEP_END};
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");
535 
536  getProblem().addAuxKernel(ml_kernel_type, prefix() + "mixing_length_aux ", ml_params);
537  }
538 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const InputParameters & parameters() const
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const ExecFlagType EXEC_TIMESTEP_END
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
std::vector< SubdomainName > _blocks
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
virtual FEProblemBase & getProblem()
virtual void addAuxiliaryKernels() override
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
bool isParamValid(const std::string &name) const
const ExecFlagType EXEC_INITIAL

◆ addAuxiliaryVariables()

void WCNSFVTurbulencePhysics::addAuxiliaryVariables ( )
overrideprivatevirtual

Reimplemented from WCNSFVTurbulencePhysicsBase.

Definition at line 145 of file WCNSFVTurbulencePhysics.C.

146 {
147  if (_turbulence_model == "mixing-length" && _define_variables)
148  {
149  auto params = getFactory().getValidParams("MooseVariableFVReal");
150  assignBlocks(params, _blocks);
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");
154  if (!shouldCreateVariable(_tke_name, _blocks, /*error if aux*/ false))
155  reportPotentiallyMissedParameters({"mixing_length_two_term_bc_expansion"},
156  "MooseVariableFVReal");
157  else
158  getProblem().addAuxVariable("MooseVariableFVReal", _mixing_length_name, params);
159  }
161 }
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)
Factory & getFactory()
InputParameters getValidParams(const std::string &name) const
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") 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.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const VariableName _tke_name
Name of the turbulent kinetic energy.
bool _define_variables
Whether to define variables if they do not exist.
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
bool isParamValid(const std::string &name) const
virtual void addAuxiliaryVariables() override

◆ addAxisymmetricTurbulentViscousSource()

void WCNSFVTurbulencePhysics::addAxisymmetricTurbulentViscousSource ( )
private

Definition at line 265 of file WCNSFVTurbulencePhysics.C.

Referenced by addFlowTurbulenceKernels().

266 {
267  if (_turbulence_model == "none")
268  return;
270  return;
272  return;
273 
274  const auto rz_blocks = _flow_equations_physics->getAxisymmetricRZBlocks();
275  if (rz_blocks.empty())
276  return;
277 
278  const auto radial_index =
280 
281  InputParameters params = getFactory().getValidParams("INSFVMomentumViscousSourceRZ");
282  assignBlocks(params, rz_blocks);
283  params.set<MooseFunctorName>(NS::mu) = _turbulent_viscosity_name;
284  params.set<UserObjectName>("rhie_chow_user_object") = _flow_equations_physics->rhieChowUOName();
285  params.set<MooseEnum>("momentum_component") = NS::directions[radial_index];
286  params.set<bool>("complete_expansion") =
288  params.set<NonlinearVariableName>("variable") =
289  _flow_equations_physics->getVelocityNames()[radial_index];
290 
291  getProblem().addFVKernel("INSFVMomentumViscousSourceRZ",
292  prefix() + "ins_momentum_turbulent_viscous_source_rz_" +
293  NS::directions[radial_index],
294  params);
295 }
std::string prefix() const
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
bool includeSymmetrizedViscousStress() const
Whether to include the symmetrized contribution in the viscous stress.
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
unsigned int getAxisymmetricRadialCoord() const
static const std::string mu
Definition: NS.h:127
std::vector< SubdomainName > getAxisymmetricRZBlocks() const
Return the set of blocks restricted to an RZ coordinate system.
bool addAxisymmetricViscousSourceEnabled() const
Whether the cylindrical viscous source helper is enabled.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
virtual MooseMesh & mesh() override
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addFlowTurbulenceKernels()

void WCNSFVTurbulencePhysics::addFlowTurbulenceKernels ( )
private

Functions adding kernels for turbulence in the other equation(s)

Definition at line 189 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

190 {
191  if (_turbulence_model == "mixing-length")
192  {
193  const std::string u_names[3] = {"u", "v", "w"};
194  const std::string kernel_type = "INSFVMixingLengthReynoldsStress";
195  InputParameters params = getFactory().getValidParams(kernel_type);
196  assignBlocks(params, _blocks);
197  params.set<MooseFunctorName>(NS::density) = _density_name;
198  params.set<MooseFunctorName>(NS::mixing_length) = _mixing_length_name;
199 
200  std::string kernel_name = prefix() + "ins_momentum_mixing_length_reynolds_stress_";
202  kernel_name = prefix() + "pins_momentum_mixing_length_reynolds_stress_";
203 
204  params.set<UserObjectName>("rhie_chow_user_object") = _flow_equations_physics->rhieChowUOName();
205  for (const auto dim_i : make_range(dimension()))
206  params.set<MooseFunctorName>(u_names[dim_i]) = _velocity_names[dim_i];
207 
208  for (const auto d : make_range(dimension()))
209  {
210  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
211  params.set<MooseEnum>("momentum_component") = NS::directions[d];
212 
213  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
214  }
215  }
216  else if (_turbulence_model == "k-epsilon")
217  {
218  // We rely on using the turbulent viscosity in the flow equation
219  // This check is rudimentary, we should think of a better way
220  // We could also check for the use of 'mu_t' with the right parameters already
222  !MooseUtils::isFloat(_flow_equations_physics->dynamicViscosityName()))
223  mooseError(
224  "Regular fluid viscosity 'mu' should be used for the momentum diffusion term. You are "
225  "currently using: " +
227 
228  const std::string u_names[3] = {"u", "v", "w"};
229  const std::string kernel_type = "INSFVMomentumDiffusion";
230  InputParameters params = getFactory().getValidParams(kernel_type);
231  assignBlocks(params, _blocks);
232  params.set<MooseFunctorName>("mu") = _turbulent_viscosity_name;
233  params.set<MooseEnum>("mu_interp_method") =
234  getParam<MooseEnum>("turbulent_viscosity_interp_method");
235  params.set<MooseEnum>("variable_interp_method") =
237  params.set<bool>("complete_expansion") = true;
239  params.set<bool>("include_isotropic_viscous_stress") = true;
240 
241  std::string kernel_name = prefix() + "ins_momentum_k_epsilon_reynolds_stress_";
243  kernel_name = prefix() + "pins_momentum_k_epsilon_reynolds_stress_";
244 
245  params.set<UserObjectName>("rhie_chow_user_object") = _flow_equations_physics->rhieChowUOName();
246  for (const auto dim_i : make_range(dimension()))
247  params.set<MooseFunctorName>(u_names[dim_i]) = _velocity_names[dim_i];
248 
249  for (const auto d : make_range(dimension()))
250  {
251  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
252  params.set<MooseEnum>("momentum_component") = NS::directions[d];
253 
254  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
255  }
256 
257  // We only add it here because the mixing length kernels deal with this
258  // withn the kernel. For mixing length see issue: #32112
261  }
262 }
std::string prefix() const
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 assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
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.
Factory & getFactory()
static const std::string mixing_length
Definition: NS.h:75
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
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:23
virtual FEProblemBase & getProblem()
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)
const std::vector< std::string > _velocity_names
Velocity names.
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addFluidEnergyTurbulenceKernels()

void WCNSFVTurbulencePhysics::addFluidEnergyTurbulenceKernels ( )
private

Definition at line 298 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

299 {
300  if (_turbulence_model == "mixing-length")
301  {
302  const std::string u_names[3] = {"u", "v", "w"};
303  const std::string kernel_type = "WCNSFVMixingLengthEnergyDiffusion";
304  InputParameters params = getFactory().getValidParams(kernel_type);
305  assignBlocks(params, _blocks);
306  params.set<MooseFunctorName>(NS::density) = _density_name;
307  params.set<MooseFunctorName>(NS::cp) = _fluid_energy_physics->getSpecificHeatName();
308  params.set<MooseFunctorName>(NS::mixing_length) = _mixing_length_name;
309  params.set<Real>("schmidt_number") = getParam<Real>("turbulent_prandtl");
310  params.set<NonlinearVariableName>("variable") =
312 
313  for (const auto dim_i : make_range(dimension()))
314  params.set<MooseFunctorName>(u_names[dim_i]) = _velocity_names[dim_i];
315 
318  kernel_type, prefix() + "pins_energy_mixing_length_diffusion", params);
319  else
321  kernel_type, prefix() + "ins_energy_mixing_length_diffusion", params);
322  }
323  else if (_turbulence_model == "k-epsilon")
324  {
325  const std::string kernel_type = "FVDiffusion";
326  const auto T_fluid_name = _flow_equations_physics->getFluidTemperatureName();
327  InputParameters params = getFactory().getValidParams(kernel_type);
328  assignBlocks(params, _blocks);
329  params.set<NonlinearVariableName>("variable") = T_fluid_name;
330  params.set<MooseFunctorName>("coeff") = NS::k_t;
331  getProblem().addFVKernel(kernel_type, prefix() + T_fluid_name + "_turbulent_diffusion", params);
332  }
333 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
const MooseFunctorName _density_name
Name of the density material property.
Factory & getFactory()
static const std::string mixing_length
Definition: NS.h:75
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
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
static const std::string cp
Definition: NS.h:125
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
const NonlinearVariableName & getFluidTemperatureName() const
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
const WCNSFVFluidHeatTransferPhysicsBase * _fluid_energy_physics
The heat advection physics to add turbulent mixing for.
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.
IntRange< T > make_range(T beg, T end)
static const std::string k_t
Definition: NS.h:136
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addFVBCs()

void WCNSFVTurbulencePhysics::addFVBCs ( )
overrideprivatevirtual

Implements WCNSFVTurbulencePhysicsBase.

Definition at line 541 of file WCNSFVTurbulencePhysics.C.

542 {
543  const std::string u_names[3] = {"u", "v", "w"};
544 
545  if (_turbulence_model == "k-epsilon" && getParam<bool>("mu_t_as_aux_variable"))
546  {
547  mooseAssert(_flow_equations_physics, "Should have a flow equation physics");
548  const std::string bc_type = "INSFVTurbulentViscosityWallFunction";
549  InputParameters params = getFactory().getValidParams(bc_type);
550  params.set<std::vector<BoundaryName>>("boundary") = _turbulence_walls;
551  params.set<NonlinearVariableName>("variable") = _turbulent_viscosity_name;
552  params.set<MooseFunctorName>(NS::density) = _flow_equations_physics->densityName();
553  params.set<MooseFunctorName>(NS::mu) = _flow_equations_physics->dynamicViscosityName();
554  params.set<MooseFunctorName>(NS::mu_t) = _turbulent_viscosity_name;
555  params.set<MooseFunctorName>(NS::TKE) = _tke_name;
556  params.set<Real>("C_mu") = getParam<Real>("C_mu");
557  params.set<MooseEnum>("wall_treatment") = _wall_treatment_eps;
558  for (const auto d : make_range(dimension()))
559  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
560 
561  getProblem().addFVBC(bc_type, prefix() + "turbulence_walls", params);
562  // Energy wall function boundary conditions are added in the WCNSFVFluidEnergyPhysics
563  // because it facilitates counting the number of walls, specifying energy wall functors
564  // the same way as for boundary conditions
565  }
566 }
std::string prefix() const
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
static const std::string mu_t
Definition: NS.h:129
const MooseFunctorName & dynamicViscosityName() const
Return the name of the dynamic viscosity functor.
Factory & getFactory()
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
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
unsigned int dimension() const
const MooseFunctorName & densityName() const
Return the name of the density functor.
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
virtual FEProblemBase & getProblem()
static const std::string mu
Definition: NS.h:127
const VariableName _tke_name
Name of the turbulent kinetic energy.
const std::vector< std::string > _velocity_names
Velocity names.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
MooseEnum _wall_treatment_eps
Turbulence wall treatment for epsilon (same for all walls currently)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addFVKernels()

void WCNSFVTurbulencePhysics::addFVKernels ( )
overrideprivatevirtual

Implements WCNSFVTurbulencePhysicsBase.

Definition at line 164 of file WCNSFVTurbulencePhysics.C.

165 {
166  if (_turbulence_model == "none")
167  return;
168 
169  // Turbulence terms in other equations
176 
177  // Turbulence models with their own set of equations
178  if (_turbulence_model == "k-epsilon")
179  {
180  if (isTransient())
184  addKEpsilonSink();
185  }
186 }
void addFlowTurbulenceKernels()
Functions adding kernels for turbulence in the other equation(s)
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
void addKEpsilonTimeDerivatives()
Functions adding kernels for the k-epsilon to the k-epsilon equations.
bool isTransient() const

◆ addInitialConditions()

void WCNSFVTurbulencePhysicsBase::addInitialConditions ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 282 of file WCNSFVTurbulencePhysicsBase.C.

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 }
std::string prefix() const
virtual void addFVInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
bool shouldCreateIC(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
std::vector< SubdomainName > _blocks
const MooseFunctorName & densityName() const
Return the name of the density functor.
virtual FEProblemBase & getProblem()
const VariableName _tke_name
Name of the turbulent kinetic energy.
bool _define_variables
Whether to define variables if they do not exist.
void mooseError(Args &&... args) const
bool isParamValid(const std::string &name) const
bool isParamSetByUser(const std::string &name) const
MooseUnits pow(const MooseUnits &, int)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addKEpsilonAdvection()

void WCNSFVTurbulencePhysics::addKEpsilonAdvection ( )
private

Definition at line 403 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

404 {
405  const std::string kernel_type = "INSFVTurbulentAdvection";
406  InputParameters params = getFactory().getValidParams(kernel_type);
407 
408  assignBlocks(params, _blocks);
409 
410  params.set<MooseEnum>("velocity_interp_method") = _velocity_interpolation;
411  params.set<UserObjectName>("rhie_chow_user_object") = _flow_equations_physics->rhieChowUOName();
412  params.set<MooseFunctorName>(NS::density) = _flow_equations_physics->densityName();
413  params.set<bool>("neglect_advection_derivatives") =
414  getParam<bool>("neglect_advection_derivatives");
415 
416  params.set<MooseEnum>("advected_interp_method") =
417  getParam<MooseEnum>("tke_advection_interpolation");
418  params.set<NonlinearVariableName>("variable") = _tke_name;
419  getProblem().addFVKernel(kernel_type, prefix() + "tke_advection", params);
420  params.set<NonlinearVariableName>("variable") = _tked_name;
421  params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
422  params.set<MooseEnum>("advected_interp_method") =
423  getParam<MooseEnum>("tked_advection_interpolation");
424  getProblem().addFVKernel(kernel_type, prefix() + "tked_advection", params);
425 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
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
std::vector< SubdomainName > _blocks
const MooseFunctorName & densityName() const
Return the name of the density functor.
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
virtual FEProblemBase & getProblem()
const VariableName _tke_name
Name of the turbulent kinetic energy.
const UserObjectName & rhieChowUOName() const
Return the name of the Rhie Chow user object.
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const MooseEnum _velocity_interpolation
The velocity / momentum face interpolation method for advecting other quantities. ...

◆ addKEpsilonDiffusion()

void WCNSFVTurbulencePhysics::addKEpsilonDiffusion ( )
private

Definition at line 428 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

429 {
430  {
431  const std::string kernel_type = "INSFVTurbulentDiffusion";
432  InputParameters params = getFactory().getValidParams(kernel_type);
433  assignBlocks(params, _blocks);
434 
435  params.set<NonlinearVariableName>("variable") = _tke_name;
436  params.set<MooseFunctorName>("coeff") = _flow_equations_physics->dynamicViscosityName();
437  getProblem().addFVKernel(kernel_type, prefix() + "tke_diffusion_mu", params);
438 
439  params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
440  params.set<NonlinearVariableName>("variable") = _tked_name;
441  getProblem().addFVKernel(kernel_type, prefix() + "tked_diffusion_mu", params);
442  }
443 
444  {
445  const std::string kernel_type = "INSFVTurbulentDiffusion";
446  InputParameters params = getFactory().getValidParams(kernel_type);
447  assignBlocks(params, _blocks);
448 
449  params.set<NonlinearVariableName>("variable") = _tke_name;
450  params.set<MooseFunctorName>("coeff") = _turbulent_viscosity_name;
451  params.set<MooseFunctorName>("scaling_coef") = getParam<MooseFunctorName>("sigma_k");
452  params.set<MooseEnum>("coeff_interp_method") =
453  getParam<MooseEnum>("turbulent_viscosity_interp_method");
454  getProblem().addFVKernel(kernel_type, prefix() + "tke_diffusion_mu_turb", params);
455 
456  params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
457  params.set<NonlinearVariableName>("variable") = _tked_name;
458  params.set<MooseFunctorName>("scaling_coef") = getParam<MooseFunctorName>("sigma_eps");
459  getProblem().addFVKernel(kernel_type, prefix() + "tked_diffusion_mu_turb", params);
460  }
461 }
std::string prefix() const
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
const MooseFunctorName & dynamicViscosityName() const
Return the name of the dynamic viscosity functor.
Factory & getFactory()
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::vector< SubdomainName > _blocks
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
virtual FEProblemBase & getProblem()
const VariableName _tke_name
Name of the turbulent kinetic energy.
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addKEpsilonSink()

void WCNSFVTurbulencePhysics::addKEpsilonSink ( )
private

Definition at line 464 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

465 {
466  const std::string u_names[3] = {"u", "v", "w"};
467  {
468  const std::string kernel_type = "INSFVTKESourceSink";
469  InputParameters params = getFactory().getValidParams(kernel_type);
470  assignBlocks(params, _blocks);
471  params.set<NonlinearVariableName>("variable") = _tke_name;
472  params.set<MooseFunctorName>(NS::TKED) = _tked_name;
473  params.set<MooseFunctorName>(NS::density) = _flow_equations_physics->densityName();
474  params.set<MooseFunctorName>(NS::mu) = _flow_equations_physics->dynamicViscosityName();
475  params.set<MooseFunctorName>(NS::mu_t) = _turbulent_viscosity_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");
479  params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
480  params.set<MooseEnum>("wall_treatment") = _wall_treatment_eps;
481  // Currently only Newton method for WCNSFVTurbulencePhysics
482  params.set<bool>("newton_solve") = true;
483  for (const auto d : make_range(dimension()))
484  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
485  getProblem().addFVKernel(kernel_type, prefix() + "tke_source_sink", params);
486  }
487 
488  {
489  const std::string kernel_type = "INSFVTKEDSourceSink";
490  InputParameters params = getFactory().getValidParams(kernel_type);
491  assignBlocks(params, _blocks);
492  params.set<NonlinearVariableName>("variable") = _tked_name;
493  params.set<MooseFunctorName>(NS::TKE) = _tke_name;
494  params.set<MooseFunctorName>(NS::density) = _flow_equations_physics->densityName();
495  params.set<MooseFunctorName>(NS::mu) = _flow_equations_physics->dynamicViscosityName();
496  params.set<MooseFunctorName>(NS::mu_t) = _turbulent_viscosity_name;
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");
500  params.set<std::vector<BoundaryName>>("walls") = _turbulence_walls;
501  params.set<MooseEnum>("wall_treatment") = _wall_treatment_eps;
502  params.set<MooseFunctorName>("C1_eps") = getParam<MooseFunctorName>("C1_eps");
503  params.set<MooseFunctorName>("C2_eps") = getParam<MooseFunctorName>("C2_eps");
504  // Currently only Newton method for WCNSFVTurbulencePhysics
505  params.set<bool>("newton_solve") = true;
506  for (const auto d : make_range(dimension()))
507  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
508  getProblem().addFVKernel(kernel_type, prefix() + "tked_source_sink", params);
509  }
510 }
std::string prefix() const
const VariableName _turbulent_viscosity_name
Name of the turbulence viscosity auxiliary variable (or property)
static const std::string mu_t
Definition: NS.h:129
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
const MooseFunctorName & dynamicViscosityName() const
Return the name of the dynamic viscosity functor.
Factory & getFactory()
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
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
std::vector< SubdomainName > _blocks
unsigned int dimension() const
const MooseFunctorName & densityName() const
Return the name of the density functor.
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.
virtual FEProblemBase & getProblem()
static const std::string mu
Definition: NS.h:127
const VariableName _tke_name
Name of the turbulent kinetic energy.
const std::vector< std::string > _velocity_names
Velocity names.
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
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
MooseEnum _wall_treatment_eps
Turbulence wall treatment for epsilon (same for all walls currently)
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addKEpsilonTimeDerivatives()

void WCNSFVTurbulencePhysics::addKEpsilonTimeDerivatives ( )
private

Functions adding kernels for the k-epsilon to the k-epsilon equations.

Definition at line 388 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

389 {
390  const std::string kernel_type = "FVFunctorTimeKernel";
391  InputParameters params = getFactory().getValidParams(kernel_type);
392  assignBlocks(params, _blocks);
393 
394  params.set<NonlinearVariableName>("variable") = _tke_name;
395  if (shouldCreateTimeDerivative(_tke_name, _blocks, /*error if already defined*/ false))
396  getProblem().addFVKernel(kernel_type, prefix() + "tke_time", params);
397  params.set<NonlinearVariableName>("variable") = _tked_name;
398  if (shouldCreateTimeDerivative(_tked_name, _blocks, /*error if already defined*/ false))
399  getProblem().addFVKernel(kernel_type, prefix() + "tked_time", params);
400 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const VariableName _tke_name
Name of the turbulent kinetic energy.
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addMaterials()

void WCNSFVTurbulencePhysics::addMaterials ( )
overrideprivatevirtual

Reimplemented from WCNSFVTurbulencePhysicsBase.

Definition at line 569 of file WCNSFVTurbulencePhysics.C.

570 {
571  if (_turbulence_model == "mixing-length")
572  {
573  const std::string u_names[3] = {"u", "v", "w"};
574  InputParameters params =
575  getFactory().getValidParams("MixingLengthTurbulentViscosityFunctorMaterial");
576  assignBlocks(params, _blocks);
577 
578  for (const auto d : make_range(dimension()))
579  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
580 
581  params.set<MooseFunctorName>(NS::mixing_length) = _mixing_length_name;
582  params.set<MooseFunctorName>(NS::density) = _density_name;
583  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
584 
585  getProblem().addMaterial("MixingLengthTurbulentViscosityFunctorMaterial",
586  prefix() + "mixing_length_material",
587  params);
588  }
590 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
const MooseFunctorName _density_name
Name of the density material property.
Factory & getFactory()
static const std::string mixing_length
Definition: NS.h:75
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
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
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
virtual FEProblemBase & getProblem()
static const std::string mu
Definition: NS.h:127
const std::vector< std::string > _velocity_names
Velocity names.
const VariableName _mixing_length_name
Name of the mixing length auxiliary variable.
IntRange< T > make_range(T beg, T end)

◆ addScalarAdvectionTurbulenceKernels()

void WCNSFVTurbulencePhysics::addScalarAdvectionTurbulenceKernels ( )
private

Definition at line 336 of file WCNSFVTurbulencePhysics.C.

Referenced by addFVKernels().

337 {
338  const auto & passive_scalar_names = _scalar_transport_physics->getAdvectedScalarNames();
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)
342  paramError(
343  "Sc_t",
344  "The number of turbulent Schmidt numbers defined is not equal to the number of passive "
345  "scalar fields!");
346 
347  if (_turbulence_model == "mixing-length")
348  {
349  const std::string u_names[3] = {"u", "v", "w"};
350  const std::string kernel_type = "INSFVMixingLengthScalarDiffusion";
351  InputParameters params = getFactory().getValidParams(kernel_type);
352  assignBlocks(params, _blocks);
353  params.set<MooseFunctorName>(NS::mixing_length) = _mixing_length_name;
354  for (const auto dim_i : make_range(dimension()))
355  params.set<MooseFunctorName>(u_names[dim_i]) = _velocity_names[dim_i];
356 
357  for (const auto & name_i : index_range(passive_scalar_names))
358  {
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];
364  else
365  params.set<Real>("schmidt_number") = 1.0;
366 
368  kernel_type, prefix() + passive_scalar_names[name_i] + "_mixing_length", params);
369  }
370  }
371  else if (_turbulence_model == "k-epsilon")
372  {
373  const std::string kernel_type = "FVDiffusion";
374  InputParameters params = getFactory().getValidParams(kernel_type);
375  assignBlocks(params, _blocks);
376 
377  for (const auto & name_i : index_range(passive_scalar_names))
378  {
379  params.set<NonlinearVariableName>("variable") = passive_scalar_names[name_i];
380  params.set<MooseFunctorName>("coeff") = NS::mu_t_passive_scalar;
382  kernel_type, prefix() + passive_scalar_names[name_i] + "_turbulent_diffusion", params);
383  }
384  }
385 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
static const std::string mixing_length
Definition: NS.h:75
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
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.
IntRange< T > make_range(T beg, T end)
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.
static const std::string mu_t_passive_scalar
Definition: NS.h:131
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
auto index_range(const T &sizable)

◆ addSolverVariables()

void WCNSFVTurbulencePhysics::addSolverVariables ( )
overrideprivatevirtual

Implements WCNSFVTurbulencePhysicsBase.

Definition at line 93 of file WCNSFVTurbulencePhysics.C.

94 {
95  if (_turbulence_model == "mixing-length" || _turbulence_model == "none")
96  return;
97  else if (_turbulence_model == "k-epsilon")
98  {
99  // Dont add if the user already defined the variable
100  // Add turbulent kinetic energy variable
101  if (!shouldCreateVariable(_tke_name, _blocks, /*error if aux*/ true))
103  {"system_names", "tke_scaling", "tke_face_interpolation", "tke_two_term_bc_expansion"},
104  "INSFVEnergyVariable");
105  else if (_define_variables)
106  {
107  auto params = getFactory().getValidParams("INSFVEnergyVariable");
108  assignBlocks(params, _blocks);
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");
112  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_tke_name);
113 
114  getProblem().addVariable("INSFVEnergyVariable", _tke_name, params);
115  }
116  else
117  paramError("turbulence_kinetic_energy_variable",
118  "Variable (" + _tke_name +
119  ") supplied to the WCNSFVTurbulencePhysics does not exist!");
120 
121  // Add turbulent kinetic energy dissipation variable
122  if (!shouldCreateVariable(_tked_name, _blocks, /*error if aux*/ true))
124  {"system_names", "tked_scaling", "tked_face_interpolation", "tked_two_term_bc_expansion"},
125  "INSFVEnergyVariable");
126  else if (_define_variables)
127  {
128  auto params = getFactory().getValidParams("INSFVEnergyVariable");
129  assignBlocks(params, _blocks);
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");
134  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_tked_name);
135  getProblem().addVariable("INSFVEnergyVariable", _tked_name, params);
136  }
137  else
138  paramError("turbulence_kinetic_energy_dissipation_variable",
139  "Variable (" + _tked_name +
140  ") supplied to the WCNSFVTurbulencePhysics does not exist!");
141  }
142 }
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)
Factory & getFactory()
void paramError(const std::string &param, Args... args) const
const VariableName _tked_name
Name of the turbulent kinetic energy dissipation.
InputParameters getValidParams(const std::string &name) const
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type, const std::string &object_name="") const
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
const VariableName _tke_name
Name of the turbulent kinetic energy.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
bool _define_variables
Whether to define variables if they do not exist.

◆ densityName()

const MooseFunctorName& WCNSFVCoupledAdvectionPhysicsHelper::densityName ( ) const
inlineinherited

◆ dynamicViscosityName()

const MooseFunctorName& WCNSFVCoupledAdvectionPhysicsHelper::dynamicViscosityName ( ) const
inlineinherited

Definition at line 37 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

37 { return _dynamic_viscosity_name; }
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.

◆ getAdditionalRMParams()

InputParameters NavierStokesPhysicsBase::getAdditionalRMParams ( ) const
overrideprotectedvirtualinherited

Parameters to change or add relationship managers.

Reimplemented from PhysicsBase.

Definition at line 42 of file NavierStokesPhysicsBase.C.

43 {
44  unsigned short necessary_layers = getParam<unsigned short>("ghost_layers");
45  necessary_layers = std::max(necessary_layers, getNumberAlgebraicGhostingLayersNeeded());
46 
47  // Just an object that has a ghost_layers parameter
48  const std::string kernel_type = "INSFVMixingLengthReynoldsStress";
49  InputParameters params = getFactory().getValidParams(kernel_type);
50  params.template set<unsigned short>("ghost_layers") = necessary_layers;
51 
52  return params;
53 }
Factory & getFactory()
InputParameters getValidParams(const std::string &name) const
virtual unsigned short getNumberAlgebraicGhostingLayersNeeded() const =0
Return the number of ghosting layers needed.

◆ getCoupledFlowPhysics()

const WCNSFVFlowPhysicsBase * WCNSFVCoupledAdvectionPhysicsHelper::getCoupledFlowPhysics ( ) const
inherited

Definition at line 53 of file WCNSFVCoupledAdvectionPhysicsHelper.C.

54 {
55  // User passed it, just use that
56  if (_advection_physics->isParamValid("coupled_flow_physics"))
58  _advection_physics->getParam<PhysicsName>("coupled_flow_physics"));
59  // Look for any physics of the right type, and check the block restriction
60  else
61  {
62  const auto all_flow_physics =
64  for (const auto physics : all_flow_physics)
66  physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
67  {
68  return physics;
69  }
70  }
71  mooseError("No coupled flow Physics found of type derived from 'WCNSFVFlowPhysicsBase'. Use the "
72  "'coupled_flow_physics' parameter to give the name of the desired "
73  "WCNSFVFlowPhysicsBase-derived Physics to couple with");
74 }
const T & getParam(const std::string &name) const
void mooseError(Args &&... args)
const T * getCoupledPhysics(const PhysicsName &phys_name, const bool allow_fail=false) const
Base class for Physics which create the Navier Stokes flow equations.
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
bool isParamValid(const std::string &name) const
const NavierStokesPhysicsBase * _advection_physics
The Physics class using this helper.

◆ getCoupledTurbulencePhysics()

const WCNSFVTurbulencePhysicsBase * WCNSFVCoupledAdvectionPhysicsHelper::getCoupledTurbulencePhysics ( ) const
inherited

Definition at line 77 of file WCNSFVCoupledAdvectionPhysicsHelper.C.

Referenced by WCNSFVScalarTransportPhysicsBase::actOnAdditionalTasks(), and WCNSFVFluidHeatTransferPhysicsBase::actOnAdditionalTasks().

78 {
79  // User passed it, just use that
80  if (_advection_physics->isParamValid("coupled_turbulence_physics"))
82  _advection_physics->getParam<PhysicsName>("coupled_turbulence_physics"));
83  // Look for any physics of the right type, and check the block restriction
84  else
85  {
86  const auto all_turbulence_physics =
88  for (const auto physics : all_turbulence_physics)
90  physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
91  return physics;
92  }
93  // Did not find one
94  return nullptr;
95 }
Base class for a Physics that creates all the objects needed to add a turbulence model to an incompre...
const T & getParam(const std::string &name) const
const T * getCoupledPhysics(const PhysicsName &phys_name, const bool allow_fail=false) const
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
bool isParamValid(const std::string &name) const
const NavierStokesPhysicsBase * _advection_physics
The Physics class using this helper.

◆ getNumberAlgebraicGhostingLayersNeeded()

unsigned short WCNSFVTurbulencePhysics::getNumberAlgebraicGhostingLayersNeeded ( ) const
overrideprotectedvirtual

Return the number of ghosting layers needed.

Implements NavierStokesPhysicsBase.

Definition at line 593 of file WCNSFVTurbulencePhysics.C.

594 {
595  unsigned short ghost_layers = _flow_equations_physics->getNumberAlgebraicGhostingLayersNeeded();
596  // due to the computation of the eddy-diffusivity from the strain tensor
597  if (_turbulence_model == "mixing-length")
598  ghost_layers = std::max(ghost_layers, (unsigned short)3);
599  return ghost_layers;
600 }
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ getPorosityFunctorName()

MooseFunctorName WCNSFVCoupledAdvectionPhysicsHelper::getPorosityFunctorName ( bool  smoothed) const
inherited

Return the porosity functor name.

It is important to forward to the Physics so we do not get the smoothing status wrong

Definition at line 47 of file WCNSFVCoupledAdvectionPhysicsHelper.C.

48 {
50 }
MooseFunctorName getPorosityFunctorName(const bool smoothed) const
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ hasTurbulenceModel()

bool WCNSFVTurbulencePhysicsBase::hasTurbulenceModel ( ) const
inlineinherited

Whether a turbulence model is in use.

Definition at line 43 of file WCNSFVTurbulencePhysicsBase.h.

Referenced by WCNSFVScalarTransportPhysicsBase::actOnAdditionalTasks(), WCNSFVFluidHeatTransferPhysicsBase::actOnAdditionalTasks(), and WCNSFVFlowPhysicsBase::hasTurbulencePhysics().

43 { return _turbulence_model != "none"; }
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.

◆ initializePhysicsAdditional()

void WCNSFVTurbulencePhysics::initializePhysicsAdditional ( )
overrideprotectedvirtual

Reimplemented from PhysicsBase.

Definition at line 86 of file WCNSFVTurbulencePhysics.C.

87 {
88  if (_turbulence_model == "k-epsilon")
90 }
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
virtual FEProblemBase & getProblem()
void needSolutionState(unsigned int oldest_needed, Moose::SolutionIterationType iteration_type)

◆ retrieveCoupledPhysics()

void WCNSFVTurbulencePhysicsBase::retrieveCoupledPhysics ( )
protectedinherited

Retrieve the other WCNSFVPhysics at play in the simulation to be able to add the relevant terms (turbulent diffusion notably)

Definition at line 211 of file WCNSFVTurbulencePhysicsBase.C.

Referenced by WCNSFVTurbulencePhysicsBase::actOnAdditionalTasks().

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 }
bool hasFlowEquations() const
Whether the physics is actually creating the flow equations.
void paramError(const std::string &param, Args... args) const
void mooseInfoRepeated(Args &&... args)
const bool _verbose
const MooseEnum _turbulence_model
Turbulence model to create the equation(s) for.
bool hasScalarEquations() const
Whether the physics is actually creating the scalar advection equations.
const std::string & name() const
bool hasEnergyEquation() const
Whether the physics is actually creating the heat equation.
const WCNSFVFluidHeatTransferPhysicsBase * _fluid_energy_physics
The heat advection physics to add turbulent mixing for.
const WCNSFVScalarTransportPhysicsBase * _scalar_transport_physics
The scalar advection physics to add turbulent mixing for.
bool isParamValid(const std::string &name) const
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ tkeName()

MooseFunctorName WCNSFVTurbulencePhysicsBase::tkeName ( ) const
inlineinherited

The name of the turbulent kinetic energy variable.

Definition at line 51 of file WCNSFVTurbulencePhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyWallBC().

51 { return _tke_name; }
const VariableName _tke_name
Name of the turbulent kinetic energy.

◆ turbulenceEpsilonWallTreatment()

MooseEnum WCNSFVTurbulencePhysicsBase::turbulenceEpsilonWallTreatment ( ) const
inlineinherited

The turbulence epsilon wall treatment (same for all turbulence walls currently)

Definition at line 47 of file WCNSFVTurbulencePhysicsBase.h.

47 { return _wall_treatment_eps; }
MooseEnum _wall_treatment_eps
Turbulence wall treatment for epsilon (same for all walls currently)

◆ turbulenceTemperatureWallTreatment()

MooseEnum WCNSFVTurbulencePhysicsBase::turbulenceTemperatureWallTreatment ( ) const
inlineinherited

The turbulence temperature wall treatment (same for all turbulence walls currently)

Definition at line 49 of file WCNSFVTurbulencePhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyWallBC().

49 { return _wall_treatment_temp; }
MooseEnum _wall_treatment_temp
Turbulence wall treatment for temperature (same for all walls currently)

◆ turbulenceWalls()

std::vector<BoundaryName> WCNSFVTurbulencePhysicsBase::turbulenceWalls ( ) const
inlineinherited

The names of the boundaries with turbulence wall functions.

Definition at line 45 of file WCNSFVTurbulencePhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyWallBC().

45 { return _turbulence_walls; }
std::vector< BoundaryName > _turbulence_walls
List of boundaries to act as walls for turbulence models.

◆ usingNavierStokesFVSyntax()

bool NavierStokesPhysicsBase::usingNavierStokesFVSyntax ( ) const
inlineprotectedinherited

Detects if we are using the new Physics syntax or the old NavierStokesFV action.

Definition at line 32 of file NavierStokesPhysicsBase.h.

33  {
34  return (parameters().get<std::string>("registered_identifier") == "Modules/NavierStokesFV");
35  }
const InputParameters & parameters() const

◆ validParams()

InputParameters WCNSFVTurbulencePhysics::validParams ( )
static

Definition at line 23 of file WCNSFVTurbulencePhysics.C.

24 {
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  // TODO Added to facilitate transition, remove default once NavierStokesFV action is removed
31  params.addParam<AuxVariableName>(
32  "mixing_length_name", "mixing_length", "Name of the mixing length auxiliary variable");
33  params.transferParam<bool>(NSFVBase::validParams(), "mixing_length_two_term_bc_expansion");
34 
35  // K-Epsilon numerical scheme parameters
36  params.addRangeCheckedParam<Real>(
37  "tke_scaling",
38  1.0,
39  "tke_scaling > 0.0",
40  "The scaling factor for the turbulent kinetic energy equation.");
41  params.addRangeCheckedParam<Real>(
42  "tked_scaling",
43  1.0,
44  "tked_scaling > 0.0",
45  "The scaling factor for the turbulent kinetic energy dissipation equation.");
46 
47  // Better Jacobian if not linearizing sink and sources
48  params.addParam<bool>("linearize_sink_sources", false, "Whether to linearize the source term");
49  // Better convergence on some cases when neglecting advection derivatives
50  params.addParam<bool>(
51  "neglect_advection_derivatives",
52  false,
53  "Whether to remove the off-diagonal velocity term in the TKE and TKED advection term");
54  MooseEnum coeff_interp_method("average harmonic", "harmonic");
55  params.addParam<MooseEnum>("turbulent_viscosity_interp_method",
56  coeff_interp_method,
57  "Face interpolation method for the turbulent viscosity");
58 
59  params.addParamNamesToGroup("tke_scaling tked_scaling "
60  "turbulent_viscosity_interp_method linearize_sink_sources",
61  "K-Epsilon model numerical");
62 
63  return params;
64 }
static InputParameters validParams()
Definition: NSFVBase.C:371
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void transferParam(const InputParameters &source_param, const std::string &name, const std::string &new_name="", const std::string &new_description="")
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
static InputParameters validParams()
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)

Member Data Documentation

◆ _advection_physics

const NavierStokesPhysicsBase* WCNSFVCoupledAdvectionPhysicsHelper::_advection_physics
protectedinherited

◆ _compressibility

const MooseEnum WCNSFVCoupledAdvectionPhysicsHelper::_compressibility
protectedinherited

Compressibility type, can be compressible, incompressible or weakly-compressible.

Definition at line 51 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyTimeKernels().

◆ _define_variables

bool NavierStokesPhysicsBase::_define_variables
protectedinherited

◆ _density_name

const MooseFunctorName WCNSFVCoupledAdvectionPhysicsHelper::_density_name
protectedinherited

◆ _dynamic_viscosity_name

const MooseFunctorName WCNSFVCoupledAdvectionPhysicsHelper::_dynamic_viscosity_name
protectedinherited

◆ _flow_equations_physics

const WCNSFVFlowPhysicsBase* WCNSFVCoupledAdvectionPhysicsHelper::_flow_equations_physics
protectedinherited

Flow physics.

Definition at line 43 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm(), WCNSFVTurbulencePhysicsBase::addAuxiliaryKernels(), addAxisymmetricTurbulentViscousSource(), WCNSFVFluidHeatTransferPhysics::addEnergyAdvectionKernels(), WCNSLinearFVFluidHeatTransferPhysics::addEnergyAdvectionKernels(), WCNSFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels(), WCNSLinearFVFluidHeatTransferPhysics::addEnergyInletBC(), WCNSFVFluidHeatTransferPhysics::addEnergyInletBC(), WCNSLinearFVFluidHeatTransferPhysics::addEnergyOutletBC(), WCNSFVFluidHeatTransferPhysics::addEnergySeparatorBC(), WCNSFVFluidHeatTransferPhysics::addEnergyTimeKernels(), WCNSLinearFVFluidHeatTransferPhysics::addEnergyWallBC(), WCNSFVFluidHeatTransferPhysics::addEnergyWallBC(), addFlowTurbulenceKernels(), addFluidEnergyTurbulenceKernels(), WCNSFVTwoPhaseMixturePhysics::addFunctorMaterials(), WCNSLinearFVTurbulencePhysics::addFunctorMaterials(), addFVBCs(), WCNSLinearFVTurbulencePhysics::addFVBCs(), WCNSLinearFVTwoPhaseMixturePhysics::addFVKernels(), WCNSFVTwoPhaseMixturePhysics::addFVKernels(), WCNSFVFluidHeatTransferPhysicsBase::addInitialConditions(), WCNSFVTurbulencePhysicsBase::addInitialConditions(), WCNSLinearFVTurbulencePhysics::addKEpsilonAdvection(), addKEpsilonAdvection(), addKEpsilonDiffusion(), WCNSLinearFVTurbulencePhysics::addKEpsilonSink(), addKEpsilonSink(), WCNSLinearFVTurbulencePhysics::addKEpsilonTimeDerivatives(), WCNSFVFluidHeatTransferPhysics::addMaterials(), WCNSLinearFVFluidHeatTransferPhysics::addMaterials(), WCNSLinearFVTwoPhaseMixturePhysics::addMaterials(), WCNSFVTurbulencePhysicsBase::addMaterials(), WCNSLinearFVTwoPhaseMixturePhysics::addPhaseDriftFluxTerm(), WCNSFVTwoPhaseMixturePhysics::addPhaseDriftFluxTerm(), WCNSFVScalarTransportPhysics::addScalarAdvectionKernels(), WCNSLinearFVScalarTransportPhysics::addScalarAdvectionKernels(), WCNSLinearFVScalarTransportPhysics::addScalarInletBC(), WCNSFVScalarTransportPhysics::addScalarInletBC(), WCNSLinearFVScalarTransportPhysics::addScalarOutletBC(), WCNSLinearFVTurbulencePhysics::checkIntegrity(), WCNSLinearFVTwoPhaseMixturePhysics::checkIntegrity(), getNumberAlgebraicGhostingLayersNeeded(), WCNSLinearFVTurbulencePhysics::getNumberAlgebraicGhostingLayersNeeded(), WCNSFVFluidHeatTransferPhysicsBase::getNumberAlgebraicGhostingLayersNeeded(), WCNSFVScalarTransportPhysicsBase::getNumberAlgebraicGhostingLayersNeeded(), WCNSFVCoupledAdvectionPhysicsHelper::getPorosityFunctorName(), WCNSFVTurbulencePhysicsBase::retrieveCoupledPhysics(), WCNSFVFluidHeatTransferPhysicsBase::WCNSFVFluidHeatTransferPhysicsBase(), WCNSFVTwoPhaseMixturePhysics::WCNSFVTwoPhaseMixturePhysics(), WCNSLinearFVScalarTransportPhysics::WCNSLinearFVScalarTransportPhysics(), and WCNSLinearFVTwoPhaseMixturePhysics::WCNSLinearFVTwoPhaseMixturePhysics().

◆ _fluid_energy_physics

const WCNSFVFluidHeatTransferPhysicsBase* WCNSFVTurbulencePhysicsBase::_fluid_energy_physics
protectedinherited

◆ _has_energy_equation

bool WCNSFVTurbulencePhysicsBase::_has_energy_equation
protectedinherited

◆ _has_flow_equations

bool WCNSFVTurbulencePhysicsBase::_has_flow_equations
protectedinherited

◆ _has_scalar_equations

bool WCNSFVTurbulencePhysicsBase::_has_scalar_equations
protectedinherited

◆ _has_turbulence_model

bool WCNSFVCoupledAdvectionPhysicsHelper::_has_turbulence_model
protectedinherited

◆ _mixing_length_name

const VariableName WCNSFVTurbulencePhysics::_mixing_length_name
private

◆ _porous_medium_treatment

const bool WCNSFVCoupledAdvectionPhysicsHelper::_porous_medium_treatment
protectedinherited

◆ _pressure_name

const NonlinearVariableName WCNSFVCoupledAdvectionPhysicsHelper::_pressure_name
protectedinherited

Pressure name.

Definition at line 59 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

◆ _scalar_transport_physics

const WCNSFVScalarTransportPhysicsBase* WCNSFVTurbulencePhysicsBase::_scalar_transport_physics
protectedinherited

The scalar advection physics to add turbulent mixing for.

Definition at line 77 of file WCNSFVTurbulencePhysicsBase.h.

Referenced by WCNSFVTurbulencePhysicsBase::addMaterials(), addScalarAdvectionTurbulenceKernels(), and WCNSFVTurbulencePhysicsBase::retrieveCoupledPhysics().

◆ _tke_name

const VariableName WCNSFVTurbulencePhysicsBase::_tke_name
protectedinherited

◆ _tked_name

const VariableName WCNSFVTurbulencePhysicsBase::_tked_name
protectedinherited

◆ _turbulence_model

const MooseEnum WCNSFVTurbulencePhysicsBase::_turbulence_model
protectedinherited

◆ _turbulence_physics

const WCNSFVTurbulencePhysicsBase* WCNSFVCoupledAdvectionPhysicsHelper::_turbulence_physics
protectedinherited

◆ _turbulence_walls

std::vector<BoundaryName> WCNSFVTurbulencePhysicsBase::_turbulence_walls
protectedinherited

◆ _turbulent_viscosity_name

const VariableName WCNSFVTurbulencePhysicsBase::_turbulent_viscosity_name = NS::mu_t
protectedinherited

◆ _velocity_interpolation

const MooseEnum WCNSFVCoupledAdvectionPhysicsHelper::_velocity_interpolation
protectedinherited

The velocity / momentum face interpolation method for advecting other quantities.

Definition at line 67 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyAdvectionKernels(), addKEpsilonAdvection(), and WCNSFVScalarTransportPhysics::addScalarAdvectionKernels().

◆ _velocity_names

const std::vector<std::string> WCNSFVCoupledAdvectionPhysicsHelper::_velocity_names
protectedinherited

◆ _wall_treatment_eps

MooseEnum WCNSFVTurbulencePhysicsBase::_wall_treatment_eps
protectedinherited

◆ _wall_treatment_temp

MooseEnum WCNSFVTurbulencePhysicsBase::_wall_treatment_temp
protectedinherited

Turbulence wall treatment for temperature (same for all walls currently)

Definition at line 84 of file WCNSFVTurbulencePhysicsBase.h.

Referenced by WCNSFVTurbulencePhysicsBase::turbulenceTemperatureWallTreatment().


The documentation for this class was generated from the following files: