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 | List of all members
WCNSLinearFVFluidHeatTransferPhysics Class Referencefinal

Creates all the objects needed to solve the Navier Stokes energy equation using a linear finite volume discretization. More...

#include <WCNSLinearFVFluidHeatTransferPhysics.h>

Inheritance diagram for WCNSLinearFVFluidHeatTransferPhysics:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 WCNSLinearFVFluidHeatTransferPhysics (const InputParameters &parameters)
 
const VariableName & getFluidTemperatureName () const
 Get the name of the fluid temperature variable. More...
 
const MooseFunctorName & getSpecificHeatName () const
 Get the name of the specific heat material property. More...
 
MooseFunctorName getSpecificEnthalpyName () const
 
const std::vector< MooseFunctorName > & getThermalConductivityName () const
 
const std::vector< std::vector< SubdomainName > > & getAmbientConvectionBlocks () const
 Get the ambient convection parameters for parameter checking. More...
 
const std::vector< MooseFunctorName > & getAmbientConvectionHTCs () const
 Name of the ambient convection heat transfer coefficients for each block-group. More...
 
bool hasEnergyEquation () const
 Whether the physics is actually creating the heat equation. 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
 
const T * getCoupledPhysics (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
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (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
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) 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 WCNSFVTurbulencePhysicsgetCoupledTurbulencePhysics () 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 ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

void actOnAdditionalTasks () override
 
void addInitialConditions () override
 
void addFVKernels () override
 
void addFVBCs () override
 
unsigned short getNumberAlgebraicGhostingLayersNeeded () const override
 Return the number of ghosting layers needed. More...
 
bool processThermalConductivity ()
 Process thermal conductivity (multiple functor input options are available). More...
 
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
 
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 T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (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 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 bool _has_energy_equation
 A boolean to help compatibility with the old Modules/NavierStokesFV syntax. More...
 
const bool _solve_for_enthalpy
 User-selected option to solve for enthalpy. More...
 
const VariableName _fluid_enthalpy_name
 Name of the fluid specific enthalpy. More...
 
VariableName _fluid_temperature_name
 Fluid temperature name. More...
 
MooseFunctorName _specific_heat_name
 Name of the specific heat material property. More...
 
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
 Vector of subdomain groups where we want to have different thermal conduction. More...
 
std::vector< MooseFunctorName > _thermal_conductivity_name
 Name of the thermal conductivity functor for each block-group. More...
 
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
 Vector of subdomain groups where we want to have different ambient convection. More...
 
std::vector< MooseFunctorName > _ambient_convection_alpha
 Name of the ambient convection heat transfer coefficients for each block-group. More...
 
std::vector< MooseFunctorName > _ambient_temperature
 Name of the solid domain temperature for each block-group. More...
 
MultiMooseEnum _energy_inlet_types
 Energy inlet boundary types. More...
 
std::vector< MooseFunctorName > _energy_inlet_functors
 Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually represent. More...
 
MultiMooseEnum _energy_wall_types
 Energy wall boundary types. More...
 
std::vector< MooseFunctorName > _energy_wall_functors
 Functors describing the wall boundary values. See energy_wall_types for what the functors actually represent. 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
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
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 WCNSFVTurbulencePhysics_turbulence_physics
 Turbulence. 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 addAuxiliaryKernels () override
 
virtual void addMaterials () override
 
void addEnergyTimeKernels () override
 Functions adding kernels for the incompressible / weakly compressible energy equation. More...
 
void addEnergyHeatConductionKernels () override
 
void addEnergyAdvectionKernels () override
 
void addEnergyAmbientConvection () override
 
void addEnergyExternalHeatSource () override
 
void addEnergyInletBC () override
 Functions adding boundary conditions for the incompressible / weakly compressible energy equation. More...
 
void addEnergyWallBC () override
 
void addEnergyOutletBC () override
 
void addEnergySeparatorBC () override
 

Detailed Description

Creates all the objects needed to solve the Navier Stokes energy equation using a linear finite volume discretization.

Definition at line 19 of file WCNSLinearFVFluidHeatTransferPhysics.h.

Constructor & Destructor Documentation

◆ WCNSLinearFVFluidHeatTransferPhysics()

WCNSLinearFVFluidHeatTransferPhysics::WCNSLinearFVFluidHeatTransferPhysics ( const InputParameters parameters)

Definition at line 48 of file WCNSLinearFVFluidHeatTransferPhysics.C.

51 {
53  paramError("porous_medium_treatment", "Porous media not supported at this time");
54  checkSecondParamSetOnlyIfFirstOneTrue("solve_for_enthalpy", NS::fluid);
55 }
static const std::string fluid
Definition: NS.h:87
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
void paramError(const std::string &param, Args... args) const
WCNSFVFluidHeatTransferPhysicsBase(const InputParameters &parameters)
const InputParameters & parameters() const
void checkSecondParamSetOnlyIfFirstOneTrue(const std::string &param1, const std::string &param2) const

Member Function Documentation

◆ actOnAdditionalTasks()

void WCNSFVFluidHeatTransferPhysicsBase::actOnAdditionalTasks ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 159 of file WCNSFVFluidHeatTransferPhysicsBase.C.

160 {
161  // Turbulence physics would not be initialized before this task
162  if (_current_task == "get_turbulence_physics")
164 }
const WCNSFVTurbulencePhysics * _turbulence_physics
Turbulence.
const std::string & _current_task
const WCNSFVTurbulencePhysics * getCoupledTurbulencePhysics() const

◆ addAuxiliaryKernels()

void WCNSLinearFVFluidHeatTransferPhysics::addAuxiliaryKernels ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 247 of file WCNSLinearFVFluidHeatTransferPhysics.C.

248 {
250  {
251  // Keep temperature updated
252  const std::string kernel_type = "FunctorAux";
253  InputParameters params = getFactory().getValidParams(kernel_type);
254  params.set<AuxVariableName>("variable") = _fluid_temperature_name;
255  assignBlocks(params, _blocks);
256  params.set<MooseFunctorName>("functor") = "T_from_p_h";
257  params.set<ExecFlagEnum>("execute_on") = {EXEC_NONLINEAR};
258  getProblem().addAuxKernel(kernel_type, prefix() + "update_temperature", params);
259  }
260 }
std::string prefix() const
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
virtual void addAuxKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const ExecFlagType EXEC_NONLINEAR
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.

◆ addAuxiliaryVariables()

void WCNSLinearFVFluidHeatTransferPhysics::addAuxiliaryVariables ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 223 of file WCNSLinearFVFluidHeatTransferPhysics.C.

224 {
226  {
227  // Dont add if the user already defined the variable
229  /*error_if_aux=*/false))
231  getProblem().getVariable(0, _fluid_temperature_name).blocks());
232  else if (_define_variables)
233  {
234  const auto var_type = "MooseLinearVariableFVReal";
235  auto params = getFactory().getValidParams(var_type);
236  assignBlocks(params, _blocks);
238  }
239  else
240  paramError("fluid_temperature_variable",
241  "Variable (" + _fluid_temperature_name +
242  ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
243  }
244 }
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
InputParameters getValidParams(const std::string &name) const
const std::vector< SubdomainName > & blocks() const
VariableName _fluid_temperature_name
Fluid temperature name.
virtual void addAuxVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
void paramError(const std::string &param, Args... args) const
bool variableExists(const VariableName &var_name, bool error_if_aux) const
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
bool _define_variables
Whether to define variables if they do not exist.
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.

◆ addEnergyAdvectionKernels()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyAdvectionKernels ( )
overrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 102 of file WCNSLinearFVFluidHeatTransferPhysics.C.

103 {
104  std::string kernel_type = "LinearFVEnergyAdvection";
105  std::string kernel_name = prefix() + "ins_energy_advection";
106 
107  InputParameters params = getFactory().getValidParams(kernel_type);
108  assignBlocks(params, _blocks);
109  if (!getParam<bool>("solve_for_enthalpy"))
110  {
111  params.set<LinearVariableName>("variable") = _fluid_temperature_name;
112  params.set<MooseEnum>("advected_quantity") = "temperature";
114  paramError("specific_heat", "Must be a Real number. Functors not supported at this time");
115  params.set<Real>("cp") = std::atof(_specific_heat_name.c_str());
116  }
117  else
118  params.set<LinearVariableName>("variable") = _fluid_enthalpy_name;
119  params.set<UserObjectName>("rhie_chow_user_object") = _flow_equations_physics->rhieChowUOName();
120  params.set<MooseEnum>("advected_interp_method") =
121  getParam<MooseEnum>("energy_advection_interpolation");
122 
123  getProblem().addLinearFVKernel(kernel_type, kernel_name, params);
124 }
std::string prefix() const
MooseFunctorName _specific_heat_name
Name of the specific heat material property.
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
VariableName _fluid_temperature_name
Fluid temperature name.
bool isFloat(const std::string &str)
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
virtual UserObjectName rhieChowUOName() const =0
Return the name of the Rhie Chow user object.
void paramError(const std::string &param, Args... args) const
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addEnergyAmbientConvection()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyAmbientConvection ( )
overrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 172 of file WCNSLinearFVFluidHeatTransferPhysics.C.

173 {
174  unsigned int num_convection_blocks = _ambient_convection_blocks.size();
175  unsigned int num_used_blocks = num_convection_blocks ? num_convection_blocks : 1;
176 
177  const std::string kernel_type = "LinearFVVolumetricHeatTransfer";
178  InputParameters params = getFactory().getValidParams(kernel_type);
179  params.set<LinearVariableName>("variable") =
181  params.set<VariableName>(NS::T_fluid) = _fluid_temperature_name;
182  params.set<bool>("is_solid") = false;
183 
184  for (unsigned int block_i = 0; block_i < num_used_blocks; ++block_i)
185  {
186  std::string block_name = "";
187  if (num_convection_blocks)
188  {
189  params.set<std::vector<SubdomainName>>("block") = _ambient_convection_blocks[block_i];
190  block_name = Moose::stringify(_ambient_convection_blocks[block_i]);
191  }
192  else
193  {
194  assignBlocks(params, _blocks);
195  block_name = std::to_string(block_i);
196  }
197 
198  params.set<MooseFunctorName>("h_solid_fluid") = _ambient_convection_alpha[block_i];
199  params.set<VariableName>(NS::T_solid) = _ambient_temperature[block_i];
200 
202  kernel_type, prefix() + "ambient_convection_" + block_name, params);
203  }
204 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
std::vector< MooseFunctorName > _ambient_temperature
Name of the solid domain temperature for each block-group.
static const std::string T_solid
Definition: NS.h:107
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
static const std::string T_fluid
Definition: NS.h:106
std::string stringify(const T &t)
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
std::vector< MooseFunctorName > _ambient_convection_alpha
Name of the ambient convection heat transfer coefficients for each block-group.

◆ addEnergyExternalHeatSource()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyExternalHeatSource ( )
overrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 207 of file WCNSLinearFVFluidHeatTransferPhysics.C.

208 {
209  const std::string kernel_type = "LinearFVSource";
210  InputParameters params = getFactory().getValidParams(kernel_type);
211  params.set<LinearVariableName>("variable") =
213  assignBlocks(params, _blocks);
214  params.set<MooseFunctorName>("source_density") =
215  getParam<MooseFunctorName>("external_heat_source");
216  params.set<MooseFunctorName>("scaling_factor") =
217  std::to_string(getParam<Real>("external_heat_source_coeff"));
218 
219  getProblem().addLinearFVKernel(kernel_type, prefix() + "external_heat_source", params);
220 }
std::string prefix() const
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
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.

◆ addEnergyHeatConductionKernels()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels ( )
overrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 127 of file WCNSLinearFVFluidHeatTransferPhysics.C.

128 {
129  const auto num_blocks = _thermal_conductivity_blocks.size();
130  const auto num_used_blocks = num_blocks ? num_blocks : 1;
131 
132  for (const auto block_i : make_range(num_used_blocks))
133  {
134  std::string block_name = "";
135  if (num_blocks)
136  block_name = Moose::stringify(_thermal_conductivity_blocks[block_i]);
137  else
138  block_name = "all";
139 
140  const std::string kernel_type = "LinearFVDiffusion";
141  InputParameters params = getFactory().getValidParams(kernel_type);
142  if (!_solve_for_enthalpy)
143  {
144  params.set<LinearVariableName>("variable") = _fluid_temperature_name;
145  params.set<MooseFunctorName>("diffusion_coeff") = _thermal_conductivity_name[block_i];
146  }
147  else
148  {
149  params.set<LinearVariableName>("variable") = _fluid_enthalpy_name;
150  params.set<MooseFunctorName>("diffusion_coeff") =
151  _thermal_conductivity_name[block_i] + "_by_cp";
152  }
153  std::vector<SubdomainName> block_names =
154  num_blocks ? _thermal_conductivity_blocks[block_i] : _blocks;
155  assignBlocks(params, block_names);
156  // NOTE: vector conductivities not supported at this time
157  bool has_vector = processThermalConductivity();
158  if (has_vector)
159  paramError("thermal_conductivity",
160  "Vector thermal conductivities not currently supported with the linear finite "
161  "volume discretization");
162 
163  params.set<bool>("use_nonorthogonal_correction") =
164  getParam<bool>("use_nonorthogonal_correction");
165 
167  kernel_type, prefix() + "ins_energy_diffusion_" + block_name, params);
168  }
169 }
std::string prefix() const
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
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
void paramError(const std::string &param, Args... args) const
std::string stringify(const T &t)
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::vector< std::vector< SubdomainName > > _thermal_conductivity_blocks
Vector of subdomain groups where we want to have different thermal conduction.
bool processThermalConductivity()
Process thermal conductivity (multiple functor input options are available).
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.
IntRange< T > make_range(T beg, T end)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.

◆ addEnergyInletBC()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyInletBC ( )
overrideprivatevirtual

Functions adding boundary conditions for the incompressible / weakly compressible energy equation.

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 263 of file WCNSLinearFVFluidHeatTransferPhysics.C.

264 {
265  const auto & inlet_boundaries = _flow_equations_physics->getInletBoundaries();
266  // These are parameter errors for now. If Components add boundaries to Physics, the error
267  // may not be due to parameters anymore.
268  if (inlet_boundaries.size() != _energy_inlet_types.size())
269  paramError("energy_inlet_types",
270  "Energy inlet types (size " + std::to_string(_energy_inlet_types.size()) +
271  ") should be the same size as inlet_boundaries (size " +
272  std::to_string(inlet_boundaries.size()) + ")");
273  if (inlet_boundaries.size() != _energy_inlet_functors.size())
274  paramError("energy_inlet_functors",
275  "Energy inlet functors (size " + std::to_string(_energy_inlet_functors.size()) +
276  ") should be the same size as inlet_boundaries (size " +
277  std::to_string(inlet_boundaries.size()) + ")");
278 
279  for (const auto bc_ind : index_range(_energy_inlet_types))
280  {
281  if (_energy_inlet_types[bc_ind] == "fixed-temperature")
282  {
283  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
284  InputParameters params = getFactory().getValidParams(bc_type);
285  params.set<LinearVariableName>("variable") = _fluid_temperature_name;
286  params.set<MooseFunctorName>("functor") = _energy_inlet_functors[bc_ind];
287  params.set<std::vector<BoundaryName>>("boundary") = {inlet_boundaries[bc_ind]};
288 
290  bc_type, _fluid_temperature_name + "_" + inlet_boundaries[bc_ind], params);
291 
292  // Boundary condition on temperature must be forwarded to enthalpy
294  {
295  params.set<LinearVariableName>("variable") = _fluid_enthalpy_name;
296  params.set<MooseFunctorName>("functor") = "h_from_p_T";
298  bc_type, _fluid_enthalpy_name + "_" + inlet_boundaries[bc_ind], params);
299  }
300  }
301  else if (_energy_inlet_types[bc_ind] == "heatflux")
302  paramError("energy_inlet_types", "Heat flux inlet boundary conditions not yet supported");
303  else if (_energy_inlet_types[bc_ind] == "flux-mass" ||
304  _energy_inlet_types[bc_ind] == "flux-velocity")
305  paramError("energy_inlet_types", "Flux inlet boundary conditions not yet supported");
306  }
307 }
Factory & getFactory()
const std::vector< BoundaryName > & getInletBoundaries() const
Get the inlet boundaries.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
unsigned int size() const
VariableName _fluid_temperature_name
Fluid temperature name.
MultiMooseEnum _energy_inlet_types
Energy inlet boundary types.
virtual FEProblemBase & getProblem()
void paramError(const std::string &param, Args... args) const
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
std::vector< MooseFunctorName > _energy_inlet_functors
Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually ...
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
auto index_range(const T &sizable)

◆ addEnergyOutletBC()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyOutletBC ( )
overrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 390 of file WCNSLinearFVFluidHeatTransferPhysics.C.

391 {
392  const auto & outlet_boundaries = _flow_equations_physics->getOutletBoundaries();
393  if (outlet_boundaries.empty())
394  return;
395 
396  for (const auto & outlet_bdy : outlet_boundaries)
397  {
398  const std::string bc_type = "LinearFVAdvectionDiffusionOutflowBC";
400  InputParameters params = getFactory().getValidParams(bc_type);
401  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
402  params.set<bool>("use_two_term_expansion") = getParam<bool>("energy_two_term_bc_expansion");
403 
404  params.set<LinearVariableName>("variable") = variable_name;
405  getProblem().addLinearFVBC(bc_type, variable_name + "_" + outlet_bdy, params);
406  }
407 }
Factory & getFactory()
const std::vector< BoundaryName > & getOutletBoundaries() const
Get the outlet boundaries.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
VariableName _fluid_temperature_name
Fluid temperature name.
virtual FEProblemBase & getProblem()
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.

◆ addEnergySeparatorBC()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergySeparatorBC ( )
inlineoverrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 45 of file WCNSLinearFVFluidHeatTransferPhysics.h.

45 {}

◆ addEnergyTimeKernels()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyTimeKernels ( )
overrideprivatevirtual

Functions adding kernels for the incompressible / weakly compressible energy equation.

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 84 of file WCNSLinearFVFluidHeatTransferPhysics.C.

85 {
86  std::string kernel_type = "LinearFVTimeDerivative";
87  std::string kernel_name = prefix() + "ins_energy_time";
88 
89  InputParameters params = getFactory().getValidParams(kernel_type);
90  params.set<LinearVariableName>("variable") =
92  assignBlocks(params, _blocks);
94  params.set<MooseFunctorName>("factor") = "rho_cp";
95  else
96  params.set<MooseFunctorName>("factor") = _density_name;
97 
98  getProblem().addLinearFVKernel(kernel_type, kernel_name, params);
99 }
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()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addLinearFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.

◆ addEnergyWallBC()

void WCNSLinearFVFluidHeatTransferPhysics::addEnergyWallBC ( )
overrideprivatevirtual

Implements WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 310 of file WCNSLinearFVFluidHeatTransferPhysics.C.

311 {
312  const auto & wall_boundaries = isParamSetByUser("energy_wall_boundaries")
313  ? getParam<std::vector<BoundaryName>>("energy_wall_boundaries")
315  if (wall_boundaries.size() != _energy_wall_types.size())
316  paramError("energy_wall_types",
317  "Energy wall types (size " + std::to_string(_energy_wall_types.size()) +
318  ") should be the same size as wall_boundaries (size " +
319  std::to_string(wall_boundaries.size()) + ")");
320  if (wall_boundaries.size() != _energy_wall_functors.size())
321  paramError("energy_wall_functors",
322  "Energy wall functors (size " + std::to_string(_energy_wall_functors.size()) +
323  ") should be the same size as wall_boundaries (size " +
324  std::to_string(wall_boundaries.size()) + ")");
325 
326  for (unsigned int bc_ind = 0; bc_ind < _energy_wall_types.size(); ++bc_ind)
327  {
328  if (_energy_wall_types[bc_ind] == "fixed-temperature")
329  {
330  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorDirichletBC";
331  InputParameters params = getFactory().getValidParams(bc_type);
332  params.set<LinearVariableName>("variable") = _fluid_temperature_name;
333  params.set<MooseFunctorName>("functor") = _energy_wall_functors[bc_ind];
334  params.set<std::vector<BoundaryName>>("boundary") = {wall_boundaries[bc_ind]};
335 
337  bc_type, _fluid_temperature_name + "_" + wall_boundaries[bc_ind], params);
338 
339  // Boundary condition on temperature must be forwarded to enthalpy
341  {
342  params.set<LinearVariableName>("variable") = _fluid_enthalpy_name;
343  params.set<MooseFunctorName>("functor") = "h_from_p_T";
345  bc_type, _fluid_enthalpy_name + "_" + wall_boundaries[bc_ind], params);
346  }
347  }
348  else if (_energy_wall_types[bc_ind] == "heatflux")
349  {
350  const std::string bc_type = "LinearFVAdvectionDiffusionFunctorNeumannBC";
351  InputParameters params = getFactory().getValidParams(bc_type);
353  params.set<LinearVariableName>("variable") = var_name;
354  params.set<MooseFunctorName>("functor") = _energy_wall_functors[bc_ind];
355  params.set<std::vector<BoundaryName>>("boundary") = {wall_boundaries[bc_ind]};
356 
358  bc_type, var_name + "_heatflux_" + wall_boundaries[bc_ind], params);
359  }
360  else if (_energy_wall_types[bc_ind] == "convection")
361  {
362  const std::string bc_type = "LinearFVConvectiveHeatTransferBC";
363  InputParameters params = getFactory().getValidParams(bc_type);
364  params.set<LinearVariableName>("variable") =
366  params.set<MooseFunctorName>(NS::T_fluid) = _fluid_temperature_name;
367  const auto Tinf_htc_functors =
368  MooseUtils::split(_energy_wall_functors[bc_ind], /*delimiter=*/":", /*max_count=*/1);
369  if (Tinf_htc_functors.size() != 2)
370  paramError("energy_wall_functors",
371  "'convection' wall types require two functors specified as "
372  "<Tinf_functor>:<htc_functor>.");
373  params.set<MooseFunctorName>(NS::T_solid) = Tinf_htc_functors[0];
374  params.set<MooseFunctorName>("h") = Tinf_htc_functors[1];
375  params.set<std::vector<BoundaryName>>("boundary") = {wall_boundaries[bc_ind]};
376 
378  bc_type,
380  wall_boundaries[bc_ind],
381  params);
382  }
383  else
384  paramError(
385  "energy_wall_types", _energy_wall_types[bc_ind], " wall type is currently unsupported.");
386  }
387 }
Factory & getFactory()
static const std::string T_solid
Definition: NS.h:107
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
unsigned int size() const
VariableName _fluid_temperature_name
Fluid temperature name.
MultiMooseEnum _energy_wall_types
Energy wall boundary types.
std::vector< MooseFunctorName > _energy_wall_functors
Functors describing the wall boundary values. See energy_wall_types for what the functors actually re...
std::vector< std::string > split(const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max())
virtual FEProblemBase & getProblem()
static const std::string T_fluid
Definition: NS.h:106
void paramError(const std::string &param, Args... args) const
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
bool isParamSetByUser(const std::string &nm) const
virtual void addLinearFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
const WCNSFVFlowPhysicsBase * _flow_equations_physics
Flow physics.
const std::vector< BoundaryName > & getWallBoundaries() const
Get the wall boundaries.

◆ addFVBCs()

void WCNSFVFluidHeatTransferPhysicsBase::addFVBCs ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 146 of file WCNSFVFluidHeatTransferPhysicsBase.C.

147 {
148  // For compatibility with Modules/NavierStokesFV syntax
150  return;
151 
153  addEnergyWallBC();
156 }
const bool _has_energy_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax.
virtual void addEnergyInletBC()=0
Functions adding boundary conditions for the fluid heat transfer equation.

◆ addFVKernels()

void WCNSFVFluidHeatTransferPhysicsBase::addFVKernels ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 125 of file WCNSFVFluidHeatTransferPhysicsBase.C.

126 {
127  // For compatibility with Modules/NavierStokesFV syntax
129  return;
130 
133  _blocks,
134  /*error if already defined*/ false))
136 
139  if (getParam<std::vector<MooseFunctorName>>("ambient_temperature").size())
141  if (isParamValid("external_heat_source"))
143 }
virtual void addEnergyExternalHeatSource()=0
virtual void addEnergyTimeKernels()=0
Functions adding kernels for the incompressible / weakly compressible energy equation.
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
virtual void addEnergyAmbientConvection()=0
bool isParamValid(const std::string &name) const
virtual void addEnergyAdvectionKernels()=0
const T & getParam(const std::string &name) const
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
const bool _has_energy_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax.
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
virtual void addEnergyHeatConductionKernels()=0

◆ addInitialConditions()

void WCNSFVFluidHeatTransferPhysicsBase::addInitialConditions ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 212 of file WCNSFVFluidHeatTransferPhysicsBase.C.

213 {
214  // For compatibility with Modules/NavierStokesFV syntax
216  return;
217  if (!_define_variables && parameters().isParamSetByUser("initial_temperature"))
218  paramError(
219  "initial_temperature",
220  "T_fluid is defined externally of WCNSFVFluidHeatTransferPhysicsBase, so should the inital "
221  "condition");
222  // do not set initial conditions if we are not defining variables
223  if (!_define_variables)
224  return;
225 
226  InputParameters params = getFactory().getValidParams("FunctionIC");
227  assignBlocks(params, _blocks);
228 
230  _blocks,
231  /*whether IC is a default*/ !isParamSetByUser("initial_temperature"),
232  /*error if already an IC*/ isParamSetByUser("initial_temperature")))
233  {
234  params.set<VariableName>("variable") = _fluid_temperature_name;
235  params.set<FunctionName>("function") = getParam<FunctionName>("initial_temperature");
236 
237  getProblem().addInitialCondition("FunctionIC", _fluid_temperature_name + "_ic", params);
238  }
239  if (parameters().isParamValid("initial_enthalpy") &&
241  _blocks,
242  /*whether IC is a default*/ false,
243  /*error if already an IC*/ true))
244  {
245  params.set<VariableName>("variable") = _fluid_enthalpy_name;
246  params.set<FunctionName>("function") = getParam<FunctionName>("initial_enthalpy");
247 
248  getProblem().addInitialCondition("FunctionIC", _fluid_enthalpy_name + "_ic", params);
249  }
250 }
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
bool shouldCreateIC(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
bool isParamValid(const std::string &name) const
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
virtual FEProblemBase & getProblem()
void paramError(const std::string &param, Args... args) const
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
const bool _has_energy_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax.
bool _define_variables
Whether to define variables if they do not exist.
bool isParamSetByUser(const std::string &nm) const
const InputParameters & parameters() const

◆ addMaterials()

void WCNSLinearFVFluidHeatTransferPhysics::addMaterials ( )
overrideprivatevirtual

Reimplemented from WCNSFVFluidHeatTransferPhysicsBase.

Definition at line 410 of file WCNSLinearFVFluidHeatTransferPhysics.C.

411 {
413 
415  {
416  // Define alpha, the diffusion coefficient when solving for enthalpy, on each block
417  for (unsigned int i = 0; i < _thermal_conductivity_name.size(); ++i)
418  {
419  const auto object_type = "ADParsedFunctorMaterial";
420  InputParameters params = getFactory().getValidParams(object_type);
421  assignBlocks(params, _blocks);
422  std::vector<std::string> f_names;
424  f_names.push_back(_thermal_conductivity_name[i]);
426  f_names.push_back(getSpecificHeatName());
427  params.set<std::vector<std::string>>("functor_names") = f_names;
428  params.set<std::string>("expression") =
430  params.set<std::string>("property_name") = _thermal_conductivity_name[i] + "_by_cp";
432  object_type, prefix() + "alpha_from_" + _thermal_conductivity_name[i], params);
433  }
434  }
435 }
std::string prefix() const
bool parsesToReal(const std::string &input)
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
virtual void addMaterial(const std::string &material_name, const std::string &name, InputParameters &parameters)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const MooseFunctorName & getSpecificHeatName() const
Get the name of the specific heat material property.
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.

◆ addSolverVariables()

void WCNSLinearFVFluidHeatTransferPhysics::addSolverVariables ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 58 of file WCNSLinearFVFluidHeatTransferPhysics.C.

59 {
60  // For compatibility with Modules/NavierStokesFV syntax
62  return;
63 
65 
66  // Dont add if the user already defined the variable
67  if (!shouldCreateVariable(variable_name, _blocks, /*error if aux*/ true))
68  reportPotentiallyMissedParameters({"system_names"}, "MooseLinearVariableFVReal");
69  else if (_define_variables)
70  {
71  const auto var_type = "MooseLinearVariableFVReal";
72  auto params = getFactory().getValidParams(var_type);
73  assignBlocks(params, _blocks);
74  params.set<SolverSystemName>("solver_sys") = getSolverSystem(variable_name);
75  getProblem().addVariable(var_type, variable_name, params);
76  }
77  else
78  paramError(_solve_for_enthalpy ? "solve_for_enthalpy" : "fluid_temperature_variable",
79  "Variable (" + variable_name +
80  ") supplied to the WCNSLinearFVFluidHeatTransferPhysics does not exist!");
81 }
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
VariableName _fluid_temperature_name
Fluid temperature name.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
void paramError(const std::string &param, Args... args) const
const VariableName _fluid_enthalpy_name
Name of the fluid specific enthalpy.
virtual void addVariable(const std::string &var_type, const std::string &var_name, InputParameters &params)
const bool _has_energy_equation
A boolean to help compatibility with the old Modules/NavierStokesFV syntax.
bool _define_variables
Whether to define variables if they do not exist.
const bool _solve_for_enthalpy
User-selected option to solve for enthalpy.
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type) const

◆ 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.

◆ getAmbientConvectionBlocks()

const std::vector<std::vector<SubdomainName> >& WCNSFVFluidHeatTransferPhysicsBase::getAmbientConvectionBlocks ( ) const
inlineinherited

Get the ambient convection parameters for parameter checking.

Definition at line 47 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by PNSFVSolidHeatTransferPhysics::checkFluidAndSolidHeatTransferPhysicsParameters().

48  {
50  }
std::vector< std::vector< SubdomainName > > _ambient_convection_blocks
Vector of subdomain groups where we want to have different ambient convection.

◆ getAmbientConvectionHTCs()

const std::vector<MooseFunctorName>& WCNSFVFluidHeatTransferPhysicsBase::getAmbientConvectionHTCs ( ) const
inlineinherited

Name of the ambient convection heat transfer coefficients for each block-group.

Definition at line 52 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by PNSFVSolidHeatTransferPhysics::checkFluidAndSolidHeatTransferPhysicsParameters().

53  {
55  }
std::vector< MooseFunctorName > _ambient_convection_alpha
Name of the ambient convection heat transfer coefficients for each block-group.

◆ 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 }
void mooseError(Args &&... args)
const T * getCoupledPhysics(const PhysicsName &phys_name, const bool allow_fail=false) const
bool isParamValid(const std::string &name) const
Base class for Physics which create the Navier Stokes flow equations.
const T & getParam(const std::string &name) const
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
const NavierStokesPhysicsBase * _advection_physics
The Physics class using this helper.

◆ getCoupledTurbulencePhysics()

const WCNSFVTurbulencePhysics * WCNSFVCoupledAdvectionPhysicsHelper::getCoupledTurbulencePhysics ( ) const
inherited

Definition at line 77 of file WCNSFVCoupledAdvectionPhysicsHelper.C.

Referenced by 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 }
Creates all the objects needed to add a turbulence model to an incompressible / weakly-compressible N...
const T * getCoupledPhysics(const PhysicsName &phys_name, const bool allow_fail=false) const
bool isParamValid(const std::string &name) const
const T & getParam(const std::string &name) const
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
const NavierStokesPhysicsBase * _advection_physics
The Physics class using this helper.

◆ getFluidTemperatureName()

const VariableName& WCNSFVFluidHeatTransferPhysicsBase::getFluidTemperatureName ( ) const
inlineinherited

Get the name of the fluid temperature variable.

Definition at line 36 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addPhaseChangeEnergySource().

36 { return _fluid_temperature_name; }
VariableName _fluid_temperature_name
Fluid temperature name.

◆ getNumberAlgebraicGhostingLayersNeeded()

unsigned short WCNSFVFluidHeatTransferPhysicsBase::getNumberAlgebraicGhostingLayersNeeded ( ) const
overrideprotectedvirtualinherited

Return the number of ghosting layers needed.

Implements NavierStokesPhysicsBase.

Definition at line 296 of file WCNSFVFluidHeatTransferPhysicsBase.C.

297 {
298  unsigned short necessary_layers = getParam<unsigned short>("ghost_layers");
299  necessary_layers =
301  if (getParam<MooseEnum>("energy_face_interpolation") == "skewness-corrected")
302  necessary_layers = std::max(necessary_layers, (unsigned short)3);
303 
304  return necessary_layers;
305 }
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
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.

◆ getSpecificEnthalpyName()

MooseFunctorName WCNSFVFluidHeatTransferPhysicsBase::getSpecificEnthalpyName ( ) const
inlineinherited

Definition at line 40 of file WCNSFVFluidHeatTransferPhysicsBase.h.

40 { return NS::specific_enthalpy; }
static const std::string specific_enthalpy
Definition: NS.h:68

◆ getSpecificHeatName()

const MooseFunctorName& WCNSFVFluidHeatTransferPhysicsBase::getSpecificHeatName ( ) const
inlineinherited

◆ getThermalConductivityName()

const std::vector<MooseFunctorName>& WCNSFVFluidHeatTransferPhysicsBase::getThermalConductivityName ( ) const
inlineinherited

Definition at line 41 of file WCNSFVFluidHeatTransferPhysicsBase.h.

42  {
44  }
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.

◆ hasEnergyEquation()

bool WCNSFVFluidHeatTransferPhysicsBase::hasEnergyEquation ( ) const
inlineinherited

◆ processThermalConductivity()

bool WCNSFVFluidHeatTransferPhysicsBase::processThermalConductivity ( )
protectedinherited

Process thermal conductivity (multiple functor input options are available).

Return true if we have vector thermal conductivity and false if scalar

Definition at line 167 of file WCNSFVFluidHeatTransferPhysicsBase.C.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels(), and addEnergyHeatConductionKernels().

168 {
169  checkBlockwiseConsistency<MooseFunctorName>("thermal_conductivity_blocks",
170  {"thermal_conductivity"});
171  bool have_scalar = false;
172  bool have_vector = false;
173 
174  for (unsigned int i = 0; i < _thermal_conductivity_name.size(); ++i)
175  {
176  // First, check if the name is just a number (only in case of isotropic conduction)
178  have_scalar = true;
179  // Now we determine what kind of functor we are dealing with
180  else
181  {
183  /*thread_id=*/0) ||
185  /*thread_id=*/0))
186  have_scalar = true;
187  else
188  {
190  /*thread_id=*/0))
191  have_vector = true;
192  else
193  paramError("thermal_conductivity",
194  "We only allow functor of type Real/ADReal or ADRealVectorValue for thermal "
195  "conductivity! Functor '" +
196  _thermal_conductivity_name[i] + "' is not of the requested type.");
197  }
198  }
199  }
200 
201  if (have_vector && !_porous_medium_treatment)
202  paramError("thermal_conductivity", "Cannot use anisotropic diffusion with non-porous flows!");
203 
204  if (have_vector == have_scalar)
205  paramError("thermal_conductivity",
206  "The entries on thermal conductivity shall either be scalars of vectors, mixing "
207  "them is not supported!");
208  return have_vector;
209 }
bool parsesToReal(const std::string &input)
DualNumber< Real, DNDerivativeType, true > ADReal
virtual FEProblemBase & getProblem()
bool hasFunctorWithType(const std::string &name, const THREAD_ID tid) const
const bool _porous_medium_treatment
Switch to show if porous medium treatment is requested or not.
void paramError(const std::string &param, Args... args) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< MooseFunctorName > _thermal_conductivity_name
Name of the thermal conductivity functor for each block-group.

◆ 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 WCNSLinearFVFluidHeatTransferPhysics::validParams ( )
static

Definition at line 22 of file WCNSLinearFVFluidHeatTransferPhysics.C.

23 {
25  params.addParam<bool>(
26  "use_nonorthogonal_correction",
27  true,
28  "Whether to use a non-orthogonal correction. This can potentially slow down convergence "
29  ", but reduces numerical dispersion on non-orthogonal meshes. Can be safely turned off on "
30  "orthogonal meshes.");
31  params.set<std::vector<SolverSystemName>>("system_names") = {"energy_system"};
32 
33  params.addParam<UserObjectName>(NS::fluid, "Fluid properties userobject");
34  params.addParamNamesToGroup(NS::fluid, "Material properties");
35 
36  // We could split between discretization and solver here.
37  params.addParamNamesToGroup("use_nonorthogonal_correction system_names", "Numerical scheme");
38 
39  // Not implemented
40  params.suppressParameter<bool>("effective_conductivity");
41  // Not needed
42  params.suppressParameter<bool>("add_energy_equation");
43  params.suppressParameter<MooseEnum>("preconditioning");
44 
45  return params;
46 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
static const std::string fluid
Definition: NS.h:87
void suppressParameter(const std::string &name)
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)

Member Data Documentation

◆ _advection_physics

const NavierStokesPhysicsBase* WCNSFVCoupledAdvectionPhysicsHelper::_advection_physics
protectedinherited

◆ _ambient_convection_alpha

std::vector<MooseFunctorName> WCNSFVFluidHeatTransferPhysicsBase::_ambient_convection_alpha
protectedinherited

Name of the ambient convection heat transfer coefficients for each block-group.

Definition at line 106 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyAmbientConvection(), addEnergyAmbientConvection(), and WCNSFVFluidHeatTransferPhysicsBase::getAmbientConvectionHTCs().

◆ _ambient_convection_blocks

std::vector<std::vector<SubdomainName> > WCNSFVFluidHeatTransferPhysicsBase::_ambient_convection_blocks
protectedinherited

Vector of subdomain groups where we want to have different ambient convection.

Definition at line 104 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyAmbientConvection(), addEnergyAmbientConvection(), and WCNSFVFluidHeatTransferPhysicsBase::getAmbientConvectionBlocks().

◆ _ambient_temperature

std::vector<MooseFunctorName> WCNSFVFluidHeatTransferPhysicsBase::_ambient_temperature
protectedinherited

Name of the solid domain temperature for each block-group.

Definition at line 108 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyAmbientConvection(), and addEnergyAmbientConvection().

◆ _compressibility

const MooseEnum WCNSFVCoupledAdvectionPhysicsHelper::_compressibility
protectedinherited

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

Definition at line 48 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

◆ _energy_inlet_functors

std::vector<MooseFunctorName> WCNSFVFluidHeatTransferPhysicsBase::_energy_inlet_functors
protectedinherited

Functors describing the inlet boundary values. See energy_inlet_types for what the functors actually represent.

Definition at line 113 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyInletBC(), and addEnergyInletBC().

◆ _energy_inlet_types

MultiMooseEnum WCNSFVFluidHeatTransferPhysicsBase::_energy_inlet_types
protectedinherited

Energy inlet boundary types.

Definition at line 111 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyInletBC(), and addEnergyInletBC().

◆ _energy_wall_functors

std::vector<MooseFunctorName> WCNSFVFluidHeatTransferPhysicsBase::_energy_wall_functors
protectedinherited

Functors describing the wall boundary values. See energy_wall_types for what the functors actually represent.

Definition at line 117 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyWallBC(), and addEnergyWallBC().

◆ _energy_wall_types

MultiMooseEnum WCNSFVFluidHeatTransferPhysicsBase::_energy_wall_types
protectedinherited

Energy wall boundary types.

Definition at line 115 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyWallBC(), and addEnergyWallBC().

◆ _flow_equations_physics

const WCNSFVFlowPhysicsBase* WCNSFVCoupledAdvectionPhysicsHelper::_flow_equations_physics
protectedinherited

Flow physics.

Definition at line 43 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

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

◆ _fluid_enthalpy_name

const VariableName WCNSFVFluidHeatTransferPhysicsBase::_fluid_enthalpy_name
protectedinherited

◆ _fluid_temperature_name

VariableName WCNSFVFluidHeatTransferPhysicsBase::_fluid_temperature_name
protectedinherited

◆ _has_energy_equation

const bool WCNSFVFluidHeatTransferPhysicsBase::_has_energy_equation
protectedinherited

◆ _porous_medium_treatment

const bool WCNSFVCoupledAdvectionPhysicsHelper::_porous_medium_treatment
protectedinherited

◆ _pressure_name

const NonlinearVariableName WCNSFVCoupledAdvectionPhysicsHelper::_pressure_name
protectedinherited

Pressure name.

Definition at line 56 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

◆ _solve_for_enthalpy

const bool WCNSFVFluidHeatTransferPhysicsBase::_solve_for_enthalpy
protectedinherited

◆ _specific_heat_name

MooseFunctorName WCNSFVFluidHeatTransferPhysicsBase::_specific_heat_name
protectedinherited

◆ _thermal_conductivity_blocks

std::vector<std::vector<SubdomainName> > WCNSFVFluidHeatTransferPhysicsBase::_thermal_conductivity_blocks
protectedinherited

Vector of subdomain groups where we want to have different thermal conduction.

Definition at line 99 of file WCNSFVFluidHeatTransferPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels(), and addEnergyHeatConductionKernels().

◆ _thermal_conductivity_name

std::vector<MooseFunctorName> WCNSFVFluidHeatTransferPhysicsBase::_thermal_conductivity_name
protectedinherited

◆ _turbulence_physics

const WCNSFVTurbulencePhysics* WCNSFVCoupledAdvectionPhysicsHelper::_turbulence_physics
protectedinherited

◆ _velocity_interpolation

const MooseEnum WCNSFVCoupledAdvectionPhysicsHelper::_velocity_interpolation
protectedinherited

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

Definition at line 64 of file WCNSFVCoupledAdvectionPhysicsHelper.h.

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

◆ _velocity_names

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

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