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

This user-object gathers 'a' (on-diagonal velocity coefficients) data. More...

#include <INSFVRhieChowInterpolator.h>

Inheritance diagram for INSFVRhieChowInterpolator:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 
enum  ResidualTagType { ResidualTagType::NonReference, ResidualTagType::Reference }
 

Public Member Functions

 INSFVRhieChowInterpolator (const InputParameters &params)
 
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. More...
 
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. More...
 
virtual void initialSetup () override
 
virtual void meshChanged () override
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
virtual bool segregated () const override
 Bool of the Rhie Chow user object is used in monolithic/segregated approaches. More...
 
virtual void ghostADataOnBoundary (const BoundaryID boundary_id) override
 makes sure coefficient data gets communicated on both sides of a given boundary More...
 
void pullAllNonlocal ()
 Whether to pull all 'a' coefficient data from the owning process for all nonlocal elements we have access to (e.g. More...
 
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. More...
 
bool pressureSkewCorrection (THREAD_ID tid) const
 Whether central differencing face interpolations of pressure should include a skewness correction. More...
 
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. More...
 
Moose::FV::InterpMethod velocityInterpolationMethod () const
 Return the interpolation method used for velocity. More...
 
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. More...
 
SubProblemgetSubProblem () const
 
bool shouldDuplicateInitialExecution () const
 
virtual Real spatialValue (const Point &) const
 
virtual const std::vector< Point > spatialPoints () 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)
 
void setPrimaryThreadCopy (UserObject *primary)
 
UserObjectprimaryThreadCopy ()
 
std::set< UserObjectName > getDependObjects () const
 
virtual bool needThreadedCopy () const
 
const std::set< std::string > & getRequestedItems () override
 
const std::set< std::string > & getSuppliedItems () override
 
unsigned int systemNumber () const
 
virtual bool enabled () const
 
std::shared_ptr< MooseObjectgetSharedPtr ()
 
std::shared_ptr< const MooseObjectgetSharedPtr () const
 
bool isKokkosObject (IsKokkosObjectKey &&) 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 T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T * queryParam (const std::string &name) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &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 mooseInfo (Args &&... args) const
 
void callMooseError (std::string msg, const bool with_prefix, const hit::Node *node=nullptr) 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 T & getUserObject (const std::string &param_name, bool is_dependency=true) const
 
const T & getUserObjectByName (const UserObjectName &object_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBase (const std::string &param_name, bool is_dependency=true) const
 
const UserObjectgetUserObjectBaseByName (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)
 
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
 
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
 
T & getSampler (const std::string &name)
 
SamplergetSampler (const std::string &name)
 
T & getSamplerByName (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 T & getDistribution (const std::string &name) const
 
const DistributiongetDistribution (const std::string &name) const
 
const T & getDistribution (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (const std::string &name) const
 
const DistributiongetDistributionByName (const DistributionName &name) const
 
const T & getDistributionByName (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
 

Static Public Member Functions

static InputParameters uniqueParams ()
 Parameters of this object that should be added to the NSFV action that are unique to this object. More...
 
static std::vector< std::string > listOfCommonParams ()
 
static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node)
 
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)
 
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

void insfvSetup ()
 perform the setup of this object More...
 
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. More...
 
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. More...
 
template<typename VarType >
void checkBlocks (const VarType &var) const
 Check the block consistency between the passed in var and us. More...
 
virtual void addPostprocessorDependencyHelper (const PostprocessorName &name) const override
 
virtual void addVectorPostprocessorDependencyHelper (const VectorPostprocessorName &name) const override
 
virtual void addUserObjectDependencyHelper (const UserObject &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
 
T & declareRestartableData (const std::string &data_name, Args &&... args)
 
ManagedValue< T > declareManagedRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
const T & getRestartableData (const std::string &data_name) const
 
T & declareRestartableDataWithContext (const std::string &data_name, void *context, Args &&... args)
 
T & declareRecoverableData (const std::string &data_name, Args &&... args)
 
T & declareRestartableDataWithObjectName (const std::string &data_name, const std::string &object_name, Args &&... args)
 
T & declareRestartableDataWithObjectNameWithContext (const std::string &data_name, const std::string &object_name, void *context, Args &&... args)
 
std::string restartableName (const std::string &data_name) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 
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 T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, const std::size_t time_index=0)
 
const T & getReporterValue (const std::string &param_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, ReporterMode mode, const std::size_t time_index=0)
 
const T & getReporterValueByName (const ReporterName &reporter_name, const std::size_t time_index=0)
 
const T & getReporterValueByName (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 (const Moose::Kokkos::Mesh *mesh)
 
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 (ThreadID tid) const
 
KOKKOS_FUNCTION ContiguousElementID kokkosBlockNodeID (ThreadID tid) const
 
KOKKOS_FUNCTION auto kokkosBlockElementSideID (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 ADResidualsPacket &packet)
 
void addJacobian (Assembly &assembly, 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)
 

Static Protected Member Functions

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

Protected Attributes

std::vector< std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADRealVectorValue > > > _vel
 A functor for computing the (non-RC corrected) velocity. More...
 
std::vector< MooseVariableField< Real > * > _disp_xs
 All the thread copies of the x-displacement variable. More...
 
std::vector< MooseVariableField< Real > * > _disp_ys
 All the thread copies of the y-displacement variable. More...
 
std::vector< MooseVariableField< Real > * > _disp_zs
 All the thread copies of the z-displacement variable. More...
 
std::vector< std::unique_ptr< Moose::VectorCompositeFunctor< ADReal > > > _disps
 A functor for computing the displacement. More...
 
std::unique_ptr< ConstElemRange_elem_range
 All the active and elements local to this process that exist on this object's subdomains. More...
 
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
 A map from element IDs to 'a' coefficient data. More...
 
const unsigned int _momentum_sys_number
 The number of the nonlinear system in which the monolithic momentum and continuity equations are located. More...
 
MooseMesh_moose_mesh
 The MooseMesh that this user object operates on. More...
 
const libMesh::MeshBase_mesh
 The libMesh mesh that this object acts on. More...
 
const unsigned int _dim
 The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris. More...
 
INSFVPressureVariable *const _p
 The thread 0 copy of the pressure variable. More...
 
INSFVVelocityVariable *const _u
 The thread 0 copy of the x-velocity variable. More...
 
INSFVVelocityVariable *const _v
 The thread 0 copy of the y-velocity variable (null if the problem is 1D) More...
 
INSFVVelocityVariable *const _w
 The thread 0 copy of the z-velocity variable (null if the problem is not 3D) More...
 
std::vector< MooseVariableFVReal * > _ps
 All the thread copies of the pressure variable. More...
 
std::vector< MooseVariableFVReal * > _us
 All the thread copies of the x-velocity variable. More...
 
std::vector< MooseVariableFVReal * > _vs
 All the thread copies of the y-velocity variable. More...
 
std::vector< MooseVariableFVReal * > _ws
 All the thread copies of the z-velocity variable. More...
 
std::vector< unsigned int_var_numbers
 The velocity variable numbers. More...
 
Moose::FV::InterpMethod _velocity_interp_method
 The interpolation method to use for the velocity. More...
 
const bool _displaced
 Whether this object is operating on the displaced mesh. More...
 
SubProblem_subproblem
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
const THREAD_ID _tid
 
Assembly_assembly
 
const Moose::CoordinateSystemType_coord_sys
 
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'. More...
 
Moose::VectorComponentFunctor< ADReal_az
 The z-component of 'a'. More...
 

Static Protected Attributes

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

Private Member Functions

void fillARead ()
 Fills the _a_read data member at construction time with the appropriate functors. More...
 
bool needAComputation () const
 Whether we need 'a' coefficient computation. More...
 

Private Attributes

std::unordered_set< const Elem * > _elements_to_push_pull
 Non-local elements that we should push and pull data for across processes. More...
 
const VectorValue< ADReal_example
 An example datum used to help communicate AD vector information in parallel. More...
 
Threads::spin_mutex _a_mutex
 Mutex that prevents multiple threads from saving into the 'a' coefficients at the same time. More...
 
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. More...
 
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. More...
 
bool _a_data_provided
 Whether 'a' data has been provided by the user. More...
 
bool _pull_all_nonlocal
 Whether we want to pull all nonlocal 'a' coefficient data. More...
 
const bool & _bool_correct_vf
 Correct Rhie-Chow coefficients for volumetric force flag. More...
 
const MooseEnum _volume_force_correction_method
 – Method used for computing the properties average More...
 
const std::vector< MooseFunctorName > * _volumetric_force_functors
 Names of the functors storing the volumetric forces. More...
 
std::vector< const Moose::Functor< Real > * > _volumetric_force
 Values of the functors storing the volumetric forces. More...
 
Real _baseline_volume_force
 Minimum absolute RC force over the domain. More...
 
const Moose::ConstantFunctor< ADReal_zero_functor {0}
 A zero functor potentially used in _a_read. More...
 

Detailed Description

This user-object gathers 'a' (on-diagonal velocity coefficients) data.

Having the gathered 'a' data, this object is responsible for the computation of the Rhie-Chow velocity, which can be used in advection kernels and postprocessors. This class also supports computation of an average face velocity although this is generally not encouraged as it will lead to a checkerboard in the pressure field

Definition at line 38 of file INSFVRhieChowInterpolator.h.

Constructor & Destructor Documentation

◆ INSFVRhieChowInterpolator()

INSFVRhieChowInterpolator::INSFVRhieChowInterpolator ( const InputParameters params)

Definition at line 113 of file INSFVRhieChowInterpolator.C.

114  : RhieChowInterpolatorBase(params),
116  _a(_moose_mesh, blockIDs(), "a", /*extrapolated_boundary*/ true),
117  _ax(_a, 0),
118  _ay(_a, 1),
119  _az(_a, 2),
120  _momentum_sys_number(_fe_problem.systemNumForVariable(getParam<VariableName>("u"))),
121  _example(0),
122  _a_data_provided(false),
123  _pull_all_nonlocal(getParam<bool>("pull_all_nonlocal_a")),
124  _bool_correct_vf(getParam<bool>("correct_volumetric_force")),
125  _volume_force_correction_method(getParam<MooseEnum>("volume_force_correction_method")),
127  isParamValid("volumetric_force_functors")
128  ? &getParam<std::vector<MooseFunctorName>>("volumetric_force_functors")
129  : nullptr)
130 {
131  auto process_displacement = [this](const auto & disp_name, auto & disp_container)
132  {
133  if (!_displaced)
134  paramError(disp_name,
135  "Displacement provided but we are not running on the displaced mesh. If you "
136  "really want this object to run on the displaced mesh, then set "
137  "'use_displaced_mesh = true', otherwise remove this displacement parameter");
138  disp_container.resize(libMesh::n_threads());
139  fillContainer(disp_name, disp_container);
140  checkBlocks(*disp_container[0]);
141  };
142 
143  if (isParamValid("disp_x"))
144  process_displacement("disp_x", _disp_xs);
145 
146  if (_dim >= 2)
147  {
148  if (isParamValid("disp_y"))
149  process_displacement("disp_y", _disp_ys);
150  else if (isParamValid("disp_x"))
151  paramError("disp_y", "If 'disp_x' is provided, then 'disp_y' must be as well");
152  }
153 
154  if (_dim >= 3)
155  {
156  if (isParamValid("disp_z"))
157  process_displacement("disp_z", _disp_zs);
158  else if (isParamValid("disp_x"))
159  paramError("disp_z", "If 'disp_x' is provided, then 'disp_z' must be as well");
160  }
161 
162  for (const auto tid : make_range(libMesh::n_threads()))
163  {
164  _vel[tid] = std::make_unique<PiecewiseByBlockLambdaFunctor<ADRealVectorValue>>(
165  name() + std::to_string(tid),
166  [this, tid](const auto & r, const auto & t) -> ADRealVectorValue
167  {
168  ADRealVectorValue velocity((*_us[tid])(r, t));
169  if (_dim >= 2)
170  velocity(1) = (*_vs[tid])(r, t);
171  if (_dim >= 3)
172  velocity(2) = (*_ws[tid])(r, t);
173  return velocity;
174  },
175  std::set<ExecFlagType>({EXEC_ALWAYS}),
176  _moose_mesh,
177  blockIDs());
178 
179  if (_disp_xs.size())
180  _disps.push_back(std::make_unique<Moose::VectorCompositeFunctor<ADReal>>(
181  name() + "_disp_" + std::to_string(tid),
182  *_disp_xs[tid],
183  _dim >= 2 ? static_cast<const Moose::FunctorBase<ADReal> &>(*_disp_ys[tid])
184  : static_cast<const Moose::FunctorBase<ADReal> &>(_zero_functor),
185  _dim >= 3 ? static_cast<const Moose::FunctorBase<ADReal> &>(*_disp_zs[tid])
186  : static_cast<const Moose::FunctorBase<ADReal> &>(_zero_functor)));
187  }
188 
190  paramError("a_u",
191  "Rhie Chow coefficients may not be specified for average velocity interpolation");
192 
194  fillARead();
195 
197  paramError("volumetric_force_functors",
198  "At least one volumetric force functor must be specified if "
199  "'correct_volumetric_force' is true.");
200 
201  // Volume correction related
202  if (_bool_correct_vf)
203  {
204  const unsigned int num_volume_forces = (*_volumetric_force_functors).size();
205  _volumetric_force.resize(num_volume_forces);
206  for (const auto i : make_range(num_volume_forces))
207  _volumetric_force[i] = &getFunctor<Real>((*_volumetric_force_functors)[i]);
208  }
209 }
std::vector< const Moose::Functor< Real > * > _volumetric_force
Values of the functors storing the volumetric forces.
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to &#39;a&#39; coefficient data.
unsigned int n_threads()
void paramError(const std::string &param, Args... args) const
const T & getParam(const std::string &name) const
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
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.
const Moose::ConstantFunctor< ADReal > _zero_functor
A zero functor potentially used in _a_read.
bool _pull_all_nonlocal
Whether we want to pull all nonlocal &#39;a&#39; coefficient data.
Moose::VectorComponentFunctor< ADReal > _az
The z-component of &#39;a&#39;.
const bool _displaced
Whether this object is operating on the displaced mesh.
const std::vector< MooseFunctorName > * _volumetric_force_functors
Names of the functors storing the volumetric forces.
virtual const std::set< SubdomainID > & blockIDs() const
const ExecFlagType EXEC_ALWAYS
std::vector< MooseVariableFVReal * > _us
All the thread copies of the x-velocity variable.
const std::string & name() const
Moose::VectorComponentFunctor< ADReal > _ay
The y-component of &#39;a&#39;.
RhieChowInterpolatorBase(const InputParameters &params)
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
unsigned int systemNumForVariable(const VariableName &variable_name) const
void fillARead()
Fills the _a_read data member at construction time with the appropriate functors. ...
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
void fillContainer(const std::string &var_name, Container &container)
Fill the passed-in variable container with the thread copies of var_name.
const MooseEnum _volume_force_correction_method
– Method used for computing the properties average
void checkBlocks(const VarType &var) const
Check the block consistency between the passed in var and us.
const VectorValue< ADReal > _example
An example datum used to help communicate AD vector information in parallel.
FEProblemBase & _fe_problem
IntRange< T > make_range(T beg, T end)
std::vector< std::unique_ptr< Moose::VectorCompositeFunctor< ADReal > > > _disps
A functor for computing the displacement.
std::vector< MooseVariableField< Real > * > _disp_zs
All the thread copies of the z-displacement variable.
const bool & _bool_correct_vf
Correct Rhie-Chow coefficients for volumetric force flag.
std::vector< MooseVariableFVReal * > _ws
All the thread copies of the z-velocity variable.
static const std::string velocity
Definition: NS.h:45
Moose::VectorComponentFunctor< ADReal > _ax
bool isParamValid(const std::string &name) const
bool _a_data_provided
Whether &#39;a&#39; data has been provided by the user.
std::vector< MooseVariableFVReal * > _vs
All the thread copies of the y-velocity variable.
std::vector< std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADRealVectorValue > > > _vel
A functor for computing the (non-RC corrected) velocity.
const unsigned int _momentum_sys_number
The number of the nonlinear system in which the monolithic momentum and continuity equations are loca...

Member Function Documentation

◆ addToA()

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

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.

Referenced by ghostADataOnBoundary().

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 }
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to &#39;a&#39; coefficient data.
static const std::string component
Definition: NS.h:153
dof_id_type id() const
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 &#39;a&#39; coefficients at the same time...
processor_id_type processor_id() const
processor_id_type processor_id() const

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

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

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 }
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
const std::set< SubdomainID > & getBlockConnectedBlocks(const SubdomainID subdomain_id) const
virtual const std::set< SubdomainID > & blockIDs() const
const std::string & name() const
std::string stringify(const T &t)
const std::vector< SubdomainName > & blocks() const
void mooseError(Args &&... args) const

◆ epsilon()

const Moose::FunctorBase< ADReal > & RhieChowInterpolatorBase::epsilon ( THREAD_ID  tid) const
inlineprotectedvirtualinherited

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

Reimplemented in PINSFVRhieChowInterpolator, and PINSFVRhieChowInterpolatorSegregated.

Definition at line 154 of file RhieChowInterpolatorBase.h.

Referenced by INSFVRhieChowInterpolatorSegregated::computeHbyA(), and getVelocity().

155 {
156  return _unity_functor;
157 }
const Moose::ConstantFunctor< ADReal > _unity_functor
A unity functor used in the epsilon virtual method.

◆ execute()

void INSFVRhieChowInterpolator::execute ( )
overridevirtual

Implements GeneralUserObject.

Reimplemented in PINSFVRhieChowInterpolator.

Definition at line 370 of file INSFVRhieChowInterpolator.C.

Referenced by PINSFVRhieChowInterpolator::execute().

371 {
372  // Either we provided the RC coefficients using aux-variable, or we are solving for another
373  // system than the momentum equations are in, in a multi-system setup for example
375  return;
376 
377  mooseAssert(!_a_data_provided,
378  "a-coefficient data should not be provided if the velocity variables are in the "
379  "nonlinear system and we are running kernels that compute said a-coefficients");
380  // One might think that we should do a similar assertion for
381  // (_velocity_interp_method == Moose::FV::InterpMethod::RhieChow). However, even if we are not
382  // using the generated a-coefficient data in that case, some kernels have been optimized to
383  // add their residuals into the global system during the generation of the a-coefficient data.
384  // Hence if we were to skip the kernel execution we would drop those residuals
385 
386  TIME_SECTION("execute", 1, "Computing Rhie-Chow coefficients");
387 
388  // A lot of RC data gathering leverages the automatic differentiation system, e.g. for linear
389  // operators we pull out the 'a' coefficients by querying the ADReal residual derivatives
390  // member at the element or neighbor dof locations. Consequently we need to enable derivative
391  // computation. We do this here outside the threaded regions
392  const auto saved_do_derivatives = ADReal::do_derivatives;
393  ADReal::do_derivatives = true;
394 
395  PARALLEL_TRY
396  {
398  Threads::parallel_reduce(*_elem_range, et);
399  }
400  PARALLEL_CATCH;
401 
402  PARALLEL_TRY
403  {
408  Threads::parallel_reduce(faces, fvr);
409  }
410  PARALLEL_CATCH;
411 
412  ADReal::do_derivatives = saved_do_derivatives;
413 }
A class that gathers body force data from elemental kernels contributing to the Navier-Stokes momentu...
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
face_info_iterator ownedFaceInfoBegin()
const bool _displaced
Whether this object is operating on the displaced mesh.
A class that gathers &#39;a&#39; coefficient data from flux kernels, boundary conditions, and interface kerne...
virtual unsigned int currentNlSysNum() const override
FEProblemBase & _fe_problem
std::vector< unsigned int > _var_numbers
The velocity variable numbers.
std::unique_ptr< ConstElemRange > _elem_range
All the active and elements local to this process that exist on this object&#39;s subdomains.
bool _a_data_provided
Whether &#39;a&#39; data has been provided by the user.
face_info_iterator ownedFaceInfoEnd()
const unsigned int _momentum_sys_number
The number of the nonlinear system in which the monolithic momentum and continuity equations are loca...

◆ fillARead()

void INSFVRhieChowInterpolator::fillARead ( )
private

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 212 of file INSFVRhieChowInterpolator.C.

Referenced by INSFVRhieChowInterpolator().

213 {
214  _a_read.resize(libMesh::n_threads());
215 
216  if (isParamValid("a_u"))
217  {
218  if (_dim > 1 && !isParamValid("a_v"))
219  mooseError("If a_u is provided, then a_v must be provided");
220 
221  if (_dim > 2 && !isParamValid("a_w"))
222  mooseError("If a_u is provided, then a_w must be provided");
223 
224  _a_data_provided = true;
225  _a_aux.resize(libMesh::n_threads());
226  }
227  else if (isParamValid("a_v"))
228  paramError("a_v", "If the a_v coefficients are provided, then a_u must be provided");
229  else if (isParamValid("a_w"))
230  paramError("a_w", "If the a_w coefficients are provided, then a_u must be provided");
231 
232  if (_a_data_provided)
233  {
234  for (const auto tid : make_range(libMesh::n_threads()))
235  {
236  const Moose::FunctorBase<ADReal> *v_comp, *w_comp;
237  if (_dim > 1)
239  deduceFunctorName("a_v"), tid, name(), true);
240  else
241  v_comp = &_zero_functor;
242  if (_dim > 2)
244  deduceFunctorName("a_w"), tid, name(), true);
245  else
246  w_comp = &_zero_functor;
247 
248  _a_aux[tid] = std::make_unique<Moose::VectorCompositeFunctor<ADReal>>(
249  "RC_a_coeffs",
251  *v_comp,
252  *w_comp);
253  _a_read[tid] = _a_aux[tid].get();
254  }
255  }
256  else
257  for (const auto tid : make_range(libMesh::n_threads()))
258  {
259  _a_read[tid] = &_a;
260 
261  // We are the fluid flow application, so we should make sure users have the ability to
262  // write 'a' out to aux variables for possible transfer to other applications
266  }
267 }
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to &#39;a&#39; coefficient data.
unsigned int n_threads()
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)
void paramError(const std::string &param, Args... args) const
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
const Moose::ConstantFunctor< ADReal > _zero_functor
A zero functor potentially used in _a_read.
Moose::VectorComponentFunctor< ADReal > _az
The z-component of &#39;a&#39;.
SubProblem & _subproblem
const std::string & name() const
Moose::VectorComponentFunctor< ADReal > _ay
The y-component of &#39;a&#39;.
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
std::vector< const Moose::FunctorBase< VectorValue< ADReal > > * > _a_read
A vector sized according to the number of threads that holds the &#39;a&#39; data we will read from when comp...
IntRange< T > make_range(T beg, T end)
void mooseError(Args &&... args) const
Moose::VectorComponentFunctor< ADReal > _ax
bool isParamValid(const std::string &name) const
bool _a_data_provided
Whether &#39;a&#39; data has been provided by the user.
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 &#39;a&#39; component funct...
static std::string deduceFunctorName(const std::string &name, const InputParameters &params)

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

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

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 }
unsigned int n_threads()
SubProblem & _subproblem
const std::string & name() const
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const=0
IntRange< T > make_range(T beg, T end)

◆ finalize()

void INSFVRhieChowInterpolator::finalize ( )
overridevirtual

Implements GeneralUserObject.

Reimplemented in PINSFVRhieChowInterpolator.

Definition at line 416 of file INSFVRhieChowInterpolator.C.

Referenced by PINSFVRhieChowInterpolator::finalize().

417 {
418  if (!needAComputation() || this->n_processors() == 1)
419  return;
420 
421  // If advecting with auxiliary variables, no need to synchronize data
422  // Same if not solving for the velocity variables at the moment
424  return;
425 
426  using Datum = std::pair<dof_id_type, VectorValue<ADReal>>;
427  std::unordered_map<processor_id_type, std::vector<Datum>> push_data;
428  std::unordered_map<processor_id_type, std::vector<dof_id_type>> pull_requests;
429  static const VectorValue<ADReal> example;
430 
431  // Create push data
432  for (const auto * const elem : _elements_to_push_pull)
433  {
434  const auto id = elem->id();
435  const auto pid = elem->processor_id();
436  auto it = _a.find(id);
437  mooseAssert(it != _a.end(), "We definitely should have found something");
438  push_data[pid].push_back(std::make_pair(id, it->second));
439  }
440 
441  // Create pull data
442  if (_pull_all_nonlocal)
443  {
444  for (const auto * const elem :
445  as_range(_mesh.active_not_local_elements_begin(), _mesh.active_not_local_elements_end()))
446  if (blockIDs().count(elem->subdomain_id()))
447  pull_requests[elem->processor_id()].push_back(elem->id());
448  }
449  else
450  {
451  for (const auto * const elem : _elements_to_push_pull)
452  pull_requests[elem->processor_id()].push_back(elem->id());
453  }
454 
455  // First push
456  {
457  auto action_functor =
458  [this](const processor_id_type libmesh_dbg_var(pid), const std::vector<Datum> & sent_data)
459  {
460  mooseAssert(pid != this->processor_id(), "We do not send messages to ourself here");
461  for (const auto & pr : sent_data)
462  _a[pr.first] += pr.second;
463  };
464  TIMPI::push_parallel_vector_data(_communicator, push_data, action_functor);
465  }
466 
467  // Then pull
468  {
469  auto gather_functor = [this](const processor_id_type libmesh_dbg_var(pid),
470  const std::vector<dof_id_type> & elem_ids,
471  std::vector<VectorValue<ADReal>> & data_to_fill)
472  {
473  mooseAssert(pid != this->processor_id(), "We shouldn't be gathering from ourselves.");
474  data_to_fill.resize(elem_ids.size());
475  for (const auto i : index_range(elem_ids))
476  {
477  const auto id = elem_ids[i];
478  auto it = _a.find(id);
479  mooseAssert(it != _a.end(), "We should hold the value for this locally");
480  data_to_fill[i] = it->second;
481  }
482  };
483 
484  auto action_functor = [this](const processor_id_type libmesh_dbg_var(pid),
485  const std::vector<dof_id_type> & elem_ids,
486  const std::vector<VectorValue<ADReal>> & filled_data)
487  {
488  mooseAssert(pid != this->processor_id(), "The request filler shouldn't have been ourselves");
489  mooseAssert(elem_ids.size() == filled_data.size(), "I think these should be the same size");
490  for (const auto i : index_range(elem_ids))
491  _a[elem_ids[i]] = filled_data[i];
492  };
494  _communicator, pull_requests, gather_functor, action_functor, &example);
495  }
496 }
void pull_parallel_vector_data(const Communicator &comm, const MapToVectors &queries, GatherFunctor &gather_data, const ActionFunctor &act_on_data, const datum *example)
bool needAComputation() const
Whether we need &#39;a&#39; coefficient computation.
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to &#39;a&#39; coefficient data.
bool _pull_all_nonlocal
Whether we want to pull all nonlocal &#39;a&#39; coefficient data.
const Parallel::Communicator & _communicator
virtual const std::set< SubdomainID > & blockIDs() const
void push_parallel_vector_data(const Communicator &comm, MapToVectors &&data, const ActionFunctor &act_on_data)
uint8_t processor_id_type
processor_id_type n_processors() const
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
virtual unsigned int currentNlSysNum() const override
std::unordered_set< const Elem * > _elements_to_push_pull
Non-local elements that we should push and pull data for across processes.
const libMesh::MeshBase & _mesh
The libMesh mesh that this object acts on.
FEProblemBase & _fe_problem
processor_id_type processor_id() const
auto index_range(const T &sizable)
const unsigned int _momentum_sys_number
The number of the nonlinear system in which the monolithic momentum and continuity equations are loca...

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

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 527 of file INSFVRhieChowInterpolator.C.

Referenced by GetAllTheRCVelocities::execute().

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

◆ 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 133 of file RhieChowInterpolatorBase.C.

138 {
139  return raw_value(this->getVelocity(m, fi, time, tid, subtract_mesh_velocity)) * fi.normal();
140 }
auto raw_value(const Eigen::Map< T > &in)
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.
const Point & normal() const

◆ ghostADataOnBoundary()

void INSFVRhieChowInterpolator::ghostADataOnBoundary ( const BoundaryID  boundary_id)
overridevirtual

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

Reimplemented from RhieChowInterpolatorBase.

Definition at line 499 of file INSFVRhieChowInterpolator.C.

500 {
501  if (!needAComputation() || this->n_processors() == 1)
502  return;
503 
504  // Ghost a for the elements on the boundary
505  for (auto elem_id : _moose_mesh.getBoundaryActiveSemiLocalElemIds(boundary_id))
506  {
507  const auto & elem = _moose_mesh.elemPtr(elem_id);
508  // no need to ghost if locally owned or far from local process
509  if (elem->processor_id() != this->processor_id() && elem->is_semilocal(this->processor_id()))
510  // Adding to the a coefficient will make sure the final result gets communicated
511  addToA(elem, 0, 0);
512  }
513 
514  // Ghost a for the neighbors of the elements on the boundary
515  for (auto neighbor_id : _moose_mesh.getBoundaryActiveNeighborElemIds(boundary_id))
516  {
517  const auto & neighbor = _moose_mesh.queryElemPtr(neighbor_id);
518  // no need to ghost if locally owned or far from local process
519  if (neighbor->processor_id() != this->processor_id() &&
520  neighbor->is_semilocal(this->processor_id()))
521  // Adding to the a coefficient will make sure the final result gets communicated
522  addToA(neighbor, 0, 0);
523  }
524 }
bool needAComputation() const
Whether we need &#39;a&#39; coefficient computation.
std::unordered_set< dof_id_type > getBoundaryActiveSemiLocalElemIds(BoundaryID bid) const
virtual Elem * elemPtr(const dof_id_type i)
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
virtual Elem * queryElemPtr(const dof_id_type i)
processor_id_type n_processors() const
std::unordered_set< dof_id_type > getBoundaryActiveNeighborElemIds(BoundaryID bid) const
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.
processor_id_type processor_id() const

◆ hasFaceSide()

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

Implements FaceArgInterface.

Definition at line 29 of file RhieChowFaceFluxProvider.C.

30 {
31  if (fi_elem_side)
32  return hasBlocks(fi.elem().subdomain_id());
33  else
34  return fi.neighborPtr() && hasBlocks(fi.neighbor().subdomain_id());
35 }
const Elem & elem() const
const Elem * neighborPtr() const
const Elem & neighbor() const
subdomain_id_type subdomain_id() const
bool hasBlocks(const SubdomainName &name) const

◆ initialize()

void INSFVRhieChowInterpolator::initialize ( )
overridevirtual

Implements GeneralUserObject.

Reimplemented in PINSFVRhieChowInterpolator.

Definition at line 349 of file INSFVRhieChowInterpolator.C.

Referenced by PINSFVRhieChowInterpolator::initialize().

350 {
351  if (!needAComputation())
352  return;
353 
354  // Reset map of coefficients to zero.
355  // The keys should not have changed unless the mesh has changed
356  // Dont reset if not in current system
357  // IDEA: clear them derivatives
359  for (auto & pair : _a)
360  pair.second = 0;
361  else
362  for (auto & pair : _a)
363  {
364  auto & a_val = pair.second;
365  a_val = MetaPhysicL::raw_value(a_val);
366  }
367 }
bool needAComputation() const
Whether we need &#39;a&#39; coefficient computation.
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to &#39;a&#39; coefficient data.
auto raw_value(const Eigen::Map< T > &in)
virtual unsigned int currentNlSysNum() const override
FEProblemBase & _fe_problem
const unsigned int _momentum_sys_number
The number of the nonlinear system in which the monolithic momentum and continuity equations are loca...

◆ initialSetup()

void INSFVRhieChowInterpolator::initialSetup ( )
overridevirtual

Reimplemented from GeneralUserObject.

Definition at line 270 of file INSFVRhieChowInterpolator.C.

271 {
272  insfvSetup();
273 
275  return;
276  for (const auto var_num : _var_numbers)
277  {
278  std::vector<MooseObject *> var_objects;
280  .query()
281  .template condition<AttribVar>(static_cast<int>(var_num))
282  .template condition<AttribResidualObject>(true)
283  .template condition<AttribSysNum>(_u->sys().number())
284  .queryInto(var_objects);
285  for (auto * const var_object : var_objects)
286  {
287  // Allow FVElementalKernel that are not INSFVMomentumResidualObject for now, refs #20695
288  if (!dynamic_cast<INSFVMomentumResidualObject *>(var_object) &&
289  !dynamic_cast<FVElementalKernel *>(var_object))
290  mooseError("Object ",
291  var_object->name(),
292  " is not a INSFVMomentumResidualObject. Make sure that all the objects applied "
293  "to the momentum equation are INSFV or derived objects.");
294  else if (!dynamic_cast<INSFVMomentumResidualObject *>(var_object) &&
295  dynamic_cast<FVElementalKernel *>(var_object))
296  mooseWarning(
297  "Elemental kernel ",
298  var_object->name(),
299  " is not a INSFVMomentumResidualObject. Make sure that all the objects applied "
300  "to the momentum equation are INSFV or derived objects.");
301  }
302 
303  if (var_objects.size() == 0 && !_a_data_provided)
304  mooseError("No INSFVKernels detected for the velocity variables. If you are trying to use "
305  "auxiliary variables for advection, please specify the a_u/v/w coefficients. If "
306  "not, please specify INSFVKernels for the momentum equations.");
307  }
308 
309  // Get baseline force if force-correction method is used for volumetric correction
310  if (_bool_correct_vf && _volume_force_correction_method == "force-consistent")
311  {
312  _baseline_volume_force = 1e10;
313  for (const auto & loc_elem : *_elem_range)
314  {
315  Real elem_value = 0.0;
316  for (const auto i : make_range(_volumetric_force.size()))
317  elem_value += (*_volumetric_force[i])(makeElemArg(loc_elem), determineState());
318 
319  if (std::abs(elem_value) < _baseline_volume_force)
320  _baseline_volume_force = std::abs(elem_value);
321  if (_baseline_volume_force == 0)
322  break;
323  }
325  }
326 }
std::vector< const Moose::Functor< Real > * > _volumetric_force
Values of the functors storing the volumetric forces.
INSFVVelocityVariable *const _u
The thread 0 copy of the x-velocity variable.
Moose::StateArg determineState() const
const Parallel::Communicator & _communicator
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
void min(const T &r, T &o, Request &req) const
TheWarehouse & theWarehouse() const
void insfvSetup()
perform the setup of this object
unsigned int number() const
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
const MooseEnum _volume_force_correction_method
– Method used for computing the properties average
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _baseline_volume_force
Minimum absolute RC force over the domain.
FEProblemBase & _fe_problem
std::vector< unsigned int > _var_numbers
The velocity variable numbers.
Query query()
std::unique_ptr< ConstElemRange > _elem_range
All the active and elements local to this process that exist on this object&#39;s subdomains.
void mooseWarning(Args &&... args) const
IntRange< T > make_range(T beg, T end)
const bool & _bool_correct_vf
Correct Rhie-Chow coefficients for volumetric force flag.
void mooseError(Args &&... args) const
bool _a_data_provided
Whether &#39;a&#39; data has been provided by the user.

◆ insfvSetup()

void INSFVRhieChowInterpolator::insfvSetup ( )
protected

perform the setup of this object

Definition at line 329 of file INSFVRhieChowInterpolator.C.

Referenced by initialSetup(), and meshChanged().

330 {
331  _elem_range =
332  std::make_unique<ConstElemRange>(_mesh.active_local_subdomain_set_elements_begin(blockIDs()),
333  _mesh.active_local_subdomain_set_elements_end(blockIDs()));
334 }
virtual const std::set< SubdomainID > & blockIDs() const
const libMesh::MeshBase & _mesh
The libMesh mesh that this object acts on.
std::unique_ptr< ConstElemRange > _elem_range
All the active and elements local to this process that exist on this object&#39;s subdomains.

◆ listOfCommonParams()

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

Definition at line 70 of file INSFVRhieChowInterpolator.C.

Referenced by WCNSFVFlowPhysics::addRhieChowUserObjects().

71 {
72  return {"pull_all_nonlocal_a",
73  "correct_volumetric_force",
74  "volume_force_correction_method",
75  "volumetric_force_functors"};
76 }

◆ meshChanged()

void INSFVRhieChowInterpolator::meshChanged ( )
overridevirtual

Reimplemented from GeneralUserObject.

Reimplemented in PINSFVRhieChowInterpolator.

Definition at line 337 of file INSFVRhieChowInterpolator.C.

Referenced by PINSFVRhieChowInterpolator::meshChanged().

338 {
339  insfvSetup();
340 
341  // If the mesh has been modified:
342  // - the boundary elements may have changed
343  // - some elements may have been refined
344  _elements_to_push_pull.clear();
345  _a.clear();
346 }
CellCenteredMapFunctor< ADRealVectorValue, std::unordered_map< dof_id_type, ADRealVectorValue > > _a
A map from element IDs to &#39;a&#39; coefficient data.
void insfvSetup()
perform the setup of this object
std::unordered_set< const Elem * > _elements_to_push_pull
Non-local elements that we should push and pull data for across processes.

◆ needAComputation()

bool INSFVRhieChowInterpolator::needAComputation ( ) const
inlineprivate

Whether we need 'a' coefficient computation.

Definition at line 234 of file INSFVRhieChowInterpolator.h.

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

235 {
236  // We dont check for "a"s being in another nonlinear system here, only being auxiliary
238 }
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
bool _a_data_provided
Whether &#39;a&#39; data has been provided by the user.

◆ 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 *static_cast<INSFVPressureVariable *>(_ps[tid]);
164 }
std::vector< MooseVariableFVReal * > _ps
All the thread copies of the pressure variable.

◆ pressureSkewCorrection()

bool INSFVRhieChowInterpolator::pressureSkewCorrection ( THREAD_ID  tid) const
inline

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

Definition at line 248 of file INSFVRhieChowInterpolator.h.

Referenced by getVelocity().

249 {
250  const auto * const p = _ps[tid];
251  return (p->faceInterpolationMethod() == Moose::FV::InterpMethod::SkewCorrectedAverage);
252 }
std::vector< MooseVariableFVReal * > _ps
All the thread copies of the pressure variable.

◆ pullAllNonlocal()

void INSFVRhieChowInterpolator::pullAllNonlocal ( )
inline

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.

Referenced by GetAllTheRCVelocities::GetAllTheRCVelocities().

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

◆ segregated()

virtual bool INSFVRhieChowInterpolator::segregated ( ) const
inlineoverridevirtual

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.

Referenced by VolumetricFlowRate::VolumetricFlowRate().

49 { return true; }

◆ uniqueParams()

InputParameters INSFVRhieChowInterpolator::uniqueParams ( )
static

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

Definition at line 45 of file INSFVRhieChowInterpolator.C.

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

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

◆ validParams()

InputParameters INSFVRhieChowInterpolator::validParams ( )
static

Definition at line 79 of file INSFVRhieChowInterpolator.C.

Referenced by PINSFVRhieChowInterpolator::validParams().

80 {
83 
84  params.addClassDescription(
85  "Computes the Rhie-Chow velocity based on gathered 'a' coefficient data.");
86 
87  ExecFlagEnum & exec_enum = params.set<ExecFlagEnum>("execute_on", true);
88  exec_enum.addAvailableFlags(EXEC_PRE_KERNELS);
89  exec_enum = {EXEC_PRE_KERNELS};
90  params.suppressParameter<ExecFlagEnum>("execute_on");
91 
92  params.addParam<MooseFunctorName>(
93  "a_u",
94  "For simulations in which the advecting velocities are aux variables, this parameter must be "
95  "supplied. It represents the on-diagonal coefficients for the 'x' component velocity, solved "
96  "via the Navier-Stokes equations.");
97  params.addParam<MooseFunctorName>(
98  "a_v",
99  "For simulations in which the advecting velocities are aux variables, this parameter must be "
100  "supplied when the mesh dimension is greater than 1. It represents the on-diagonal "
101  "coefficients for the 'y' component velocity, solved via the Navier-Stokes equations.");
102  params.addParam<MooseFunctorName>(
103  "a_w",
104  "For simulations in which the advecting velocities are aux variables, this parameter must be "
105  "supplied when the mesh dimension is greater than 2. It represents the on-diagonal "
106  "coefficients for the 'z' component velocity, solved via the Navier-Stokes equations.");
107  params.addParam<VariableName>("disp_x", "The x-component of displacement");
108  params.addParam<VariableName>("disp_y", "The y-component of displacement");
109  params.addParam<VariableName>("disp_z", "The z-component of displacement");
110  return params;
111 }
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
static InputParameters uniqueParams()
Parameters of this object that should be added to the NSFV action that are unique to this object...
const ExecFlagType EXEC_PRE_KERNELS
static InputParameters validParams()

◆ vel()

const INSFVVelocityVariable* RhieChowInterpolatorBase::vel ( ) const
inlineinherited

Definition at line 83 of file RhieChowInterpolatorBase.h.

Referenced by getVelocity().

83 { return _u; }
INSFVVelocityVariable *const _u
The thread 0 copy of the x-velocity variable.

◆ velocityInterpolationMethod()

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

Return the interpolation method used for velocity.

Definition at line 70 of file RhieChowInterpolatorBase.h.

70 { return _velocity_interp_method; }
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.

◆ velocitySkewCorrection()

bool INSFVRhieChowInterpolator::velocitySkewCorrection ( THREAD_ID  tid) const
inline

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.

Referenced by getVelocity().

242 {
243  const auto * const u = _us[tid];
244  return (u->faceInterpolationMethod() == Moose::FV::InterpMethod::SkewCorrectedAverage);
245 }
std::vector< MooseVariableFVReal * > _us
All the thread copies of the x-velocity variable.

Member Data Documentation

◆ _a

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

A map from element IDs to 'a' coefficient data.

Definition at line 141 of file INSFVRhieChowInterpolator.h.

Referenced by addToA(), fillARead(), finalize(), initialize(), and meshChanged().

◆ _a_aux

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

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 fillARead().

◆ _a_data_provided

bool INSFVRhieChowInterpolator::_a_data_provided
private

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 execute(), fillARead(), getVelocity(), initialSetup(), and needAComputation().

◆ _a_mutex

Threads::spin_mutex INSFVRhieChowInterpolator::_a_mutex
private

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 addToA().

◆ _a_read

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

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 fillARead(), and getVelocity().

◆ _ax

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

The x-component of 'a'

Definition at line 151 of file INSFVRhieChowInterpolator.h.

Referenced by fillARead().

◆ _ay

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

The y-component of 'a'.

Definition at line 154 of file INSFVRhieChowInterpolator.h.

Referenced by fillARead().

◆ _az

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

The z-component of 'a'.

Definition at line 157 of file INSFVRhieChowInterpolator.h.

Referenced by fillARead().

◆ _baseline_volume_force

Real INSFVRhieChowInterpolator::_baseline_volume_force
private

Minimum absolute RC force over the domain.

Definition at line 214 of file INSFVRhieChowInterpolator.h.

Referenced by getVelocity(), and initialSetup().

◆ _bool_correct_vf

const bool& INSFVRhieChowInterpolator::_bool_correct_vf
private

Correct Rhie-Chow coefficients for volumetric force flag.

Definition at line 202 of file INSFVRhieChowInterpolator.h.

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

◆ _dim

const unsigned int RhieChowInterpolatorBase::_dim
protectedinherited

◆ _disp_xs

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

All the thread copies of the x-displacement variable.

Definition at line 126 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator().

◆ _disp_ys

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

All the thread copies of the y-displacement variable.

Definition at line 129 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator().

◆ _disp_zs

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

All the thread copies of the z-displacement variable.

Definition at line 132 of file INSFVRhieChowInterpolator.h.

Referenced by 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 execute(), and INSFVRhieChowInterpolator().

◆ _disps

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

A functor for computing the displacement.

Definition at line 135 of file INSFVRhieChowInterpolator.h.

Referenced by getVelocity(), and INSFVRhieChowInterpolator().

◆ _elem_range

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

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 execute(), initialSetup(), and insfvSetup().

◆ _elements_to_push_pull

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

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

Definition at line 176 of file INSFVRhieChowInterpolator.h.

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

◆ _example

const VectorValue<ADReal> INSFVRhieChowInterpolator::_example
private

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

Definition at line 179 of file INSFVRhieChowInterpolator.h.

◆ _mesh

const libMesh::MeshBase& RhieChowInterpolatorBase::_mesh
protectedinherited

◆ _momentum_sys_number

const unsigned int INSFVRhieChowInterpolator::_momentum_sys_number
protected

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 execute(), finalize(), getVelocity(), and initialize().

◆ _moose_mesh

MooseMesh& RhieChowInterpolatorBase::_moose_mesh
protectedinherited

◆ _p

INSFVPressureVariable* const RhieChowInterpolatorBase::_p
protectedinherited

◆ _ps

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

All the thread copies of the pressure variable.

Definition at line 128 of file RhieChowInterpolatorBase.h.

Referenced by getVelocity(), RhieChowInterpolatorBase::pressure(), pressureSkewCorrection(), and RhieChowInterpolatorBase::RhieChowInterpolatorBase().

◆ _pull_all_nonlocal

bool INSFVRhieChowInterpolator::_pull_all_nonlocal
private

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

Definition at line 199 of file INSFVRhieChowInterpolator.h.

Referenced by finalize(), and pullAllNonlocal().

◆ _u

INSFVVelocityVariable* const RhieChowInterpolatorBase::_u
protectedinherited

◆ _us

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

All the thread copies of the x-velocity variable.

Definition at line 131 of file RhieChowInterpolatorBase.h.

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

◆ _v

INSFVVelocityVariable* const RhieChowInterpolatorBase::_v
protectedinherited

◆ _var_numbers

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

The velocity variable numbers.

Definition at line 140 of file RhieChowInterpolatorBase.h.

Referenced by execute(), initialSetup(), and RhieChowInterpolatorBase::RhieChowInterpolatorBase().

◆ _vel

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

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

Definition at line 123 of file INSFVRhieChowInterpolator.h.

Referenced by getVelocity(), and INSFVRhieChowInterpolator().

◆ _velocity_interp_method

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

◆ _volume_force_correction_method

const MooseEnum INSFVRhieChowInterpolator::_volume_force_correction_method
private

– Method used for computing the properties average

Definition at line 205 of file INSFVRhieChowInterpolator.h.

Referenced by getVelocity(), and initialSetup().

◆ _volumetric_force

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

Values of the functors storing the volumetric forces.

Definition at line 211 of file INSFVRhieChowInterpolator.h.

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

◆ _volumetric_force_functors

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

Names of the functors storing the volumetric forces.

Definition at line 208 of file INSFVRhieChowInterpolator.h.

Referenced by INSFVRhieChowInterpolator().

◆ _vs

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

All the thread copies of the y-velocity variable.

Definition at line 134 of file RhieChowInterpolatorBase.h.

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

◆ _w

INSFVVelocityVariable* const RhieChowInterpolatorBase::_w
protectedinherited

◆ _ws

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

All the thread copies of the z-velocity variable.

Definition at line 137 of file RhieChowInterpolatorBase.h.

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

◆ _zero_functor

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

A zero functor potentially used in _a_read.

Definition at line 217 of file INSFVRhieChowInterpolator.h.

Referenced by fillARead(), and INSFVRhieChowInterpolator().


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