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
WCNSFVFlowPhysics Class Referencefinal

Creates all the objects needed to solve the Navier Stokes mass and momentum equations. More...

#include <WCNSFVFlowPhysics.h>

Inheritance diagram for WCNSFVFlowPhysics:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 WCNSFVFlowPhysics (const InputParameters &parameters)
 
virtual MooseFunctorName getLinearFrictionCoefName () const override
 Get the name of the linear friction coefficient. Returns an empty string if no friction. More...
 
UserObjectName rhieChowUOName () const override
 Return the name of the Rhie Chow user object. More...
 
unsigned short getNumberAlgebraicGhostingLayersNeeded () const override
 Return the number of algebraic ghosting layers needed. More...
 
bool hasFlowEquations () const
 Whether the physics is actually creating the flow equations. More...
 
const std::vector< std::string > & getVelocityNames () const
 To interface with other Physics. More...
 
const NonlinearVariableName & getPressureName () const
 
const NonlinearVariableName & getFluidTemperatureName () const
 
MooseFunctorName getPorosityFunctorName (const bool smoothed) const
 
const MooseEnumcompressibility () const
 Return the compressibility of the flow equations selected. More...
 
bool porousMediumTreatment () const
 Return whether a porous medium treatment is applied. More...
 
RealVectorValue gravityVector () const
 Return the gravity vector. More...
 
const MooseFunctorName & densityName () const
 Return the name of the density functor. More...
 
const MooseFunctorName & dynamicViscosityName () const
 Return the name of the dynamic viscosity functor. More...
 
const MooseEnumgetVelocityFaceInterpolationMethod () const
 Get the face interpolation method for velocity. More...
 
const MooseEnumgetMomentumAdvectionFaceInterpolationMethod () const
 Get the face interpolation method for momentum in the advection term. More...
 
const MooseEnumgetMomentumFaceInterpolationMethod () const
 Get the face interpolation method for momentum (mostly used in the stress terms) More...
 
const std::vector< BoundaryName > & getInletBoundaries () const
 Get the inlet boundaries. More...
 
const std::vector< BoundaryName > & getOutletBoundaries () const
 Get the outlet boundaries. More...
 
const std::vector< BoundaryName > & getWallBoundaries () const
 Get the wall boundaries. More...
 
const std::vector< BoundaryName > & getHydraulicSeparators () const
 Get the hydraulic separator boundaries. More...
 
const std::vector< Point > & getFluxInletDirections () const
 Get the inlet direction if using a flux inlet. More...
 
const std::vector< PostprocessorName > & getFluxInletPPs () const
 Get the inlet flux postprocessor if using a flux inlet. 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
 

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

virtual void initializePhysicsAdditional () override
 
virtual void actOnAdditionalTasks () override
 
virtual void addInitialConditions () override
 
virtual void addFVBCs () override
 
virtual void addMaterials () override
 
virtual void addPostprocessors () override
 
void addPorousMediumSpeedMaterial ()
 Add material to define the local speed in porous medium flows. More...
 
void addNonPorousMediumSpeedMaterial ()
 Add material to define the local speed with no porous medium treatment. More...
 
VariableName getFlowVariableName (const std::string &default_name) const
 Convenience routine to be able to retrieve the actual variable names from their default names. More...
 
bool hasTurbulencePhysics () const
 Whether a turbulence Physics has been coupled in, to know which viscosity to pick on symmetry boundary conditions. More...
 
const WCNSFVTurbulencePhysicsgetCoupledTurbulencePhysics () const
 Find the turbulence physics. 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 TagName _pressure_tag = "p_tag"
 Name of the vector to hold pressure momentum equation contributions. More...
 
const bool _has_flow_equations
 Boolean to keep track of whether the flow equations should be created. More...
 
const MooseEnum _compressibility
 Compressibility type, can be compressible, incompressible or weakly-compressible. More...
 
const bool _solve_for_dynamic_pressure
 Whether we are solving for the total or dynamic pressure. More...
 
const bool _porous_medium_treatment
 Whether to use the porous medium treatment. More...
 
const MooseFunctorName _porosity_name
 Name of the porosity functor. More...
 
MooseFunctorName _flow_porosity_functor_name
 Name of the porosity functor for the flow equations (if smoothed) More...
 
const std::vector< std::string > _velocity_names
 Velocity names. More...
 
const NonlinearVariableName _pressure_name
 Pressure name. More...
 
const NonlinearVariableName _fluid_temperature_name
 Fluid temperature name. More...
 
const MooseFunctorName _density_name
 Name of the density material property. More...
 
const MooseFunctorName _density_gravity_name
 Name of the density material property used for gravity and Boussinesq terms. More...
 
const MooseFunctorName _dynamic_viscosity_name
 Name of the dynamic viscosity material property. More...
 
const MooseEnum _velocity_interpolation
 The velocity face interpolation method for advecting other quantities. More...
 
const MooseEnum _momentum_advection_interpolation
 The momentum face interpolation method for being advected. More...
 
const MooseEnum _momentum_face_interpolation
 The momentum face interpolation method for stress terms. More...
 
const WCNSFVTurbulencePhysics_turbulence_physics
 Can be set to a coupled turbulence physics. More...
 
std::vector< std::vector< SubdomainName > > _friction_blocks
 Subdomains where we want to have volumetric friction. More...
 
std::vector< std::vector< std::string > > _friction_types
 The friction correlation types used for each block. More...
 
std::vector< std::vector< std::string > > _friction_coeffs
 The coefficients used for each item if friction type. More...
 
const std::vector< BoundaryName > _inlet_boundaries
 Boundaries with a flow inlet specified on them. More...
 
const std::vector< BoundaryName > _outlet_boundaries
 Boundaries with a flow outlet specified on them. More...
 
const std::vector< BoundaryName > _wall_boundaries
 Boundaries which define a wall (slip/noslip/etc.) More...
 
const std::vector< BoundaryName > _hydraulic_separators
 Hydraulic separator boundaries. More...
 
std::map< BoundaryName, MooseEnum_momentum_inlet_types
 Momentum inlet boundary types. More...
 
std::map< BoundaryName, MooseEnum_momentum_outlet_types
 Momentum outlet boundary types. More...
 
std::map< BoundaryName, MooseEnum_momentum_wall_types
 Momentum wall boundary types. More...
 
std::vector< PostprocessorName > _flux_inlet_pps
 Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux boundaries. More...
 
std::vector< Point > _flux_inlet_directions
 Direction of each flux inlet. Indexing based on the number of flux boundaries. More...
 
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
 Functors describing the momentum inlet for each boundary. More...
 
std::map< BoundaryName, MooseFunctorName > _pressure_functors
 Functors describing the outlet pressure on each boundary. More...
 
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
 Functors describing the momentum for each wall boundary. 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
 

Private Member Functions

virtual void addSolverVariables () override
 
virtual void addFVKernels () override
 
virtual void addUserObjects () override
 
virtual void addCorrectors () override
 
void addMassTimeKernels ()
 Function adding kernels for the time derivative term of the weakly compressible continuity equation. More...
 
void addMassKernels ()
 Function adding kernels for the incompressible continuity equation. More...
 
void addPressurePinKernel ()
 Function adding the pressure constraint. More...
 
void addMomentumTimeKernels () override
 Functions adding kernels for the incompressible momentum equation If the material properties are not constant, these can be used for weakly-compressible simulations (except the Boussinesq kernel) as well. More...
 
void addMomentumViscousDissipationKernels ()
 
void addMomentumMixingLengthKernels ()
 
void addMomentumAdvectionKernels ()
 
void addMomentumPressureKernels () override
 
void addMomentumGravityKernels () override
 
void addMomentumBoussinesqKernels () override
 
void addMomentumFrictionKernels () override
 
void addInletBC () override
 Functions adding boundary conditions for the incompressible simulation. More...
 
void addOutletBC () override
 
void addWallsBC () override
 
void addSeparatorBC () override
 
bool hasForchheimerFriction () const override
 Return whether a Forchheimer friction model is in use. More...
 
void addRhieChowUserObjects () override
 Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations. More...
 
void checkRhieChowFunctorsDefined () const
 Checks that sufficient Rhie Chow coefficients have been defined for the given dimension, used for scalar or temperature advection by auxiliary variables. More...
 

Private Attributes

const unsigned _porosity_smoothing_layers
 The number of smoothing layers if that treatment is used on porosity. More...
 
UserObjectName _rc_uo_name
 Name of the user object in charge of computing the Rhie Chow coefficients. More...
 

Detailed Description

Creates all the objects needed to solve the Navier Stokes mass and momentum equations.

Definition at line 18 of file WCNSFVFlowPhysics.h.

Constructor & Destructor Documentation

◆ WCNSFVFlowPhysics()

WCNSFVFlowPhysics::WCNSFVFlowPhysics ( const InputParameters parameters)

Definition at line 90 of file WCNSFVFlowPhysics.C.

92  _porosity_smoothing_layers(isParamValid("porosity_smoothing_layers")
93  ? getParam<unsigned short>("porosity_smoothing_layers")
94  : 0)
95 {
96  _flow_porosity_functor_name = isParamValid("porosity_smoothing_layers") &&
97  getParam<unsigned short>("porosity_smoothing_layers")
100 
101  // Most likely to be a mistake
102  if (getParam<bool>("pin_pressure") &&
103  getParam<std::vector<MooseFunctorName>>("pressure_functors").size())
104  paramError("pin_pressure", "Cannot pin the pressure if a pressure boundary exists");
105 
106  // Pressure pin checks
107  checkSecondParamSetOnlyIfFirstOneTrue("pin_pressure", "pinned_pressure_type");
108  checkSecondParamSetOnlyIfFirstOneTrue("pin_pressure", "pinned_pressure_value");
109  if (getParam<bool>("pin_pressure"))
110  {
111  if ((std::string(getParam<MooseEnum>("pinned_pressure_type")).find("point") !=
112  std::string::npos) &&
113  !isParamSetByUser("pinned_pressure_point"))
114  paramError("pinned_pressure_point",
115  "This parameter must be set to specify the pinned pressure point");
116  else if ((std::string(getParam<MooseEnum>("pinned_pressure_type")).find("point") ==
117  std::string::npos) &&
118  isParamSetByUser("pinned_pressure_point"))
119  paramError("pinned_pressure_point",
120  "This parameter should not be given by the user with the corresponding "
121  "pinned_pressure_type setting: " +
122  std::string(getParam<MooseEnum>("pinned_pressure_type")) + ".");
123  }
124 
125  // Porosity correction checks
126  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment", "use_friction_correction");
127  checkSecondParamSetOnlyIfFirstOneTrue("use_friction_correction", "consistent_scaling");
128  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment",
129  "porosity_interface_pressure_treatment");
130  if (getParam<MooseEnum>("porosity_interface_pressure_treatment") != "bernoulli")
131  errorDependentParameter("porosity_interface_pressure_treatment",
132  "bernoulli",
133  {"pressure_allow_expansion_on_bernoulli_faces",
134  "pressure_drop_sidesets",
135  "pressure_drop_form_factors"});
136 
137  // Porous media parameters
138  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment", "porosity_smoothing_layers");
139 }
static const std::string smoothed_porosity
Definition: NS.h:105
const unsigned _porosity_smoothing_layers
The number of smoothing layers if that treatment is used on porosity.
const MooseFunctorName _porosity_name
Name of the porosity functor.
void errorDependentParameter(const std::string &param1, const std::string &value_not_set, const std::vector< std::string > &dependent_params) const
bool isParamValid(const std::string &name) const
void paramError(const std::string &param, Args... args) const
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
bool isParamSetByUser(const std::string &nm) const
const InputParameters & parameters() const
WCNSFVFlowPhysicsBase(const InputParameters &parameters)
void checkSecondParamSetOnlyIfFirstOneTrue(const std::string &param1, const std::string &param2) const

Member Function Documentation

◆ actOnAdditionalTasks()

void WCNSFVFlowPhysicsBase::actOnAdditionalTasks ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 252 of file WCNSFVFlowPhysicsBase.C.

253 {
254  // Turbulence physics would not be initialized before this task
255  if (_current_task == "get_turbulence_physics")
257 }
const WCNSFVTurbulencePhysics * _turbulence_physics
Can be set to a coupled turbulence physics.
const std::string & _current_task
const WCNSFVTurbulencePhysics * getCoupledTurbulencePhysics() const
Find the turbulence physics.

◆ addCorrectors()

void WCNSFVFlowPhysics::addCorrectors ( )
overrideprivatevirtual

Reimplemented from PhysicsBase.

Definition at line 1041 of file WCNSFVFlowPhysics.C.

1042 {
1043  if (!_has_flow_equations)
1044  return;
1045 
1046  // Pressure pin
1047  if (getParam<bool>("pin_pressure"))
1048  {
1049  const auto pin_type = getParam<MooseEnum>("pinned_pressure_type");
1050  std::string object_type = "NSPressurePin";
1051 
1052  // No need for the user object
1053  if (pin_type == "point-value" || pin_type == "average")
1054  return;
1055 
1056  // Create the average value postprocessor if needed
1057  if (pin_type == "average-uo")
1058  {
1059  // Volume average by default, but we could do inlet or outlet for example
1060  InputParameters params = getFactory().getValidParams("ElementAverageValue");
1061  params.set<std::vector<VariableName>>("variable") = {_pressure_name};
1062  assignBlocks(params, _blocks);
1063  params.set<std::vector<OutputName>>("outputs") = {"none"};
1064  getProblem().addPostprocessor("ElementAverageValue", "ns_pressure_average", params);
1065  }
1066 
1067  InputParameters params = getFactory().getValidParams(object_type);
1068  if (pin_type == "point-value" || pin_type == "point-value-uo")
1069  params.set<MooseEnum>("pin_type") = "point-value";
1070  else
1071  params.set<MooseEnum>("pin_type") = "average";
1072 
1073  params.set<PostprocessorName>("phi0") = getParam<PostprocessorName>("pinned_pressure_value");
1074  params.set<NonlinearVariableName>("variable") = _pressure_name;
1075  if (pin_type == "point-value" || pin_type == "point-value-uo")
1076  params.set<Point>("point") = getParam<Point>("pinned_pressure_point");
1077  else if (pin_type == "average-uo")
1078  params.set<PostprocessorName>("pressure_average") = "ns_pressure_average";
1079 
1080  getProblem().addUserObject(object_type, prefix() + "ins_mass_pressure_pin", params);
1081  }
1082 }
std::string prefix() const
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
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 NonlinearVariableName _pressure_name
Pressure name.
static const std::string pin_type
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)

◆ addFVBCs()

void WCNSFVFlowPhysicsBase::addFVBCs ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 260 of file WCNSFVFlowPhysicsBase.C.

261 {
262  addInletBC();
263  addOutletBC();
264  addWallsBC();
265  addSeparatorBC();
266 }
virtual void addSeparatorBC()=0
virtual void addOutletBC()=0
virtual void addWallsBC()=0
virtual void addInletBC()=0
Functions adding boundary conditions for the flow simulation.

◆ addFVKernels()

void WCNSFVFlowPhysics::addFVKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 265 of file WCNSFVFlowPhysics.C.

266 {
267  if (!_has_flow_equations)
268  return;
269 
270  // Mass equation: time derivative
271  if (_compressibility == "weakly-compressible" &&
272  shouldCreateTimeDerivative(_pressure_name, _blocks, /*error if already defined*/ false))
274 
275  // Mass equation: divergence of momentum
276  addMassKernels();
277 
278  // Pressure pin
279  if (getParam<bool>("pin_pressure"))
281 
282  // Momentum equation: time derivative
283  if (isTransient())
285 
286  // Momentum equation: momentum advection
288 
289  // Momentum equation: momentum viscous stress
291 
292  // Momentum equation: pressure term
294 
295  // Momentum equation: gravity source term
297 
298  // Momentum equation: friction kernels
299  if (_friction_types.size())
301 
302  // Momentum equation: boussinesq approximation
303  if (getParam<bool>("boussinesq_approximation"))
305 }
void addMomentumTimeKernels() override
Functions adding kernels for the incompressible momentum equation If the material properties are not ...
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
void addMomentumBoussinesqKernels() override
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
void addMomentumViscousDissipationKernels()
void addMassKernels()
Function adding kernels for the incompressible continuity equation.
void addPressurePinKernel()
Function adding the pressure constraint.
const NonlinearVariableName _pressure_name
Pressure name.
bool shouldCreateTimeDerivative(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool error_if_already_defined) const
std::vector< SubdomainName > _blocks
void addMassTimeKernels()
Function adding kernels for the time derivative term of the weakly compressible continuity equation...
void addMomentumPressureKernels() override
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...
void addMomentumFrictionKernels() override
void addMomentumGravityKernels() override
void addMomentumAdvectionKernels()
bool isTransient() const

◆ addInitialConditions()

void WCNSFVFlowPhysicsBase::addInitialConditions ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 310 of file WCNSFVFlowPhysicsBase.C.

311 {
312  if (!_define_variables && parameters().isParamSetByUser("initial_velocity") &&
313  parameters().isParamSetByUser("velocity_variable") &&
314  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
315  // TODO: Rework and remove this last statement once the NSFV action is removed
316  paramError("initial_velocity",
317  "Velocity is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
318  "conditions");
319  if (!_define_variables && parameters().isParamSetByUser("initial_pressure") &&
320  parameters().isParamSetByUser("pressure_variable"))
321  paramError("initial_pressure",
322  "Pressure is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
323  "condition");
324 
325  // Check dimension
326  if (getParam<std::vector<FunctionName>>("initial_velocity").size() != dimension() &&
327  getParam<std::vector<FunctionName>>("initial_velocity").size() != 3 &&
328  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
329  // TODO: Rework and remove this last statement once the NSFV action is removed
330  paramError("initial_velocity",
331  "The number of velocity components in the " + type() + " initial condition is not " +
332  std::to_string(dimension()) + " or 3!");
333 
334  InputParameters params = getFactory().getValidParams("FunctionIC");
335  assignBlocks(params, _blocks);
336  auto vvalue = getParam<std::vector<FunctionName>>("initial_velocity");
337 
338  for (const auto d : make_range(dimension()))
339  {
340  params.set<VariableName>("variable") = _velocity_names[d];
341  params.set<FunctionName>("function") = vvalue[d];
342 
344  _blocks,
345  /*whether IC is a default*/ !isParamSetByUser("initial_velocity"),
346  /*error if already an IC*/ isParamSetByUser("initial_velocity")))
347  getProblem().addInitialCondition("FunctionIC", prefix() + _velocity_names[d] + "_ic", params);
348  }
349 
351  _blocks,
352  /*whether IC is a default*/ !isParamSetByUser("initial_pressure"),
353  /*error if already an IC*/ isParamSetByUser("initial_pressure")))
354  {
355  params.set<VariableName>("variable") = _pressure_name;
356  params.set<FunctionName>("function") = getParam<FunctionName>("initial_pressure");
357 
358  getProblem().addInitialCondition("FunctionIC", prefix() + _pressure_name + "_ic", params);
359  }
360 }
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
const NonlinearVariableName _pressure_name
Pressure name.
bool shouldCreateIC(const VariableName &var_name, const std::vector< SubdomainName > &blocks, const bool ic_is_default_ic, const bool error_if_already_defined) const
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual void addInitialCondition(const std::string &ic_name, const std::string &name, InputParameters &parameters)
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
const std::string & type() const
const T & getParam(const std::string &name) const
void paramError(const std::string &param, Args... args) const
bool _define_variables
Whether to define variables if they do not exist.
bool isParamSetByUser(const std::string &nm) const
IntRange< T > make_range(T beg, T end)
const InputParameters & parameters() const

◆ addInletBC()

void WCNSFVFlowPhysics::addInletBC ( )
overrideprivatevirtual

Functions adding boundary conditions for the incompressible simulation.

These are used for weakly-compressible simulations as well.

Implements WCNSFVFlowPhysicsBase.

Definition at line 684 of file WCNSFVFlowPhysics.C.

685 {
686  // Check the size of the BC parameters
687  unsigned int num_velocity_functor_inlets = 0;
688  for (const auto & [bdy, momentum_outlet_type] : _momentum_inlet_types)
689  if (momentum_outlet_type == "fixed-velocity" || momentum_outlet_type == "fixed-pressure")
690  num_velocity_functor_inlets++;
691 
692  if (num_velocity_functor_inlets != _momentum_inlet_functors.size())
693  paramError("momentum_inlet_functors",
694  "Size (" + std::to_string(_momentum_inlet_functors.size()) +
695  ") is not the same as the number of entries in the momentum_inlet_types "
696  "subvector for fixed-velocities/pressures functors (size " +
697  std::to_string(num_velocity_functor_inlets) + ")");
698 
699  unsigned int flux_bc_counter = 0;
700  unsigned int velocity_pressure_counter = 0;
701  for (const auto & [inlet_bdy, momentum_inlet_type] : _momentum_inlet_types)
702  {
703  if (momentum_inlet_type == "fixed-velocity")
704  {
705  const std::string bc_type = "INSFVInletVelocityBC";
706  InputParameters params = getFactory().getValidParams(bc_type);
707  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
708  if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
709  paramError("momentum_inlet_functors",
710  "More non-flux inlets than inlet functors (" +
711  std::to_string(_momentum_inlet_functors.size()) + ")");
712 
713  // Check that enough functors have been provided for the dimension of the problem
714  const auto momentum_functors = libmesh_map_find(_momentum_inlet_functors, inlet_bdy);
715  if (momentum_functors.size() < dimension())
716  paramError("momentum_inlet_functors",
717  "Subvector for boundary '" + inlet_bdy + "' (size " +
718  std::to_string(momentum_functors.size()) +
719  ") is not the same size as the number of dimensions of the physics (" +
720  std::to_string(dimension()) + ")");
721 
722  for (const auto d : make_range(dimension()))
723  {
724  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
725  params.set<MooseFunctorName>("functor") = momentum_functors[d];
726 
727  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + inlet_bdy, params);
728  }
729  ++velocity_pressure_counter;
730  }
731  else if (momentum_inlet_type == "fixed-pressure")
732  {
733  const std::string bc_type = "INSFVOutletPressureBC";
734  InputParameters params = getFactory().getValidParams(bc_type);
735  params.set<NonlinearVariableName>("variable") = _pressure_name;
736  if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
737  paramError("momentum_inlet_functors",
738  "More non-flux inlets than inlet functors (" +
739  std::to_string(_momentum_inlet_functors.size()) + ")");
740 
741  params.set<FunctionName>("function") =
742  libmesh_map_find(_momentum_inlet_functors, inlet_bdy)[0];
743  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
744 
745  getProblem().addFVBC(bc_type, _pressure_name + "_" + inlet_bdy, params);
746  ++velocity_pressure_counter;
747  }
748  else if (momentum_inlet_type == "flux-mass" || momentum_inlet_type == "flux-velocity")
749  {
750  {
751  const std::string bc_type =
752  _porous_medium_treatment ? "PWCNSFVMomentumFluxBC" : "WCNSFVMomentumFluxBC";
753  InputParameters params = getFactory().getValidParams(bc_type);
754 
755  if (_flux_inlet_directions.size())
756  params.set<Point>("direction") = _flux_inlet_directions[flux_bc_counter];
757 
758  params.set<MooseFunctorName>(NS::density) = _density_name;
759  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
760  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
762  params.set<MooseFunctorName>(NS::porosity) = _porosity_name;
763  if (_flux_inlet_pps.size() < flux_bc_counter + 1)
764  paramError("flux_inlet_pps",
765  "More inlet flux BCs than inlet flux pps (" +
766  std::to_string(_flux_inlet_pps.size()) + ")");
767 
768  if (momentum_inlet_type == "flux-mass")
769  {
770  params.set<PostprocessorName>("mdot_pp") = _flux_inlet_pps[flux_bc_counter];
771  params.set<PostprocessorName>("area_pp") = "area_pp_" + inlet_bdy;
772  }
773  else
774  params.set<PostprocessorName>("velocity_pp") = _flux_inlet_pps[flux_bc_counter];
775 
776  for (const auto d : make_range(dimension()))
777  params.set<MooseFunctorName>(NS::velocity_vector[d]) = _velocity_names[d];
778 
779  for (const auto d : make_range(dimension()))
780  {
781  params.set<MooseEnum>("momentum_component") = NS::directions[d];
782  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
783 
784  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + inlet_bdy, params);
785  }
786  }
787  {
788  const std::string bc_type = "WCNSFVMassFluxBC";
789  InputParameters params = getFactory().getValidParams(bc_type);
790  params.set<MooseFunctorName>(NS::density) = _density_name;
791  params.set<NonlinearVariableName>("variable") = _pressure_name;
792  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
793 
794  if (_flux_inlet_directions.size())
795  params.set<Point>("direction") = _flux_inlet_directions[flux_bc_counter];
796 
797  if (momentum_inlet_type == "flux-mass")
798  {
799  params.set<PostprocessorName>("mdot_pp") = _flux_inlet_pps[flux_bc_counter];
800  params.set<PostprocessorName>("area_pp") = "area_pp_" + inlet_bdy;
801  }
802  else
803  params.set<PostprocessorName>("velocity_pp") = _flux_inlet_pps[flux_bc_counter];
804 
805  for (const auto d : make_range(dimension()))
806  params.set<MooseFunctorName>(NS::velocity_vector[d]) = _velocity_names[d];
807 
808  getProblem().addFVBC(bc_type, _pressure_name + "_" + inlet_bdy, params);
809  }
810 
811  // need to increment flux_bc_counter
812  ++flux_bc_counter;
813  }
814  }
815 }
Factory & getFactory()
std::map< BoundaryName, MooseEnum > _momentum_inlet_types
Momentum inlet boundary types.
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_inlet_functors
Functors describing the momentum inlet for each boundary.
const NonlinearVariableName _pressure_name
Pressure name.
const MooseFunctorName _porosity_name
Name of the porosity functor.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
std::vector< PostprocessorName > _flux_inlet_pps
Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux ...
const std::vector< std::string > _velocity_names
Velocity names.
void paramError(const std::string &param, Args... args) const
IntRange< T > make_range(T beg, T end)
const std::string velocity_vector[3]
Definition: NS.h:49
std::vector< Point > _flux_inlet_directions
Direction of each flux inlet. Indexing based on the number of flux boundaries.
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)

◆ addMassKernels()

void WCNSFVFlowPhysics::addMassKernels ( )
private

Function adding kernels for the incompressible continuity equation.

Definition at line 329 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

330 {
331  std::string kernel_type = "INSFVMassAdvection";
332  std::string kernel_name = prefix() + "ins_mass_advection";
333 
335  {
336  kernel_type = "PINSFVMassAdvection";
337  kernel_name = prefix() + "pins_mass_advection";
338  }
339 
340  InputParameters params = getFactory().getValidParams(kernel_type);
341  assignBlocks(params, _blocks);
342  params.set<NonlinearVariableName>("variable") = _pressure_name;
343  params.set<MooseFunctorName>(NS::density) = _density_name;
344  params.set<MooseEnum>("velocity_interp_method") = _velocity_interpolation;
345  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
346  params.set<MooseEnum>("advected_interp_method") =
347  getParam<MooseEnum>("mass_advection_interpolation");
348 
349  getProblem().addFVKernel(kernel_type, kernel_name, params);
350 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
const MooseEnum _velocity_interpolation
The velocity face interpolation method for advecting other quantities.
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addMassTimeKernels()

void WCNSFVFlowPhysics::addMassTimeKernels ( )
private

Function adding kernels for the time derivative term of the weakly compressible continuity equation.

Definition at line 308 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

309 {
310  std::string mass_kernel_type = "WCNSFVMassTimeDerivative";
311  std::string kernel_name = prefix() + "wcns_mass_time";
312 
314  {
315  mass_kernel_type = "PWCNSFVMassTimeDerivative";
316  kernel_name = prefix() + "pwcns_mass_time";
317  }
318 
319  InputParameters params = getFactory().getValidParams(mass_kernel_type);
320  assignBlocks(params, _blocks);
321  params.set<NonlinearVariableName>("variable") = _pressure_name;
322  params.set<MooseFunctorName>(NS::time_deriv(NS::density)) = NS::time_deriv(_density_name);
324  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
325  getProblem().addFVKernel(mass_kernel_type, kernel_name, params);
326 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::string time_deriv(const std::string &var)
Definition: NS.h:97

◆ addMaterials()

void WCNSFVFlowPhysicsBase::addMaterials ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 269 of file WCNSFVFlowPhysicsBase.C.

270 {
273  else
275 }
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
void addPorousMediumSpeedMaterial()
Add material to define the local speed in porous medium flows.
void addNonPorousMediumSpeedMaterial()
Add material to define the local speed with no porous medium treatment.
virtual bool hasForchheimerFriction() const =0
Return whether a Forchheimer friction model is in use.

◆ addMomentumAdvectionKernels()

void WCNSFVFlowPhysics::addMomentumAdvectionKernels ( )
private

Definition at line 411 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

412 {
413  std::string kernel_type = "INSFVMomentumAdvection";
414  std::string kernel_name = prefix() + "ins_momentum_advection_";
415 
417  {
418  kernel_type = "PINSFVMomentumAdvection";
419  kernel_name = prefix() + "pins_momentum_advection_";
420  }
421 
422  InputParameters params = getFactory().getValidParams(kernel_type);
423  assignBlocks(params, _blocks);
424  params.set<MooseFunctorName>(NS::density) = _density_name;
425  params.set<MooseEnum>("velocity_interp_method") = _velocity_interpolation;
426  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
427  params.set<MooseEnum>("advected_interp_method") = _momentum_advection_interpolation;
429  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
431 
432  for (const auto d : make_range(dimension()))
433  {
434  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
435  params.set<MooseEnum>("momentum_component") = NS::directions[d];
436 
437  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
438  }
439 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const MooseEnum _momentum_advection_interpolation
The momentum face interpolation method for being advected.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
const std::vector< std::string > _velocity_names
Velocity names.
static std::vector< std::string > listOfCommonParams()
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
const MooseEnum _velocity_interpolation
The velocity face interpolation method for advecting other quantities.
IntRange< T > make_range(T beg, T end)
const InputParameters & parameters() const
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addMomentumBoussinesqKernels()

void WCNSFVFlowPhysics::addMomentumBoussinesqKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 546 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

547 {
548  if (_compressibility == "weakly-compressible")
549  paramError("boussinesq_approximation",
550  "We cannot use boussinesq approximation while running in weakly-compressible mode!");
551 
552  std::string kernel_type = "INSFVMomentumBoussinesq";
553  std::string kernel_name = prefix() + "ins_momentum_boussinesq_";
554 
556  {
557  kernel_type = "PINSFVMomentumBoussinesq";
558  kernel_name = prefix() + "pins_momentum_boussinesq_";
559  }
560 
561  InputParameters params = getFactory().getValidParams(kernel_type);
562  assignBlocks(params, _blocks);
563  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
564  params.set<MooseFunctorName>(NS::T_fluid) = _fluid_temperature_name;
565  params.set<MooseFunctorName>(NS::density) = _density_gravity_name;
566  params.set<RealVectorValue>("gravity") = getParam<RealVectorValue>("gravity");
567  params.set<Real>("ref_temperature") = getParam<Real>("ref_temperature");
568  params.set<MooseFunctorName>("alpha_name") = getParam<MooseFunctorName>("thermal_expansion");
570  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
571  // User declared the flow to be incompressible, we have to trust them
572  params.set<bool>("_override_constant_check") = true;
573 
574  for (const auto d : make_range(dimension()))
575  {
576  params.set<MooseEnum>("momentum_component") = NS::directions[d];
577  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
578 
579  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
580  }
581 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_gravity_name
Name of the density material property used for gravity and Boussinesq terms.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
static const std::string T_fluid
Definition: NS.h:106
const std::vector< std::string > _velocity_names
Velocity names.
void paramError(const std::string &param, Args... args) const
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addMomentumFrictionKernels()

void WCNSFVFlowPhysics::addMomentumFrictionKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 584 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

585 {
586  unsigned int num_friction_blocks = _friction_blocks.size();
587  unsigned int num_used_blocks = num_friction_blocks ? num_friction_blocks : 1;
588 
589  const std::string kernel_type = "PINSFVMomentumFriction";
590  InputParameters params = getFactory().getValidParams(kernel_type);
591  params.set<MooseFunctorName>(NS::density) = _density_name;
592  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
594  params.set<MooseFunctorName>(NS::speed) = NS::speed;
595  params.set<bool>("standard_friction_formulation") =
596  getParam<bool>("standard_friction_formulation");
597  params.set<bool>("is_porous_medium") = _porous_medium_treatment;
598 
599  for (const auto block_i : make_range(num_used_blocks))
600  {
601  std::string block_name = "";
602  if (num_friction_blocks)
603  {
604  params.set<std::vector<SubdomainName>>("block") = _friction_blocks[block_i];
605  block_name = Moose::stringify(_friction_blocks[block_i]);
606  }
607  else
608  {
609  assignBlocks(params, _blocks);
610  block_name = std::to_string(block_i);
611  }
612 
613  for (const auto d : make_range(dimension()))
614  {
615  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
616  params.set<MooseEnum>("momentum_component") = NS::directions[d];
617  for (unsigned int type_i = 0; type_i < _friction_types[block_i].size(); ++type_i)
618  {
619  const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
620  if (upper_name == "DARCY")
621  {
622  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
623  params.set<MooseFunctorName>("Darcy_name") = _friction_coeffs[block_i][type_i];
624  }
625  else if (upper_name == "FORCHHEIMER")
626  {
627  params.set<MooseFunctorName>(NS::speed) = NS::speed;
628  params.set<MooseFunctorName>("Forchheimer_name") = _friction_coeffs[block_i][type_i];
629  }
630  else
631  paramError("momentum_friction_types",
632  "Friction type '",
633  _friction_types[block_i][type_i],
634  "' is not implemented");
635  }
636 
637  getProblem().addFVKernel(kernel_type,
638  prefix() + "momentum_friction_" + block_name + "_" +
639  NS::directions[d],
640  params);
641  }
642 
643  if (_porous_medium_treatment && getParam<bool>("use_friction_correction"))
644  {
645  const std::string correction_kernel_type = "PINSFVMomentumFrictionCorrection";
646  InputParameters corr_params = getFactory().getValidParams(correction_kernel_type);
647  if (num_friction_blocks)
648  corr_params.set<std::vector<SubdomainName>>("block") = _friction_blocks[block_i];
649  else
650  assignBlocks(corr_params, _blocks);
651  corr_params.set<MooseFunctorName>(NS::density) = _density_name;
652  corr_params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
653  corr_params.set<Real>("consistent_scaling") = getParam<Real>("consistent_scaling");
654  for (const auto d : make_range(dimension()))
655  {
656  corr_params.set<NonlinearVariableName>("variable") = _velocity_names[d];
657  corr_params.set<MooseEnum>("momentum_component") = NS::directions[d];
658  for (unsigned int type_i = 0; type_i < _friction_types[block_i].size(); ++type_i)
659  {
660  const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
661  if (upper_name == "DARCY")
662  {
663  corr_params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
664  corr_params.set<MooseFunctorName>("Darcy_name") = _friction_coeffs[block_i][type_i];
665  }
666  else if (upper_name == "FORCHHEIMER")
667  {
668  corr_params.set<MooseFunctorName>(NS::speed) = NS::speed;
669  corr_params.set<MooseFunctorName>("Forchheimer_name") =
670  _friction_coeffs[block_i][type_i];
671  }
672  }
673 
674  getProblem().addFVKernel(correction_kernel_type,
675  prefix() + "pins_momentum_friction_correction_" + block_name +
676  "_" + NS::directions[d],
677  corr_params);
678  }
679  }
680  }
681 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
std::string toUpper(const std::string &name)
static const std::string speed
Definition: NS.h:143
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
std::vector< std::vector< SubdomainName > > _friction_blocks
Subdomains where we want to have volumetric friction.
static const std::string mu
Definition: NS.h:123
const std::vector< std::string > _velocity_names
Velocity names.
void paramError(const std::string &param, Args... args) const
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
std::string stringify(const T &t)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::vector< std::vector< std::string > > _friction_coeffs
The coefficients used for each item if friction type.
bool hasForchheimerFriction() const override
Return whether a Forchheimer friction model is in use.

◆ addMomentumGravityKernels()

void WCNSFVFlowPhysics::addMomentumGravityKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 511 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

512 {
514  {
515  std::string kernel_type = "INSFVMomentumGravity";
516  std::string kernel_name = prefix() + "ins_momentum_gravity_";
517 
519  {
520  kernel_type = "PINSFVMomentumGravity";
521  kernel_name = prefix() + "pins_momentum_gravity_";
522  }
523 
524  InputParameters params = getFactory().getValidParams(kernel_type);
525  assignBlocks(params, _blocks);
526  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
527  params.set<MooseFunctorName>(NS::density) = _density_gravity_name;
528  params.set<RealVectorValue>("gravity") = getParam<RealVectorValue>("gravity");
530  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
531 
532  for (const auto d : make_range(dimension()))
533  {
534  if (getParam<RealVectorValue>("gravity")(d) != 0)
535  {
536  params.set<MooseEnum>("momentum_component") = NS::directions[d];
537  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
538 
539  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
540  }
541  }
542  }
543 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_gravity_name
Name of the density material property used for gravity and Boussinesq terms.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
bool isParamValid(const std::string &name) const
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
const std::vector< std::string > _velocity_names
Velocity names.
const bool _solve_for_dynamic_pressure
Whether we are solving for the total or dynamic pressure.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
IntRange< T > make_range(T beg, T end)
const InputParameters & parameters() const
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addMomentumMixingLengthKernels()

void WCNSFVFlowPhysics::addMomentumMixingLengthKernels ( )
private

◆ addMomentumPressureKernels()

void WCNSFVFlowPhysics::addMomentumPressureKernels ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 482 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

483 {
484  std::string kernel_type = "INSFVMomentumPressure";
485  std::string kernel_name = prefix() + "ins_momentum_pressure_";
486 
488  {
489  kernel_type = "PINSFVMomentumPressure";
490  kernel_name = prefix() + "pins_momentum_pressure_";
491  }
492 
493  InputParameters params = getFactory().getValidParams(kernel_type);
494  assignBlocks(params, _blocks);
495  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
496  params.set<MooseFunctorName>("pressure") = _pressure_name;
497  params.set<bool>("correct_skewness") =
498  getParam<MooseEnum>("pressure_face_interpolation") == "skewness-corrected";
500  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
501 
502  for (const auto d : make_range(dimension()))
503  {
504  params.set<MooseEnum>("momentum_component") = NS::directions[d];
505  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
506  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
507  }
508 }
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
const NonlinearVariableName _pressure_name
Pressure name.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
const std::vector< std::string > _velocity_names
Velocity names.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
IntRange< T > make_range(T beg, T end)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addMomentumTimeKernels()

void WCNSFVFlowPhysics::addMomentumTimeKernels ( )
overrideprivatevirtual

Functions adding kernels for the incompressible momentum equation If the material properties are not constant, these can be used for weakly-compressible simulations (except the Boussinesq kernel) as well.

Implements WCNSFVFlowPhysicsBase.

Definition at line 372 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

373 {
374  std::string kernel_type = (_compressibility == "weakly-compressible")
375  ? "WCNSFVMomentumTimeDerivative"
376  : "INSFVMomentumTimeDerivative";
377  std::string kernel_name = prefix() +
378  ((_compressibility == "weakly-compressible") ? "wcns_" : "ins_") +
379  "momentum_time_";
380 
382  {
383  // Porosity does not appear in the term
384  kernel_type = (_compressibility == "weakly-compressible") ? "WCNSFVMomentumTimeDerivative"
385  : "PINSFVMomentumTimeDerivative";
386  kernel_name = prefix() + ((_compressibility == "weakly-compressible") ? "pwcns_" : "pins_") +
387  "momentum_time_";
388  }
389 
390  InputParameters params = getFactory().getValidParams(kernel_type);
391  assignBlocks(params, _blocks);
392  params.set<MooseFunctorName>(NS::density) = _density_name;
393  if (_compressibility == "weakly-compressible")
394  params.set<MooseFunctorName>(NS::time_deriv(NS::density)) = NS::time_deriv(_density_name);
395 
396  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
397  params.set<bool>("contribute_to_rc") =
398  getParam<bool>("time_derivative_contributes_to_RC_coefficients");
399 
400  for (const auto d : make_range(dimension()))
401  {
402  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
403  params.set<MooseEnum>("momentum_component") = NS::directions[d];
404 
405  if (shouldCreateTimeDerivative(_velocity_names[d], _blocks, /*error if already defined*/ false))
406  getProblem().addFVKernel(kernel_type, kernel_name + _velocity_names[d], params);
407  }
408 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
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
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...
IntRange< T > make_range(T beg, T end)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)
std::string time_deriv(const std::string &var)
Definition: NS.h:97

◆ addMomentumViscousDissipationKernels()

void WCNSFVFlowPhysics::addMomentumViscousDissipationKernels ( )
private

Definition at line 442 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

443 {
444  std::string kernel_type = "INSFVMomentumDiffusion";
445  std::string kernel_name = prefix() + "ins_momentum_diffusion_";
446 
448  {
449  kernel_type = "PINSFVMomentumDiffusion";
450  kernel_name = prefix() + "pins_momentum_diffusion_";
451  }
452 
453  InputParameters params = getFactory().getValidParams(kernel_type);
454  assignBlocks(params, _blocks);
455  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
456  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
457  params.set<MooseEnum>("mu_interp_method") = getParam<MooseEnum>("mu_interp_method");
458  params.set<MooseEnum>("variable_interp_method") =
459  getParam<MooseEnum>("momentum_face_interpolation");
460  if (getParam<bool>("include_deviatoric_stress"))
461  {
462  params.set<bool>("complete_expansion") = true;
463  const std::string u_names[3] = {"u", "v", "w"};
464  for (unsigned int i = 0; i < dimension(); ++i)
465  params.set<MooseFunctorName>(u_names[i]) = _velocity_names[i];
466  }
467 
469  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
470  // Currently only Newton method for WCNSFVFlowPhysics
471  params.set<bool>("newton_solve") = true;
472  for (const auto d : make_range(dimension()))
473  {
474  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
475  params.set<MooseEnum>("momentum_component") = NS::directions[d];
476 
477  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
478  }
479 }
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
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
static const std::string mu
Definition: NS.h:123
const std::vector< std::string > _velocity_names
Velocity names.
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
IntRange< T > make_range(T beg, T end)
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addNonPorousMediumSpeedMaterial()

void WCNSFVFlowPhysicsBase::addNonPorousMediumSpeedMaterial ( )
protectedinherited

Add material to define the local speed with no porous medium treatment.

Definition at line 295 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

296 {
297  const std::string class_name = "ADVectorMagnitudeFunctorMaterial";
298  InputParameters params = getFactory().getValidParams(class_name);
299  assignBlocks(params, _blocks);
300 
301  const std::vector<std::string> param_names{"x_functor", "y_functor", "z_functor"};
302  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
303  params.set<MooseFunctorName>(param_names[dim_i]) = _velocity_names[dim_i];
304  params.set<MooseFunctorName>("vector_magnitude_name") = NS::speed;
305 
306  getProblem().addMaterial(class_name, prefix() + "ins_speed_material", params);
307 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
static const std::string speed
Definition: NS.h:143
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
unsigned int dimension() const
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.

◆ addOutletBC()

void WCNSFVFlowPhysics::addOutletBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 818 of file WCNSFVFlowPhysics.C.

819 {
820  // Check the BCs size
821  unsigned int num_pressure_outlets = 0;
822  for (const auto & [bdy, momentum_outlet_type] : _momentum_outlet_types)
823  if (momentum_outlet_type == "fixed-pressure" ||
824  momentum_outlet_type == "fixed-pressure-zero-gradient")
825  num_pressure_outlets++;
826 
827  if (num_pressure_outlets != _pressure_functors.size())
828  paramError("pressure_functors",
829  "Size (" + std::to_string(_pressure_functors.size()) +
830  ") is not the same as the number of pressure outlet boundaries in "
831  "'fixed-pressure/fixed-pressure-zero-gradient' (size " +
832  std::to_string(num_pressure_outlets) + ")");
833 
834  const std::string u_names[3] = {"u", "v", "w"};
835  for (const auto & [outlet_bdy, momentum_outlet_type] : _momentum_outlet_types)
836  {
837  if (momentum_outlet_type == "zero-gradient" ||
838  momentum_outlet_type == "fixed-pressure-zero-gradient")
839  {
840  {
841  const std::string bc_type = _porous_medium_treatment ? "PINSFVMomentumAdvectionOutflowBC"
842  : "INSFVMomentumAdvectionOutflowBC";
843  InputParameters params = getFactory().getValidParams(bc_type);
844  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
846  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
847  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
848  params.set<MooseFunctorName>(NS::density) = _density_name;
849 
850  for (unsigned int i = 0; i < dimension(); ++i)
851  params.set<MooseFunctorName>(u_names[i]) = _velocity_names[i];
852 
853  for (const auto d : make_range(dimension()))
854  {
855  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
856  params.set<MooseEnum>("momentum_component") = NS::directions[d];
857 
858  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + outlet_bdy, params);
859  }
860  }
861  }
862 
863  if (momentum_outlet_type == "fixed-pressure" ||
864  momentum_outlet_type == "fixed-pressure-zero-gradient")
865  {
866  const std::string bc_type = "INSFVOutletPressureBC";
867  InputParameters params = getFactory().getValidParams(bc_type);
868  params.set<NonlinearVariableName>("variable") = _pressure_name;
869  params.set<MooseFunctorName>("functor") = libmesh_map_find(_pressure_functors, outlet_bdy);
870  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
871 
872  getProblem().addFVBC(bc_type, _pressure_name + "_" + outlet_bdy, params);
873  }
874  else if (momentum_outlet_type == "zero-gradient")
875  {
876  const std::string bc_type = "INSFVMassAdvectionOutflowBC";
877  InputParameters params = getFactory().getValidParams(bc_type);
878  params.set<NonlinearVariableName>("variable") = _pressure_name;
879  params.set<MooseFunctorName>(NS::density) = _density_name;
880  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
881 
882  for (const auto d : make_range(dimension()))
883  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
884 
885  getProblem().addFVBC(bc_type, _pressure_name + "_" + outlet_bdy, params);
886  }
887  }
888 }
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
std::map< BoundaryName, MooseEnum > _momentum_outlet_types
Momentum outlet boundary types.
const std::vector< std::string > _velocity_names
Velocity names.
void paramError(const std::string &param, Args... args) const
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)
std::map< BoundaryName, MooseFunctorName > _pressure_functors
Functors describing the outlet pressure on each boundary.
IntRange< T > make_range(T beg, T end)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)

◆ addPorousMediumSpeedMaterial()

void WCNSFVFlowPhysicsBase::addPorousMediumSpeedMaterial ( )
protectedinherited

Add material to define the local speed in porous medium flows.

Definition at line 278 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

279 {
280  InputParameters params = getFactory().getValidParams("PINSFVSpeedFunctorMaterial");
281  assignBlocks(params, _blocks);
282 
283  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
284  params.set<MooseFunctorName>(NS::superficial_velocity_vector[dim_i]) = _velocity_names[dim_i];
286  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
287  else
288  params.set<MooseFunctorName>(NS::porosity) = "1";
289  params.set<bool>("define_interstitial_velocity_components") = _porous_medium_treatment;
290 
291  getProblem().addMaterial("PINSFVSpeedFunctorMaterial", prefix() + "pins_speed_material", params);
292 }
std::string prefix() const
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
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
static const std::string superficial_velocity_vector[3]
Definition: NS.h:54
const std::vector< std::string > _velocity_names
Velocity names.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)

◆ addPostprocessors()

void WCNSFVFlowPhysicsBase::addPostprocessors ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 370 of file WCNSFVFlowPhysicsBase.C.

371 {
372  const auto momentum_inlet_types = getParam<MultiMooseEnum>("momentum_inlet_types");
373 
374  for (unsigned int bc_ind = 0; bc_ind < momentum_inlet_types.size(); ++bc_ind)
375  if (momentum_inlet_types[bc_ind] == "flux-mass" ||
376  momentum_inlet_types[bc_ind] == "flux-velocity")
377  {
378  const std::string pp_type = "AreaPostprocessor";
379  InputParameters params = getFactory().getValidParams(pp_type);
380  params.set<std::vector<BoundaryName>>("boundary") = {_inlet_boundaries[bc_ind]};
381  params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
382 
383  const auto name_pp = "area_pp_" + _inlet_boundaries[bc_ind];
384  if (!getProblem().hasUserObject(name_pp))
385  getProblem().addPostprocessor(pp_type, name_pp, params);
386  }
387 }
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
bool hasUserObject(const std::string &name) const
virtual FEProblemBase & getProblem()
virtual void addPostprocessor(const std::string &pp_name, const std::string &name, InputParameters &parameters)
const std::vector< BoundaryName > _inlet_boundaries
Boundaries with a flow inlet specified on them.

◆ addPressurePinKernel()

void WCNSFVFlowPhysics::addPressurePinKernel ( )
private

Function adding the pressure constraint.

Definition at line 353 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

354 {
355  const auto pin_type = getParam<MooseEnum>("pinned_pressure_type");
356  const auto object_type =
357  (pin_type == "average") ? "FVIntegralValueConstraint" : "FVPointValueConstraint";
358  InputParameters params = getFactory().getValidParams(object_type);
359  if (pin_type != "point-value" && pin_type != "average")
360  return;
361 
362  params.set<CoupledName>("lambda") = {"lambda"};
363  params.set<PostprocessorName>("phi0") = getParam<PostprocessorName>("pinned_pressure_value");
364  params.set<NonlinearVariableName>("variable") = _pressure_name;
365  if (pin_type == "point-value")
366  params.set<Point>("point") = getParam<Point>("pinned_pressure_point");
367 
368  getProblem().addFVKernel(object_type, prefix() + "ins_mass_pressure_pin", params);
369 }
std::string prefix() const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
static const std::string pin_type
virtual FEProblemBase & getProblem()
std::vector< VariableName > CoupledName
virtual void addFVKernel(const std::string &kernel_name, const std::string &name, InputParameters &parameters)

◆ addRhieChowUserObjects()

void WCNSFVFlowPhysics::addRhieChowUserObjects ( )
overrideprivatevirtual

Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations.

Implements WCNSFVFlowPhysicsBase.

Definition at line 1109 of file WCNSFVFlowPhysics.C.

Referenced by addUserObjects().

1110 {
1111  mooseAssert(dimension(), "0-dimension not supported");
1112 
1113  // First make sure that we only add this object once
1114  // Potential cases:
1115  // - there is a flow physics, and an advection one (UO should be added by one)
1116  // - there is only an advection physics (UO should be created)
1117  // - there are two advection physics on different blocks with set velocities (first one picks)
1118  // Counting RC UOs defined on the same blocks seems to be the most fool proof option
1119  std::vector<UserObject *> objs;
1120  getProblem()
1121  .theWarehouse()
1122  .query()
1123  .condition<AttribSystem>("UserObject")
1124  .condition<AttribThread>(0)
1125  .queryInto(objs);
1126  bool have_matching_rc_uo = false;
1127  for (const auto & obj : objs)
1128  if (const auto * const rc_obj = dynamic_cast<INSFVRhieChowInterpolator *>(obj); rc_obj)
1129  // Latter check is for whether one of the RC user object is defined everywhere
1130  if (rc_obj->blocks() == _blocks || (rc_obj->blocks().size() == 0 || _blocks.size() == 0))
1131  {
1132  have_matching_rc_uo = true;
1133  _rc_uo_name = rc_obj->name();
1134  break;
1135  }
1136 
1137  if (have_matching_rc_uo)
1138  return;
1139 
1140  _rc_uo_name =
1141  _porous_medium_treatment ? +"pins_rhie_chow_interpolator" : "ins_rhie_chow_interpolator";
1142 
1143  const std::string u_names[3] = {"u", "v", "w"};
1144  const auto object_type =
1145  _porous_medium_treatment ? "PINSFVRhieChowInterpolator" : "INSFVRhieChowInterpolator";
1146 
1147  auto params = getFactory().getValidParams(object_type);
1148  assignBlocks(params, _blocks);
1149  for (unsigned int d = 0; d < dimension(); ++d)
1150  params.set<VariableName>(u_names[d]) = _velocity_names[d];
1151 
1152  params.set<VariableName>("pressure") = _pressure_name;
1153 
1155  {
1156  params.set<MooseFunctorName>(NS::porosity) = _porosity_name;
1157  unsigned short smoothing_layers = isParamValid("porosity_smoothing_layers")
1158  ? getParam<unsigned short>("porosity_smoothing_layers")
1159  : 0;
1160  params.set<unsigned short>("smoothing_layers") = smoothing_layers;
1161  }
1162 
1163  if (!_has_flow_equations)
1164  {
1166  params.set<MooseFunctorName>("a_u") = "ax";
1167  params.set<MooseFunctorName>("a_v") = "ay";
1168  params.set<MooseFunctorName>("a_w") = "az";
1169  }
1170 
1171  params.applySpecificParameters(parameters(), INSFVRhieChowInterpolator::listOfCommonParams());
1172  getProblem().addUserObject(object_type, _rc_uo_name, params);
1173 }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
InputParameters getValidParams(const std::string &name) const
UserObjectName _rc_uo_name
Name of the user object in charge of computing the Rhie Chow coefficients.
void checkRhieChowFunctorsDefined() const
Checks that sufficient Rhie Chow coefficients have been defined for the given dimension, used for scalar or temperature advection by auxiliary variables.
const NonlinearVariableName _pressure_name
Pressure name.
const MooseFunctorName _porosity_name
Name of the porosity functor.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
bool isParamValid(const std::string &name) const
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
TheWarehouse & theWarehouse() const
const std::vector< std::string > _velocity_names
Velocity names.
static std::vector< std::string > listOfCommonParams()
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
Query query()
const InputParameters & parameters() const

◆ addSeparatorBC()

void WCNSFVFlowPhysics::addSeparatorBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 1009 of file WCNSFVFlowPhysics.C.

1010 {
1011  if (_hydraulic_separators.size())
1012  {
1013  std::string bc_type = "INSFVVelocityHydraulicSeparatorBC";
1014  InputParameters params = getFactory().getValidParams(bc_type);
1015  params.set<std::vector<BoundaryName>>("boundary") = _hydraulic_separators;
1016  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
1017 
1018  for (const auto d : make_range(dimension()))
1019  {
1020  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
1021  params.set<MooseEnum>("momentum_component") = NS::directions[d];
1022  getProblem().addFVBC(bc_type, prefix() + _velocity_names[d] + "_separators", params);
1023  }
1024 
1025  bc_type = "INSFVScalarFieldSeparatorBC";
1026  params = getFactory().getValidParams(bc_type);
1027  params.set<std::vector<BoundaryName>>("boundary") = _hydraulic_separators;
1028  params.set<NonlinearVariableName>("variable") = _pressure_name;
1029  getProblem().addFVBC(bc_type, prefix() + _pressure_name + "_separators", params);
1030  }
1031 }
std::string prefix() const
Factory & getFactory()
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
const std::vector< std::string > _velocity_names
Velocity names.
IntRange< T > make_range(T beg, T end)
const std::vector< BoundaryName > _hydraulic_separators
Hydraulic separator boundaries.
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)

◆ addSolverVariables()

void WCNSFVFlowPhysics::addSolverVariables ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 142 of file WCNSFVFlowPhysics.C.

143 {
144  if (!_has_flow_equations)
145  return;
146 
147  for (const auto d : make_range(dimension()))
150 
151  // Check number of variables
152  if (_velocity_names.size() != dimension() && _velocity_names.size() != 3)
153  paramError("velocity_variable",
154  "The number of velocity variable names supplied to the NSFVAction is not " +
155  Moose::stringify(dimension()) + " (mesh dimension)" +
156  ((dimension() == 3) ? "" : " or 3!") + "\nVelocity variables " +
158 
159  // Velocities
160  for (const auto d : make_range(dimension()))
161  {
162  if (!shouldCreateVariable(_velocity_names[d], _blocks, /*error if aux*/ true))
163  reportPotentiallyMissedParameters({"system_names",
164  "momentum_scaling",
165  "momentum_face_interpolation",
166  "momentum_two_term_bc_expansion"},
167  "INSFVVelocityVariable");
168  else if (_define_variables)
169  {
170  std::string variable_type = "INSFVVelocityVariable";
172  variable_type = "PINSFVSuperficialVelocityVariable";
173 
174  auto params = getFactory().getValidParams(variable_type);
175  assignBlocks(params, _blocks); // TODO: check wrt components
176  params.set<std::vector<Real>>("scaling") = {getParam<Real>("momentum_scaling")};
177  params.set<MooseEnum>("face_interp_method") =
178  getParam<MooseEnum>("momentum_face_interpolation");
179  params.set<bool>("two_term_boundary_expansion") =
180  getParam<bool>("momentum_two_term_bc_expansion");
181 
182  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_velocity_names[d]);
183  getProblem().addVariable(variable_type, _velocity_names[d], params);
184  }
185  else
186  paramError("velocity_variable",
187  "Variable (" + _velocity_names[d] +
188  ") supplied to the WCNSFVFlowPhysics does not exist!");
189  }
190 
191  // Pressure
192  const bool using_bernouilli_pressure_var =
194  getParam<MooseEnum>("porosity_interface_pressure_treatment") != "automatic";
195  const auto pressure_type =
196  using_bernouilli_pressure_var ? "BernoulliPressureVariable" : "INSFVPressureVariable";
197  if (!shouldCreateVariable(_pressure_name, _blocks, /*error if aux*/ true))
198  {
199  std::vector<std::string> potentially_missed = {"system_names",
200  "mass_scaling",
201  "pressure_face_interpolation",
202  "pressure_two_term_bc_expansion"};
203  if (using_bernouilli_pressure_var)
204  {
205  std::vector<std::string> other_missed = {"pressure_allow_expansion_on_bernoulli_faces",
206  "pressure_drop_sidesets",
207  "pressure_drop_form_factors"};
208  potentially_missed.insert(potentially_missed.end(), other_missed.begin(), other_missed.end());
209  }
210  reportPotentiallyMissedParameters(potentially_missed, pressure_type);
211  }
212  else if (_define_variables)
213  {
214  auto params = getFactory().getValidParams(pressure_type);
215  assignBlocks(params, _blocks);
216  params.set<std::vector<Real>>("scaling") = {getParam<Real>("mass_scaling")};
217  params.set<MooseEnum>("face_interp_method") =
218  getParam<MooseEnum>("pressure_face_interpolation");
219  params.set<bool>("two_term_boundary_expansion") =
220  getParam<bool>("pressure_two_term_bc_expansion");
221 
222  if (using_bernouilli_pressure_var)
223  {
224  params.set<MooseFunctorName>("u") = _velocity_names[0];
225  if (dimension() >= 2)
226  params.set<MooseFunctorName>("v") = _velocity_names[1];
227  if (dimension() == 3)
228  params.set<MooseFunctorName>("w") = _velocity_names[2];
229  params.set<MooseFunctorName>(NS::porosity) = _porosity_name;
230  params.set<MooseFunctorName>(NS::density) = _density_name;
231  params.set<bool>("allow_two_term_expansion_on_bernoulli_faces") =
232  getParam<bool>("pressure_allow_expansion_on_bernoulli_faces");
233  params.set<std::vector<BoundaryName>>("pressure_drop_sidesets") =
234  getParam<std::vector<BoundaryName>>("pressure_drop_sidesets");
235  params.set<std::vector<Real>>("pressure_drop_form_factors") =
236  getParam<std::vector<Real>>("pressure_drop_form_factors");
237  }
238  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_pressure_name);
239  getProblem().addVariable(pressure_type, _pressure_name, params);
240  }
241  else
242  paramError("pressure_variable",
243  "Variable (" + _pressure_name +
244  ") supplied to the WCNSFVFlowPhysics does not exist!");
245 
246  // Add lagrange multiplier for pinning pressure, if needed
247  if (getParam<bool>("pin_pressure"))
248  {
249  auto type = getParam<MooseEnum>("pinned_pressure_type");
250  auto lm_params = getFactory().getValidParams("MooseVariableScalar");
251  lm_params.set<MooseEnum>("family") = "scalar";
252  lm_params.set<MooseEnum>("order") = "first";
253 
254  if ((type == "point-value" || type == "average") && !_problem->hasScalarVariable("lambda"))
255  {
256  lm_params.set<SolverSystemName>("solver_sys") = getSolverSystem("lambda");
257  getProblem().addVariable("MooseVariableScalar", "lambda", lm_params);
258  }
259  else
260  reportPotentiallyMissedParameters({"system_names"}, "MooseVariableScalar");
261  }
262 }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.
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()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
const MooseFunctorName _porosity_name
Name of the porosity functor.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
std::vector< SubdomainName > _blocks
unsigned int dimension() const
virtual FEProblemBase & getProblem()
static const std::string porosity
Definition: NS.h:104
const SolverSystemName & getSolverSystem(unsigned int variable_index) const
const std::vector< std::string > _velocity_names
Velocity names.
const std::string & type() const
const T & getParam(const std::string &name) const
void paramError(const std::string &param, Args... args) const
std::string stringify(const T &t)
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.
IntRange< T > make_range(T beg, T end)
std::shared_ptr< FEProblemBase > & _problem
void reportPotentiallyMissedParameters(const std::vector< std::string > &param_names, const std::string &object_type) const
void saveSolverVariableName(const VariableName &var_name)

◆ addUserObjects()

void WCNSFVFlowPhysics::addUserObjects ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 1034 of file WCNSFVFlowPhysics.C.

1035 {
1036  // Rhie Chow user object for interpolation velocities
1038 }
void addRhieChowUserObjects() override
Function which adds the RhieChow interpolator user objects for weakly and incompressible formulations...

◆ addWallsBC()

void WCNSFVFlowPhysics::addWallsBC ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 891 of file WCNSFVFlowPhysics.C.

892 {
893  const std::string u_names[3] = {"u", "v", "w"};
894 
895  // Count the number of fixed velocity wall boundaries (moving walls)
896  unsigned int num_functor_walls = 0;
897  for (const auto & [boundary_name, momentum_wall_type] : _momentum_wall_types)
898  if (momentum_wall_type == "noslip")
899  num_functor_walls++;
900  if (_momentum_wall_functors.size() && num_functor_walls != _momentum_wall_functors.size())
901  paramError("momentum_wall_functors",
902  "If any wall functors are specified, the number of boundaries requiring a momentum "
903  "functor (" +
904  std::to_string(num_functor_walls) + ") and the number of functors specified (" +
905  std::to_string(_momentum_wall_functors.size()) + ") must match");
906  for (const auto & wall_functors : _momentum_wall_functors)
907  if (wall_functors.second.size() != dimension())
908  paramError("momentum_wall_functors",
909  "Number of wall functors (" + std::to_string(wall_functors.second.size()) +
910  ") must match dimension (" + std::to_string(dimension()) +
911  ").\nFunctors currently specified:" + Moose::stringify(wall_functors.second));
912 
913  for (const auto & [boundary_name, wall_type] : _momentum_wall_types)
914  {
915  if (wall_type == "noslip")
916  {
917  const std::string bc_type = "INSFVNoSlipWallBC";
918  InputParameters params = getFactory().getValidParams(bc_type);
919  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
920 
921  for (const auto d : make_range(dimension()))
922  {
923  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
924  if (_momentum_wall_functors.count(boundary_name) == 0)
925  params.set<FunctionName>("function") = "0";
926  else
927  params.set<FunctionName>("function") = _momentum_wall_functors[boundary_name][d];
928 
929  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
930  }
931  }
932  else if (wall_type == "wallfunction")
933  {
934  const std::string bc_type = "INSFVWallFunctionBC";
935  InputParameters params = getFactory().getValidParams(bc_type);
936  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
937  params.set<MooseFunctorName>(NS::density) = _density_name;
938  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
939  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
940 
941  for (const auto d : make_range(dimension()))
942  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
943 
944  for (const auto d : make_range(dimension()))
945  {
946  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
947  params.set<MooseEnum>("momentum_component") = NS::directions[d];
948 
949  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
950  }
951  }
952  else if (wall_type == "slip")
953  {
954  const std::string bc_type = "INSFVNaturalFreeSlipBC";
955  InputParameters params = getFactory().getValidParams(bc_type);
956  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
957  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
958 
959  for (const auto d : make_range(dimension()))
960  {
961  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
962  params.set<MooseEnum>("momentum_component") = NS::directions[d];
963 
964  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
965  }
966  }
967  else if (wall_type == "symmetry")
968  {
969  {
970  std::string bc_type;
972  bc_type = "PINSFVSymmetryVelocityBC";
973  else
974  bc_type = "INSFVSymmetryVelocityBC";
975 
976  InputParameters params = getFactory().getValidParams(bc_type);
977  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
978 
979  MooseFunctorName viscosity_name = _dynamic_viscosity_name;
980  if (hasTurbulencePhysics())
981  viscosity_name = NS::total_viscosity;
982  params.set<MooseFunctorName>(NS::mu) = viscosity_name;
983  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
984 
985  for (const auto d : make_range(dimension()))
986  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
987 
988  for (const auto d : make_range(dimension()))
989  {
990  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
991  params.set<MooseEnum>("momentum_component") = NS::directions[d];
992 
993  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
994  }
995  }
996  {
997  const std::string bc_type = "INSFVSymmetryPressureBC";
998  InputParameters params = getFactory().getValidParams(bc_type);
999  params.set<NonlinearVariableName>("variable") = _pressure_name;
1000  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
1001 
1002  getProblem().addFVBC(bc_type, _pressure_name + "_" + boundary_name, params);
1003  }
1004  }
1005  }
1006 }
Factory & getFactory()
const MooseFunctorName _density_name
Name of the density material property.
T & set(const std::string &name, bool quiet_mode=false)
static const std::string density
Definition: NS.h:33
InputParameters getValidParams(const std::string &name) const
std::map< BoundaryName, std::vector< MooseFunctorName > > _momentum_wall_functors
Functors describing the momentum for each wall boundary.
const NonlinearVariableName _pressure_name
Pressure name.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
unsigned int dimension() const
static const std::string directions[3]
Definition: NS.h:22
UserObjectName rhieChowUOName() const override
Return the name of the Rhie Chow user object.
virtual FEProblemBase & getProblem()
static const std::string mu
Definition: NS.h:123
const std::vector< std::string > _velocity_names
Velocity names.
void paramError(const std::string &param, Args... args) const
const MooseFunctorName _dynamic_viscosity_name
Name of the dynamic viscosity material property.
std::string stringify(const T &t)
std::map< BoundaryName, MooseEnum > _momentum_wall_types
Momentum wall boundary types.
bool hasTurbulencePhysics() const
Whether a turbulence Physics has been coupled in, to know which viscosity to pick on symmetry boundar...
IntRange< T > make_range(T beg, T end)
virtual void addFVBC(const std::string &fv_bc_name, const std::string &name, InputParameters &parameters)
static const std::string total_viscosity
Definition: NS.h:78

◆ checkRhieChowFunctorsDefined()

void WCNSFVFlowPhysics::checkRhieChowFunctorsDefined ( ) const
private

Checks that sufficient Rhie Chow coefficients have been defined for the given dimension, used for scalar or temperature advection by auxiliary variables.

Definition at line 1176 of file WCNSFVFlowPhysics.C.

Referenced by addRhieChowUserObjects().

1177 {
1178  if (!getProblem().hasFunctor("ax", /*thread_id=*/0))
1179  mooseError("Rhie Chow coefficient ax must be provided for advection by auxiliary velocities");
1180  if (dimension() >= 2 && !getProblem().hasFunctor("ay", /*thread_id=*/0))
1181  mooseError("Rhie Chow coefficient ay must be provided for advection by auxiliary velocities");
1182  if (dimension() == 3 && !getProblem().hasFunctor("az", /*thread_id=*/0))
1183  mooseError("Rhie Chow coefficient az must be provided for advection by auxiliary velocities");
1184 }
unsigned int dimension() const
virtual FEProblemBase & getProblem()
void mooseError(Args &&... args) const

◆ compressibility()

const MooseEnum& WCNSFVFlowPhysicsBase::compressibility ( ) const
inlineinherited

Return the compressibility of the flow equations selected.

Definition at line 47 of file WCNSFVFlowPhysicsBase.h.

47 { return _compressibility; }
const MooseEnum _compressibility
Compressibility type, can be compressible, incompressible or weakly-compressible. ...

◆ densityName()

const MooseFunctorName& WCNSFVFlowPhysicsBase::densityName ( ) const
inlineinherited

◆ dynamicViscosityName()

const MooseFunctorName& WCNSFVFlowPhysicsBase::dynamicViscosityName ( ) const
inlineinherited

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

◆ getCoupledTurbulencePhysics()

const WCNSFVTurbulencePhysics * WCNSFVFlowPhysicsBase::getCoupledTurbulencePhysics ( ) const
protectedinherited

Find the turbulence physics.

Definition at line 416 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::actOnAdditionalTasks().

417 {
418  // User passed it, just use that
419  if (isParamValid("coupled_turbulence_physics"))
420  return getCoupledPhysics<WCNSFVTurbulencePhysics>(
421  getParam<PhysicsName>("coupled_flow_physics"));
422  // Look for any physics of the right type, and check the block restriction
423  else
424  {
425  const auto all_turbulence_physics = getCoupledPhysics<const WCNSFVTurbulencePhysics>(true);
426  for (const auto physics : all_turbulence_physics)
428  physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
429  return physics;
430  }
431  // Did not find one
432  return nullptr;
433 }
bool isParamValid(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

◆ getFlowVariableName()

VariableName WCNSFVFlowPhysicsBase::getFlowVariableName ( const std::string &  default_name) const
protectedinherited

Convenience routine to be able to retrieve the actual variable names from their default names.

Definition at line 390 of file WCNSFVFlowPhysicsBase.C.

391 {
392  if (short_name == NS::pressure)
393  return getPressureName();
394  else if (short_name == NS::velocity_x && dimension() > 0)
395  return getVelocityNames()[0];
396  else if (short_name == NS::velocity_y && dimension() > 1)
397  return getVelocityNames()[1];
398  else if (short_name == NS::velocity_z && dimension() > 2)
399  return getVelocityNames()[2];
400  else if (short_name == NS::temperature)
401  return getFluidTemperatureName();
402  else
403  mooseError("Short Variable name '", short_name, "' not recognized.");
404 }
const std::vector< std::string > & getVelocityNames() const
To interface with other Physics.
static const std::string velocity_z
Definition: NS.h:48
static const std::string velocity_x
Definition: NS.h:46
static const std::string temperature
Definition: NS.h:59
unsigned int dimension() const
const NonlinearVariableName & getFluidTemperatureName() const
static const std::string velocity_y
Definition: NS.h:47
static const std::string pressure
Definition: NS.h:56
void mooseError(Args &&... args) const
const NonlinearVariableName & getPressureName() const

◆ getFluidTemperatureName()

const NonlinearVariableName& WCNSFVFlowPhysicsBase::getFluidTemperatureName ( ) const
inlineinherited

Definition at line 42 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTurbulencePhysics::addFluidEnergyTurbulenceKernels(), and WCNSFVFlowPhysicsBase::getFlowVariableName().

42 { return _fluid_temperature_name; }
const NonlinearVariableName _fluid_temperature_name
Fluid temperature name.

◆ getFluxInletDirections()

const std::vector<Point>& WCNSFVFlowPhysicsBase::getFluxInletDirections ( ) const
inlineinherited

Get the inlet direction if using a flux inlet.

Definition at line 77 of file WCNSFVFlowPhysicsBase.h.

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

77 { return _flux_inlet_directions; }
std::vector< Point > _flux_inlet_directions
Direction of each flux inlet. Indexing based on the number of flux boundaries.

◆ getFluxInletPPs()

const std::vector<PostprocessorName>& WCNSFVFlowPhysicsBase::getFluxInletPPs ( ) const
inlineinherited

Get the inlet flux postprocessor if using a flux inlet.

Definition at line 79 of file WCNSFVFlowPhysicsBase.h.

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

79 { return _flux_inlet_pps; }
std::vector< PostprocessorName > _flux_inlet_pps
Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux ...

◆ getHydraulicSeparators()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getHydraulicSeparators ( ) const
inlineinherited

Get the hydraulic separator boundaries.

Definition at line 75 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergySeparatorBC().

75 { return _hydraulic_separators; }
const std::vector< BoundaryName > _hydraulic_separators
Hydraulic separator boundaries.

◆ getInletBoundaries()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getInletBoundaries ( ) const
inlineinherited

◆ getLinearFrictionCoefName()

MooseFunctorName WCNSFVFlowPhysics::getLinearFrictionCoefName ( ) const
overridevirtual

Get the name of the linear friction coefficient. Returns an empty string if no friction.

Implements WCNSFVFlowPhysicsBase.

Definition at line 1194 of file WCNSFVFlowPhysics.C.

1195 {
1196  // Check all blocks. If more than one block, they would need to be consolidated #include in
1197  // a single functor material. We won't implement this for now
1198  if (_friction_types.empty())
1199  return "";
1200  else if (_friction_types.size() == 1)
1201  {
1202  for (const auto & type_i : index_range(_friction_types[0]))
1203  {
1204  const auto upper_name = MooseUtils::toUpper(_friction_types[0][type_i]);
1205  if (upper_name == "DARCY")
1206  return _friction_coeffs[0][type_i];
1207  }
1208  // No linear type found
1209  return "";
1210  }
1211  else if (_friction_types.size() > 1)
1212  {
1213  bool linear_friction_factor_found = false;
1214  MooseFunctorName linear_friction_factor;
1215  for (const auto block_i : index_range(_friction_types))
1216  for (const auto type_i : index_range(_friction_types[block_i]))
1217  {
1218  const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
1219  if (upper_name == "DARCY" && !linear_friction_factor_found)
1220  {
1221  linear_friction_factor_found = true;
1222  linear_friction_factor = _friction_types[block_i][type_i];
1223  }
1224  else if (upper_name == "DARCY" && !linear_friction_factor_found)
1225  if (linear_friction_factor != _friction_types[block_i][type_i])
1226  mooseError("Multiple linear friction factor with different names have been specified. "
1227  "This is not currently supported as a single name should be retrievable. "
1228  "Use a PiecewiseByBlockFunctorMaterial to consolidate them.");
1229  }
1230  if (linear_friction_factor_found)
1231  return linear_friction_factor;
1232  else
1233  return "";
1234  }
1235  mooseError("Should not get here");
1236 }
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
std::string toUpper(const std::string &name)
void mooseError(Args &&... args) const
auto index_range(const T &sizable)
std::vector< std::vector< std::string > > _friction_coeffs
The coefficients used for each item if friction type.

◆ getMomentumAdvectionFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getMomentumAdvectionFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for momentum in the advection term.

Definition at line 59 of file WCNSFVFlowPhysicsBase.h.

60  {
62  }
const MooseEnum _momentum_advection_interpolation
The momentum face interpolation method for being advected.

◆ getMomentumFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getMomentumFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for momentum (mostly used in the stress terms)

Definition at line 64 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm(), and WCNSFVTurbulencePhysics::addFlowTurbulenceKernels().

65  {
67  }
const MooseEnum _momentum_face_interpolation
The momentum face interpolation method for stress terms.

◆ getNumberAlgebraicGhostingLayersNeeded()

unsigned short WCNSFVFlowPhysics::getNumberAlgebraicGhostingLayersNeeded ( ) const
overridevirtual

Return the number of algebraic ghosting layers needed.

Implements NavierStokesPhysicsBase.

Definition at line 1095 of file WCNSFVFlowPhysics.C.

1096 {
1098  if (_porous_medium_treatment && isParamValid("porosity_smoothing_layers"))
1099  ghost_layers = std::max(getParam<unsigned short>("porosity_smoothing_layers"), ghost_layers);
1100  if ((_porous_medium_treatment &&
1101  getParam<MooseEnum>("porosity_interface_pressure_treatment") != "automatic") ||
1102  getParam<MooseEnum>("momentum_face_interpolation") == "skewness-corrected" ||
1103  getParam<MooseEnum>("pressure_face_interpolation") == "skewness-corrected")
1104  ghost_layers = std::max(ghost_layers, (unsigned short)3);
1105  return ghost_layers;
1106 }
unsigned short getNumberAlgebraicGhostingLayersNeeded() const override
Return the number of algebraic ghosting layers needed.
const bool _porous_medium_treatment
Whether to use the porous medium treatment.
bool isParamValid(const std::string &name) const

◆ getOutletBoundaries()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getOutletBoundaries ( ) const
inlineinherited

Get the outlet boundaries.

Definition at line 71 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFluidHeatTransferPhysics::addEnergyOutletBC(), and WCNSLinearFVScalarTransportPhysics::addScalarOutletBC().

71 { return _outlet_boundaries; }
const std::vector< BoundaryName > _outlet_boundaries
Boundaries with a flow outlet specified on them.

◆ getPorosityFunctorName()

MooseFunctorName WCNSFVFlowPhysicsBase::getPorosityFunctorName ( const bool  smoothed) const
inherited

Definition at line 407 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergyHeatConductionKernels(), WCNSFVFluidHeatTransferPhysics::addEnergyTimeKernels(), WCNSFVScalarTransportPhysics::addScalarAdvectionKernels(), and WCNSFVCoupledAdvectionPhysicsHelper::getPorosityFunctorName().

408 {
409  if (smoothed)
411  else
412  return _porosity_name;
413 }
const MooseFunctorName _porosity_name
Name of the porosity functor.
MooseFunctorName _flow_porosity_functor_name
Name of the porosity functor for the flow equations (if smoothed)

◆ getPressureName()

const NonlinearVariableName& WCNSFVFlowPhysicsBase::getPressureName ( ) const
inlineinherited

Definition at line 41 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysicsBase::addMaterials(), and WCNSFVFlowPhysicsBase::getFlowVariableName().

41 { return _pressure_name; }
const NonlinearVariableName _pressure_name
Pressure name.

◆ getVelocityFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getVelocityFaceInterpolationMethod ( ) const
inlineinherited

Get the face interpolation method for velocity.

Definition at line 57 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm().

57 { return _velocity_interpolation; }
const MooseEnum _velocity_interpolation
The velocity face interpolation method for advecting other quantities.

◆ getVelocityNames()

const std::vector<std::string>& WCNSFVFlowPhysicsBase::getVelocityNames ( ) const
inlineinherited

◆ getWallBoundaries()

const std::vector<BoundaryName>& WCNSFVFlowPhysicsBase::getWallBoundaries ( ) const
inlineinherited

Get the wall boundaries.

Definition at line 73 of file WCNSFVFlowPhysicsBase.h.

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

73 { return _wall_boundaries; }
const std::vector< BoundaryName > _wall_boundaries
Boundaries which define a wall (slip/noslip/etc.)

◆ gravityVector()

RealVectorValue WCNSFVFlowPhysicsBase::gravityVector ( ) const
inlineinherited

Return the gravity vector.

Definition at line 51 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVTwoPhaseMixturePhysics::addMaterials(), WCNSFVTwoPhaseMixturePhysics::addMaterials(), and WCNSLinearFVTwoPhaseMixturePhysics::checkIntegrity().

51 { return getParam<RealVectorValue>("gravity"); }

◆ hasFlowEquations()

bool WCNSFVFlowPhysicsBase::hasFlowEquations ( ) const
inlineinherited

Whether the physics is actually creating the flow equations.

Definition at line 37 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVTwoPhaseMixturePhysics::addFVKernels(), WCNSFVTwoPhaseMixturePhysics::addFVKernels(), and WCNSFVTurbulencePhysics::retrieveCoupledPhysics().

37 { return _has_flow_equations; }
const bool _has_flow_equations
Boolean to keep track of whether the flow equations should be created.

◆ hasForchheimerFriction()

bool WCNSFVFlowPhysics::hasForchheimerFriction ( ) const
overrideprivatevirtual

Return whether a Forchheimer friction model is in use.

Implements WCNSFVFlowPhysicsBase.

Definition at line 1085 of file WCNSFVFlowPhysics.C.

Referenced by addMomentumFrictionKernels().

1086 {
1087  for (const auto block_i : index_range(_friction_types))
1088  for (const auto type_i : index_range(_friction_types[block_i]))
1089  if (MooseUtils::toUpper(_friction_types[block_i][type_i]) == "FORCHHEIMER")
1090  return true;
1091  return false;
1092 }
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
std::string toUpper(const std::string &name)
auto index_range(const T &sizable)

◆ hasTurbulencePhysics()

bool WCNSFVFlowPhysicsBase::hasTurbulencePhysics ( ) const
inlineprotectedinherited

Whether a turbulence Physics has been coupled in, to know which viscosity to pick on symmetry boundary conditions.

Definition at line 131 of file WCNSFVFlowPhysicsBase.h.

Referenced by addWallsBC().

132  {
135  else
136  return false;
137  }
const WCNSFVTurbulencePhysics * _turbulence_physics
Can be set to a coupled turbulence physics.
bool hasTurbulenceModel() const
Whether a turbulence model is in use.

◆ initializePhysicsAdditional()

void WCNSFVFlowPhysicsBase::initializePhysicsAdditional ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Reimplemented in WCNSLinearFVFlowPhysics.

Definition at line 246 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSLinearFVFlowPhysics::initializePhysicsAdditional().

247 {
248  getProblem().needFV();
249 }
virtual void needFV() override
virtual FEProblemBase & getProblem()

◆ porousMediumTreatment()

bool WCNSFVFlowPhysicsBase::porousMediumTreatment ( ) const
inlineinherited

Return whether a porous medium treatment is applied.

Definition at line 49 of file WCNSFVFlowPhysicsBase.h.

49 { return _porous_medium_treatment; }
const bool _porous_medium_treatment
Whether to use the porous medium treatment.

◆ rhieChowUOName()

UserObjectName WCNSFVFlowPhysics::rhieChowUOName ( ) const
overridevirtual

Return the name of the Rhie Chow user object.

Implements WCNSFVFlowPhysicsBase.

Definition at line 1187 of file WCNSFVFlowPhysics.C.

Referenced by addInletBC(), addMassKernels(), addMomentumAdvectionKernels(), addMomentumBoussinesqKernels(), addMomentumFrictionKernels(), addMomentumGravityKernels(), addMomentumPressureKernels(), addMomentumTimeKernels(), addMomentumViscousDissipationKernels(), addOutletBC(), addSeparatorBC(), and addWallsBC().

1188 {
1189  mooseAssert(!_rc_uo_name.empty(), "The Rhie-Chow user-object name should be set!");
1190  return _rc_uo_name;
1191 }
UserObjectName _rc_uo_name
Name of the user object in charge of computing the Rhie Chow coefficients.

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

Definition at line 24 of file WCNSFVFlowPhysics.C.

25 {
27  params.addClassDescription(
28  "Define the Navier Stokes weakly-compressible mass and momentum equations");
29 
30  // Rhie Chow interpolation parameters
31  params.transferParam<Real>(INSFVMomentumAdvection::validParams(), "characteristic_speed");
32  params.addParam<bool>(
33  "time_derivative_contributes_to_RC_coefficients",
34  true,
35  "Whether the time derivative term should contribute to the Rhie Chow coefficients. This adds "
36  "stabilization, but makes the solution dependent on the time step size");
37  params.addParamNamesToGroup("time_derivative_contributes_to_RC_coefficients characteristic_speed",
38  "Numerical scheme");
39 
40  // Used for flow mixtures, where one phase is solid / not moving under the action of gravity
41  params.addParam<MooseFunctorName>(
42  "density_for_gravity_terms",
43  "If specified, replaces the 'density' for the Boussinesq and gravity momentum kernels");
44 
45  // Additional porous media parameters
46  params.transferParam<unsigned short>(NSFVBase::validParams(), "porosity_smoothing_layers");
47 
48  // Techniques to limit or remove oscillations at porosity jump interfaces
49  params.transferParam<MooseEnum>(NSFVBase::validParams(), "porosity_interface_pressure_treatment");
50  params.transferParam<std::vector<BoundaryName>>(NSFVBase::validParams(),
51  "pressure_drop_sidesets");
52  params.transferParam<std::vector<Real>>(NSFVBase::validParams(), "pressure_drop_form_factors");
53 
54  // Friction correction, a technique to limit oscillations at friction interfaces
55  params.transferParam<bool>(NSFVBase::validParams(), "use_friction_correction");
56  params.transferParam<Real>(NSFVBase::validParams(), "consistent_scaling");
57 
58  // Couple to turbulence physics
59  params.addParam<PhysicsName>("coupled_turbulence_physics",
60  "Turbulence Physics coupled with the flow");
61 
62  // Spatial discretization scheme
63  // Specify the numerical schemes for interpolations of velocity and pressure
64  params.transferParam<MooseEnum>(NSFVBase::validParams(), "pressure_face_interpolation");
65  params.transferParam<MooseEnum>(NSFVBase::validParams(), "mass_advection_interpolation");
66  params.transferParam<bool>(NSFVBase::validParams(),
67  "pressure_allow_expansion_on_bernoulli_faces");
68 
69  // Nonlinear solver parameters
70  params.transferParam<Real>(NSFVBase::validParams(), "mass_scaling");
71  params.transferParam<Real>(NSFVBase::validParams(), "momentum_scaling");
72 
73  // Parameter groups
74  params.addParamNamesToGroup("coupled_turbulence_physics", "Coupled Physics");
75  params.addParamNamesToGroup(
76  "porosity_interface_pressure_treatment pressure_allow_expansion_on_bernoulli_faces "
77  "porosity_smoothing_layers use_friction_correction consistent_scaling "
78  "pressure_drop_sidesets pressure_drop_form_factors",
79  "Flow medium discontinuity treatment");
80  params.addParamNamesToGroup("pressure_face_interpolation "
81  "mass_advection_interpolation momentum_advection_interpolation "
82  "mass_scaling momentum_scaling characteristic_speed",
83  "Numerical scheme");
84 
85  // TODO Add default preconditioning and move scaling parameters to a preconditioning group
86 
87  return params;
88 }
static InputParameters validParams()
Definition: NSFVBase.C:368
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
static InputParameters validParams()
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 addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)

Member Data Documentation

◆ _compressibility

const MooseEnum WCNSFVFlowPhysicsBase::_compressibility
protectedinherited

◆ _define_variables

bool NavierStokesPhysicsBase::_define_variables
protectedinherited

◆ _density_gravity_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_density_gravity_name
protectedinherited

Name of the density material property used for gravity and Boussinesq terms.

Definition at line 170 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addFunctorMaterials(), WCNSLinearFVFlowPhysics::addMomentumBoussinesqKernels(), addMomentumBoussinesqKernels(), and addMomentumGravityKernels().

◆ _density_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_density_name
protectedinherited

◆ _dynamic_viscosity_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_dynamic_viscosity_name
protectedinherited

◆ _flow_porosity_functor_name

MooseFunctorName WCNSFVFlowPhysicsBase::_flow_porosity_functor_name
protectedinherited

◆ _fluid_temperature_name

const NonlinearVariableName WCNSFVFlowPhysicsBase::_fluid_temperature_name
protectedinherited

◆ _flux_inlet_directions

std::vector<Point> WCNSFVFlowPhysicsBase::_flux_inlet_directions
protectedinherited

Direction of each flux inlet. Indexing based on the number of flux boundaries.

Definition at line 210 of file WCNSFVFlowPhysicsBase.h.

Referenced by addInletBC(), WCNSFVFlowPhysicsBase::getFluxInletDirections(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _flux_inlet_pps

std::vector<PostprocessorName> WCNSFVFlowPhysicsBase::_flux_inlet_pps
protectedinherited

Postprocessors describing the momentum inlet for each boundary. Indexing based on the number of flux boundaries.

Definition at line 208 of file WCNSFVFlowPhysicsBase.h.

Referenced by addInletBC(), and WCNSFVFlowPhysicsBase::getFluxInletPPs().

◆ _friction_blocks

std::vector<std::vector<SubdomainName> > WCNSFVFlowPhysicsBase::_friction_blocks
protectedinherited

Subdomains where we want to have volumetric friction.

Definition at line 185 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addMomentumFrictionKernels(), addMomentumFrictionKernels(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _friction_coeffs

std::vector<std::vector<std::string> > WCNSFVFlowPhysicsBase::_friction_coeffs
protectedinherited

The coefficients used for each item if friction type.

Definition at line 189 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addMomentumFrictionKernels(), addMomentumFrictionKernels(), and getLinearFrictionCoefName().

◆ _friction_types

std::vector<std::vector<std::string> > WCNSFVFlowPhysicsBase::_friction_types
protectedinherited

◆ _has_flow_equations

const bool WCNSFVFlowPhysicsBase::_has_flow_equations
protectedinherited

◆ _hydraulic_separators

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_hydraulic_separators
protectedinherited

◆ _inlet_boundaries

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_inlet_boundaries
protectedinherited

◆ _momentum_advection_interpolation

const MooseEnum WCNSFVFlowPhysicsBase::_momentum_advection_interpolation
protectedinherited

◆ _momentum_face_interpolation

const MooseEnum WCNSFVFlowPhysicsBase::_momentum_face_interpolation
protectedinherited

The momentum face interpolation method for stress terms.

Definition at line 179 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::getMomentumFaceInterpolationMethod().

◆ _momentum_inlet_functors

std::map<BoundaryName, std::vector<MooseFunctorName> > WCNSFVFlowPhysicsBase::_momentum_inlet_functors
protectedinherited

Functors describing the momentum inlet for each boundary.

Definition at line 213 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addInletBC(), addInletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_inlet_types

std::map<BoundaryName, MooseEnum> WCNSFVFlowPhysicsBase::_momentum_inlet_types
protectedinherited

Momentum inlet boundary types.

Definition at line 201 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addInletBC(), addInletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_outlet_types

std::map<BoundaryName, MooseEnum> WCNSFVFlowPhysicsBase::_momentum_outlet_types
protectedinherited

Momentum outlet boundary types.

Definition at line 203 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addOutletBC(), addOutletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_wall_functors

std::map<BoundaryName, std::vector<MooseFunctorName> > WCNSFVFlowPhysicsBase::_momentum_wall_functors
protectedinherited

Functors describing the momentum for each wall boundary.

Definition at line 217 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addWallsBC(), addWallsBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _momentum_wall_types

std::map<BoundaryName, MooseEnum> WCNSFVFlowPhysicsBase::_momentum_wall_types
protectedinherited

Momentum wall boundary types.

Definition at line 205 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addWallsBC(), addWallsBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _outlet_boundaries

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_outlet_boundaries
protectedinherited

Boundaries with a flow outlet specified on them.

Definition at line 194 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFlowPhysicsBase::getOutletBoundaries(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _porosity_name

const MooseFunctorName WCNSFVFlowPhysicsBase::_porosity_name
protectedinherited

◆ _porosity_smoothing_layers

const unsigned WCNSFVFlowPhysics::_porosity_smoothing_layers
private

The number of smoothing layers if that treatment is used on porosity.

Definition at line 76 of file WCNSFVFlowPhysics.h.

◆ _porous_medium_treatment

const bool WCNSFVFlowPhysicsBase::_porous_medium_treatment
protectedinherited

◆ _pressure_functors

std::map<BoundaryName, MooseFunctorName> WCNSFVFlowPhysicsBase::_pressure_functors
protectedinherited

Functors describing the outlet pressure on each boundary.

Definition at line 215 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addOutletBC(), addOutletBC(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _pressure_name

const NonlinearVariableName WCNSFVFlowPhysicsBase::_pressure_name
protectedinherited

◆ _pressure_tag

const TagName WCNSFVFlowPhysicsBase::_pressure_tag = "p_tag"
protectedinherited

Name of the vector to hold pressure momentum equation contributions.

Definition at line 143 of file WCNSFVFlowPhysicsBase.h.

◆ _rc_uo_name

UserObjectName WCNSFVFlowPhysics::_rc_uo_name
private

Name of the user object in charge of computing the Rhie Chow coefficients.

Definition at line 79 of file WCNSFVFlowPhysics.h.

Referenced by addRhieChowUserObjects(), and rhieChowUOName().

◆ _solve_for_dynamic_pressure

const bool WCNSFVFlowPhysicsBase::_solve_for_dynamic_pressure
protectedinherited

Whether we are solving for the total or dynamic pressure.

Definition at line 151 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addMomentumGravityKernels(), addMomentumGravityKernels(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().

◆ _turbulence_physics

const WCNSFVTurbulencePhysics* WCNSFVFlowPhysicsBase::_turbulence_physics
protectedinherited

Can be set to a coupled turbulence physics.

Definition at line 182 of file WCNSFVFlowPhysicsBase.h.

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

◆ _velocity_interpolation

const MooseEnum WCNSFVFlowPhysicsBase::_velocity_interpolation
protectedinherited

The velocity face interpolation method for advecting other quantities.

Definition at line 175 of file WCNSFVFlowPhysicsBase.h.

Referenced by addMassKernels(), addMomentumAdvectionKernels(), and WCNSFVFlowPhysicsBase::getVelocityFaceInterpolationMethod().

◆ _velocity_names

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

◆ _wall_boundaries

const std::vector<BoundaryName> WCNSFVFlowPhysicsBase::_wall_boundaries
protectedinherited

Boundaries which define a wall (slip/noslip/etc.)

Definition at line 196 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSLinearFVFlowPhysics::addWallsBC(), WCNSFVFlowPhysicsBase::getWallBoundaries(), and WCNSFVFlowPhysicsBase::WCNSFVFlowPhysicsBase().


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