https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
PINSFVRhieChowInterpolator Class Reference

A class that inherits the free-flow class's implementation of Rhie-Chow data gathering and adds the ability to perform repeated interpolations and reconstructions of the porosity in order to reduce non-physical oscillations that arise from property discontinuities in a collocated discretization of pressure and velocity. More...

#include <PINSFVRhieChowInterpolator.h>

Inheritance diagram for PINSFVRhieChowInterpolator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 
enum  ResidualTagType
 

Public Member Functions

 PINSFVRhieChowInterpolator (const InputParameters &params)
 
virtual void meshChanged () override
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual void addToA (const libMesh::Elem *elem, unsigned int component, const ADReal &value) override
 API that momentum residual objects that have on-diagonals for velocity call.
 
virtual VectorValue< ADRealgetVelocity (const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const override
 Retrieve a face velocity.
 
virtual void initialSetup () override
 
virtual bool segregated () const override
 Bool of the Rhie Chow user object is used in monolithic/segregated approaches.
 
virtual void ghostADataOnBoundary (const BoundaryID boundary_id) override
 makes sure coefficient data gets communicated on both sides of a given boundary
 
void pullAllNonlocal ()
 Whether to pull all 'a' coefficient data from the owning process for all nonlocal elements we have access to (e.g.
 
bool velocitySkewCorrection (THREAD_ID tid) const
 Whether central differencing face interpolations of velocity should include a skewness correction Also used for the face interpolation of the D coefficient and the face interpolation of volumetric forces for for the volume correction method and the face interpolation of porosity.
 
bool pressureSkewCorrection (THREAD_ID tid) const
 Whether central differencing face interpolations of pressure should include a skewness correction.
 
virtual Real getVolumetricFaceFlux (const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const override
 Retrieve the volumetric face flux, will not include derivatives.
 
Moose::FV::InterpMethod velocityInterpolationMethod () const
 Return the interpolation method used for velocity.
 
const INSFVPressureVariablepressure (THREAD_ID tid) const
 
const INSFVVelocityVariablevel () const
 
bool hasFaceSide (const FaceInfo &fi, const bool fi_elem_side) const override
 
virtual bool supportMeshVelocity () const
 Returns whether the UO can support mesh velocity advection.
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () const
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
void gatherSum (T &value)
 
void gatherMax (T &value)
 
void gatherMin (T &value)
 
void gatherProxyValueMax (T1 &proxy, T2 &value)
 
void gatherProxyValueMin (T1 &proxy, T2 &value)
 
std::set< UserObjectName > getDependObjects () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool needThreadedCopy () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject () const
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
const std::string & name () const
 
std::string typeAndName () const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
MooseObjectName uniqueName () const
 
const InputParametersparameters () const
 
const hit::Node * getHitNode () const
 
bool hasBase () const
 
const std::string & getBase () const
 
const TgetParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const TqueryParam (const std::string &name) const
 
const TgetRenamedParam (const std::string &old_name, const std::string &new_name) const
 
T getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &name) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
std::string messagePrefix (const bool hit_prefix=true) const
 
std::string errorPrefix (const std::string &) const
 
void mooseError (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseDeprecatedNoTrace (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr, const bool show_trace=true) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
virtual void timestepSetup ()
 
virtual void jacobianSetup ()
 
virtual void residualSetup ()
 
virtual void customSetup (const ExecFlagType &)
 
const ExecFlagEnumgetExecuteOnEnum () const
 
UserObjectName getUserObjectName (const std::string &param_name) const
 
const TgetUserObject (const std::string &param_name, bool is_dependency=true) const
 
const TgetUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectBasegetUserObjectBaseByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const std::vector< MooseVariableScalar * > & getCoupledMooseScalarVars ()
 
const std::set< TagID > & getScalarVariableCoupleableVectorTags () const
 
const std::set< TagID > & getScalarVariableCoupleableMatrixTags () const
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialProperty (const std::string &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > & getADMaterialProperty (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOld (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const MaterialProperty< T > & getMaterialPropertyOlder (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const GenericMaterialProperty< T, is_ad > & getGenericMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const MaterialProperty< T > & getMaterialPropertyByName (const MaterialPropertyName &name, const unsigned int state=0)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const ADMaterialProperty< T > & getADMaterialPropertyByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOldByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name, MaterialData &material_data)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
const MaterialProperty< T > & getMaterialPropertyOlderByName (const MaterialPropertyName &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyByName (const std::string &prop_name_in)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOldByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlderByName (const std::string &prop_name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialProperty (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOld (const std::string &name)
 
Moose::Kokkos::MaterialProperty< T, dimension > getKokkosMaterialPropertyOlder (const std::string &name)
 
std::pair< const MaterialProperty< T > *, std::set< SubdomainID > > getBlockMaterialProperty (const MaterialPropertyName &name)
 
std::pair< Moose::Kokkos::MaterialProperty< T, dimension >, std::set< SubdomainID > > getKokkosBlockMaterialProperty (const MaterialPropertyName &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialProperty ()
 
const GenericMaterialProperty< T, is_ad > & getGenericZeroMaterialPropertyByName (const std::string &prop_name)
 
const MaterialProperty< T > & getZeroMaterialProperty (Ts... args)
 
std::set< SubdomainIDgetMaterialPropertyBlocks (const std::string &name)
 
std::vector< SubdomainName > getMaterialPropertyBlockNames (const std::string &name)
 
std::set< BoundaryIDgetMaterialPropertyBoundaryIDs (const std::string &name)
 
std::vector< BoundaryName > getMaterialPropertyBoundaryNames (const std::string &name)
 
void checkBlockAndBoundaryCompatibility (std::shared_ptr< MaterialBase > discrete)
 
std::unordered_map< SubdomainID, std::vector< MaterialBase * > > buildRequiredMaterials (bool allow_stateful=true)
 
void statefulPropertiesAllowed (bool)
 
virtual bool getMaterialPropertyCalled () const
 
virtual const std::unordered_set< unsigned int > & getMatPropDependencies () const
 
virtual void resolveOptionalProperties ()
 
const GenericMaterialProperty< T, is_ad > & getPossiblyConstantGenericMaterialPropertyByName (const MaterialPropertyName &prop_name, MaterialData &material_data, const unsigned int state)
 
bool isImplicit ()
 
Moose::StateArg determineState () const
 
virtual void threadJoin (const UserObject &) override
 
virtual void threadJoin (const UserObject &) override
 
virtual void subdomainSetup () override
 
virtual void subdomainSetup () override
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObject (const std::string &param_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
bool hasUserObjectByName (const UserObjectName &object_name) const
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const GenericOptionalMaterialProperty< T, is_ad > & getGenericOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalMaterialProperty< T > & getOptionalMaterialProperty (const std::string &name, const unsigned int state=0)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalADMaterialProperty< T > & getOptionalADMaterialProperty (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOld (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
const OptionalMaterialProperty< T > & getOptionalMaterialPropertyOlder (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterial (const std::string &name)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
MaterialBasegetMaterialByName (const std::string &name, bool no_warn=false)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialProperty (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialProperty (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasADMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialProperty (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasKokkosMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialProperty (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
bool hasGenericMaterialPropertyByName (const std::string &name)
 
const FunctiongetFunction (const std::string &name) const
 
const FunctiongetFunctionByName (const FunctionName &name) const
 
bool hasFunction (const std::string &param_name) const
 
bool hasFunctionByName (const FunctionName &name) const
 
Moose::Kokkos::Function getKokkosFunction (const std::string &name) const
 
const TgetKokkosFunction (const std::string &name) const
 
Moose::Kokkos::Function getKokkosFunctionByName (const FunctionName &name) const
 
const TgetKokkosFunctionByName (const FunctionName &name) const
 
bool hasKokkosFunction (const std::string &param_name) const
 
bool hasKokkosFunctionByName (const FunctionName &name) const
 
bool isDefaultPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessor (const std::string &param_name, const unsigned int index=0) const
 
bool hasPostprocessorByName (const PostprocessorName &name) const
 
std::size_t coupledPostprocessors (const std::string &param_name) const
 
const PostprocessorName & getPostprocessorName (const std::string &param_name, const unsigned int index=0) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name, bool needs_broadcast) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const VectorPostprocessorValuegetVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name, bool needs_broadcast) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValue (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOld (const std::string &param_name, const std::string &vector_name) const
 
const ScatterVectorPostprocessorValuegetScatterVectorPostprocessorValueOldByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
bool hasVectorPostprocessor (const std::string &param_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool hasVectorPostprocessorByName (const VectorPostprocessorName &name) const
 
const VectorPostprocessorName & getVectorPostprocessorName (const std::string &param_name) const
 
TgetSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
TgetSamplerByName (const SamplerName &name)
 
SamplergetSamplerByName (const SamplerName &name)
 
virtual void meshDisplaced ()
 
PerfGraphperfGraph ()
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValue (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOld (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
const PostprocessorValuegetPostprocessorValueOlder (const std::string &param_name, const unsigned int index=0) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
virtual const PostprocessorValuegetPostprocessorValueByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOldByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
const PostprocessorValuegetPostprocessorValueOlderByName (const PostprocessorName &name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributed (const std::string &param_name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
bool isVectorPostprocessorDistributedByName (const VectorPostprocessorName &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const TgetDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const TgetDistributionByName (const std::string &name) const
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 
const std::vector< SubdomainName > & blocks () const
 
unsigned int numBlocks () const
 
virtual const std::set< SubdomainID > & blockIDs () const
 
unsigned int blocksMaxDimension () const
 
bool hasBlocks (const SubdomainName &name) const
 
bool hasBlocks (const std::vector< SubdomainName > &names) const
 
bool hasBlocks (const std::set< SubdomainName > &names) const
 
bool hasBlocks (SubdomainID id) const
 
bool hasBlocks (const std::vector< SubdomainID > &ids) const
 
bool hasBlocks (const std::set< SubdomainID > &ids) const
 
bool isBlockSubset (const std::set< SubdomainID > &ids) const
 
bool isBlockSubset (const std::vector< SubdomainID > &ids) const
 
bool hasBlockMaterialProperty (const std::string &prop_name)
 
const std::set< SubdomainID > & meshBlockIDs () const
 
virtual bool blockRestricted () const
 
virtual void checkVariable (const MooseVariableFieldBase &variable) const
 
void useVectorTag (const TagName &tag_name, VectorTagsKey)
 
void useVectorTag (TagID tag_id, VectorTagsKey)
 
void useMatrixTag (const TagName &tag_name, MatrixTagsKey)
 
void useMatrixTag (TagID tag_id, MatrixTagsKey)
 
bool isVectorTagged ()
 
bool isMatrixTagged ()
 
bool hasVectorTags () const
 
const std::set< TagID > & getVectorTags (VectorTagsKey) const
 
const std::set< TagID > & getMatrixTags (MatrixTagsKey) const
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 

Static Public Member Functions

static InputParameters validParams ()
 
static InputParameters uniqueParams ()
 Parameters of this object that should be added to the NSFV action that are unique to this object.
 
static std::vector< std::string > listOfCommonParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

static const std::string type_param
 
static const std::string name_param
 
static const std::string unique_name_param
 
static const std::string app_param
 
static const std::string moose_base_param
 
static const std::string kokkos_object_param
 
static constexpr PropertyValue::id_type default_property_id
 
static constexpr PropertyValue::id_type zero_property_id
 
static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Member Functions

const Moose::FunctorBase< ADReal > & epsilon (THREAD_ID tid) const override
 A virtual method that allows us to only implement getVelocity once for free and porous flows.
 
bool isFaceGeometricallyRelevant (const FaceInfo &fi) const
 
void insfvSetup ()
 perform the setup of this object
 
template<typename Container >
void fillContainer (const std::string &var_name, Container &container)
 Fill the passed-in variable container with the thread copies of var_name.
 
template<typename VarType >
void checkBlocks (const VarType &var) const
 Check the block consistency between the passed in var and us.
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObjectBase &uo) const override
 
void addReporterDependencyHelper (const ReporterName &reporter_name) override
 
void flagInvalidSolutionInternal (const InvalidSolutionID invalid_solution_id) const
 
InvalidSolutionID registerInvalidSolutionInternal (const std::string &message, const bool warning) const
 
const ReporterContextBasegetReporterContextBaseByName (const ReporterName &reporter_name) const
 
const ReporterNamegetReporterName (const std::string &param_name) const
 
TdeclareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< TdeclareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const TgetRestartableData (const std::string &data_name) const
 
TdeclareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
TdeclareRecoverableData (const std::string &data_name, Args &&... args)
 
TdeclareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
TdeclareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const TgetMeshProperty (const std::string &data_name, const std::string &prefix)
 
const TgetMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
bool isCoupledScalar (const std::string &var_name, unsigned int i=0) const
 
unsigned int coupledScalarComponents (const std::string &var_name) const
 
unsigned int coupledScalar (const std::string &var_name, unsigned int comp=0) const
 
libMesh::Order coupledScalarOrder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< is_ad > & coupledGenericScalarValue (const std::string &var_name, unsigned int comp=0) const
 
const GenericVariableValue< false > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const GenericVariableValue< true > & coupledGenericScalarValue (const std::string &var_name, const unsigned int comp) const
 
const VariableValuecoupledVectorTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledMatrixTagScalarValue (const std::string &var_name, TagID tag, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarValueOlder (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const ADVariableValueadCoupledScalarDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDot (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotOld (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDu (const std::string &var_name, unsigned int comp=0) const
 
const VariableValuecoupledScalarDotDotDu (const std::string &var_name, unsigned int comp=0) const
 
const MooseVariableScalargetScalarVar (const std::string &var_name, unsigned int comp) const
 
virtual void checkMaterialProperty (const std::string &name, const unsigned int state)
 
virtual void getKokkosMaterialPropertyHook (const std::string &, const unsigned int)
 
void markMatPropRequested (const std::string &)
 
MaterialPropertyName getMaterialPropertyName (const std::string &name) const
 
void checkExecutionStage ()
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const TgetReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const TgetReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValue (const std::string &param_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
bool hasReporterValueByName (const ReporterName &reporter_name) const
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< T, is_ad > * defaultGenericMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const MaterialProperty< T > * defaultMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
const ADMaterialProperty< T > * defaultADMaterialProperty (const std::string &name)
 
virtual bool hasBlockMaterialPropertyHelper (const std::string &prop_name)
 
void initializeBlockRestrictable (const MooseObject *moose_object)
 
void initializeKokkosBlockRestrictable ()
 
Moose::CoordinateSystemType getBlockCoordSystem ()
 
KOKKOS_FUNCTION dof_id_type numKokkosBlockElements () const
 
KOKKOS_FUNCTION dof_id_type numKokkosBlockNodes () const
 
KOKKOS_FUNCTION dof_id_type numKokkosBlockSides () const
 
KOKKOS_FUNCTION ContiguousElementID kokkosBlockElementID (Moose::Kokkos::ThreadID tid) const
 
KOKKOS_FUNCTION ContiguousElementID kokkosBlockNodeID (Moose::Kokkos::ThreadID tid) const
 
KOKKOS_FUNCTION auto kokkosBlockElementSideID (Moose::Kokkos::ThreadID tid) const
 
void prepareVectorTag (Assembly &assembly, unsigned int ivar)
 
void prepareVectorTag (Assembly &assembly, unsigned int ivar, ResidualTagType tag_type)
 
void prepareVectorTagNeighbor (Assembly &assembly, unsigned int ivar)
 
void prepareVectorTagLower (Assembly &assembly, unsigned int ivar)
 
void prepareMatrixTag (Assembly &assembly, unsigned int ivar, unsigned int jvar)
 
void prepareMatrixTag (Assembly &assembly, unsigned int ivar, unsigned int jvar, DenseMatrix< Number > &k) const
 
void prepareMatrixTagNonlocal (Assembly &assembly, unsigned int ivar, unsigned int jvar)
 
void prepareMatrixTagNeighbor (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type)
 
void prepareMatrixTagNeighbor (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type, DenseMatrix< Number > &k) const
 
void prepareMatrixTagLower (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::ConstraintJacobianType type)
 
void accumulateTaggedLocalResidual ()
 
void assignTaggedLocalResidual ()
 
void accumulateTaggedLocalMatrix ()
 
void accumulateTaggedLocalMatrix (Assembly &assembly, unsigned int ivar, unsigned int jvar, const DenseMatrix< Number > &k)
 
void accumulateTaggedLocalMatrix (Assembly &assembly, unsigned int ivar, unsigned int jvar, Moose::DGJacobianType type, const DenseMatrix< Number > &k)
 
void accumulateTaggedNonlocalMatrix ()
 
void assignTaggedLocalMatrix ()
 
void addResiduals (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResiduals (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, const std::vector< Real > &scaling_factors)
 
void addResiduals (Assembly &assembly, const DenseVector< T > &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResiduals (Assembly &assembly, const ADResidualsPacket &packet)
 
void addResidualsAndJacobian (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResidualsAndJacobian (Assembly &assembly, const ADResidualsPacket &packet)
 
void addJacobian (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addJacobian (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, const std::vector< Real > &scaling_factors)
 
void addJacobian (Assembly &assembly, const ADResidualsPacket &packet)
 
void addJacobian (Assembly &assembly, const DenseMatrix< Real > &local_k, const std::vector< dof_id_type > &row_indices, const std::vector< dof_id_type > &column_indices, Real scaling_factor)
 
void addResidualsWithoutConstraints (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addResidualsAndJacobianWithoutConstraints (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addJacobianWithoutConstraints (Assembly &assembly, const Residuals &residuals, const Indices &dof_indices, Real scaling_factor)
 
void addJacobianElement (Assembly &assembly, Real value, dof_id_type row_index, dof_id_type column_index, Real scaling_factor)
 
void setResidual (SystemBase &sys, const T &residual, MooseVariableFE< T > &var)
 
void setResidual (SystemBase &sys, Real residual, dof_id_type dof_index)
 
void setResidual (SystemBase &sys, SetResidualFunctor set_residual_functor)
 
std::string deduceFunctorName (const std::string &name) const
 
const Moose::Functor< T > & getFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctor (const std::string &name, THREAD_ID tid)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem)
 
const Moose::Functor< T > & getFunctor (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
bool isFunctor (const std::string &name) const
 
bool isFunctor (const std::string &name, const SubProblem &subproblem) const
 
Moose::ElemArg makeElemArg (const Elem *elem, bool correct_skewnewss=false) const
 
void checkFunctorSupportsSideIntegration (const std::string &name, bool qp_integration)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name)
 

Static Protected Member Functions

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

Protected Attributes

const Moose::Functor< ADReal > & _eps
 The thread 0 copy of the porosity functor held by the subproblem.
 
CellCenteredMapFunctor< ADReal, std::unordered_map< dof_id_type, ADReal > > _smoothed_eps
 The smoothed porosity functor/field.
 
std::vector< const Moose::Functor< ADReal > * > _epss
 All the thread copies of the problem's porosity functor.
 
std::vector< const Moose::Functor< ADReal > * > _smoothed_epss
 All the thread copies of the problem's smoothed porosity functor.
 
const unsigned short _smoothing_layers
 The number of interpolations and reconstructions that should be performed on the porosity functor/field.
 
std::vector< const FaceInfo * > _geometric_fi
 All the face information that are "geometrically" accessible on this process.
 
std::vector< std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADRealVectorValue > > > _vel
 A functor for computing the (non-RC corrected) velocity.
 
std::vector< MooseVariableField< Real > * > _disp_xs
 All the thread copies of the x-displacement variable.
 
std::vector< MooseVariableField< Real > * > _disp_ys
 All the thread copies of the y-displacement variable.
 
std::vector< MooseVariableField< Real > * > _disp_zs
 All the thread copies of the z-displacement variable.
 
std::vector< std::unique_ptr< Moose::VectorCompositeFunctor< ADReal > > > _disps
 A functor for computing the displacement.
 
std::unique_ptr< ConstElemRange > _elem_range
 All the active and elements local to this process that exist on this object's subdomains.
 
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
 A map from element IDs to 'a' coefficient data.
 
const unsigned int _momentum_sys_number
 The number of the nonlinear system in which the monolithic momentum and continuity equations are located.
 
MooseMesh_moose_mesh
 The MooseMesh that this user object operates on.
 
const libMesh::MeshBase_mesh
 The libMesh mesh that this object acts on.
 
const unsigned int _dim
 The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
 
INSFVPressureVariable *const _p
 The thread 0 copy of the pressure variable.
 
INSFVVelocityVariable *const _u
 The thread 0 copy of the x-velocity variable.
 
INSFVVelocityVariable *const _v
 The thread 0 copy of the y-velocity variable (null if the problem is 1D)
 
INSFVVelocityVariable *const _w
 The thread 0 copy of the z-velocity variable (null if the problem is not 3D)
 
std::vector< MooseVariableFVReal * > _ps
 All the thread copies of the pressure variable.
 
std::vector< MooseVariableFVReal * > _us
 All the thread copies of the x-velocity variable.
 
std::vector< MooseVariableFVReal * > _vs
 All the thread copies of the y-velocity variable.
 
std::vector< MooseVariableFVReal * > _ws
 All the thread copies of the z-velocity variable.
 
std::vector< unsigned int_var_numbers
 The velocity variable numbers.
 
Moose::FV::InterpMethod _velocity_interp_method
 The interpolation method to use for the velocity.
 
const bool _displaced
 Whether this object is operating on the displaced mesh.
 
const Moose::CoordinateSystemType_coord_sys
 
const THREAD_ID _tid
 
SubProblem_subproblem
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
Assembly_assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_mdi_feproblem
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real & _real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const InputParameters_mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase_mi_feproblem
 
SubProblem_mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData_material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int_material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real & _t
 
const Real & _t_old
 
int_t_step
 
Real & _dt
 
Real & _dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 
const MaterialData_blk_material_data
 
DenseVector< Number > _local_re
 
DenseMatrix< Number > _local_ke
 
DenseMatrix< Number > _nonlocal_ke
 
'a' component functors

These vector component functors are not used anywhere within this class but they can be used for outputting, to auxiliary variables, the on-diagonal 'a' coefficients for use in visualization or transfer to other applications

Moose::VectorComponentFunctor< ADReal_ax
 
Moose::VectorComponentFunctor< ADReal_ay
 The y-component of 'a'.
 
Moose::VectorComponentFunctor< ADReal_az
 The z-component of 'a'.
 

Static Protected Attributes

static const std::string _interpolated_old
 
static const std::string _interpolated_older
 

Private Member Functions

void pinsfvSetup ()
 called during the first initialize() and upon meshChanged(), this method performs the interpolations and reconstructions of porosity.
 
void fillARead ()
 Fills the _a_read data member at construction time with the appropriate functors.
 
bool needAComputation () const
 Whether we need 'a' coefficient computation.
 
const Moose::FunctionBasegetKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValuegetVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValueregisterRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValuegetMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const VariableValuegetDefaultValue (const std::string &var_name) const
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void prepareVectorTagInternal (Assembly &assembly, unsigned int ivar, const std::set< TagID > &vector_tags, const std::set< TagID > &absolute_value_vector_tags)
 
void checkForNans () const
 
const Moose::Functor< T > * defaultFunctor (const std::string &name)
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
virtual bool isADObject () const override
 

Static Private Member Functions

static const hit::Node * getHitNode (const InputParameters &params)
 
static std::string messagePrefix (const InputParameters &params, const bool hit_prefix)
 

Private Attributes

std::unordered_set< const Elem * > _elements_to_push_pull
 Non-local elements that we should push and pull data for across processes.
 
const VectorValue< ADReal_example
 An example datum used to help communicate AD vector information in parallel.
 
Threads::spin_mutex _a_mutex
 Mutex that prevents multiple threads from saving into the 'a' coefficients at the same time.
 
std::vector< const Moose::FunctorBase< VectorValue< ADReal > > * > _a_read
 A vector sized according to the number of threads that holds the 'a' data we will read from when computing the Rhie-Chow velocity.
 
std::vector< std::unique_ptr< Moose::FunctorBase< VectorValue< ADReal > > > > _a_aux
 A vector sized according to the number of threads that holds vector composites of 'a' component functors.
 
bool _a_data_provided
 Whether 'a' data has been provided by the user.
 
bool _pull_all_nonlocal
 Whether we want to pull all nonlocal 'a' coefficient data.
 
const bool & _bool_correct_vf
 Correct Rhie-Chow coefficients for volumetric force flag.
 
const MooseEnum _volume_force_correction_method
 – Method used for computing the properties average
 
const std::vector< MooseFunctorName > * _volumetric_force_functors
 Names of the functors storing the volumetric forces.
 
std::vector< const Moose::Functor< Real > * > _volumetric_force
 Values of the functors storing the volumetric forces.
 
Real _baseline_volume_force
 Minimum absolute RC force over the domain.
 
const Moose::ConstantFunctor< ADReal_zero_functor {0}
 A zero functor potentially used in _a_read.
 
const Moose::ConstantFunctor< ADReal_unity_functor {1}
 A unity functor used in the epsilon virtual method.
 
UserObject_primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject_fni_object
 
const InputParameters_fni_params
 
FEProblemBase_fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject_uoi_moose_object
 
const FEProblemBase_uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject_ppi_moose_object
 
const InputParameters_ppi_params
 
const FEProblemBase_ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject_vpi_moose_object
 
const FEProblemBase_vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters_ri_params
 
FEProblemBase_ri_fe_problem_base
 
const ReporterData_ri_reporter_data
 
const MooseObject_ri_moose_object
 
const InputParameters_dni_params
 
FEProblemBase_dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters_si_params
 
FEProblemBase_si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp_meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters_sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID_sc_coupleable_vector_tags
 
std::set< TagID_sc_coupleable_matrix_tags
 
const MooseObject_mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 
std::set< SubdomainID_blk_ids
 
std::vector< SubdomainID_vec_ids
 
std::vector< SubdomainName > _blocks
 
const bool _blk_dual_restrictable
 
FEProblemBase_blk_feproblem
 
const MooseMesh_blk_mesh
 
const std::set< BoundaryID_empty_boundary_ids
 
const std::set< BoundaryID > & _boundary_ids
 
THREAD_ID _blk_tid
 
const std::string & _blk_name
 
unsigned int _blk_dim
 
const MooseObject_moose_object
 
Moose::Kokkos::Array< ContiguousElementID_kokkos_element_ids
 
Moose::Kokkos::Array< ContiguousNodeID_kokkos_node_ids
 
Moose::Kokkos::Array< Moose::Kokkos::Pair< ContiguousElementID, unsigned int > > _kokkos_element_side_ids
 
std::set< TagID_vector_tags
 
std::set< TagID_abs_vector_tags
 
std::set< TagID_matrix_tags
 
std::set< TagID_non_ref_vector_tags
 
std::set< TagID_non_ref_abs_vector_tags
 
std::set< TagID_ref_vector_tags
 
std::set< TagID_ref_abs_vector_tags
 
const InputParameters_tag_params
 
std::vector< DenseVector< Number > * > _re_blocks
 
std::vector< DenseVector< Number > * > _absre_blocks
 
std::vector< DenseMatrix< Number > * > _ke_blocks
 
std::vector< Real > _absolute_residuals
 
const InputParameters_fi_params
 
const std::string _fi_name
 
SubProblem *const _fi_subproblem
 
const THREAD_ID _fi_tid
 
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
 
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
 

Detailed Description

A class that inherits the free-flow class's implementation of Rhie-Chow data gathering and adds the ability to perform repeated interpolations and reconstructions of the porosity in order to reduce non-physical oscillations that arise from property discontinuities in a collocated discretization of pressure and velocity.

Definition at line 22 of file PINSFVRhieChowInterpolator.h.

Constructor & Destructor Documentation

◆ PINSFVRhieChowInterpolator()

PINSFVRhieChowInterpolator::PINSFVRhieChowInterpolator ( const InputParameters params)

Definition at line 43 of file PINSFVRhieChowInterpolator.C.

45 _eps(getFunctor<ADReal>(NS::porosity)),
46 _smoothed_eps(_moose_mesh, NS::smoothed_porosity, /*extrapolated_boundary*/ true),
47 _epss(libMesh::n_threads(), nullptr),
49 _smoothing_layers(getParam<unsigned short>("smoothing_layers"))
50{
51 if (_smoothing_layers && _eps.wrapsType<MooseVariableBase>())
54 "If we are reconstructing porosity, then the input porosity to this user object cannot "
55 "be a Moose variable. There are issues with reconstructing Moose variables: 1) initial "
56 "conditions are run after user objects initial setup 2) reconstructing from a variable "
57 "requires ghosting the solution vectors 3) it's difficult to restrict the face "
58 "informations we evaluate interpolations and reconstructions on such that we never query "
59 "an algebraically remote element due to things like two-term extrapolated boundary faces "
60 "which trigger gradient evaluations which trigger neighbor element evaluation");
61
62 const auto porosity_name = deduceFunctorName(NS::porosity);
63
64 for (const auto tid : make_range(libMesh::n_threads()))
65 {
66 _epss[tid] = &UserObject::_subproblem.getFunctor<ADReal>(porosity_name, tid, name(), true);
67
68 if (_smoothing_layers > 0)
69 {
71 // Smoothed porosity is only an envelope at this point, it will be set during pinsfvSetup()
73
74 _smoothed_epss[tid] =
76 }
77 }
78}
DualNumber< Real, DNDerivativeType, true > ADReal
const std::string name
Definition Setup.h:21
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)
This user-object gathers 'a' (on-diagonal velocity coefficients) data.
void paramError(const std::string &param, Args... args) const
const Moose::Functor< ADReal > & _eps
The thread 0 copy of the porosity functor held by the subproblem.
std::vector< const Moose::Functor< ADReal > * > _smoothed_epss
All the thread copies of the problem's smoothed porosity functor.
std::vector< const Moose::Functor< ADReal > * > _epss
All the thread copies of the problem's porosity functor.
const unsigned short _smoothing_layers
The number of interpolations and reconstructions that should be performed on the porosity functor/fie...
CellCenteredMapFunctor< ADReal, std::unordered_map< dof_id_type, ADReal > > _smoothed_eps
The smoothed porosity functor/field.
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)
SubProblem & _subproblem
static const std::string smoothed_porosity
Definition NS.h:109
static const std::string porosity
Definition NS.h:108
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
IntRange< T > make_range(T beg, T end)
unsigned int n_threads()

Member Function Documentation

◆ addToA()

void INSFVRhieChowInterpolator::addToA ( const libMesh::Elem elem,
unsigned int  component,
const ADReal value 
)
inlineoverridevirtualinherited

API that momentum residual objects that have on-diagonals for velocity call.

Parameters
Theelement we are adding 'a' coefficient data for
componentThe velocity component we are adding 'a' coefficient data for
valueThe value of 'a' that we are adding

Implements RhieChowInterpolatorBase.

Definition at line 221 of file INSFVRhieChowInterpolator.h.

224{
225 Threads::spin_mutex::scoped_lock lock(_a_mutex);
226
227 if (elem->processor_id() != this->processor_id())
228 _elements_to_push_pull.insert(elem);
229
230 _a[elem->id()](component) += value;
231}
std::unordered_set< const Elem * > _elements_to_push_pull
Non-local elements that we should push and pull data for across processes.
Threads::spin_mutex _a_mutex
Mutex that prevents multiple threads from saving into the 'a' coefficients at the same time.
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to 'a' coefficient data.
processor_id_type processor_id() const
dof_id_type id() const
T component(const RankTwoTensorTempl< T > &r2tensor, unsigned int i, unsigned int j)

Referenced by INSFVRhieChowInterpolator::ghostADataOnBoundary().

◆ checkBlocks()

template<typename VarType >
void RhieChowInterpolatorBase::checkBlocks ( const VarType &  var) const
protectedinherited

Check the block consistency between the passed in var and us.

Definition at line 181 of file RhieChowInterpolatorBase.h.

182{
183 const auto & var_blocks = var.blockIDs();
184 const auto & uo_blocks = blockIDs();
185
186 // Error if this UO has any blocks that the variable does not
187 std::set<SubdomainID> uo_blocks_minus_var_blocks;
188 std::set_difference(uo_blocks.begin(),
189 uo_blocks.end(),
190 var_blocks.begin(),
191 var_blocks.end(),
192 std::inserter(uo_blocks_minus_var_blocks, uo_blocks_minus_var_blocks.end()));
193 if (uo_blocks_minus_var_blocks.size() > 0)
194 mooseError("Block restriction of interpolator user object '",
195 this->name(),
196 "' (",
198 ") includes blocks not in the block restriction of variable '",
199 var.name(),
200 "' (",
201 Moose::stringify(var.blocks()),
202 ")");
203
204 // Get the blocks in the variable but not this UO
205 std::set<SubdomainID> var_blocks_minus_uo_blocks;
206 std::set_difference(var_blocks.begin(),
207 var_blocks.end(),
208 uo_blocks.begin(),
209 uo_blocks.end(),
210 std::inserter(var_blocks_minus_uo_blocks, var_blocks_minus_uo_blocks.end()));
211
212 // For each block in the variable but not this UO, error if there is connection
213 // to any blocks on the UO.
214 for (auto & block_id : var_blocks_minus_uo_blocks)
215 {
216 const auto connected_blocks = _moose_mesh.getBlockConnectedBlocks(block_id);
217 std::set<SubdomainID> connected_blocks_on_uo;
218 std::set_intersection(connected_blocks.begin(),
219 connected_blocks.end(),
220 uo_blocks.begin(),
221 uo_blocks.end(),
222 std::inserter(connected_blocks_on_uo, connected_blocks_on_uo.end()));
223 if (connected_blocks_on_uo.size() > 0)
224 mooseError("Block restriction of interpolator user object '",
225 this->name(),
226 "' (",
227 Moose::stringify(uo_blocks),
228 ") doesn't match the block restriction of variable '",
229 var.name(),
230 "' (",
231 Moose::stringify(var_blocks),
232 ")");
233 }
234}
virtual const std::set< SubdomainID > & blockIDs() const
const std::vector< SubdomainName > & blocks() const
const std::string & name() const
void mooseError(Args &&... args) const
const std::set< SubdomainID > & getBlockConnectedBlocks(const SubdomainID subdomain_id) const
std::string stringify(const T &t)

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator(), and RhieChowInterpolatorBase::RhieChowInterpolatorBase().

◆ epsilon()

const Moose::FunctorBase< ADReal > & PINSFVRhieChowInterpolator::epsilon ( THREAD_ID  tid) const
inlineoverrideprotectedvirtual

A virtual method that allows us to only implement getVelocity once for free and porous flows.

Reimplemented from RhieChowInterpolatorBase.

Definition at line 77 of file PINSFVRhieChowInterpolator.h.

78{
80 return *_epss[tid];
81 else
82 return *_smoothed_epss[tid];
83}

◆ execute()

void PINSFVRhieChowInterpolator::execute ( )
overridevirtual

Reimplemented from INSFVRhieChowInterpolator.

Definition at line 189 of file PINSFVRhieChowInterpolator.C.

190{
191 // Cannot compute Rhie Chow coefficients on initial
192 if (_current_execute_flag != EXEC_INITIAL)
194}
const ExecFlagType & _current_execute_flag

◆ fillARead()

void INSFVRhieChowInterpolator::fillARead ( )
privateinherited

Fills the _a_read data member at construction time with the appropriate functors.

_a_read will be used later when computing the Rhie-Chow velocity

Definition at line 210 of file INSFVRhieChowInterpolator.C.

211{
212 _a_read.resize(libMesh::n_threads());
213
214 if (isParamValid("a_u"))
215 {
216 if (_dim > 1 && !isParamValid("a_v"))
217 mooseError("If a_u is provided, then a_v must be provided");
218
219 if (_dim > 2 && !isParamValid("a_w"))
220 mooseError("If a_u is provided, then a_w must be provided");
221
222 _a_data_provided = true;
223 _a_aux.resize(libMesh::n_threads());
224 }
225 else if (isParamValid("a_v"))
226 paramError("a_v", "If the a_v coefficients are provided, then a_u must be provided");
227 else if (isParamValid("a_w"))
228 paramError("a_w", "If the a_w coefficients are provided, then a_u must be provided");
229
231 {
232 for (const auto tid : make_range(libMesh::n_threads()))
233 {
234 const Moose::FunctorBase<ADReal> *v_comp, *w_comp;
235 if (_dim > 1)
237 deduceFunctorName("a_v"), tid, name(), true);
238 else
239 v_comp = &_zero_functor;
240 if (_dim > 2)
242 deduceFunctorName("a_w"), tid, name(), true);
243 else
244 w_comp = &_zero_functor;
245
246 _a_aux[tid] = std::make_unique<Moose::VectorCompositeFunctor<ADReal>>(
247 "RC_a_coeffs",
249 *v_comp,
250 *w_comp);
251 _a_read[tid] = _a_aux[tid].get();
252 }
253 }
254 else
255 for (const auto tid : make_range(libMesh::n_threads()))
256 {
257 _a_read[tid] = &_a;
258
259 // We are the fluid flow application, so we should make sure users have the ability to
260 // write 'a' out to aux variables for possible transfer to other applications
264 }
265}
Moose::VectorComponentFunctor< ADReal > _ax
bool _a_data_provided
Whether 'a' data has been provided by the user.
Moose::VectorComponentFunctor< ADReal > _ay
The y-component of 'a'.
std::vector< std::unique_ptr< Moose::FunctorBase< VectorValue< ADReal > > > > _a_aux
A vector sized according to the number of threads that holds vector composites of 'a' component funct...
Moose::VectorComponentFunctor< ADReal > _az
The z-component of 'a'.
std::vector< const Moose::FunctorBase< VectorValue< ADReal > > * > _a_read
A vector sized according to the number of threads that holds the 'a' data we will read from when comp...
const Moose::ConstantFunctor< ADReal > _zero_functor
A zero functor potentially used in _a_read.
bool isParamValid(const std::string &name) const
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ fillContainer()

template<typename Container >
void RhieChowInterpolatorBase::fillContainer ( const std::string &  var_name,
Container &  container 
)
protectedinherited

Fill the passed-in variable container with the thread copies of var_name.

Definition at line 168 of file RhieChowInterpolatorBase.h.

169{
170 typedef typename Container::value_type ContainedType;
171 for (const auto tid : make_range(libMesh::n_threads()))
172 {
173 auto * const var = static_cast<ContainedType>(
174 &UserObject::_subproblem.getVariable(tid, getParam<VariableName>(name)));
175 container[tid] = var;
176 }
177}
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=0

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator(), and RhieChowInterpolatorBase::RhieChowInterpolatorBase().

◆ finalize()

void PINSFVRhieChowInterpolator::finalize ( )
overridevirtual

Reimplemented from INSFVRhieChowInterpolator.

Definition at line 197 of file PINSFVRhieChowInterpolator.C.

198{
199 // Cannot compute Rhie Chow coefficients on initial
200 if (_current_execute_flag != EXEC_INITIAL)
202}

◆ getVelocity()

VectorValue< ADReal > INSFVRhieChowInterpolator::getVelocity ( const Moose::FV::InterpMethod  m,
const FaceInfo fi,
const Moose::StateArg time,
const THREAD_ID  tid,
bool  subtract_mesh_velocity 
) const
overridevirtualinherited

Retrieve a face velocity.

Parameters
mThe velocity interpolation method. This is either Rhie-Chow or Average. Rhie-Chow is recommended as it avoids checkerboards in the pressure field
fiThe face that we wish to retrieve the velocity for
timeThe time at which to evaluate the velocity
tidThe thread ID
subtract_mesh_velocityWhether to subtract the mesh velocity if running on a displaced mesh
Returns
The face velocity

Implements RhieChowInterpolatorBase.

Definition at line 525 of file INSFVRhieChowInterpolator.C.

530{
531 const Elem * const elem = &fi.elem();
532 const Elem * const neighbor = fi.neighborPtr();
533 auto & vel = *_vel[tid];
534 auto & p = *_ps[tid];
535 auto * const u = _us[tid];
536 MooseVariableFVReal * const v = _v ? _vs[tid] : nullptr;
537 MooseVariableFVReal * const w = _w ? _ws[tid] : nullptr;
538 // Check if skewness-correction is necessary
539 const bool correct_skewness = velocitySkewCorrection(tid);
540 auto incorporate_mesh_velocity =
541 [this, tid, subtract_mesh_velocity, &time](const auto & space, auto & velocity)
542 {
543 if (_disps.size() && subtract_mesh_velocity)
544 velocity -= _disps[tid]->dot(space, time);
545 };
546
547 if (Moose::FV::onBoundary(*this, fi))
548 {
549 const Elem * const boundary_elem = hasBlocks(elem->subdomain_id()) ? elem : neighbor;
550 const Moose::FaceArg boundary_face{&fi,
551 Moose::FV::LimiterType::CentralDifference,
552 true,
553 correct_skewness,
554 boundary_elem,
555 nullptr};
556 auto velocity = vel(boundary_face, time);
557 incorporate_mesh_velocity(boundary_face, velocity);
558
559 // If not solving for velocity, clear derivatives
561 return MetaPhysicL::raw_value(velocity);
562 else
563 return velocity;
564 }
565
566 VectorValue<ADReal> velocity;
567
568 Moose::FaceArg face{
569 &fi, Moose::FV::LimiterType::CentralDifference, true, correct_skewness, nullptr, nullptr};
570 // Create the average face velocity (not corrected using RhieChow yet)
571 velocity(0) = (*u)(face, time);
572 if (v)
573 velocity(1) = (*v)(face, time);
574 if (w)
575 velocity(2) = (*w)(face, time);
576
577 incorporate_mesh_velocity(face, velocity);
578
579 // If not solving for velocity, clear derivatives
581 velocity = MetaPhysicL::raw_value(velocity);
582
583 // Return if Rhie-Chow was not requested or if we have a porosity jump
584 if (m == Moose::FV::InterpMethod::Average ||
585 std::get<0>(NS::isPorosityJumpFace(epsilon(tid), fi, time)))
586 return velocity;
587
588 // Rhie-Chow coefficients are not available on initial
589 if (_fe_problem.getCurrentExecuteOnFlag() == EXEC_INITIAL)
590 {
591 mooseDoOnce(mooseWarning("Cannot compute Rhie Chow coefficients on initial. Returning linearly "
592 "interpolated velocities"););
593 return velocity;
594 }
596 {
597 mooseDoOnce(mooseWarning("Cannot compute Rhie Chow coefficients if not solving. Returning "
598 "linearly interpolated velocities"););
599 return velocity;
600 }
601
602 mooseAssert(((m == Moose::FV::InterpMethod::RhieChow) &&
603 (_velocity_interp_method == Moose::FV::InterpMethod::RhieChow)) ||
605 "The 'a' coefficients have not been generated or provided for "
606 "Rhie Chow velocity interpolation.");
607
608 mooseAssert(neighbor && this->hasBlocks(neighbor->subdomain_id()),
609 "We should be on an internal face...");
610
611 // Get pressure gradient. This is the uncorrected gradient plus a correction from cell
612 // centroid values on either side of the face
613 const auto correct_skewness_p = pressureSkewCorrection(tid);
614 const auto & grad_p = p.adGradSln(fi, time, correct_skewness_p);
615
616 // Get uncorrected pressure gradient. This will use the element centroid gradient if we are
617 // along a boundary face
618 const auto & unc_grad_p = p.uncorrectedAdGradSln(fi, time, correct_skewness_p);
619
620 // Volumetric Correction Method #1: pressure-based correction
621 // Function that allows us to mark the face for which the Rhie-Chow interpolation is
622 // inconsistent Normally, we should apply a reconstructed volume correction to the Rhie-Chow
623 // coefficients However, since the fluxes at the face are given by the volume force we will
624 // simply mark the face add the reverse pressure interpolation for these faces In brief, this
625 // function is just marking the faces where the Rhie-Chow interpolation is inconsistent
626 auto vf_indicator_pressure_based =
627 [this, &elem, &neighbor, &time, &fi, &correct_skewness](const Point & unit_basis_vector)
628 {
629 // Holders for the interpolated corrected and uncorrected volume force
630 Real interp_vf;
631 Real uncorrected_interp_vf;
632
633 // Compute the corrected interpolated face value
634 Moose::FaceArg face{
635 &fi, Moose::FV::LimiterType::CentralDifference, true, correct_skewness, nullptr, nullptr};
636
637 interp_vf = 0.0;
638 for (const auto i : make_range(_volumetric_force.size()))
639 interp_vf += (*this->_volumetric_force[i])(face, time);
640
641 // Compute the uncorrected interpolated face value
642 // For it to be consistent with the pressure gradient interpolation `uncorrectedAdGradSln`
643 // the uncorrected volume force computation should follow the same Green-Gauss process
644
645 Real elem_value = 0.0;
646 Real neigh_value = 0.0;
647
648 // Uncorrected interpolation - Step 1: loop over the faces of the element to compute
649 // face-average cell value
650 Real coord_multiplier;
651 const auto coord_type = _fe_problem.getCoordSystem(elem->subdomain_id());
652 const unsigned int rz_radial_coord =
654
655 for (const auto side : make_range(elem->n_sides()))
656 {
657 const Elem * const loc_neighbor = elem->neighbor_ptr(side);
658 const bool elem_has_fi = Moose::FV::elemHasFaceInfo(*elem, loc_neighbor);
659 const FaceInfo * const fi_loc =
660 _moose_mesh.faceInfo(elem_has_fi ? elem : loc_neighbor,
661 elem_has_fi ? side : loc_neighbor->which_neighbor_am_i(elem));
662
663 Moose::FaceArg loc_face{
664 fi_loc, Moose::FV::LimiterType::CentralDifference, true, correct_skewness, elem, nullptr};
665
667 elem->vertex_average(), coord_multiplier, coord_type, rz_radial_coord);
668
669 Real face_volume_contribution = fi_loc->faceArea() *
670 (neighbor->vertex_average() - elem->vertex_average()).norm() *
671 coord_multiplier;
672
673 for (const auto i : make_range(_volumetric_force.size()))
674 {
675 // Add which side (can be both, then we use a nullptr) of the face info the force is defined
676 // on
677 loc_face.face_side =
678 this->_volumetric_force[i]->hasFaceSide(*fi_loc, true)
679 ? (this->_volumetric_force[i]->hasFaceSide(*fi_loc, false) ? nullptr
680 : fi_loc->elemPtr())
681 : fi_loc->neighborPtr();
682 elem_value += (*this->_volumetric_force[i])(loc_face, time) * face_volume_contribution *
683 (fi_loc->normal() * unit_basis_vector);
684 }
685 }
686 elem_value = elem_value / elem->volume();
687
688 // Uncorrected interpolation - Step 2: loop over the face of the neighbor to compute
689 // face-average cell value
690 for (const auto side : make_range(neighbor->n_sides()))
691 {
692 const Elem * const loc_elem = neighbor->neighbor_ptr(side);
693 const bool elem_has_fi = Moose::FV::elemHasFaceInfo(*neighbor, loc_elem);
694 const FaceInfo * const fi_loc =
695 _moose_mesh.faceInfo(elem_has_fi ? neighbor : loc_elem,
696 elem_has_fi ? side : loc_elem->which_neighbor_am_i(neighbor));
697
698 Moose::FaceArg loc_face{
699 fi_loc, Moose::FV::LimiterType::CentralDifference, true, correct_skewness, elem, nullptr};
700
702 neighbor->vertex_average(), coord_multiplier, coord_type, rz_radial_coord);
703
704 Real face_volume_contribution = fi_loc->faceArea() *
705 (elem->vertex_average() - neighbor->vertex_average()).norm() *
706 coord_multiplier;
707
708 for (const auto i : make_range(_volumetric_force.size()))
709 {
710 loc_face.face_side =
711 this->_volumetric_force[i]->hasFaceSide(*fi_loc, true)
712 ? (this->_volumetric_force[i]->hasFaceSide(*fi_loc, false) ? nullptr
713 : fi_loc->elemPtr())
714 : fi_loc->neighborPtr();
715 neigh_value += (*this->_volumetric_force[i])(loc_face, time) * face_volume_contribution *
716 (fi_loc->normal() * unit_basis_vector);
717 }
718 }
719 neigh_value = neigh_value / neighbor->volume();
720
721 // Uncorrected interpolation - Step 3: interpolate element and neighbor reconstructed values
722 // to the face
724 fi.faceCentroid(), coord_multiplier, coord_type, rz_radial_coord);
726 Moose::FV::InterpMethod::Average, uncorrected_interp_vf, elem_value, neigh_value, fi, true);
727
728 // Return the flag indicator on which face the volume force correction is inconsistent
729 return MooseUtils::relativeFuzzyEqual(interp_vf, uncorrected_interp_vf, 1e-10) ? 0.0 : 1.0;
730 };
731
732 // Volumetric Correction Method #2: volume-based correction
733 // In thery, pressure and velocity cannot be decoupled when a body force is present
734 // Hence, we can de-activate the RC cofficient in faces that have a normal volume force
735 // In the method we mark the faces with a non-zero volume force with recpect to the baseline
736 auto vf_indicator_force_based = [this, &time, &fi, &correct_skewness](Point & face_normal)
737 {
738 Real value = 0.0;
739 Moose::FaceArg loc_face{
740 &fi, Moose::FV::LimiterType::CentralDifference, true, correct_skewness, nullptr, nullptr};
741
742 for (const auto i : make_range(_volumetric_force.size()))
743 value += (*_volumetric_force[i])(loc_face, time) * (face_normal * fi.normal());
744 if ((std::abs(value) - _baseline_volume_force) > 0)
745 return 1.0;
746 else
747 return 0.0;
748 };
749
750 const Point & elem_centroid = fi.elemCentroid();
751 const Point & neighbor_centroid = fi.neighborCentroid();
752 Real elem_volume = fi.elemVolume();
753 Real neighbor_volume = fi.neighborVolume();
754
755 // Now we need to perform the computations of D
756 const auto elem_a = (*_a_read[tid])(makeElemArg(elem), time);
757
758 mooseAssert(UserObject::_subproblem.getCoordSystem(elem->subdomain_id()) ==
759 UserObject::_subproblem.getCoordSystem(neighbor->subdomain_id()),
760 "Coordinate systems must be the same between the two elements");
761
762 Real coord;
763 coordTransformFactor(UserObject::_subproblem, elem->subdomain_id(), elem_centroid, coord);
764
765 elem_volume *= coord;
766
767 VectorValue<ADReal> elem_D = 0;
768 for (const auto i : make_range(_dim))
769 {
770 mooseAssert(elem_a(i).value() != 0, "We should not be dividing by zero");
771 elem_D(i) = elem_volume / elem_a(i);
772 }
773
774 VectorValue<ADReal> face_D;
775
776 const auto neighbor_a = (*_a_read[tid])(makeElemArg(neighbor), time);
777
778 coordTransformFactor(UserObject::_subproblem, neighbor->subdomain_id(), neighbor_centroid, coord);
779 neighbor_volume *= coord;
780
781 VectorValue<ADReal> neighbor_D = 0;
782 for (const auto i : make_range(_dim))
783 {
784 mooseAssert(neighbor_a(i).value() != 0, "We should not be dividing by zero");
785 neighbor_D(i) = neighbor_volume / neighbor_a(i);
786 }
787
788 // We require this to ensure that the correct interpolation weights are used.
789 // This will change once the traditional weights are replaced by the weights
790 // that are used by the skewness-correction.
791 Moose::FV::InterpMethod coeff_interp_method = correct_skewness
792 ? Moose::FV::InterpMethod::SkewCorrectedAverage
793 : Moose::FV::InterpMethod::Average;
794 Moose::FV::interpolate(coeff_interp_method, face_D, elem_D, neighbor_D, fi, true);
795
796 // evaluate face porosity, see (18) in Hanimann 2021 or (11) in Nordlund 2016
797 const auto face_eps = epsilon(tid)(face, time);
798
799 // Perform the pressure correction. We don't use skewness-correction on the pressure since
800 // it only influences the averaged cell gradients which cancel out in the correction
801 // below.
802 for (const auto i : make_range(_dim))
803 {
804 // "Standard" pressure-based RC interpolation
805 velocity(i) -= face_D(i) * face_eps * (grad_p(i) - unc_grad_p(i));
806
808 {
809 // To solve the volume force incorrect interpolation, we add back the pressure gradient to the
810 // RC-inconsistent faces regarding the marking method
811 Point unit_basis_vector;
812 unit_basis_vector(i) = 1.0;
813
814 // Get the value of the correction face indicator
815 Real correction_indicator;
816 if (_volume_force_correction_method == "force-consistent")
817 correction_indicator = vf_indicator_force_based(unit_basis_vector);
818 else
819 correction_indicator = vf_indicator_pressure_based(unit_basis_vector);
820
821 // Correct back the velocity
822 velocity(i) += face_D(i) * face_eps * (grad_p(i) - unc_grad_p(i)) * correction_indicator;
823 }
824 }
825
826 // If not solving for velocity, clear derivatives
828 return MetaPhysicL::raw_value(velocity);
829 else
830 return velocity;
831}
void coordTransformFactor(const SubProblem &s, SubdomainID sub_id, const P &point, C &factor, SubdomainID neighbor_sub_id=libMesh::Elem::invalid_subdomain_id)
const Real p
const double v
bool hasBlocks(const SubdomainName &name) const
bool shouldSolve() const
const ExecFlagType & getCurrentExecuteOnFlag() const
virtual unsigned int currentNlSysNum() const override
const Point & normal() const
const Elem & elem() const
const Elem * neighborPtr() const
Real faceArea() const
const Elem * elemPtr() const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
std::vector< std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADRealVectorValue > > > _vel
A functor for computing the (non-RC corrected) velocity.
bool pressureSkewCorrection(THREAD_ID tid) const
Whether central differencing face interpolations of pressure should include a skewness correction.
std::vector< std::unique_ptr< Moose::VectorCompositeFunctor< ADReal > > > _disps
A functor for computing the displacement.
const MooseEnum _volume_force_correction_method
– Method used for computing the properties average
const bool & _bool_correct_vf
Correct Rhie-Chow coefficients for volumetric force flag.
const unsigned int _momentum_sys_number
The number of the nonlinear system in which the monolithic momentum and continuity equations are loca...
bool velocitySkewCorrection(THREAD_ID tid) const
Whether central differencing face interpolations of velocity should include a skewness correction Als...
std::vector< const Moose::Functor< Real > * > _volumetric_force
Values of the functors storing the volumetric forces.
Real _baseline_volume_force
Minimum absolute RC force over the domain.
void mooseWarning(Args &&... args) const
const std::vector< const FaceInfo * > & faceInfo() const
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
INSFVVelocityVariable *const _w
The thread 0 copy of the z-velocity variable (null if the problem is not 3D)
std::vector< MooseVariableFVReal * > _ws
All the thread copies of the z-velocity variable.
const INSFVVelocityVariable * vel() const
std::vector< MooseVariableFVReal * > _vs
All the thread copies of the y-velocity variable.
virtual const Moose::FunctorBase< ADReal > & epsilon(THREAD_ID tid) const
A virtual method that allows us to only implement getVelocity once for free and porous flows.
INSFVVelocityVariable *const _v
The thread 0 copy of the y-velocity variable (null if the problem is 1D)
std::vector< MooseVariableFVReal * > _us
All the thread copies of the x-velocity variable.
std::vector< MooseVariableFVReal * > _ps
All the thread copies of the pressure variable.
unsigned int getAxisymmetricRadialCoord() const
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
FEProblemBase & _fe_problem
auto raw_value(const Eigen::Map< T > &in)
void coordTransformFactor(const P &point, C &factor, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint)
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)
bool elemHasFaceInfo(const Elem &elem, const Elem *const neighbor)
bool onBoundary(const SubdomainRestrictable &obj, const FaceInfo &fi)
std::tuple< bool, T, T > isPorosityJumpFace(const Moose::FunctorBase< T > &porosity, const FaceInfo &fi, const Moose::StateArg &time)
Checks to see whether the porosity value jumps from one side to the other of the provided face.
Definition NSFVUtils.C:119
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
auto norm(const T &a)
const unsigned int invalid_uint
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by GetAllTheRCVelocities::execute().

◆ getVolumetricFaceFlux()

Real RhieChowInterpolatorBase::getVolumetricFaceFlux ( const Moose::FV::InterpMethod  m,
const FaceInfo fi,
const Moose::StateArg time,
const THREAD_ID  tid,
bool  subtract_mesh_velocity 
) const
overridevirtualinherited

Retrieve the volumetric face flux, will not include derivatives.

Parameters
mThe velocity interpolation method. This is either Rhie-Chow or Average. Rhie-Chow is recommended as it avoids checkerboards in the pressure field
fiThe face that we wish to retrieve the velocity for
tidThe thread ID
Returns
The face velocity

Implements RhieChowFaceFluxProvider.

Definition at line 131 of file RhieChowInterpolatorBase.C.

136{
137 return raw_value(this->getVelocity(m, fi, time, tid, subtract_mesh_velocity)) * fi.normal();
138}
virtual VectorValue< ADReal > getVelocity(const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const =0
Retrieve a face velocity.

◆ ghostADataOnBoundary()

void INSFVRhieChowInterpolator::ghostADataOnBoundary ( const BoundaryID  boundary_id)
overridevirtualinherited

makes sure coefficient data gets communicated on both sides of a given boundary

Reimplemented from RhieChowInterpolatorBase.

Definition at line 497 of file INSFVRhieChowInterpolator.C.

498{
499 if (!needAComputation() || this->n_processors() == 1)
500 return;
501
502 // Ghost a for the elements on the boundary
503 for (auto elem_id : _moose_mesh.getBoundaryActiveSemiLocalElemIds(boundary_id))
504 {
505 const auto & elem = _moose_mesh.elemPtr(elem_id);
506 // no need to ghost if locally owned or far from local process
507 if (elem->processor_id() != this->processor_id() && elem->is_semilocal(this->processor_id()))
508 // Adding to the a coefficient will make sure the final result gets communicated
509 addToA(elem, 0, 0);
510 }
511
512 // Ghost a for the neighbors of the elements on the boundary
513 for (auto neighbor_id : _moose_mesh.getBoundaryActiveNeighborElemIds(boundary_id))
514 {
515 const auto & neighbor = _moose_mesh.queryElemPtr(neighbor_id);
516 // no need to ghost if locally owned or far from local process
517 if (neighbor->processor_id() != this->processor_id() &&
518 neighbor->is_semilocal(this->processor_id()))
519 // Adding to the a coefficient will make sure the final result gets communicated
520 addToA(neighbor, 0, 0);
521 }
522}
bool needAComputation() const
Whether we need 'a' coefficient computation.
virtual void addToA(const libMesh::Elem *elem, unsigned int component, const ADReal &value) override
API that momentum residual objects that have on-diagonals for velocity call.
virtual Elem * elemPtr(const dof_id_type i)
virtual Elem * queryElemPtr(const dof_id_type i)
processor_id_type n_processors() const

◆ hasFaceSide()

bool RhieChowFaceFluxProvider::hasFaceSide ( const FaceInfo fi,
const bool  fi_elem_side 
) const
overridevirtualinherited

Implements FaceArgInterface.

Definition at line 27 of file RhieChowFaceFluxProvider.C.

28{
29 if (fi_elem_side)
30 return hasBlocks(fi.elem().subdomain_id());
31 else
32 return fi.neighborPtr() && hasBlocks(fi.neighbor().subdomain_id());
33}
const Elem & neighbor() const

◆ initialize()

void PINSFVRhieChowInterpolator::initialize ( )
overridevirtual

Reimplemented from INSFVRhieChowInterpolator.

Definition at line 179 of file PINSFVRhieChowInterpolator.C.

180{
181 if (_current_execute_flag == EXEC_INITIAL)
182 pinsfvSetup();
183 else
184 // Cannot compute Rhie Chow coefficients on initial
186}
void pinsfvSetup()
called during the first initialize() and upon meshChanged(), this method performs the interpolations ...

◆ initialSetup()

void INSFVRhieChowInterpolator::initialSetup ( )
overridevirtualinherited

Reimplemented from GeneralUserObject.

Definition at line 268 of file INSFVRhieChowInterpolator.C.

269{
270 insfvSetup();
271
272 if (_velocity_interp_method == Moose::FV::InterpMethod::Average)
273 return;
274 for (const auto var_num : _var_numbers)
275 {
276 std::vector<MooseObject *> var_objects;
278 .query()
279 .template condition<AttribVar>(static_cast<int>(var_num))
280 .template condition<AttribResidualObject>(true)
281 .template condition<AttribSysNum>(_u->sys().number())
282 .queryInto(var_objects);
283 for (auto * const var_object : var_objects)
284 {
285 // Allow FVElementalKernel that are not INSFVMomentumResidualObject for now, refs #20695
286 if (!dynamic_cast<INSFVMomentumResidualObject *>(var_object) &&
287 !dynamic_cast<FVElementalKernel *>(var_object))
288 mooseError("Object ",
289 var_object->name(),
290 " is not a INSFVMomentumResidualObject. Make sure that all the objects applied "
291 "to the momentum equation are INSFV or derived objects.");
292 else if (!dynamic_cast<INSFVMomentumResidualObject *>(var_object) &&
293 dynamic_cast<FVElementalKernel *>(var_object))
295 "Elemental kernel ",
296 var_object->name(),
297 " is not a INSFVMomentumResidualObject. Make sure that all the objects applied "
298 "to the momentum equation are INSFV or derived objects.");
299 }
300
301 if (var_objects.size() == 0 && !_a_data_provided)
302 mooseError("No INSFVKernels detected for the velocity variables. If you are trying to use "
303 "auxiliary variables for advection, please specify the a_u/v/w coefficients. If "
304 "not, please specify INSFVKernels for the momentum equations.");
305 }
306
307 // Get baseline force if force-correction method is used for volumetric correction
308 if (_bool_correct_vf && _volume_force_correction_method == "force-consistent")
309 {
311 for (const auto & loc_elem : *_elem_range)
312 {
313 Real elem_value = 0.0;
314 for (const auto i : make_range(_volumetric_force.size()))
315 elem_value += (*_volumetric_force[i])(makeElemArg(loc_elem), determineState());
316
317 if (std::abs(elem_value) < _baseline_volume_force)
318 _baseline_volume_force = std::abs(elem_value);
319 if (_baseline_volume_force == 0)
320 break;
321 }
323 }
324}
TheWarehouse & theWarehouse() const
All objects that contribute to pressure-based (e.g.
std::unique_ptr< ConstElemRange > _elem_range
All the active and elements local to this process that exist on this object's subdomains.
void insfvSetup()
perform the setup of this object
SystemBase & sys()
std::vector< unsigned int > _var_numbers
The velocity variable numbers.
INSFVVelocityVariable *const _u
The thread 0 copy of the x-velocity variable.
unsigned int number() const
void min(const T &r, T &o, Request &req) const
Query query()
Moose::StateArg determineState() const
const Parallel::Communicator & _communicator

◆ insfvSetup()

void INSFVRhieChowInterpolator::insfvSetup ( )
protectedinherited

perform the setup of this object

Definition at line 327 of file INSFVRhieChowInterpolator.C.

328{
330 std::make_unique<ConstElemRange>(_mesh.active_local_subdomain_set_elements_begin(blockIDs()),
331 _mesh.active_local_subdomain_set_elements_end(blockIDs()));
332}
const libMesh::MeshBase & _mesh
The libMesh mesh that this object acts on.

Referenced by INSFVRhieChowInterpolator::initialSetup(), and INSFVRhieChowInterpolator::meshChanged().

◆ isFaceGeometricallyRelevant()

bool PINSFVRhieChowInterpolator::isFaceGeometricallyRelevant ( const FaceInfo fi) const
protected
Returns
whether this face is geometrically relevant to us

Definition at line 129 of file PINSFVRhieChowInterpolator.C.

130{
131 if (&fi.elem() == libMesh::remote_elem)
132 return false;
133
134 bool on_us = blockIDs().count(fi.elem().subdomain_id());
135
136 if (fi.neighborPtr())
137 {
138 if (&fi.neighbor() == libMesh::remote_elem)
139 return false;
140
141 on_us = on_us || blockIDs().count(fi.neighbor().subdomain_id());
142 }
143
144 if (!on_us)
145 // Neither the element nor neighbor has a subdomain id on which we are active, so this face is
146 // not relevant
147 return false;
148
149 //
150 // Ok, we've established that either the element or neighbor is active on our subdomains and
151 // neither of them are remote elements, so this face is still in the running to be considered
152 // relevant. There is one more caveat to be considered. In the case that we are a boundary face,
153 // we will generally need a two term expansion to compute our value, which will require a
154 // cell-gradient evaluation. If that is the case, then all of our surrounding neighbors cannot be
155 // remote. If we are not a boundary face, then at this point we're safe
156 //
157
159 return true;
160
161 const auto & boundary_elem = (fi.neighborPtr() && blockIDs().count(fi.neighbor().subdomain_id()))
162 ? fi.neighbor()
163 : fi.elem();
164
165 for (auto * const neighbor : boundary_elem.neighbor_ptr_range())
166 {
167 if (!neighbor)
168 continue;
169
170 if ((neighbor == libMesh::remote_elem))
171 return false;
172 }
173
174 // We made it through all the tests!
175 return true;
176}
const RemoteElem * remote_elem

Referenced by pinsfvSetup().

◆ listOfCommonParams()

std::vector< std::string > INSFVRhieChowInterpolator::listOfCommonParams ( )
staticinherited
Returns
A list of the parameters that are common between this object and the NSFV action

Definition at line 68 of file INSFVRhieChowInterpolator.C.

69{
70 return {"pull_all_nonlocal_a",
71 "correct_volumetric_force",
72 "volume_force_correction_method",
73 "volumetric_force_functors"};
74}

Referenced by WCNSFVFlowPhysics::addRhieChowUserObjects().

◆ meshChanged()

void PINSFVRhieChowInterpolator::meshChanged ( )
overridevirtual

Reimplemented from INSFVRhieChowInterpolator.

Definition at line 81 of file PINSFVRhieChowInterpolator.C.

◆ needAComputation()

bool INSFVRhieChowInterpolator::needAComputation ( ) const
inlineprivateinherited

Whether we need 'a' coefficient computation.

Definition at line 234 of file INSFVRhieChowInterpolator.h.

235{
236 // We dont check for "a"s being in another nonlinear system here, only being auxiliary
237 return !_a_data_provided && _velocity_interp_method == Moose::FV::InterpMethod::RhieChow;
238}

Referenced by INSFVRhieChowInterpolator::finalize(), INSFVRhieChowInterpolator::ghostADataOnBoundary(), and INSFVRhieChowInterpolator::initialize().

◆ pinsfvSetup()

void PINSFVRhieChowInterpolator::pinsfvSetup ( )
private

called during the first initialize() and upon meshChanged(), this method performs the interpolations and reconstructions of porosity.

Cannot be called in initialSetup() because UOs are initialized before Functions

Definition at line 88 of file PINSFVRhieChowInterpolator.C.

89{
91 return;
92
93 if (dynamic_cast<BernoulliPressureVariable *>(_p))
96 "If 'smoothing_layers' is non-zero, e.g. if the porosity is smooth(ed), "
97 "then the pressure drop should be computed automatically. The "
98 "'BernoulliPressureVariable' class enforces a pressure drop according to the Bernoulli "
99 "equation on any face which has different pressure values on either side. This is "
100 "undesirable when the porosity is varying smoothing and there may be pressure drops "
101 "corresponding to viscous effects. Please just use the 'INSFVPressureVariable' "
102 "class for pressure when the porosity is smooth.");
103
104 const auto & all_fi = _moose_mesh.allFaceInfo();
105 _geometric_fi.reserve(all_fi.size());
106
107 for (const auto & fi : all_fi)
109 _geometric_fi.push_back(&fi);
110
111 _geometric_fi.shrink_to_fit();
112
113 const auto saved_do_derivatives = ADReal::do_derivatives;
114 ADReal::do_derivatives = true;
117 ADReal::do_derivatives = saved_do_derivatives;
118
119 // Assign the new functor to all
120 for (const auto tid : make_range((unsigned int)(1), libMesh::n_threads()))
121 {
122 auto & other_smoothed_epss = const_cast<Moose::Functor<ADReal> &>(
124 other_smoothed_epss.assign(_smoothed_eps);
125 }
126}
void ErrorVector unsigned int
A special variable class for pressure which flags faces at which porosity jumps occur as extrapolated...
const std::vector< FaceInfo > & allFaceInfo() const
bool isFaceGeometricallyRelevant(const FaceInfo &fi) const
std::vector< const FaceInfo * > _geometric_fi
All the face information that are "geometrically" accessible on this process.
INSFVPressureVariable *const _p
The thread 0 copy of the pressure variable.
void interpolateReconstruct(CellCenteredMapFunctor< T, Map > &output_functor, const Moose::FunctorBase< T > &input_functor, const unsigned int num_int_recs, const bool weight_with_sf, const std::vector< const FaceInfo * > &faces, const Moose::StateArg &time)
Takes an input functor that can be evaluated at faces, typically by linearly interpolating between ad...
static const std::string pressure
Definition NS.h:57
if(subdm)

Referenced by initialize(), and meshChanged().

◆ pressure()

const INSFVPressureVariable & RhieChowInterpolatorBase::pressure ( THREAD_ID  tid) const
inlineinherited
Returns
The pressure variable corresponding to the provided thread ID

Definition at line 160 of file RhieChowInterpolatorBase.h.

161{
162 mooseAssert(tid < _ps.size(), "Attempt to access out-of-bounds in pressure variable container");
163 return *cast_ptr<INSFVPressureVariable *>(_ps[tid]);
164}

◆ pressureSkewCorrection()

bool INSFVRhieChowInterpolator::pressureSkewCorrection ( THREAD_ID  tid) const
inlineinherited

Whether central differencing face interpolations of pressure should include a skewness correction.

Definition at line 248 of file INSFVRhieChowInterpolator.h.

249{
250 const auto * const p = _ps[tid];
251 return (p->faceInterpolationMethod() == Moose::FV::InterpMethod::SkewCorrectedAverage);
252}

Referenced by INSFVRhieChowInterpolator::getVelocity().

◆ pullAllNonlocal()

void INSFVRhieChowInterpolator::pullAllNonlocal ( )
inlineinherited

Whether to pull all 'a' coefficient data from the owning process for all nonlocal elements we have access to (e.g.

all of our nonlocal elements we have pointers to)

Definition at line 99 of file INSFVRhieChowInterpolator.h.

99{ _pull_all_nonlocal = true; }
bool _pull_all_nonlocal
Whether we want to pull all nonlocal 'a' coefficient data.

Referenced by GetAllTheRCVelocities::GetAllTheRCVelocities().

◆ segregated()

virtual bool INSFVRhieChowInterpolator::segregated ( ) const
inlineoverridevirtualinherited

Bool of the Rhie Chow user object is used in monolithic/segregated approaches.

Implements RhieChowInterpolatorBase.

Definition at line 88 of file INSFVRhieChowInterpolator.h.

88{ return false; };

◆ supportMeshVelocity()

virtual bool RhieChowFaceFluxProvider::supportMeshVelocity ( ) const
inlinevirtualinherited

Returns whether the UO can support mesh velocity advection.

Reimplemented in RhieChowMassFlux.

Definition at line 49 of file RhieChowFaceFluxProvider.h.

49{ return true; }

Referenced by VolumetricFlowRate::VolumetricFlowRate().

◆ uniqueParams()

InputParameters INSFVRhieChowInterpolator::uniqueParams ( )
staticinherited

Parameters of this object that should be added to the NSFV action that are unique to this object.

Definition at line 43 of file INSFVRhieChowInterpolator.C.

44{
45 auto params = emptyInputParameters();
46 params.addParam<bool>(
47 "pull_all_nonlocal_a",
48 false,
49 "Whether to pull all nonlocal 'a' coefficient data to our process. Note that 'nonlocal' "
50 "means elements that we have access to (this may not be all the elements in the mesh if the "
51 "mesh is distributed) but that we do not own.");
52 params.addParamNamesToGroup("pull_all_nonlocal_a", "Parallel Execution Tuning");
53
54 params.addParam<bool>(
55 "correct_volumetric_force", false, "Flag to activate volume force corrections.");
56 MooseEnum volume_force_correction_method("force-consistent pressure-consistent",
57 "force-consistent");
58 params.addParam<MooseEnum>(
59 "volume_force_correction_method",
60 volume_force_correction_method,
61 "The method used for correcting the Rhie-Chow coefficients for a volume force.");
62 params.addParam<std::vector<MooseFunctorName>>(
63 "volumetric_force_functors", "The names of the functors with the volumetric force sources.");
64 return params;
65}
InputParameters emptyInputParameters()

Referenced by NSFVBase::validParams(), and INSFVRhieChowInterpolator::validParams().

◆ validParams()

InputParameters PINSFVRhieChowInterpolator::validParams ( )
static

Definition at line 19 of file PINSFVRhieChowInterpolator.C.

20{
22 params.addClassDescription("Performs interpolations and reconstructions of porosity and computes "
23 "the Rhie-Chow face velocities.");
24 ExecFlagEnum & exec_enum = params.set<ExecFlagEnum>("execute_on", /*quiet=*/true);
25 exec_enum.setAdditionalValue(EXEC_INITIAL);
26 params.addRequiredParam<MooseFunctorName>(NS::porosity, "The porosity");
27 params.addParam<unsigned short>(
28 "smoothing_layers",
29 0,
30 "The number of interpolation-reconstruction operations to perform on the porosity");
31 params.addRelationshipManager("ElementSideNeighborLayers",
32 Moose::RelationshipManagerType::GEOMETRIC,
33 [](const InputParameters & obj_params, InputParameters & rm_params)
34 {
35 rm_params.set<unsigned short>("layers") =
36 obj_params.get<unsigned short>("smoothing_layers");
37 rm_params.set<bool>("use_displaced_mesh") =
38 obj_params.get<bool>("use_displaced_mesh");
39 });
40 return params;
41}
static InputParameters validParams()
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
T & set(const std::string &name, bool quiet_mode=false)
void setAdditionalValue(const std::string &names)

◆ vel()

const INSFVVelocityVariable * RhieChowInterpolatorBase::vel ( ) const
inlineinherited

Definition at line 83 of file RhieChowInterpolatorBase.h.

83{ return _u; }

Referenced by INSFVRhieChowInterpolator::getVelocity().

◆ velocityInterpolationMethod()

Moose::FV::InterpMethod RhieChowInterpolatorBase::velocityInterpolationMethod ( ) const
inlineinherited

Return the interpolation method used for velocity.

Definition at line 70 of file RhieChowInterpolatorBase.h.

◆ velocitySkewCorrection()

bool INSFVRhieChowInterpolator::velocitySkewCorrection ( THREAD_ID  tid) const
inlineinherited

Whether central differencing face interpolations of velocity should include a skewness correction Also used for the face interpolation of the D coefficient and the face interpolation of volumetric forces for for the volume correction method and the face interpolation of porosity.

Definition at line 241 of file INSFVRhieChowInterpolator.h.

242{
243 const auto * const u = _us[tid];
244 return (u->faceInterpolationMethod() == Moose::FV::InterpMethod::SkewCorrectedAverage);
245}

Referenced by INSFVRhieChowInterpolator::getVelocity().

Member Data Documentation

◆ _a

CellCenteredMapFunctor<ADRealVectorValue, std::unordered_map<dof_id_type, ADRealVectorValue> > INSFVRhieChowInterpolator::_a
protectedinherited

◆ _a_aux

std::vector<std::unique_ptr<Moose::FunctorBase<VectorValue<ADReal> > > > INSFVRhieChowInterpolator::_a_aux
privateinherited

A vector sized according to the number of threads that holds vector composites of 'a' component functors.

This member is leveraged when advecting velocities are auxiliary variables and the 'a' data has been transferred from another application

Definition at line 191 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::fillARead().

◆ _a_data_provided

bool INSFVRhieChowInterpolator::_a_data_provided
privateinherited

Whether 'a' data has been provided by the user.

This can happen if we are running in an application solving precursor advection, and another application has computed the fluid flow field

Definition at line 196 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::execute(), INSFVRhieChowInterpolator::fillARead(), INSFVRhieChowInterpolator::getVelocity(), INSFVRhieChowInterpolator::initialSetup(), and INSFVRhieChowInterpolator::needAComputation().

◆ _a_mutex

Threads::spin_mutex INSFVRhieChowInterpolator::_a_mutex
privateinherited

Mutex that prevents multiple threads from saving into the 'a' coefficients at the same time.

Definition at line 182 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::addToA().

◆ _a_read

std::vector<const Moose::FunctorBase<VectorValue<ADReal> > *> INSFVRhieChowInterpolator::_a_read
privateinherited

A vector sized according to the number of threads that holds the 'a' data we will read from when computing the Rhie-Chow velocity.

Definition at line 186 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::fillARead(), and INSFVRhieChowInterpolator::getVelocity().

◆ _ax

Moose::VectorComponentFunctor<ADReal> INSFVRhieChowInterpolator::_ax
protectedinherited

The x-component of 'a'

Definition at line 151 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::fillARead().

◆ _ay

Moose::VectorComponentFunctor<ADReal> INSFVRhieChowInterpolator::_ay
protectedinherited

The y-component of 'a'.

Definition at line 154 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::fillARead().

◆ _az

Moose::VectorComponentFunctor<ADReal> INSFVRhieChowInterpolator::_az
protectedinherited

The z-component of 'a'.

Definition at line 157 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::fillARead().

◆ _baseline_volume_force

Real INSFVRhieChowInterpolator::_baseline_volume_force
privateinherited

Minimum absolute RC force over the domain.

Definition at line 214 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::getVelocity(), and INSFVRhieChowInterpolator::initialSetup().

◆ _bool_correct_vf

const bool& INSFVRhieChowInterpolator::_bool_correct_vf
privateinherited

Correct Rhie-Chow coefficients for volumetric force flag.

Definition at line 202 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::getVelocity(), INSFVRhieChowInterpolator::initialSetup(), and INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _dim

const unsigned int RhieChowInterpolatorBase::_dim
protectedinherited

◆ _disp_xs

std::vector<MooseVariableField<Real> *> INSFVRhieChowInterpolator::_disp_xs
protectedinherited

All the thread copies of the x-displacement variable.

Definition at line 126 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _disp_ys

std::vector<MooseVariableField<Real> *> INSFVRhieChowInterpolator::_disp_ys
protectedinherited

All the thread copies of the y-displacement variable.

Definition at line 129 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _disp_zs

std::vector<MooseVariableField<Real> *> INSFVRhieChowInterpolator::_disp_zs
protectedinherited

All the thread copies of the z-displacement variable.

Definition at line 132 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _displaced

const bool RhieChowInterpolatorBase::_displaced
protectedinherited

Whether this object is operating on the displaced mesh.

Definition at line 146 of file RhieChowInterpolatorBase.h.

Referenced by INSFVRhieChowInterpolator::execute(), and INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _disps

std::vector<std::unique_ptr<Moose::VectorCompositeFunctor<ADReal> > > INSFVRhieChowInterpolator::_disps
protectedinherited

A functor for computing the displacement.

Definition at line 135 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::getVelocity(), and INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _elem_range

std::unique_ptr<ConstElemRange> INSFVRhieChowInterpolator::_elem_range
protectedinherited

All the active and elements local to this process that exist on this object's subdomains.

Definition at line 138 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::execute(), INSFVRhieChowInterpolator::initialSetup(), and INSFVRhieChowInterpolator::insfvSetup().

◆ _elements_to_push_pull

std::unordered_set<const Elem *> INSFVRhieChowInterpolator::_elements_to_push_pull
privateinherited

Non-local elements that we should push and pull data for across processes.

Definition at line 176 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::addToA(), INSFVRhieChowInterpolator::finalize(), and INSFVRhieChowInterpolator::meshChanged().

◆ _eps

const Moose::Functor<ADReal>& PINSFVRhieChowInterpolator::_eps
protected

The thread 0 copy of the porosity functor held by the subproblem.

Initially this functor should be provided by a functor material property or function. We then perform repeated interpolations and reconstructions to create the resulting smoothed field

Definition at line 44 of file PINSFVRhieChowInterpolator.h.

Referenced by PINSFVRhieChowInterpolator(), and pinsfvSetup().

◆ _epss

std::vector<const Moose::Functor<ADReal> *> PINSFVRhieChowInterpolator::_epss
protected

All the thread copies of the problem's porosity functor.

Definition at line 50 of file PINSFVRhieChowInterpolator.h.

Referenced by epsilon(), and PINSFVRhieChowInterpolator().

◆ _example

const VectorValue<ADReal> INSFVRhieChowInterpolator::_example
privateinherited

An example datum used to help communicate AD vector information in parallel.

Definition at line 179 of file INSFVRhieChowInterpolator.h.

◆ _geometric_fi

std::vector<const FaceInfo *> PINSFVRhieChowInterpolator::_geometric_fi
protected

All the face information that are "geometrically" accessible on this process.

For an internal face, we consider it to be geometrically accessible if neither element nor neighbor is a libMesh::remote_elem. For a boundary face, we consider the face to be geometrically accessible if the adjoining element and all its non-null neighbors are not libMesh::remote_elem. This is due to the need to be able to perform two-term expansions which require ability to compute a Green-Gauss gradient

Definition at line 65 of file PINSFVRhieChowInterpolator.h.

Referenced by pinsfvSetup().

◆ _mesh

const libMesh::MeshBase& RhieChowInterpolatorBase::_mesh
protectedinherited

◆ _momentum_sys_number

const unsigned int INSFVRhieChowInterpolator::_momentum_sys_number
protectedinherited

The number of the nonlinear system in which the monolithic momentum and continuity equations are located.

Definition at line 161 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::execute(), INSFVRhieChowInterpolator::finalize(), INSFVRhieChowInterpolator::getVelocity(), and INSFVRhieChowInterpolator::initialize().

◆ _moose_mesh

MooseMesh& RhieChowInterpolatorBase::_moose_mesh
protectedinherited

◆ _p

INSFVPressureVariable* const RhieChowInterpolatorBase::_p
protectedinherited

◆ _ps

std::vector<MooseVariableFVReal *> RhieChowInterpolatorBase::_ps
protectedinherited

◆ _pull_all_nonlocal

bool INSFVRhieChowInterpolator::_pull_all_nonlocal
privateinherited

Whether we want to pull all nonlocal 'a' coefficient data.

Definition at line 199 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::finalize(), and INSFVRhieChowInterpolator::pullAllNonlocal().

◆ _smoothed_eps

CellCenteredMapFunctor<ADReal, std::unordered_map<dof_id_type, ADReal> > PINSFVRhieChowInterpolator::_smoothed_eps
protected

The smoothed porosity functor/field.

Definition at line 47 of file PINSFVRhieChowInterpolator.h.

Referenced by PINSFVRhieChowInterpolator(), and pinsfvSetup().

◆ _smoothed_epss

std::vector<const Moose::Functor<ADReal> *> PINSFVRhieChowInterpolator::_smoothed_epss
protected

All the thread copies of the problem's smoothed porosity functor.

Definition at line 53 of file PINSFVRhieChowInterpolator.h.

Referenced by epsilon(), and PINSFVRhieChowInterpolator().

◆ _smoothing_layers

const unsigned short PINSFVRhieChowInterpolator::_smoothing_layers
protected

The number of interpolations and reconstructions that should be performed on the porosity functor/field.

One smoothing layer corresponds to one interpolation and one reconstruction

Definition at line 57 of file PINSFVRhieChowInterpolator.h.

Referenced by epsilon(), PINSFVRhieChowInterpolator(), and pinsfvSetup().

◆ _u

INSFVVelocityVariable* const RhieChowInterpolatorBase::_u
protectedinherited

◆ _unity_functor

const Moose::ConstantFunctor<ADReal> RhieChowInterpolatorBase::_unity_functor {1}
privateinherited

A unity functor used in the epsilon virtual method.

Definition at line 150 of file RhieChowInterpolatorBase.h.

150{1};

Referenced by RhieChowInterpolatorBase::epsilon().

◆ _us

std::vector<MooseVariableFVReal *> RhieChowInterpolatorBase::_us
protectedinherited

◆ _v

INSFVVelocityVariable* const RhieChowInterpolatorBase::_v
protectedinherited

◆ _var_numbers

std::vector<unsigned int> RhieChowInterpolatorBase::_var_numbers
protectedinherited

◆ _vel

std::vector<std::unique_ptr<PiecewiseByBlockLambdaFunctor<ADRealVectorValue> > > INSFVRhieChowInterpolator::_vel
protectedinherited

A functor for computing the (non-RC corrected) velocity.

Definition at line 123 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::getVelocity(), and INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _velocity_interp_method

Moose::FV::InterpMethod RhieChowInterpolatorBase::_velocity_interp_method
protectedinherited

◆ _volume_force_correction_method

const MooseEnum INSFVRhieChowInterpolator::_volume_force_correction_method
privateinherited

– Method used for computing the properties average

Definition at line 205 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::getVelocity(), and INSFVRhieChowInterpolator::initialSetup().

◆ _volumetric_force

std::vector<const Moose::Functor<Real> *> INSFVRhieChowInterpolator::_volumetric_force
privateinherited

◆ _volumetric_force_functors

const std::vector<MooseFunctorName>* INSFVRhieChowInterpolator::_volumetric_force_functors
privateinherited

Names of the functors storing the volumetric forces.

Definition at line 208 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().

◆ _vs

std::vector<MooseVariableFVReal *> RhieChowInterpolatorBase::_vs
protectedinherited

◆ _w

INSFVVelocityVariable* const RhieChowInterpolatorBase::_w
protectedinherited

◆ _ws

std::vector<MooseVariableFVReal *> RhieChowInterpolatorBase::_ws
protectedinherited

◆ _zero_functor

const Moose::ConstantFunctor<ADReal> INSFVRhieChowInterpolator::_zero_functor {0}
privateinherited

A zero functor potentially used in _a_read.

Definition at line 217 of file INSFVRhieChowInterpolator.h.

217{0};

Referenced by INSFVRhieChowInterpolator::fillARead(), and INSFVRhieChowInterpolator::INSFVRhieChowInterpolator().


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