Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 MooseEnumgetMomentumFaceInterpolationMethod () const
 Get the face interpolation method for momentum in the advection term. 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 & 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
 
void addPetscPairsToPetscOptions (const std::vector< std::pair< MooseEnumItem, std::string >> &petsc_pair_options)
 
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 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 WCNSFVTurbulencePhysics_turbulence_physics
 Can be set to a coupled turbulence physics. 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 ()
 
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...
 
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...
 
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 91 of file WCNSFVFlowPhysics.C.

93  _porosity_smoothing_layers(isParamValid("porosity_smoothing_layers")
94  ? getParam<unsigned short>("porosity_smoothing_layers")
95  : 0),
96  _friction_blocks(getParam<std::vector<std::vector<SubdomainName>>>("friction_blocks")),
97  _friction_types(getParam<std::vector<std::vector<std::string>>>("friction_types")),
98  _friction_coeffs(getParam<std::vector<std::vector<std::string>>>("friction_coeffs"))
99 {
100  _flow_porosity_functor_name = isParamValid("porosity_smoothing_layers") &&
101  getParam<unsigned short>("porosity_smoothing_layers")
103  : _porosity_name;
104 
105  // Most likely to be a mistake
106  if (getParam<bool>("pin_pressure") &&
107  getParam<std::vector<MooseFunctorName>>("pressure_functors").size())
108  paramError("pin_pressure", "Cannot pin the pressure if a pressure boundary exists");
109 
110  // Friction parameter checks
111  if (_friction_blocks.size())
112  checkVectorParamsSameLength<std::vector<SubdomainName>, std::vector<std::string>>(
113  "friction_blocks", "friction_types");
114  checkTwoDVectorParamsSameLength<std::string, std::string>("friction_types", "friction_coeffs");
115 
116  // Pressure pin checks
117  checkSecondParamSetOnlyIfFirstOneTrue("pin_pressure", "pinned_pressure_type");
118  checkSecondParamSetOnlyIfFirstOneTrue("pin_pressure", "pinned_pressure_value");
119  if (getParam<bool>("pin_pressure"))
120  {
121  if ((std::string(getParam<MooseEnum>("pinned_pressure_type")).find("point") !=
122  std::string::npos) &&
123  !isParamSetByUser("pinned_pressure_point"))
124  paramError("pinned_pressure_point",
125  "This parameter must be set to specify the pinned pressure point");
126  else if ((std::string(getParam<MooseEnum>("pinned_pressure_type")).find("point") ==
127  std::string::npos) &&
128  isParamSetByUser("pinned_pressure_point"))
129  paramError("pinned_pressure_point",
130  "This parameter should not be given by the user with the corresponding "
131  "pinned_pressure_type setting: " +
132  std::string(getParam<MooseEnum>("pinned_pressure_type")) + ".");
133  }
134 
135  // Porosity correction checks
136  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment", "use_friction_correction");
137  checkSecondParamSetOnlyIfFirstOneTrue("use_friction_correction", "consistent_scaling");
138  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment",
139  "porosity_interface_pressure_treatment");
140  if (getParam<MooseEnum>("porosity_interface_pressure_treatment") != "bernoulli")
141  errorDependentParameter("porosity_interface_pressure_treatment",
142  "bernoulli",
143  {"pressure_allow_expansion_on_bernoulli_faces",
144  "pressure_drop_sidesets",
145  "pressure_drop_form_factors"});
146 
147  // Porous media parameters
148  checkSecondParamSetOnlyIfFirstOneTrue("porous_medium_treatment", "porosity_smoothing_layers");
149 }
static const std::string smoothed_porosity
Definition: NS.h:105
std::vector< std::vector< SubdomainName > > _friction_blocks
Subdomains where we want to have volumetric friction.
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
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
void checkVectorParamsSameLength(const std::string &param1, const std::string &param2) const
const T & getParam(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
std::vector< std::vector< std::string > > _friction_coeffs
The coefficients used for each item if friction type.

Member Function Documentation

◆ actOnAdditionalTasks()

void WCNSFVFlowPhysicsBase::actOnAdditionalTasks ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 240 of file WCNSFVFlowPhysicsBase.C.

241 {
242  // Turbulence physics would not be initialized before this task
243  if (_current_task == "get_turbulence_physics")
245 }
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 1029 of file WCNSFVFlowPhysics.C.

1030 {
1031  if (!_has_flow_equations)
1032  return;
1033 
1034  // Pressure pin
1035  if (getParam<bool>("pin_pressure"))
1036  {
1037  const auto pin_type = getParam<MooseEnum>("pinned_pressure_type");
1038  std::string object_type = "NSPressurePin";
1039 
1040  // No need for the user object
1041  if (pin_type == "point-value" || pin_type == "average")
1042  return;
1043 
1044  // Create the average value postprocessor if needed
1045  if (pin_type == "average-uo")
1046  {
1047  // Volume average by default, but we could do inlet or outlet for example
1048  InputParameters params = getFactory().getValidParams("ElementAverageValue");
1049  params.set<std::vector<VariableName>>("variable") = {_pressure_name};
1050  assignBlocks(params, _blocks);
1051  params.set<std::vector<OutputName>>("outputs") = {"none"};
1052  getProblem().addPostprocessor("ElementAverageValue", "ns_pressure_average", params);
1053  }
1054 
1055  InputParameters params = getFactory().getValidParams(object_type);
1056  if (pin_type == "point-value" || pin_type == "point-value-uo")
1057  params.set<MooseEnum>("pin_type") = "point-value";
1058  else
1059  params.set<MooseEnum>("pin_type") = "average";
1060 
1061  params.set<PostprocessorName>("phi0") = getParam<PostprocessorName>("pinned_pressure_value");
1062  params.set<NonlinearVariableName>("variable") = _pressure_name;
1063  if (pin_type == "point-value" || pin_type == "point-value-uo")
1064  params.set<Point>("point") = getParam<Point>("pinned_pressure_point");
1065  else if (pin_type == "average-uo")
1066  params.set<PostprocessorName>("pressure_average") = "ns_pressure_average";
1067 
1068  getProblem().addUserObject(object_type, prefix() + "ins_mass_pressure_pin", params);
1069  }
1070 }
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 248 of file WCNSFVFlowPhysicsBase.C.

249 {
250  addInletBC();
251  addOutletBC();
252  addWallsBC();
253  addSeparatorBC();
254 }
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 262 of file WCNSFVFlowPhysics.C.

263 {
264  if (!_has_flow_equations)
265  return;
266 
267  // Mass equation: time derivative
268  if (_compressibility == "weakly-compressible" && isTransient())
270 
271  // Mass equation: divergence of momentum
272  addMassKernels();
273 
274  // Pressure pin
275  if (getParam<bool>("pin_pressure"))
277 
278  // Momentum equation: time derivative
279  if (isTransient())
281 
282  // Momentum equation: momentum advection
284 
285  // Momentum equation: momentum viscous stress
287 
288  // Momentum equation: pressure term
290 
291  // Momentum equation: gravity source term
293 
294  // Momentum equation: friction kernels
295  if (_friction_types.size())
297 
298  // Momentum equation: boussinesq approximation
299  if (getParam<bool>("boussinesq_approximation"))
301 }
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
void addMomentumViscousDissipationKernels()
void addMassKernels()
Function adding kernels for the incompressible continuity equation.
void addPressurePinKernel()
Function adding the pressure constraint.
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
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 addMomentumGravityKernels() override
void addMomentumAdvectionKernels()
bool isTransient() const

◆ addInitialConditions()

void WCNSFVFlowPhysicsBase::addInitialConditions ( )
overrideprotectedvirtualinherited

Reimplemented from PhysicsBase.

Definition at line 298 of file WCNSFVFlowPhysicsBase.C.

299 {
300  if (!_define_variables && parameters().isParamSetByUser("initial_velocity") &&
301  parameters().isParamSetByUser("velocity_variable") &&
302  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
303  // TODO: Rework and remove this last statement once the NSFV action is removed
304  paramError("initial_velocity",
305  "Velocity is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
306  "conditions");
307  if (!_define_variables && parameters().isParamSetByUser("initial_pressure") &&
308  parameters().isParamSetByUser("pressure_variable"))
309  paramError("initial_pressure",
310  "Pressure is defined externally of WCNSFVFlowPhysicsBase, so should the inital "
311  "condition");
312 
313  // Check dimension
314  if (getParam<std::vector<FunctionName>>("initial_velocity").size() != dimension() &&
315  getParam<std::vector<FunctionName>>("initial_velocity").size() != 3 &&
316  getParam<std::vector<FunctionName>>("initial_velocity").size() != 0)
317  // TODO: Rework and remove this last statement once the NSFV action is removed
318  paramError("initial_velocity",
319  "The number of velocity components in the " + type() + " initial condition is not " +
320  std::to_string(dimension()) + " or 3!");
321 
322  // do not set initial conditions if we load from file
323  if (getParam<bool>("initialize_variables_from_mesh_file"))
324  return;
325  // do not set initial conditions if we are not defining variables
326  if (!_define_variables)
327  return;
328 
329  InputParameters params = getFactory().getValidParams("FunctionIC");
330  assignBlocks(params, _blocks);
331  auto vvalue = getParam<std::vector<FunctionName>>("initial_velocity");
332 
333  if (!_app.isRestarting() || parameters().isParamSetByUser("initial_velocity"))
334  for (const auto d : make_range(dimension()))
335  {
336  params.set<VariableName>("variable") = _velocity_names[d];
337  params.set<FunctionName>("function") = vvalue[d];
338 
339  getProblem().addInitialCondition("FunctionIC", prefix() + _velocity_names[d] + "_ic", params);
340  }
341 
342  if (!_app.isRestarting() || parameters().isParamSetByUser("initial_pressure"))
343  {
344  params.set<VariableName>("variable") = _pressure_name;
345  params.set<FunctionName>("function") = getParam<FunctionName>("initial_pressure");
346 
347  getProblem().addInitialCondition("FunctionIC", prefix() + _pressure_name + "_ic", params);
348  }
349 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
MooseApp & _app
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const NonlinearVariableName _pressure_name
Pressure name.
bool isRestarting() 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 &name) const
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 672 of file WCNSFVFlowPhysics.C.

673 {
674  // Check the size of the BC parameters
675  unsigned int num_velocity_functor_inlets = 0;
676  for (const auto & [bdy, momentum_outlet_type] : _momentum_inlet_types)
677  if (momentum_outlet_type == "fixed-velocity" || momentum_outlet_type == "fixed-pressure")
678  num_velocity_functor_inlets++;
679 
680  if (num_velocity_functor_inlets != _momentum_inlet_functors.size())
681  paramError("momentum_inlet_functors",
682  "Size (" + std::to_string(_momentum_inlet_functors.size()) +
683  ") is not the same as the number of entries in the momentum_inlet_types "
684  "subvector for fixed-velocities/pressures functors (size " +
685  std::to_string(num_velocity_functor_inlets) + ")");
686 
687  unsigned int flux_bc_counter = 0;
688  unsigned int velocity_pressure_counter = 0;
689  for (const auto & [inlet_bdy, momentum_inlet_type] : _momentum_inlet_types)
690  {
691  if (momentum_inlet_type == "fixed-velocity")
692  {
693  const std::string bc_type = "INSFVInletVelocityBC";
694  InputParameters params = getFactory().getValidParams(bc_type);
695  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
696  if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
697  paramError("momentum_inlet_functors",
698  "More non-flux inlets than inlet functors (" +
699  std::to_string(_momentum_inlet_functors.size()) + ")");
700 
701  // Check that enough functors have been provided for the dimension of the problem
702  const auto momentum_functors = libmesh_map_find(_momentum_inlet_functors, inlet_bdy);
703  if (momentum_functors.size() < dimension())
704  paramError("momentum_inlet_functors",
705  "Subvector for boundary '" + inlet_bdy + "' (size " +
706  std::to_string(momentum_functors.size()) +
707  ") is not the same size as the number of dimensions of the physics (" +
708  std::to_string(dimension()) + ")");
709 
710  for (const auto d : make_range(dimension()))
711  {
712  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
713  params.set<MooseFunctorName>("functor") = momentum_functors[d];
714 
715  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + inlet_bdy, params);
716  }
717  ++velocity_pressure_counter;
718  }
719  else if (momentum_inlet_type == "fixed-pressure")
720  {
721  const std::string bc_type = "INSFVOutletPressureBC";
722  InputParameters params = getFactory().getValidParams(bc_type);
723  params.set<NonlinearVariableName>("variable") = _pressure_name;
724  if (_momentum_inlet_functors.size() < velocity_pressure_counter + 1)
725  paramError("momentum_inlet_functors",
726  "More non-flux inlets than inlet functors (" +
727  std::to_string(_momentum_inlet_functors.size()) + ")");
728 
729  params.set<FunctionName>("function") =
730  libmesh_map_find(_momentum_inlet_functors, inlet_bdy)[0];
731  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
732 
733  getProblem().addFVBC(bc_type, _pressure_name + "_" + inlet_bdy, params);
734  ++velocity_pressure_counter;
735  }
736  else if (momentum_inlet_type == "flux-mass" || momentum_inlet_type == "flux-velocity")
737  {
738  {
739  const std::string bc_type =
740  _porous_medium_treatment ? "PWCNSFVMomentumFluxBC" : "WCNSFVMomentumFluxBC";
741  InputParameters params = getFactory().getValidParams(bc_type);
742 
743  if (_flux_inlet_directions.size())
744  params.set<Point>("direction") = _flux_inlet_directions[flux_bc_counter];
745 
746  params.set<MooseFunctorName>(NS::density) = _density_name;
747  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
748  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
750  params.set<MooseFunctorName>(NS::porosity) = _porosity_name;
751  if (_flux_inlet_pps.size() < flux_bc_counter + 1)
752  paramError("flux_inlet_pps",
753  "More inlet flux BCs than inlet flux pps (" +
754  std::to_string(_flux_inlet_pps.size()) + ")");
755 
756  if (momentum_inlet_type == "flux-mass")
757  {
758  params.set<PostprocessorName>("mdot_pp") = _flux_inlet_pps[flux_bc_counter];
759  params.set<PostprocessorName>("area_pp") = "area_pp_" + inlet_bdy;
760  }
761  else
762  params.set<PostprocessorName>("velocity_pp") = _flux_inlet_pps[flux_bc_counter];
763 
764  for (const auto d : make_range(dimension()))
765  params.set<MooseFunctorName>(NS::velocity_vector[d]) = _velocity_names[d];
766 
767  for (const auto d : make_range(dimension()))
768  {
769  params.set<MooseEnum>("momentum_component") = NS::directions[d];
770  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
771 
772  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + inlet_bdy, params);
773  }
774  }
775  {
776  const std::string bc_type = "WCNSFVMassFluxBC";
777  InputParameters params = getFactory().getValidParams(bc_type);
778  params.set<MooseFunctorName>(NS::density) = _density_name;
779  params.set<NonlinearVariableName>("variable") = _pressure_name;
780  params.set<std::vector<BoundaryName>>("boundary") = {inlet_bdy};
781 
782  if (_flux_inlet_directions.size())
783  params.set<Point>("direction") = _flux_inlet_directions[flux_bc_counter];
784 
785  if (momentum_inlet_type == "flux-mass")
786  {
787  params.set<PostprocessorName>("mdot_pp") = _flux_inlet_pps[flux_bc_counter];
788  params.set<PostprocessorName>("area_pp") = "area_pp_" + inlet_bdy;
789  }
790  else
791  params.set<PostprocessorName>("velocity_pp") = _flux_inlet_pps[flux_bc_counter];
792 
793  for (const auto d : make_range(dimension()))
794  params.set<MooseFunctorName>(NS::velocity_vector[d]) = _velocity_names[d];
795 
796  getProblem().addFVBC(bc_type, _pressure_name + "_" + inlet_bdy, params);
797  }
798 
799  // need to increment flux_bc_counter
800  ++flux_bc_counter;
801  }
802  }
803 }
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 325 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

326 {
327  std::string kernel_type = "INSFVMassAdvection";
328  std::string kernel_name = prefix() + "ins_mass_advection";
329 
331  {
332  kernel_type = "PINSFVMassAdvection";
333  kernel_name = prefix() + "pins_mass_advection";
334  }
335 
336  InputParameters params = getFactory().getValidParams(kernel_type);
337  assignBlocks(params, _blocks);
338  params.set<NonlinearVariableName>("variable") = _pressure_name;
339  params.set<MooseFunctorName>(NS::density) = _density_name;
340  params.set<MooseEnum>("velocity_interp_method") = _velocity_interpolation;
341  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
342  params.set<MooseEnum>("advected_interp_method") =
343  getParam<MooseEnum>("mass_advection_interpolation");
344 
345  getProblem().addFVKernel(kernel_type, kernel_name, params);
346 }
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 304 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

305 {
306  std::string mass_kernel_type = "WCNSFVMassTimeDerivative";
307  std::string kernel_name = prefix() + "wcns_mass_time";
308 
310  {
311  mass_kernel_type = "PWCNSFVMassTimeDerivative";
312  kernel_name = prefix() + "pwcns_mass_time";
313  }
314 
315  InputParameters params = getFactory().getValidParams(mass_kernel_type);
316  assignBlocks(params, _blocks);
317  params.set<NonlinearVariableName>("variable") = _pressure_name;
318  params.set<MooseFunctorName>(NS::time_deriv(NS::density)) = NS::time_deriv(_density_name);
320  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
321  getProblem().addFVKernel(mass_kernel_type, kernel_name, params);
322 }
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 257 of file WCNSFVFlowPhysicsBase.C.

258 {
261  else
263 }
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 406 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

407 {
408  std::string kernel_type = "INSFVMomentumAdvection";
409  std::string kernel_name = prefix() + "ins_momentum_advection_";
410 
412  {
413  kernel_type = "PINSFVMomentumAdvection";
414  kernel_name = prefix() + "pins_momentum_advection_";
415  }
416 
417  InputParameters params = getFactory().getValidParams(kernel_type);
418  assignBlocks(params, _blocks);
419  params.set<MooseFunctorName>(NS::density) = _density_name;
420  params.set<MooseEnum>("velocity_interp_method") = _velocity_interpolation;
421  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
422  params.set<MooseEnum>("advected_interp_method") = _momentum_advection_interpolation;
424  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
426 
427  for (const auto d : make_range(dimension()))
428  {
429  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
430  params.set<MooseEnum>("momentum_component") = NS::directions[d];
431 
432  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
433  }
434 }
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 539 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

540 {
541  if (_compressibility == "weakly-compressible")
542  paramError("boussinesq_approximation",
543  "We cannot use boussinesq approximation while running in weakly-compressible mode!");
544 
545  std::string kernel_type = "INSFVMomentumBoussinesq";
546  std::string kernel_name = prefix() + "ins_momentum_boussinesq_";
547 
549  {
550  kernel_type = "PINSFVMomentumBoussinesq";
551  kernel_name = prefix() + "pins_momentum_boussinesq_";
552  }
553 
554  InputParameters params = getFactory().getValidParams(kernel_type);
555  assignBlocks(params, _blocks);
556  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
557  params.set<MooseFunctorName>(NS::T_fluid) = _fluid_temperature_name;
558  params.set<MooseFunctorName>(NS::density) = _density_gravity_name;
559  params.set<RealVectorValue>("gravity") = getParam<RealVectorValue>("gravity");
560  params.set<Real>("ref_temperature") = getParam<Real>("ref_temperature");
561  params.set<MooseFunctorName>("alpha_name") = getParam<MooseFunctorName>("thermal_expansion");
563  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
564  // User declared the flow to be incompressible, we have to trust them
565  params.set<bool>("_override_constant_check") = true;
566 
567  for (const auto d : make_range(dimension()))
568  {
569  params.set<MooseEnum>("momentum_component") = NS::directions[d];
570  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
571 
572  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
573  }
574 }
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 ( )
private

Definition at line 577 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

578 {
579  unsigned int num_friction_blocks = _friction_blocks.size();
580  unsigned int num_used_blocks = num_friction_blocks ? num_friction_blocks : 1;
581 
582  const std::string kernel_type = "PINSFVMomentumFriction";
583  InputParameters params = getFactory().getValidParams(kernel_type);
584  params.set<MooseFunctorName>(NS::density) = _density_name;
585  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
587  params.set<MooseFunctorName>(NS::speed) = NS::speed;
588  params.set<bool>("standard_friction_formulation") =
589  getParam<bool>("standard_friction_formulation");
590  params.set<bool>("is_porous_medium") = _porous_medium_treatment;
591 
592  for (const auto block_i : make_range(num_used_blocks))
593  {
594  std::string block_name = "";
595  if (num_friction_blocks)
596  {
597  params.set<std::vector<SubdomainName>>("block") = _friction_blocks[block_i];
598  block_name = Moose::stringify(_friction_blocks[block_i]);
599  }
600  else
601  {
602  assignBlocks(params, _blocks);
603  block_name = std::to_string(block_i);
604  }
605 
606  for (const auto d : make_range(dimension()))
607  {
608  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
609  params.set<MooseEnum>("momentum_component") = NS::directions[d];
610  for (unsigned int type_i = 0; type_i < _friction_types[block_i].size(); ++type_i)
611  {
612  const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
613  if (upper_name == "DARCY")
614  {
615  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
616  params.set<MooseFunctorName>("Darcy_name") = _friction_coeffs[block_i][type_i];
617  }
618  else if (upper_name == "FORCHHEIMER")
619  {
620  params.set<MooseFunctorName>(NS::speed) = NS::speed;
621  params.set<MooseFunctorName>("Forchheimer_name") = _friction_coeffs[block_i][type_i];
622  }
623  }
624 
625  getProblem().addFVKernel(kernel_type,
626  prefix() + "momentum_friction_" + block_name + "_" +
627  NS::directions[d],
628  params);
629  }
630 
631  if (_porous_medium_treatment && getParam<bool>("use_friction_correction"))
632  {
633  const std::string correction_kernel_type = "PINSFVMomentumFrictionCorrection";
634  InputParameters corr_params = getFactory().getValidParams(correction_kernel_type);
635  if (num_friction_blocks)
636  corr_params.set<std::vector<SubdomainName>>("block") = _friction_blocks[block_i];
637  else
638  assignBlocks(corr_params, _blocks);
639  corr_params.set<MooseFunctorName>(NS::density) = _density_name;
640  corr_params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
641  corr_params.set<Real>("consistent_scaling") = getParam<Real>("consistent_scaling");
642  for (const auto d : make_range(dimension()))
643  {
644  corr_params.set<NonlinearVariableName>("variable") = _velocity_names[d];
645  corr_params.set<MooseEnum>("momentum_component") = NS::directions[d];
646  for (unsigned int type_i = 0; type_i < _friction_types[block_i].size(); ++type_i)
647  {
648  const auto upper_name = MooseUtils::toUpper(_friction_types[block_i][type_i]);
649  if (upper_name == "DARCY")
650  {
651  corr_params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
652  corr_params.set<MooseFunctorName>("Darcy_name") = _friction_coeffs[block_i][type_i];
653  }
654  else if (upper_name == "FORCHHEIMER")
655  {
656  corr_params.set<MooseFunctorName>(NS::speed) = NS::speed;
657  corr_params.set<MooseFunctorName>("Forchheimer_name") =
658  _friction_coeffs[block_i][type_i];
659  }
660  }
661 
662  getProblem().addFVKernel(correction_kernel_type,
663  prefix() + "pins_momentum_friction_correction_" + block_name +
664  "_" + NS::directions[d],
665  corr_params);
666  }
667  }
668  }
669 }
std::string prefix() const
void assignBlocks(InputParameters &params, const std::vector< SubdomainName > &blocks) const
Factory & getFactory()
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.
std::vector< std::vector< SubdomainName > > _friction_blocks
Subdomains where we want to have volumetric friction.
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
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
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.
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 504 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

505 {
507  {
508  std::string kernel_type = "INSFVMomentumGravity";
509  std::string kernel_name = prefix() + "ins_momentum_gravity_";
510 
512  {
513  kernel_type = "PINSFVMomentumGravity";
514  kernel_name = prefix() + "pins_momentum_gravity_";
515  }
516 
517  InputParameters params = getFactory().getValidParams(kernel_type);
518  assignBlocks(params, _blocks);
519  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
520  params.set<MooseFunctorName>(NS::density) = _density_gravity_name;
521  params.set<RealVectorValue>("gravity") = getParam<RealVectorValue>("gravity");
523  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
524 
525  for (const auto d : make_range(dimension()))
526  {
527  if (getParam<RealVectorValue>("gravity")(d) != 0)
528  {
529  params.set<MooseEnum>("momentum_component") = NS::directions[d];
530  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
531 
532  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
533  }
534  }
535  }
536 }
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 475 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

476 {
477  std::string kernel_type = "INSFVMomentumPressure";
478  std::string kernel_name = prefix() + "ins_momentum_pressure_";
479 
481  {
482  kernel_type = "PINSFVMomentumPressure";
483  kernel_name = prefix() + "pins_momentum_pressure_";
484  }
485 
486  InputParameters params = getFactory().getValidParams(kernel_type);
487  assignBlocks(params, _blocks);
488  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
489  params.set<MooseFunctorName>("pressure") = _pressure_name;
490  params.set<bool>("correct_skewness") =
491  getParam<MooseEnum>("pressure_face_interpolation") == "skewness-corrected";
493  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
494 
495  for (const auto d : make_range(dimension()))
496  {
497  params.set<MooseEnum>("momentum_component") = NS::directions[d];
498  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
499  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
500  }
501 }
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 368 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

369 {
370  std::string kernel_type = (_compressibility == "weakly-compressible")
371  ? "WCNSFVMomentumTimeDerivative"
372  : "INSFVMomentumTimeDerivative";
373  std::string kernel_name = prefix() +
374  ((_compressibility == "weakly-compressible") ? "wcns_" : "ins_") +
375  "momentum_time_";
376 
378  {
379  // Porosity does not appear in the term
380  kernel_type = (_compressibility == "weakly-compressible") ? "WCNSFVMomentumTimeDerivative"
381  : "PINSFVMomentumTimeDerivative";
382  kernel_name = prefix() + ((_compressibility == "weakly-compressible") ? "pwcns_" : "pins_") +
383  "momentum_time_";
384  }
385 
386  InputParameters params = getFactory().getValidParams(kernel_type);
387  assignBlocks(params, _blocks);
388  params.set<MooseFunctorName>(NS::density) = _density_name;
389  if (_compressibility == "weakly-compressible")
390  params.set<MooseFunctorName>(NS::time_deriv(NS::density)) = NS::time_deriv(_density_name);
391 
392  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
393  params.set<bool>("contribute_to_rc") =
394  getParam<bool>("time_derivative_contributes_to_RC_coefficients");
395 
396  for (const auto d : make_range(dimension()))
397  {
398  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
399  params.set<MooseEnum>("momentum_component") = NS::directions[d];
400 
401  getProblem().addFVKernel(kernel_type, kernel_name + _velocity_names[d], params);
402  }
403 }
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 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 437 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

438 {
439  std::string kernel_type = "INSFVMomentumDiffusion";
440  std::string kernel_name = prefix() + "ins_momentum_diffusion_";
441 
443  {
444  kernel_type = "PINSFVMomentumDiffusion";
445  kernel_name = prefix() + "pins_momentum_diffusion_";
446  }
447 
448  InputParameters params = getFactory().getValidParams(kernel_type);
449  assignBlocks(params, _blocks);
450  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
451  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
452  params.set<MooseEnum>("mu_interp_method") = getParam<MooseEnum>("mu_interp_method");
453  if (getParam<bool>("include_deviatoric_stress"))
454  {
455  params.set<bool>("complete_expansion") = true;
456  const std::string u_names[3] = {"u", "v", "w"};
457  for (unsigned int i = 0; i < dimension(); ++i)
458  params.set<MooseFunctorName>(u_names[i]) = _velocity_names[i];
459  }
460 
462  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
463  // Currently only Newton method for WCNSFVFlowPhysics
464  params.set<bool>("newton_solve") = true;
465  for (const auto d : make_range(dimension()))
466  {
467  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
468  params.set<MooseEnum>("momentum_component") = NS::directions[d];
469 
470  getProblem().addFVKernel(kernel_type, kernel_name + NS::directions[d], params);
471  }
472 }
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 283 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

284 {
285  const std::string class_name = "ADVectorMagnitudeFunctorMaterial";
286  InputParameters params = getFactory().getValidParams(class_name);
287  assignBlocks(params, _blocks);
288 
289  const std::vector<std::string> param_names{"x_functor", "y_functor", "z_functor"};
290  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
291  params.set<MooseFunctorName>(param_names[dim_i]) = _velocity_names[dim_i];
292  params.set<MooseFunctorName>("vector_magnitude_name") = NS::speed;
293 
294  getProblem().addMaterial(class_name, prefix() + "ins_speed_material", params);
295 }
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 806 of file WCNSFVFlowPhysics.C.

807 {
808  // Check the BCs size
809  unsigned int num_pressure_outlets = 0;
810  for (const auto & [bdy, momentum_outlet_type] : _momentum_outlet_types)
811  if (momentum_outlet_type == "fixed-pressure" ||
812  momentum_outlet_type == "fixed-pressure-zero-gradient")
813  num_pressure_outlets++;
814 
815  if (num_pressure_outlets != _pressure_functors.size())
816  paramError("pressure_functors",
817  "Size (" + std::to_string(_pressure_functors.size()) +
818  ") is not the same as the number of pressure outlet boundaries in "
819  "'fixed-pressure/fixed-pressure-zero-gradient' (size " +
820  std::to_string(num_pressure_outlets) + ")");
821 
822  const std::string u_names[3] = {"u", "v", "w"};
823  for (const auto & [outlet_bdy, momentum_outlet_type] : _momentum_outlet_types)
824  {
825  if (momentum_outlet_type == "zero-gradient" ||
826  momentum_outlet_type == "fixed-pressure-zero-gradient")
827  {
828  {
829  const std::string bc_type = _porous_medium_treatment ? "PINSFVMomentumAdvectionOutflowBC"
830  : "INSFVMomentumAdvectionOutflowBC";
831  InputParameters params = getFactory().getValidParams(bc_type);
832  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
834  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
835  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
836  params.set<MooseFunctorName>(NS::density) = _density_name;
837 
838  for (unsigned int i = 0; i < dimension(); ++i)
839  params.set<MooseFunctorName>(u_names[i]) = _velocity_names[i];
840 
841  for (const auto d : make_range(dimension()))
842  {
843  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
844  params.set<MooseEnum>("momentum_component") = NS::directions[d];
845 
846  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + outlet_bdy, params);
847  }
848  }
849  }
850 
851  if (momentum_outlet_type == "fixed-pressure" ||
852  momentum_outlet_type == "fixed-pressure-zero-gradient")
853  {
854  const std::string bc_type = "INSFVOutletPressureBC";
855  InputParameters params = getFactory().getValidParams(bc_type);
856  params.set<NonlinearVariableName>("variable") = _pressure_name;
857  params.set<MooseFunctorName>("functor") = libmesh_map_find(_pressure_functors, outlet_bdy);
858  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
859 
860  getProblem().addFVBC(bc_type, _pressure_name + "_" + outlet_bdy, params);
861  }
862  else if (momentum_outlet_type == "zero-gradient")
863  {
864  const std::string bc_type = "INSFVMassAdvectionOutflowBC";
865  InputParameters params = getFactory().getValidParams(bc_type);
866  params.set<NonlinearVariableName>("variable") = _pressure_name;
867  params.set<MooseFunctorName>(NS::density) = _density_name;
868  params.set<std::vector<BoundaryName>>("boundary") = {outlet_bdy};
869 
870  for (const auto d : make_range(dimension()))
871  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
872 
873  getProblem().addFVBC(bc_type, _pressure_name + "_" + outlet_bdy, params);
874  }
875  }
876 }
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 266 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::addMaterials().

267 {
268  InputParameters params = getFactory().getValidParams("PINSFVSpeedFunctorMaterial");
269  assignBlocks(params, _blocks);
270 
271  for (unsigned int dim_i = 0; dim_i < dimension(); ++dim_i)
272  params.set<MooseFunctorName>(NS::superficial_velocity_vector[dim_i]) = _velocity_names[dim_i];
274  params.set<MooseFunctorName>(NS::porosity) = _flow_porosity_functor_name;
275  else
276  params.set<MooseFunctorName>(NS::porosity) = "1";
277  params.set<bool>("define_interstitial_velocity_components") = _porous_medium_treatment;
278 
279  getProblem().addMaterial("PINSFVSpeedFunctorMaterial", prefix() + "pins_speed_material", params);
280 }
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 359 of file WCNSFVFlowPhysicsBase.C.

360 {
361  const auto momentum_inlet_types = getParam<MultiMooseEnum>("momentum_inlet_types");
362 
363  for (unsigned int bc_ind = 0; bc_ind < momentum_inlet_types.size(); ++bc_ind)
364  if (momentum_inlet_types[bc_ind] == "flux-mass" ||
365  momentum_inlet_types[bc_ind] == "flux-velocity")
366  {
367  const std::string pp_type = "AreaPostprocessor";
368  InputParameters params = getFactory().getValidParams(pp_type);
369  params.set<std::vector<BoundaryName>>("boundary") = {_inlet_boundaries[bc_ind]};
370  params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL;
371 
372  const auto name_pp = "area_pp_" + _inlet_boundaries[bc_ind];
373  if (!getProblem().hasUserObject(name_pp))
374  getProblem().addPostprocessor(pp_type, name_pp, params);
375  }
376 }
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 349 of file WCNSFVFlowPhysics.C.

Referenced by addFVKernels().

350 {
351  const auto pin_type = getParam<MooseEnum>("pinned_pressure_type");
352  const auto object_type =
353  (pin_type == "average") ? "FVIntegralValueConstraint" : "FVPointValueConstraint";
354  InputParameters params = getFactory().getValidParams(object_type);
355  if (pin_type != "point-value" && pin_type != "average")
356  return;
357 
358  params.set<CoupledName>("lambda") = {"lambda"};
359  params.set<PostprocessorName>("phi0") = getParam<PostprocessorName>("pinned_pressure_value");
360  params.set<NonlinearVariableName>("variable") = _pressure_name;
361  if (pin_type == "point-value")
362  params.set<Point>("point") = getParam<Point>("pinned_pressure_point");
363 
364  getProblem().addFVKernel(object_type, prefix() + "ins_mass_pressure_pin", params);
365 }
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 1097 of file WCNSFVFlowPhysics.C.

Referenced by addUserObjects().

1098 {
1099  mooseAssert(dimension(), "0-dimension not supported");
1100 
1101  // First make sure that we only add this object once
1102  // Potential cases:
1103  // - there is a flow physics, and an advection one (UO should be added by one)
1104  // - there is only an advection physics (UO should be created)
1105  // - there are two advection physics on different blocks with set velocities (first one picks)
1106  // Counting RC UOs defined on the same blocks seems to be the most fool proof option
1107  std::vector<UserObject *> objs;
1108  getProblem()
1109  .theWarehouse()
1110  .query()
1111  .condition<AttribSystem>("UserObject")
1112  .condition<AttribThread>(0)
1113  .queryInto(objs);
1114  bool have_matching_rc_uo = false;
1115  for (const auto & obj : objs)
1116  if (const auto * const rc_obj = dynamic_cast<INSFVRhieChowInterpolator *>(obj); rc_obj)
1117  // Latter check is for whether one of the RC user object is defined everywhere
1118  if (rc_obj->blocks() == _blocks || (rc_obj->blocks().size() == 0 || _blocks.size() == 0))
1119  {
1120  have_matching_rc_uo = true;
1121  _rc_uo_name = rc_obj->name();
1122  break;
1123  }
1124 
1125  if (have_matching_rc_uo)
1126  return;
1127 
1128  _rc_uo_name =
1129  _porous_medium_treatment ? +"pins_rhie_chow_interpolator" : "ins_rhie_chow_interpolator";
1130 
1131  const std::string u_names[3] = {"u", "v", "w"};
1132  const auto object_type =
1133  _porous_medium_treatment ? "PINSFVRhieChowInterpolator" : "INSFVRhieChowInterpolator";
1134 
1135  auto params = getFactory().getValidParams(object_type);
1136  assignBlocks(params, _blocks);
1137  for (unsigned int d = 0; d < dimension(); ++d)
1138  params.set<VariableName>(u_names[d]) = _velocity_names[d];
1139 
1140  params.set<VariableName>("pressure") = _pressure_name;
1141 
1143  {
1144  params.set<MooseFunctorName>(NS::porosity) = _porosity_name;
1145  unsigned short smoothing_layers = isParamValid("porosity_smoothing_layers")
1146  ? getParam<unsigned short>("porosity_smoothing_layers")
1147  : 0;
1148  params.set<unsigned short>("smoothing_layers") = smoothing_layers;
1149  }
1150 
1151  if (!_has_flow_equations)
1152  {
1154  params.set<MooseFunctorName>("a_u") = "ax";
1155  params.set<MooseFunctorName>("a_v") = "ay";
1156  params.set<MooseFunctorName>("a_w") = "az";
1157  }
1158 
1159  params.applySpecificParameters(parameters(), INSFVRhieChowInterpolator::listOfCommonParams());
1160  getProblem().addUserObject(object_type, _rc_uo_name, params);
1161 }
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 997 of file WCNSFVFlowPhysics.C.

998 {
999  if (_hydraulic_separators.size())
1000  {
1001  std::string bc_type = "INSFVVelocityHydraulicSeparatorBC";
1002  InputParameters params = getFactory().getValidParams(bc_type);
1003  params.set<std::vector<BoundaryName>>("boundary") = _hydraulic_separators;
1004  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
1005 
1006  for (const auto d : make_range(dimension()))
1007  {
1008  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
1009  params.set<MooseEnum>("momentum_component") = NS::directions[d];
1010  getProblem().addFVBC(bc_type, prefix() + _velocity_names[d] + "_separators", params);
1011  }
1012 
1013  bc_type = "INSFVScalarFieldSeparatorBC";
1014  params = getFactory().getValidParams(bc_type);
1015  params.set<std::vector<BoundaryName>>("boundary") = _hydraulic_separators;
1016  params.set<NonlinearVariableName>("variable") = _pressure_name;
1017  getProblem().addFVBC(bc_type, prefix() + _pressure_name + "_separators", params);
1018  }
1019 }
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 152 of file WCNSFVFlowPhysics.C.

153 {
154  if (!_has_flow_equations)
155  return;
156 
157  for (const auto d : make_range(dimension()))
160 
161  // Check number of variables
162  if (_velocity_names.size() != dimension() && _velocity_names.size() != 3)
163  paramError("velocity_variable",
164  "The number of velocity variable names supplied to the NSFVAction is not " +
165  Moose::stringify(dimension()) + " (mesh dimension)" +
166  ((dimension() == 3) ? "" : " or 3!") + "\nVelocity variables " +
168 
169  // Velocities
170  for (const auto d : make_range(dimension()))
171  {
172  if (variableExists(_velocity_names[d], true))
175  else if (_define_variables)
176  {
177  std::string variable_type = "INSFVVelocityVariable";
179  variable_type = "PINSFVSuperficialVelocityVariable";
180 
181  auto params = getFactory().getValidParams(variable_type);
182  assignBlocks(params, _blocks); // TODO: check wrt components
183  params.set<std::vector<Real>>("scaling") = {getParam<Real>("momentum_scaling")};
184  params.set<MooseEnum>("face_interp_method") =
185  getParam<MooseEnum>("momentum_face_interpolation");
186  params.set<bool>("two_term_boundary_expansion") =
187  getParam<bool>("momentum_two_term_bc_expansion");
188 
189  for (const auto d : make_range(dimension()))
190  {
191  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_velocity_names[d]);
192  getProblem().addVariable(variable_type, _velocity_names[d], params);
193  }
194  }
195  else
196  paramError("velocity_variable",
197  "Variable (" + _velocity_names[d] +
198  ") supplied to the WCNSFVFlowPhysics does not exist!");
199  }
200 
201  // Pressure
202  if (variableExists(_pressure_name, true))
204  getProblem().getVariable(0, _pressure_name).blocks());
205  else if (_define_variables)
206  {
207  const bool using_pinsfv_pressure_var =
209  getParam<MooseEnum>("porosity_interface_pressure_treatment") != "automatic";
210  const auto pressure_type =
211  using_pinsfv_pressure_var ? "BernoulliPressureVariable" : "INSFVPressureVariable";
212 
213  auto params = getFactory().getValidParams(pressure_type);
214  assignBlocks(params, _blocks);
215  params.set<std::vector<Real>>("scaling") = {getParam<Real>("mass_scaling")};
216  params.set<MooseEnum>("face_interp_method") =
217  getParam<MooseEnum>("pressure_face_interpolation");
218  params.set<bool>("two_term_boundary_expansion") =
219  getParam<bool>("pressure_two_term_bc_expansion");
220 
221  if (using_pinsfv_pressure_var)
222  {
223  params.set<MooseFunctorName>("u") = _velocity_names[0];
224  if (dimension() >= 2)
225  params.set<MooseFunctorName>("v") = _velocity_names[1];
226  if (dimension() == 3)
227  params.set<MooseFunctorName>("w") = _velocity_names[2];
228  params.set<MooseFunctorName>(NS::porosity) = _porosity_name;
229  params.set<MooseFunctorName>(NS::density) = _density_name;
230  params.set<bool>("allow_two_term_expansion_on_bernoulli_faces") =
231  getParam<bool>("pressure_allow_expansion_on_bernoulli_faces");
232  params.set<std::vector<BoundaryName>>("pressure_drop_sidesets") =
233  getParam<std::vector<BoundaryName>>("pressure_drop_sidesets");
234  params.set<std::vector<Real>>("pressure_drop_form_factors") =
235  getParam<std::vector<Real>>("pressure_drop_form_factors");
236  }
237  params.set<SolverSystemName>("solver_sys") = getSolverSystem(_pressure_name);
238  getProblem().addVariable(pressure_type, _pressure_name, params);
239  }
240  else
241  paramError("pressure_variable",
242  "Variable (" + _pressure_name +
243  ") supplied to the WCNSFVFlowPhysics does not exist!");
244 
245  // Add lagrange multiplier for pinning pressure, if needed
246  if (getParam<bool>("pin_pressure"))
247  {
248  auto type = getParam<MooseEnum>("pinned_pressure_type");
249  auto lm_params = getFactory().getValidParams("MooseVariableScalar");
250  lm_params.set<MooseEnum>("family") = "scalar";
251  lm_params.set<MooseEnum>("order") = "first";
252 
253  if (type == "point-value" || type == "average")
254  {
255  lm_params.set<SolverSystemName>("solver_sys") = getSolverSystem("lambda");
256  getProblem().addVariable("MooseVariableScalar", "lambda", lm_params);
257  }
258  }
259 }
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()
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 std::vector< SubdomainName > & blocks() 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 const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const override
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 variableExists(const VariableName &var_name, bool error_if_aux) const
bool checkBlockRestrictionIdentical(const std::string &object_name, const std::vector< SubdomainName > &blocks, const bool error_if_not_identical=true) const
bool _define_variables
Whether to define variables if they do not exist.
const std::vector< SubdomainName > & blocks() const
IntRange< T > make_range(T beg, T end)
void saveSolverVariableName(const VariableName &var_name)

◆ addUserObjects()

void WCNSFVFlowPhysics::addUserObjects ( )
overrideprivatevirtual

Implements WCNSFVFlowPhysicsBase.

Definition at line 1022 of file WCNSFVFlowPhysics.C.

1023 {
1024  // Rhie Chow user object for interpolation velocities
1026 }
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 879 of file WCNSFVFlowPhysics.C.

880 {
881  const std::string u_names[3] = {"u", "v", "w"};
882 
883  // Count the number of fixed velocity wall boundaries (moving walls)
884  unsigned int num_functor_walls = 0;
885  for (const auto & [boundary_name, momentum_wall_type] : _momentum_wall_types)
886  if (momentum_wall_type == "noslip")
887  num_functor_walls++;
888  if (_momentum_wall_functors.size() && num_functor_walls != _momentum_wall_functors.size())
889  paramError("momentum_wall_functors",
890  "If any wall functors are specified, the number of boundaries requiring a momentum "
891  "functor (" +
892  std::to_string(num_functor_walls) + ") and the number of functors specified (" +
893  std::to_string(_momentum_wall_functors.size()) + ") must match");
894  for (const auto & wall_functors : _momentum_wall_functors)
895  if (wall_functors.second.size() != dimension())
896  paramError("momentum_wall_functors",
897  "Number of wall functors (" + std::to_string(wall_functors.second.size()) +
898  ") must match dimension (" + std::to_string(dimension()) +
899  ").\nFunctors currently specified:" + Moose::stringify(wall_functors.second));
900 
901  for (const auto & [boundary_name, wall_type] : _momentum_wall_types)
902  {
903  if (wall_type == "noslip")
904  {
905  const std::string bc_type = "INSFVNoSlipWallBC";
906  InputParameters params = getFactory().getValidParams(bc_type);
907  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
908 
909  for (const auto d : make_range(dimension()))
910  {
911  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
912  if (_momentum_wall_functors.count(boundary_name) == 0)
913  params.set<FunctionName>("function") = "0";
914  else
915  params.set<FunctionName>("function") = _momentum_wall_functors[boundary_name][d];
916 
917  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
918  }
919  }
920  else if (wall_type == "wallfunction")
921  {
922  const std::string bc_type = "INSFVWallFunctionBC";
923  InputParameters params = getFactory().getValidParams(bc_type);
924  params.set<MooseFunctorName>(NS::mu) = _dynamic_viscosity_name;
925  params.set<MooseFunctorName>(NS::density) = _density_name;
926  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
927  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
928 
929  for (const auto d : make_range(dimension()))
930  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
931 
932  for (const auto d : make_range(dimension()))
933  {
934  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
935  params.set<MooseEnum>("momentum_component") = NS::directions[d];
936 
937  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
938  }
939  }
940  else if (wall_type == "slip")
941  {
942  const std::string bc_type = "INSFVNaturalFreeSlipBC";
943  InputParameters params = getFactory().getValidParams(bc_type);
944  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
945  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
946 
947  for (const auto d : make_range(dimension()))
948  {
949  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
950  params.set<MooseEnum>("momentum_component") = NS::directions[d];
951 
952  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
953  }
954  }
955  else if (wall_type == "symmetry")
956  {
957  {
958  std::string bc_type;
960  bc_type = "PINSFVSymmetryVelocityBC";
961  else
962  bc_type = "INSFVSymmetryVelocityBC";
963 
964  InputParameters params = getFactory().getValidParams(bc_type);
965  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
966 
967  MooseFunctorName viscosity_name = _dynamic_viscosity_name;
968  if (hasTurbulencePhysics())
969  viscosity_name = NS::total_viscosity;
970  params.set<MooseFunctorName>(NS::mu) = viscosity_name;
971  params.set<UserObjectName>("rhie_chow_user_object") = rhieChowUOName();
972 
973  for (const auto d : make_range(dimension()))
974  params.set<MooseFunctorName>(u_names[d]) = _velocity_names[d];
975 
976  for (const auto d : make_range(dimension()))
977  {
978  params.set<NonlinearVariableName>("variable") = _velocity_names[d];
979  params.set<MooseEnum>("momentum_component") = NS::directions[d];
980 
981  getProblem().addFVBC(bc_type, _velocity_names[d] + "_" + boundary_name, params);
982  }
983  }
984  {
985  const std::string bc_type = "INSFVSymmetryPressureBC";
986  InputParameters params = getFactory().getValidParams(bc_type);
987  params.set<NonlinearVariableName>("variable") = _pressure_name;
988  params.set<std::vector<BoundaryName>>("boundary") = {boundary_name};
989 
990  getProblem().addFVBC(bc_type, _pressure_name + "_" + boundary_name, params);
991  }
992  }
993  }
994 }
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 1164 of file WCNSFVFlowPhysics.C.

Referenced by addRhieChowUserObjects().

1165 {
1166  if (!getProblem().hasFunctor("ax", /*thread_id=*/0))
1167  mooseError("Rhie Chow coefficient ax must be provided for advection by auxiliary velocities");
1168  if (dimension() >= 2 && !getProblem().hasFunctor("ay", /*thread_id=*/0))
1169  mooseError("Rhie Chow coefficient ay must be provided for advection by auxiliary velocities");
1170  if (dimension() == 3 && !getProblem().hasFunctor("az", /*thread_id=*/0))
1171  mooseError("Rhie Chow coefficient az must be provided for advection by auxiliary velocities");
1172 }
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 405 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSFVFlowPhysicsBase::actOnAdditionalTasks().

406 {
407  // User passed it, just use that
408  if (isParamValid("coupled_turbulence_physics"))
409  return getCoupledPhysics<WCNSFVTurbulencePhysics>(
410  getParam<PhysicsName>("coupled_flow_physics"));
411  // Look for any physics of the right type, and check the block restriction
412  else
413  {
414  const auto all_turbulence_physics = getCoupledPhysics<const WCNSFVTurbulencePhysics>(true);
415  for (const auto physics : all_turbulence_physics)
417  physics->name(), physics->blocks(), /*error_if_not_identical=*/false))
418  return physics;
419  }
420  // Did not find one
421  return nullptr;
422 }
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 379 of file WCNSFVFlowPhysicsBase.C.

380 {
381  if (short_name == NS::pressure)
382  return getPressureName();
383  else if (short_name == NS::velocity_x && dimension() > 0)
384  return getVelocityNames()[0];
385  else if (short_name == NS::velocity_y && dimension() > 1)
386  return getVelocityNames()[1];
387  else if (short_name == NS::velocity_z && dimension() > 2)
388  return getVelocityNames()[2];
389  else if (short_name == NS::temperature)
390  return getFluidTemperatureName();
391  else
392  mooseError("Short Variable name '", short_name, "' not recognized.");
393 }
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 72 of file WCNSFVFlowPhysicsBase.h.

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

72 { 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 74 of file WCNSFVFlowPhysicsBase.h.

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

74 { 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 70 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVFluidHeatTransferPhysics::addEnergySeparatorBC().

70 { 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 1182 of file WCNSFVFlowPhysics.C.

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

◆ getMomentumFaceInterpolationMethod()

const MooseEnum& WCNSFVFlowPhysicsBase::getMomentumFaceInterpolationMethod ( ) const
inlineinherited

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

Definition at line 59 of file WCNSFVFlowPhysicsBase.h.

Referenced by WCNSFVTwoPhaseMixturePhysics::addAdvectionSlipTerm().

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

◆ getNumberAlgebraicGhostingLayersNeeded()

unsigned short WCNSFVFlowPhysics::getNumberAlgebraicGhostingLayersNeeded ( ) const
overridevirtual

Return the number of algebraic ghosting layers needed.

Implements NavierStokesPhysicsBase.

Definition at line 1083 of file WCNSFVFlowPhysics.C.

1084 {
1086  if (_porous_medium_treatment && isParamValid("porosity_smoothing_layers"))
1087  ghost_layers = std::max(getParam<unsigned short>("porosity_smoothing_layers"), ghost_layers);
1088  if ((_porous_medium_treatment &&
1089  getParam<MooseEnum>("porosity_interface_pressure_treatment") != "automatic") ||
1090  getParam<MooseEnum>("momentum_face_interpolation") == "skewness-corrected" ||
1091  getParam<MooseEnum>("pressure_face_interpolation") == "skewness-corrected")
1092  ghost_layers = std::max(ghost_layers, (unsigned short)3);
1093  return ghost_layers;
1094 }
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 66 of file WCNSFVFlowPhysicsBase.h.

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

66 { 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 396 of file WCNSFVFlowPhysicsBase.C.

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

397 {
398  if (smoothed)
400  else
401  return _porosity_name;
402 }
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 68 of file WCNSFVFlowPhysicsBase.h.

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

68 { 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 WCNSFVTwoPhaseMixturePhysics::addMaterials().

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 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 1073 of file WCNSFVFlowPhysics.C.

Referenced by addMomentumFrictionKernels().

1074 {
1075  for (const auto block_i : index_range(_friction_types))
1076  for (const auto type_i : index_range(_friction_types[block_i]))
1077  if (MooseUtils::toUpper(_friction_types[block_i][type_i]) == "FORCHHEIMER")
1078  return true;
1079  return false;
1080 }
std::string toUpper(const std::string &name)
std::vector< std::vector< std::string > > _friction_types
The friction correlation types used for each block.
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 125 of file WCNSFVFlowPhysicsBase.h.

Referenced by addWallsBC().

126  {
129  else
130  return false;
131  }
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 234 of file WCNSFVFlowPhysicsBase.C.

Referenced by WCNSLinearFVFlowPhysics::initializePhysicsAdditional().

235 {
236  getProblem().needFV();
237 }
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 1175 of file WCNSFVFlowPhysics.C.

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

1176 {
1177  mooseAssert(!_rc_uo_name.empty(), "The Rhie-Chow user-object name should be set!");
1178  return _rc_uo_name;
1179 }
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(), "momentum_face_interpolation");
66  params.transferParam<MooseEnum>(NSFVBase::validParams(), "mass_advection_interpolation");
67  params.transferParam<bool>(NSFVBase::validParams(),
68  "pressure_allow_expansion_on_bernoulli_faces");
69 
70  // Nonlinear solver parameters
71  params.transferParam<Real>(NSFVBase::validParams(), "mass_scaling");
72  params.transferParam<Real>(NSFVBase::validParams(), "momentum_scaling");
73 
74  // Parameter groups
75  params.addParamNamesToGroup("coupled_turbulence_physics", "Coupled Physics");
76  params.addParamNamesToGroup(
77  "porosity_interface_pressure_treatment pressure_allow_expansion_on_bernoulli_faces "
78  "porosity_smoothing_layers use_friction_correction consistent_scaling "
79  "pressure_drop_sidesets pressure_drop_form_factors",
80  "Flow medium discontinuity treatment");
81  params.addParamNamesToGroup("pressure_face_interpolation momentum_face_interpolation "
82  "mass_advection_interpolation momentum_advection_interpolation "
83  "mass_scaling momentum_scaling characteristic_speed",
84  "Numerical scheme");
85 
86  // TODO Add default preconditioning and move scaling parameters to a preconditioning group
87 
88  return params;
89 }
static InputParameters validParams()
Definition: NSFVBase.C:353
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 164 of file WCNSFVFlowPhysicsBase.h.

Referenced by 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 195 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 193 of file WCNSFVFlowPhysicsBase.h.

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

◆ _friction_blocks

std::vector<std::vector<SubdomainName> > WCNSFVFlowPhysics::_friction_blocks
private

Subdomains where we want to have volumetric friction.

Definition at line 79 of file WCNSFVFlowPhysics.h.

Referenced by addMomentumFrictionKernels(), and WCNSFVFlowPhysics().

◆ _friction_coeffs

std::vector<std::vector<std::string> > WCNSFVFlowPhysics::_friction_coeffs
private

The coefficients used for each item if friction type.

Definition at line 83 of file WCNSFVFlowPhysics.h.

Referenced by addMomentumFrictionKernels(), and getLinearFrictionCoefName().

◆ _friction_types

std::vector<std::vector<std::string> > WCNSFVFlowPhysics::_friction_types
private

The friction correlation types used for each block.

Definition at line 81 of file WCNSFVFlowPhysics.h.

Referenced by addFVKernels(), addMomentumFrictionKernels(), getLinearFrictionCoefName(), and hasForchheimerFriction().

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

The momentum face interpolation method for being advected.

Definition at line 171 of file WCNSFVFlowPhysicsBase.h.

Referenced by addMomentumAdvectionKernels(), WCNSLinearFVFlowPhysics::addMomentumFluxKernels(), and 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 198 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 186 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 188 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 202 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 190 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 179 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 200 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 137 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 86 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 145 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 174 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 169 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 181 of file WCNSFVFlowPhysicsBase.h.

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


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