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

A user object which implements the Rhie Chow interpolation for segregated momentum-pressure systems. More...

#include <INSFVRhieChowInterpolatorSegregated.h>

Inheritance diagram for INSFVRhieChowInterpolatorSegregated:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 
enum  ResidualTagType
 

Public Member Functions

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

Static Public Member Functions

static InputParameters validParams ()
 
static void callMooseError (MooseApp *const app, const InputParameters &params, std::string msg, const bool with_prefix, const hit::Node *node, const bool show_trace=true)
 
static void sort (typename std::vector< T > &vector)
 
static void sortDFS (typename std::vector< T > &vector)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header, NameFunc &&name_func)
 
static void cyclicDependencyError (CyclicDependencyException< T2 > &e, const std::string &header)
 
static std::string deduceFunctorName (const std::string &name, const InputParameters &params)
 

Public Attributes

 usingCombinedWarningSolutionWarnings
 
const ConsoleStream _console
 

Static Public Attributes

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

Protected Member Functions

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

Static Protected Member Functions

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

Protected Attributes

FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _HbyA
 A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source})_{ij}/A_{ij}$.
 
std::vector< std::unique_ptr< NumericVector< Number > > > _HbyA_raw
 We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as well.
 
CellCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _Ainv
 A map functor from element IDs to $1/A_i$.
 
std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADRealVectorValue > > _vel
 A functor for computing the (non-RC corrected) velocity.
 
FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _face_velocity
 A map functor from faces to face velocities which are used in the advection terms.
 
std::vector< NonlinearSystemBase * > _momentum_systems
 Pointers to the nonlinear system(s) corresponding to the momentum equation(s)
 
std::vector< unsigned int_momentum_system_numbers
 Numbers of the momentum system(s)
 
std::vector< libMesh::NonlinearImplicitSystem * > _momentum_implicit_systems
 Pointers to the momentum equation implicit system(s)
 
TagID _pressure_gradient_tag
 Residual tag corresponding to the pressure gradient contribution.
 
MooseMesh_moose_mesh
 The MooseMesh that this user object operates on.
 
const libMesh::MeshBase_mesh
 The libMesh mesh that this object acts on.
 
const unsigned int _dim
 The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
 
INSFVPressureVariable *const _p
 The thread 0 copy of the pressure variable.
 
INSFVVelocityVariable *const _u
 The thread 0 copy of the x-velocity variable.
 
INSFVVelocityVariable *const _v
 The thread 0 copy of the y-velocity variable (null if the problem is 1D)
 
INSFVVelocityVariable *const _w
 The thread 0 copy of the z-velocity variable (null if the problem is not 3D)
 
std::vector< MooseVariableFVReal * > _ps
 All the thread copies of the pressure variable.
 
std::vector< MooseVariableFVReal * > _us
 All the thread copies of the x-velocity variable.
 
std::vector< MooseVariableFVReal * > _vs
 All the thread copies of the y-velocity variable.
 
std::vector< MooseVariableFVReal * > _ws
 All the thread copies of the z-velocity variable.
 
std::vector< unsigned int_var_numbers
 The velocity variable numbers.
 
Moose::FV::InterpMethod _velocity_interp_method
 The interpolation method to use for the velocity.
 
const bool _displaced
 Whether this object is operating on the displaced mesh.
 
const Moose::CoordinateSystemType_coord_sys
 
const THREAD_ID _tid
 
SubProblem_subproblem
 
SubProblem_subproblem
 
FEProblemBase_fe_problem
 
SystemBase_sys
 
Assembly_assembly
 
const bool _duplicate_initial_execution
 
std::set< std::string > _depend_uo
 
const bool & _enabled
 
MooseApp_app
 
Factory_factory
 
ActionFactory_action_factory
 
const std::string & _type
 
const std::string & _name
 
const InputParameters_pars
 
const ExecFlagEnum_execute_enum
 
const ExecFlagType_current_execute_flag
 
MooseApp_restartable_app
 
const std::string _restartable_system_name
 
const THREAD_ID _restartable_tid
 
const bool _restartable_read_only
 
FEProblemBase_mci_feproblem
 
FEProblemBase_mdi_feproblem
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
FEProblemBase_sc_fe_problem
 
const THREAD_ID _sc_tid
 
const Real & _real_zero
 
const VariableValue_scalar_zero
 
const Point & _point_zero
 
const InputParameters_mi_params
 
const std::string _mi_name
 
const MooseObjectName _mi_moose_object_name
 
FEProblemBase_mi_feproblem
 
SubProblem_mi_subproblem
 
const THREAD_ID _mi_tid
 
const bool _is_kokkos_object
 
const Moose::MaterialDataType _material_data_type
 
MaterialData_material_data
 
bool _stateful_allowed
 
bool _get_material_property_called
 
std::vector< std::unique_ptr< PropertyValue > > _default_properties
 
std::unordered_set< unsigned int_material_property_dependencies
 
const MaterialPropertyName _get_suffix
 
const bool _use_interpolated_state
 
const InputParameters_ti_params
 
FEProblemBase_ti_feproblem
 
bool _is_implicit
 
Real & _t
 
const Real & _t_old
 
int_t_step
 
Real & _dt
 
Real & _dt_old
 
bool _is_transient
 
const Parallel::Communicator & _communicator
 
const MaterialData_blk_material_data
 
DenseVector< Number > _local_re
 
DenseMatrix< Number > _local_ke
 
DenseMatrix< Number > _nonlocal_ke
 

Static Protected Attributes

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

Private Member Functions

const Moose::FunctionBasegetKokkosFunctionByNameHelper (const FunctionName &name) const
 
const UserObjectBasegetUserObjectFromFEProblem (const UserObjectName &object_name, const THREAD_ID tid=0) const
 
const TcastUserObject (const UserObjectBase &uo_base, const std::string &param_name="") const
 
void mooseObjectError (const std::string &param_name, std::stringstream &oss) const
 
const std::string & userObjectType (const UserObjectBase &uo) const
 
const std::string & userObjectName (const UserObjectBase &uo) const
 
const PostprocessorName & getPostprocessorNameInternal (const std::string &param_name, const unsigned int index, const bool allow_default_value=true) const
 
bool isDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
PostprocessorValue getDefaultPostprocessorValueByName (const PostprocessorName &name) const
 
void checkParam (const std::string &param_name, const unsigned int index=std::numeric_limits< unsigned int >::max()) const
 
bool postprocessorsAdded () const
 
const VectorPostprocessorValuegetVectorPostprocessorByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name, bool broadcast, std::size_t t_index) const
 
const VectorPostprocessorContext< VectorPostprocessorValue > & getVectorPostprocessorContextByNameHelper (const VectorPostprocessorName &name, const std::string &vector_name) const
 
bool vectorPostprocessorsAdded () const
 
bool reportersAdded () const
 
void possiblyCheckHasReporter (const ReporterName &reporter_name, const std::string &param_name="") const
 
RestartableDataValueregisterRestartableDataOnApp (std::unique_ptr< RestartableDataValue > data, THREAD_ID tid) const
 
void registerRestartableNameWithFilterOnApp (const std::string &name, Moose::RESTARTABLE_FILTER filter)
 
RestartableData< T > & declareRestartableDataHelper (const std::string &data_name, void *context, Args &&... args) const
 
virtual std::string meshPropertyPrefix (const std::string &data_name) const
 
const RestartableDataValuegetMeshPropertyInternal (const std::string &data_name, const std::string &prefix) const
 
void mooseErrorInternal (Args &&... args) const
 
const VariableValuegetDefaultValue (const std::string &var_name) const
 
const ADVariableValuegetADDefaultValue (const std::string &var_name) const
 
void checkVar (const std::string &var_name) const
 
void validateExecutionerType (const std::string &name, const std::string &fn_name) const
 
Moose::MaterialDataType getMaterialDataType (const std::set< BoundaryID > &boundary_ids) const
 
unsigned int getMaxQps () const
 
void addConsumedPropertyName (const MooseObjectName &obj_name, const std::string &prop_name)
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueInternal (const std::string &param_name, unsigned int index, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
const PostprocessorValuegetPostprocessorValueByNameInternal (const PostprocessorName &name, std::size_t t_index) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessor (const std::string &param_name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void possiblyCheckHasVectorPostprocessorByName (const VectorPostprocessorName &name, const std::string &vector_name) const
 
void prepareVectorTagInternal (Assembly &assembly, unsigned int ivar, const std::set< TagID > &vector_tags, const std::set< TagID > &absolute_value_vector_tags)
 
void checkForNans () const
 
const Moose::Functor< T > * defaultFunctor (const std::string &name)
 
const Moose::Functor< Real > * defaultFunctor (const std::string &name)
 
const Moose::Functor< ADReal > * defaultFunctor (const std::string &name)
 
const Moose::Functor< T > & getFunctorByName (const std::string &name, SubProblem &subproblem, THREAD_ID tid)
 
virtual bool isADObject () const override
 

Static Private Member Functions

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

Private Attributes

const Moose::ConstantFunctor< ADReal_unity_functor {1}
 A unity functor used in the epsilon virtual method.
 
UserObject_primary_thread_copy
 
std::set< std::string > _supplied_uo
 
const ParallelParamObject_parent
 
const MooseBase_si_moose_base
 
const FEProblemBase_si_problem
 
ExecFlagEnum _empty_execute_enum
 
const MooseObject_fni_object
 
const InputParameters_fni_params
 
FEProblemBase_fni_feproblem
 
const THREAD_ID _fni_tid
 
const MooseObject_uoi_moose_object
 
const FEProblemBase_uoi_feproblem
 
const THREAD_ID _uoi_tid
 
const MooseObject_ppi_moose_object
 
const InputParameters_ppi_params
 
const FEProblemBase_ppi_feproblem
 
std::map< PostprocessorName, std::unique_ptr< PostprocessorValue > > _default_values
 
const bool _broadcast_by_default
 
const MooseObject_vpi_moose_object
 
const FEProblemBase_vpi_feproblem
 
const THREAD_ID _vpi_tid
 
const InputParameters_ri_params
 
FEProblemBase_ri_fe_problem_base
 
const ReporterData_ri_reporter_data
 
const MooseObject_ri_moose_object
 
const InputParameters_dni_params
 
FEProblemBase_dni_feproblem
 
const MooseObject *const _dni_moose_object_ptr
 
const InputParameters_si_params
 
FEProblemBase_si_feproblem
 
THREAD_ID _si_tid
 
const RestartableDataMapName _metaname
 
std::string _restartable_name
 
MooseApp_meta_data_app
 
const MooseObject *const _meta_data_object
 
const InputParameters_sc_parameters
 
const std::string & _sc_name
 
const bool _sc_is_implicit
 
std::unordered_map< std::string, std::vector< MooseVariableScalar * > > _coupled_scalar_vars
 
std::unordered_map< std::string, std::unique_ptr< VariableValue > > _default_value
 
std::unordered_map< std::string, std::unique_ptr< ADVariableValue > > _dual_default_value
 
std::vector< MooseVariableScalar * > _coupled_moose_scalar_vars
 
std::unordered_map< std::string, std::vector< MooseVariableFieldBase * > > _sc_coupled_vars
 
std::set< TagID_sc_coupleable_vector_tags
 
std::set< TagID_sc_coupleable_matrix_tags
 
const MooseObject_mi_moose_object
 
const bool _mi_boundary_restricted
 
const std::set< SubdomainID > & _mi_block_ids
 
const std::set< BoundaryID > & _mi_boundary_ids
 
std::vector< std::unique_ptr< OptionalMaterialPropertyProxyBase< MaterialPropertyInterface > > > _optional_property_proxies
 
const std::string _ti_name
 
std::set< SubdomainID_blk_ids
 
std::vector< SubdomainID_vec_ids
 
std::vector< SubdomainName > _blocks
 
const bool _blk_dual_restrictable
 
FEProblemBase_blk_feproblem
 
const MooseMesh_blk_mesh
 
const std::set< BoundaryID_empty_boundary_ids
 
const std::set< BoundaryID > & _boundary_ids
 
THREAD_ID _blk_tid
 
const std::string & _blk_name
 
unsigned int _blk_dim
 
const MooseObject_moose_object
 
Moose::Kokkos::Array< ContiguousElementID_kokkos_element_ids
 
Moose::Kokkos::Array< ContiguousNodeID_kokkos_node_ids
 
Moose::Kokkos::Array< Moose::Kokkos::Pair< ContiguousElementID, unsigned int > > _kokkos_element_side_ids
 
std::set< TagID_vector_tags
 
std::set< TagID_abs_vector_tags
 
std::set< TagID_matrix_tags
 
std::set< TagID_non_ref_vector_tags
 
std::set< TagID_non_ref_abs_vector_tags
 
std::set< TagID_ref_vector_tags
 
std::set< TagID_ref_abs_vector_tags
 
const InputParameters_tag_params
 
std::vector< DenseVector< Number > * > _re_blocks
 
std::vector< DenseVector< Number > * > _absre_blocks
 
std::vector< DenseMatrix< Number > * > _ke_blocks
 
std::vector< Real > _absolute_residuals
 
const InputParameters_fi_params
 
const std::string _fi_name
 
SubProblem *const _fi_subproblem
 
const THREAD_ID _fi_tid
 
std::vector< std::unique_ptr< Moose::Functor< Real > > > _default_real_functors
 
std::vector< std::unique_ptr< Moose::Functor< ADReal > > > _default_ad_real_functors
 

Detailed Description

A user object which implements the Rhie Chow interpolation for segregated momentum-pressure systems.

Definition at line 33 of file INSFVRhieChowInterpolatorSegregated.h.

Constructor & Destructor Documentation

◆ INSFVRhieChowInterpolatorSegregated()

INSFVRhieChowInterpolatorSegregated::INSFVRhieChowInterpolatorSegregated ( const InputParameters params)

Definition at line 52 of file INSFVRhieChowInterpolatorSegregated.C.

55 _HbyA(_moose_mesh, blockIDs(), "HbyA"),
56 _Ainv(_moose_mesh, blockIDs(), "Ainv", false),
58 name(),
59 [this](const auto & r, const auto & t) -> ADRealVectorValue
60 {
61 ADRealVectorValue velocity((*_u)(r, t));
62 if (_dim >= 2)
63 velocity(1) = (*_v)(r, t);
64 if (_dim >= 3)
65 velocity(2) = (*_w)(r, t);
66 return velocity;
67 },
68 std::set<ExecFlagType>({EXEC_ALWAYS}),
70 blockIDs())),
71 _face_velocity(_moose_mesh, blockIDs(), "face_values")
72{
73 if (_displaced)
74 paramError("use_displaced_mesh",
75 "The segregated Rhie-Chow user object does not currently support operation on a "
76 "displaced mesh");
77
78 // Register the elemental/face functors which will be queried in the pressure equation
79 for (const auto tid : make_range(libMesh::n_threads()))
80 {
83 }
84
85 if (_velocity_interp_method == Moose::FV::InterpMethod::Average)
86 paramError("velocity_interp_method",
87 "Segregated momentum-pressure solvers do not allow average interpolation methods!");
88
89 if (!dynamic_cast<SIMPLENonlinearAssembly *>(getMooseApp().getExecutioner()))
90 mooseError(this->name(), " should only be used with a segregated thermal-hydraulics solver!");
91}
const ExecFlagType EXEC_ALWAYS
virtual const std::set< SubdomainID > & blockIDs() const
std::unique_ptr< PiecewiseByBlockLambdaFunctor< ADRealVectorValue > > _vel
A functor for computing the (non-RC corrected) velocity.
FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _face_velocity
A map functor from faces to face velocities which are used in the advection terms.
CellCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _Ainv
A map functor from element IDs to $1/A_i$.
FaceCenteredMapFunctor< RealVectorValue, std::unordered_map< dof_id_type, RealVectorValue > > _HbyA
A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source}...
const std::string & name() const
void paramError(const std::string &param, Args... args) const
void mooseError(Args &&... args) const
MooseApp & getMooseApp() const
const bool _displaced
Whether this object is operating on the displaced mesh.
Moose::FV::InterpMethod _velocity_interp_method
The interpolation method to use for the velocity.
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
INSFVVelocityVariable *const _u
The thread 0 copy of the x-velocity variable.
const unsigned int _dim
The dimension of the mesh, e.g. 3 for hexes and tets, 2 for quads and tris.
Executioner set up to solve a thermal-hydraulics problem using the SIMPLENonlinearAssembly algorithm.
void addFunctor(const std::string &name, const Moose::FunctorBase< T > &functor, const THREAD_ID tid)
SubProblem & _subproblem
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
IntRange< T > make_range(T beg, T end)
unsigned int n_threads()

Member Function Documentation

◆ addToA()

void INSFVRhieChowInterpolatorSegregated::addToA ( const libMesh::Elem ,
unsigned int  ,
const ADReal  
)
inlineoverridevirtual

We disable this for the segregated solver.

Implements RhieChowInterpolatorBase.

Definition at line 54 of file INSFVRhieChowInterpolatorSegregated.h.

57 {
59 "addToA function is not implemented for the RhieChow interpolation in segregated solvers.");
60 }

◆ checkBlocks()

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

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

Definition at line 181 of file RhieChowInterpolatorBase.h.

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

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

◆ computeCellVelocity()

void INSFVRhieChowInterpolatorSegregated::computeCellVelocity ( )

Update the cell values of the velocity variables.

Definition at line 232 of file INSFVRhieChowInterpolatorSegregated.C.

233{
234 std::vector<unsigned int> var_nums = {_momentum_implicit_systems[0]->variable_number(_u->name())};
235 if (_v)
236 var_nums.push_back(_momentum_implicit_systems[1]->variable_number(_v->name()));
237 if (_w)
238 var_nums.push_back(_momentum_implicit_systems[2]->variable_number(_w->name()));
239
240 const auto time_arg = Moose::currentState();
241
242 for (auto & elem :
243 as_range(_mesh.active_local_elements_begin(), _mesh.active_local_elements_end()))
244 {
245 if (hasBlocks(elem->subdomain_id()))
246 {
247 const auto elem_arg = makeElemArg(elem);
248 const RealVectorValue Ainv = _Ainv(elem_arg, time_arg);
249 const RealVectorValue & grad_p = raw_value(_p->gradient(elem_arg, time_arg));
250
251 for (auto comp_index : make_range(_dim))
252 {
253 // If we are doing segregated momentum components we need to access different vector
254 // components otherwise everything is in the same vector (with different variable names)
255 const unsigned int system_number = _momentum_implicit_systems[comp_index]->number();
256 const auto index = elem->dof_number(system_number, var_nums[comp_index], 0);
257
258 // We set the dof value in the solution vector the same logic applies:
259 // u_C = -(H/A)_C - (1/A)_C*grad(p)_C where C is the cell index
260 _momentum_implicit_systems[comp_index]->solution->set(
261 index, -(*_HbyA_raw[comp_index])(index)-Ainv(comp_index) * grad_p(comp_index));
262 }
263 }
264 }
265
266 for (auto system_i : index_range(_momentum_implicit_systems))
267 {
268 _momentum_implicit_systems[system_i]->solution->close();
269 _momentum_implicit_systems[system_i]->update();
270 _momentum_systems[system_i]->setSolution(
271 *_momentum_implicit_systems[system_i]->current_local_solution);
272 }
273}
bool hasBlocks(const SubdomainName &name) const
Moose::ElemArg makeElemArg(const Elem *elem, bool correct_skewnewss=false) const
std::vector< NonlinearSystemBase * > _momentum_systems
Pointers to the nonlinear system(s) corresponding to the momentum equation(s)
std::vector< std::unique_ptr< NumericVector< Number > > > _HbyA_raw
We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as we...
std::vector< libMesh::NonlinearImplicitSystem * > _momentum_implicit_systems
Pointers to the momentum equation implicit system(s)
GradientType gradient(const ElemArg &elem, const StateArg &state) const
INSFVPressureVariable *const _p
The thread 0 copy of the pressure variable.
INSFVVelocityVariable *const _w
The thread 0 copy of the z-velocity variable (null if the problem is not 3D)
const libMesh::MeshBase & _mesh
The libMesh mesh that this object acts on.
INSFVVelocityVariable *const _v
The thread 0 copy of the y-velocity variable (null if the problem is 1D)
auto raw_value(const Eigen::Map< T > &in)
StateArg currentState()
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
auto index_range(const T &sizable)

Referenced by SIMPLESolveNonlinearAssembly::solve().

◆ computeFaceVelocity()

void INSFVRhieChowInterpolatorSegregated::computeFaceVelocity ( )

Update the values of the face velocities in the containers.

Definition at line 172 of file INSFVRhieChowInterpolatorSegregated.C.

173{
174 const auto time_arg = Moose::currentState();
175
176 for (auto & fi : _fe_problem.mesh().faceInfo())
177 {
178 if (hasBlocks(fi->elemPtr()->subdomain_id()) ||
179 (fi->neighborPtr() && hasBlocks(fi->neighborPtr()->subdomain_id())))
180 {
181 // On internal face we just use the interpolated H/A and the pressure face gradient
182 // So u_f = -(H/A)_f - (1/A)_f*grad(p)_f
183 // Notice the (-) sign on H/A which is because we use the Jacobian/Residual
184 // computations and we get -H instead of H.
185 if (_u->isInternalFace(*fi))
186 {
187 const Moose::FaceArg face{
188 fi, Moose::FV::LimiterType::CentralDifference, true, false, nullptr, nullptr};
189
190 RealVectorValue Ainv;
191 RealVectorValue HbyA = MetaPhysicL::raw_value(_HbyA(face, time_arg));
192
193 interpolate(Moose::FV::InterpMethod::Average,
194 Ainv,
195 _Ainv(makeElemArg(fi->elemPtr()), time_arg),
196 _Ainv(makeElemArg(fi->neighborPtr()), time_arg),
197 *fi,
198 true);
199
200 RealVectorValue grad_p = MetaPhysicL::raw_value(_p->gradient(face, time_arg));
201 for (const auto comp_index : make_range(_dim))
202 _face_velocity[fi->id()](comp_index) =
203 -HbyA(comp_index) - Ainv(comp_index) * grad_p(comp_index);
204 }
205 else
206 {
207 const Elem * const boundary_elem =
208 hasBlocks(fi->elemPtr()->subdomain_id()) ? fi->elemPtr() : fi->neighborPtr();
209 const Moose::FaceArg boundary_face{
210 fi, Moose::FV::LimiterType::CentralDifference, true, false, boundary_elem, nullptr};
211
212 // If we have a dirichlet boundary conditions, this sill give us the exact value of the
213 // velocity on the face as expected (see populateHbyA())
214 if (_u->isDirichletBoundaryFace(*fi, boundary_elem, time_arg))
215 _face_velocity[fi->id()] = -MetaPhysicL::raw_value(_HbyA(boundary_face, time_arg));
216 else
217 {
218 const RealVectorValue & Ainv = MetaPhysicL::raw_value(_Ainv(boundary_face, time_arg));
219 const RealVectorValue & HbyA = MetaPhysicL::raw_value(_HbyA(boundary_face, time_arg));
220 const RealVectorValue & grad_p =
221 MetaPhysicL::raw_value(_p->gradient(boundary_face, time_arg));
222 for (const auto comp_index : make_range(_dim))
223 _face_velocity[fi->id()](comp_index) =
224 -HbyA(comp_index) - Ainv(comp_index) * grad_p(comp_index);
225 }
226 }
227 }
228 }
229}
virtual bool isDirichletBoundaryFace(const FaceInfo &fi, const Elem *elem, const Moose::StateArg &state) const
bool isInternalFace(const FaceInfo &) const
FEProblemBase & _fe_problem
MeshBase & mesh
void interpolate(InterpMethod m, T &result, const T2 &value1, const T3 &value2, const FaceInfo &fi, const bool one_is_elem)

Referenced by SIMPLESolveNonlinearAssembly::solve().

◆ computeHbyA()

void INSFVRhieChowInterpolatorSegregated::computeHbyA ( bool  verbose)

Computes the inverse of the digaonal (1/A) of the system matrix plus the H/A components for the pressure equation plus Rhie-Chow interpolation.

Definition at line 331 of file INSFVRhieChowInterpolatorSegregated.C.

332{
333 if (verbose)
334 {
335 _console << "************************************" << std::endl;
336 _console << "Computing HbyA" << std::endl;
337 _console << "************************************" << std::endl;
338 }
340 "The momentum system shall be linked before calling this function!");
341
343
344 std::vector<unsigned int> var_nums = {_momentum_implicit_systems[0]->variable_number(_u->name())};
345 if (_v)
346 var_nums.push_back(_momentum_implicit_systems[1]->variable_number(_v->name()));
347 if (_w)
348 var_nums.push_back(_momentum_implicit_systems[2]->variable_number(_w->name()));
349
350 _HbyA_raw.clear();
351 for (auto system_i : index_range(_momentum_systems))
352 {
354
355 momentum_system = _momentum_implicit_systems[system_i];
356
357 NumericVector<Number> & rhs = *(momentum_system->rhs);
358 NumericVector<Number> & current_local_solution = *(momentum_system->current_local_solution);
359 NumericVector<Number> & solution = *(momentum_system->solution);
360 PetscMatrix<Number> * mmat = dynamic_cast<PetscMatrix<Number> *>(momentum_system->matrix);
361 mooseAssert(mmat,
362 "The matrices used in the segregated INSFVRhieChow objects need to be convertable "
363 "to PetscMAtrix!");
364
365 if (verbose)
366 {
367 _console << "Matrix in rc object" << std::endl;
368 mmat->print();
369 }
370
371 auto Ainv = current_local_solution.zero_clone();
372 PetscVector<Number> * Ainv_petsc = dynamic_cast<PetscVector<Number> *>(Ainv.get());
373
374 mmat->get_diagonal(*Ainv_petsc);
375
376 auto working_vector = momentum_system->current_local_solution->zero_clone();
377 PetscVector<Number> * working_vector_petsc =
378 dynamic_cast<PetscVector<Number> *>(working_vector.get());
379 mooseAssert(working_vector_petsc,
380 "The vectors used in the segregated INSFVRhieChow objects need to be convertable "
381 "to PetscVectors!");
382
383 *working_vector_petsc = 1.0;
384 Ainv_petsc->pointwise_divide(*working_vector_petsc, *Ainv_petsc);
385
386 _HbyA_raw.push_back(current_local_solution.zero_clone());
387 NumericVector<Number> & HbyA = *(_HbyA_raw.back());
388
389 if (verbose)
390 {
391 _console << "Velocity solution in H(u)" << std::endl;
392 solution.print();
393 }
394
395 // We fill the 1/A functor
396 auto active_local_begin =
397 _mesh.evaluable_elements_begin(momentum_system->get_dof_map(), var_nums[system_i]);
398 auto active_local_end =
399 _mesh.evaluable_elements_end(momentum_system->get_dof_map(), var_nums[system_i]);
400
401 const auto & state = Moose::currentState();
402 for (auto it = active_local_begin; it != active_local_end; ++it)
403 {
404 const Elem * elem = *it;
405 if (this->hasBlocks(elem->subdomain_id()))
406 {
407 const Moose::ElemArg & elem_arg = makeElemArg(elem);
408 Real coord_multiplier;
409 const auto coord_type = _fe_problem.getCoordSystem(elem->subdomain_id());
410 const unsigned int rz_radial_coord =
412
414 elem->vertex_average(), coord_multiplier, coord_type, rz_radial_coord);
415
416 const Real volume = _moose_mesh.elemInfo(elem->id()).volume();
417 const auto dof_index = elem->dof_number(momentum_system->number(), var_nums[system_i], 0);
418 _Ainv[elem->id()](system_i) = MetaPhysicL::raw_value(epsilon(_tid)(elem_arg, state)) *
419 (*Ainv_petsc)(dof_index)*volume * coord_multiplier;
420 }
421 }
422
423 // Now we set the diagonal of our system matrix to 0 so we can create H*u
424 // TODO: Add a function for this in libmesh
425 *working_vector_petsc = 0.0;
426 LibmeshPetscCall(MatDiagonalSet(mmat->mat(), working_vector_petsc->vec(), INSERT_VALUES));
427
428 if (verbose)
429 {
430 _console << "H" << std::endl;
431 mmat->print();
432 }
433
434 // We need to subtract the contribution of the pressure gradient from the residual (right hand
435 // side). We plug working_vector=0 in here to get the right hand side contribution
437
438 // Now we reorganize the association between tags and vectors to make sure
439 // that the next solve is perfect
440 _momentum_systems[system_i]->associateVectorToTag(
441 momentum_system->get_vector(_fe_problem.vectorTagName(0)), 0);
442 _momentum_systems[system_i]->associateVectorToTag(
445 _momentum_systems[system_i]->setSolution(current_local_solution);
446
447 if (verbose)
448 {
449 _console << "total RHS" << std::endl;
450 rhs.print();
451 _console << "pressure RHS" << std::endl;
452 HbyA.print();
453 }
454
455 // We correct the right hand side to exclude the pressure contribution
456 HbyA.scale(-1.0);
457 HbyA.add(-1.0, rhs);
458
459 if (verbose)
460 {
461 _console << "H RHS" << std::endl;
462 HbyA.print();
463 }
464
465 // Create H(u)
466 mmat->vector_mult(*working_vector_petsc, solution);
467
468 if (verbose)
469 {
470 _console << " H(u)" << std::endl;
471 working_vector_petsc->print();
472 }
473
474 // Create H(u) - RHS
475 HbyA.add(*working_vector_petsc);
476
477 if (verbose)
478 {
479 _console << " H(u)-rhs-relaxation_source" << std::endl;
480 HbyA.print();
481 }
482
483 // Create 1/A*(H(u)-RHS)
484 HbyA.pointwise_mult(HbyA, *Ainv);
485
486 if (verbose)
487 {
488 _console << " (H(u)-rhs)/A" << std::endl;
489 HbyA.print();
490 }
491 }
492
493 populateHbyA(_HbyA_raw, var_nums);
494
495 if (verbose)
496 {
497 _console << "************************************" << std::endl;
498 _console << "DONE Computing HbyA " << std::endl;
499 _console << "************************************" << std::endl;
500 }
501}
const ConsoleStream _console
Real volume() const
void setCurrentNonlinearSystem(const unsigned int nl_sys_num)
virtual void computeResidualTag(const NumericVector< libMesh::Number > &soln, NumericVector< libMesh::Number > &residual, TagID tag)
TagID _pressure_gradient_tag
Residual tag corresponding to the pressure gradient contribution.
void populateHbyA(const std::vector< std::unique_ptr< NumericVector< Number > > > &raw_hbya, const std::vector< unsigned int > &var_nums)
Populate the face values of the H/A field.
std::vector< unsigned int > _momentum_system_numbers
Numbers of the momentum system(s)
const ElemInfo & elemInfo(const dof_id_type id) const
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.
virtual TagName vectorTagName(const TagID tag) const
unsigned int getAxisymmetricRadialCoord() const
Moose::CoordinateSystemType getCoordSystem(SubdomainID sid) const
const THREAD_ID _tid
dof_id_type dof_number(const unsigned int s, const unsigned int var, const unsigned int comp) const
dof_id_type id() const
subdomain_id_type subdomain_id() const
Point vertex_average() const
NumericVector< Number > * rhs
SparseMatrix< Number > * matrix
virtual void pointwise_mult(const NumericVector< T > &vec1, const NumericVector< T > &vec2)=0
virtual void print(std::ostream &os=libMesh::out) const
virtual void scale(const T factor)=0
virtual std::unique_ptr< NumericVector< T > > zero_clone() const=0
virtual void add(const numeric_index_type i, const T value)=0
virtual void get_diagonal(NumericVector< T > &dest) const override
virtual void pointwise_divide(const NumericVector< T > &vec1, const NumericVector< T > &vec2) override
void vector_mult(NumericVector< T > &dest, const NumericVector< T > &arg) const
void print(std::ostream &os=libMesh::out, const bool sparse=false) const
std::unique_ptr< NumericVector< Number > > current_local_solution
std::unique_ptr< NumericVector< Number > > solution
unsigned int variable_number(std::string_view var) const
const DofMap & get_dof_map() const
unsigned int number() const
const NumericVector< Number > & get_vector(std::string_view vec_name) const
void coordTransformFactor(const P &point, C &factor, const Moose::CoordinateSystemType coord_type, const unsigned int rz_radial_coord=libMesh::invalid_uint)
Real volume(const MeshBase &mesh, unsigned int dim=libMesh::invalid_uint)
const unsigned int invalid_uint
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

Referenced by SIMPLESolveNonlinearAssembly::solve().

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

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

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

◆ execute()

void INSFVRhieChowInterpolatorSegregated::execute ( )
inlineoverridevirtual

Implements GeneralUserObject.

Definition at line 64 of file INSFVRhieChowInterpolatorSegregated.h.

64{}

◆ fillContainer()

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

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

Definition at line 168 of file RhieChowInterpolatorBase.h.

169{
170 typedef typename Container::value_type ContainedType;
171 for (const auto tid : make_range(libMesh::n_threads()))
172 {
173 auto * const var = static_cast<ContainedType>(
174 &UserObject::_subproblem.getVariable(tid, getParam<VariableName>(name)));
175 container[tid] = var;
176 }
177}
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const=0

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

◆ finalize()

void INSFVRhieChowInterpolatorSegregated::finalize ( )
inlineoverridevirtual

Implements GeneralUserObject.

Definition at line 65 of file INSFVRhieChowInterpolatorSegregated.h.

65{}

◆ getVelocity()

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

Get the face velocity (used in advection terms)

Implements RhieChowInterpolatorBase.

Definition at line 160 of file INSFVRhieChowInterpolatorSegregated.C.

165{
166 if (m != Moose::FV::InterpMethod::RhieChow)
167 mooseError("Segregated solution algorithms only support Rhie-Chow interpolation!");
168 return _face_velocity.evaluate(&fi);
169}
ValueType evaluate(const FaceInfo *const fi) const
Evaluate the face functor using a FaceInfo argument.

◆ 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}
const Point & normal() const
virtual VectorValue< ADReal > getVelocity(const Moose::FV::InterpMethod m, const FaceInfo &fi, const Moose::StateArg &time, const THREAD_ID tid, bool subtract_mesh_velocity) const =0
Retrieve a face velocity.

◆ ghostADataOnBoundary()

virtual void RhieChowInterpolatorBase::ghostADataOnBoundary ( const BoundaryID  )
inlinevirtualinherited

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

This is a virtual function, mostly used for monolithic approaches.

Reimplemented in INSFVRhieChowInterpolator.

Definition at line 76 of file RhieChowInterpolatorBase.h.

76{}

Referenced by VolumetricFlowRate::initialSetup().

◆ 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

◆ initFaceVelocities()

void INSFVRhieChowInterpolatorSegregated::initFaceVelocities ( )

Initialize the container for face velocities.

Definition at line 128 of file INSFVRhieChowInterpolatorSegregated.C.

129{
130 for (auto & fi : _fe_problem.mesh().faceInfo())
131 {
132 if (hasBlocks(fi->elemPtr()->subdomain_id()) ||
133 (fi->neighborPtr() && hasBlocks(fi->neighborPtr()->subdomain_id())))
134 {
135 // On internal face we do a regular interpoaltion with geometric weights
136 if (_u->isInternalFace(*fi))
137 {
138 const Moose::FaceArg face{
139 fi, Moose::FV::LimiterType::CentralDifference, true, false, nullptr, nullptr};
140
142 }
143 // On the boundary, we just take the boundary values
144 else
145 {
146 const Elem * const boundary_elem =
147 hasBlocks(fi->elemPtr()->subdomain_id()) ? fi->elemPtr() : fi->neighborPtr();
148
149 const Moose::FaceArg boundary_face{
150 fi, Moose::FV::LimiterType::CentralDifference, true, false, boundary_elem, nullptr};
151
152 _face_velocity[fi->id()] =
153 MetaPhysicL::raw_value((*_vel)(boundary_face, Moose::currentState()));
154 }
155 }
156 }
157}

Referenced by SIMPLESolveNonlinearAssembly::linkRhieChowUserObject().

◆ initialize()

void INSFVRhieChowInterpolatorSegregated::initialize ( )
overridevirtual

Implements GeneralUserObject.

Definition at line 118 of file INSFVRhieChowInterpolatorSegregated.C.

119{
120 for (const auto & pair : _HbyA)
121 _HbyA[pair.first] = 0;
122
123 for (const auto & pair : _Ainv)
124 _Ainv[pair.first] = 0;
125}

◆ linkMomentumSystem()

void INSFVRhieChowInterpolatorSegregated::linkMomentumSystem ( std::vector< NonlinearSystemBase * >  momentum_systems,
const std::vector< unsigned int > &  momentum_system_numbers,
const TagID  pressure_gradient_tag 
)

Update the momentum system-related information.

Parameters
momentum_systemsPointers to the momentum systems which are solved for the momentum vector components
momentum_system_numbersThe numbers of these systems
pressure_gradient_tagThe tag which is associated with the pressure gradient kernels. This is needed for separating the pressure contibution from other terms in the momentum systems.

Definition at line 94 of file INSFVRhieChowInterpolatorSegregated.C.

98{
99 _momentum_systems = momentum_systems;
100 _momentum_system_numbers = momentum_system_numbers;
101 _pressure_gradient_tag = pressure_gradient_tag;
102
104 for (auto & system : _momentum_systems)
106 dynamic_cast<NonlinearImplicitSystem *>(&system->system()));
107}

Referenced by SIMPLESolveNonlinearAssembly::linkRhieChowUserObject().

◆ meshChanged()

void INSFVRhieChowInterpolatorSegregated::meshChanged ( )
overridevirtual

Reimplemented from GeneralUserObject.

Definition at line 110 of file INSFVRhieChowInterpolatorSegregated.C.

111{
112 _HbyA.clear();
113 _Ainv.clear();
114 _face_velocity.clear();
115}

◆ populateHbyA()

void INSFVRhieChowInterpolatorSegregated::populateHbyA ( const std::vector< std::unique_ptr< NumericVector< Number > > > &  raw_hbya,
const std::vector< unsigned int > &  var_nums 
)
protected

Populate the face values of the H/A field.

Definition at line 276 of file INSFVRhieChowInterpolatorSegregated.C.

279{
280 for (auto & fi : _fe_problem.mesh().faceInfo())
281 {
282 if (hasBlocks(fi->elemPtr()->subdomain_id()) ||
283 (fi->neighborPtr() && hasBlocks(fi->neighborPtr()->subdomain_id())))
284 {
285 // If we are on an internal face, we just interpolate the values to the faces.
286 // Otherwise, depending on the boundary type, we take the velocity value or
287 // extrapolated HbyA values.
288 if (_u->isInternalFace(*fi))
289 {
290 const Elem * elem = fi->elemPtr();
291 const Elem * neighbor = fi->neighborPtr();
292 for (auto comp_index : make_range(_dim))
293 {
294 unsigned int system_number = _momentum_implicit_systems[comp_index]->number();
295 const auto dof_index_elem = elem->dof_number(system_number, var_nums[comp_index], 0);
296 const auto dof_index_neighbor =
297 neighbor->dof_number(system_number, var_nums[comp_index], 0);
298
299 interpolate(Moose::FV::InterpMethod::Average,
300 _HbyA[fi->id()](comp_index),
301 (*raw_hbya[comp_index])(dof_index_elem),
302 (*raw_hbya[comp_index])(dof_index_neighbor),
303 *fi,
304 true);
305 }
306 }
307 else
308 {
309 const Elem * const boundary_elem =
310 hasBlocks(fi->elemPtr()->subdomain_id()) ? fi->elemPtr() : fi->neighborPtr();
311
312 const Moose::FaceArg boundary_face{
313 fi, Moose::FV::LimiterType::CentralDifference, true, false, boundary_elem, nullptr};
314
315 if (_u->isDirichletBoundaryFace(*fi, boundary_elem, Moose::currentState()))
316 _HbyA[fi->id()] = -MetaPhysicL::raw_value((*_vel)(boundary_face, Moose::currentState()));
317 else
318 for (const auto comp_index : make_range(_dim))
319 {
320 unsigned int system_number = _momentum_implicit_systems[comp_index]->number();
321 const auto dof_index_elem =
322 boundary_elem->dof_number(system_number, var_nums[comp_index], 0);
323 _HbyA[fi->id()](comp_index) = (*raw_hbya[comp_index])(dof_index_elem);
324 }
325 }
326 }
327 }
328}

Referenced by computeHbyA().

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

◆ segregated()

bool INSFVRhieChowInterpolatorSegregated::segregated ( ) const
inlineoverridevirtual

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

Implements RhieChowInterpolatorBase.

Definition at line 67 of file INSFVRhieChowInterpolatorSegregated.h.

67{ return true; };

◆ supportMeshVelocity()

virtual bool RhieChowFaceFluxProvider::supportMeshVelocity ( ) const
inlinevirtualinherited

Returns whether the UO can support mesh velocity advection.

Reimplemented in RhieChowMassFlux.

Definition at line 49 of file RhieChowFaceFluxProvider.h.

49{ return true; }

Referenced by VolumetricFlowRate::VolumetricFlowRate().

◆ validParams()

InputParameters INSFVRhieChowInterpolatorSegregated::validParams ( )
static

Definition at line 35 of file INSFVRhieChowInterpolatorSegregated.C.

36{
38
39 params.addClassDescription("Computes H/A and 1/A together with face velocities for segregated "
40 "momentum-pressure equations.");
41
42 // We disable the execution of this, should only provide functions
43 // for the SIMPLENonlinearAssembly executioner
44 ExecFlagEnum & exec_enum = params.set<ExecFlagEnum>("execute_on", true);
45 exec_enum.addAvailableFlags(EXEC_NONE);
46 exec_enum = {EXEC_NONE};
47 params.suppressParameter<ExecFlagEnum>("execute_on");
48
49 return params;
50}
const ExecFlagType EXEC_NONE
void addAvailableFlags(const ExecFlagType &flag, Args... flags)
static InputParameters validParams()

Referenced by PINSFVRhieChowInterpolatorSegregated::validParams().

◆ vel()

const INSFVVelocityVariable * RhieChowInterpolatorBase::vel ( ) const
inlineinherited

Definition at line 83 of file RhieChowInterpolatorBase.h.

83{ return _u; }

Referenced by INSFVRhieChowInterpolator::getVelocity().

◆ velocityInterpolationMethod()

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

Return the interpolation method used for velocity.

Definition at line 70 of file RhieChowInterpolatorBase.h.

Member Data Documentation

◆ _Ainv

CellCenteredMapFunctor<RealVectorValue, std::unordered_map<dof_id_type, RealVectorValue> > INSFVRhieChowInterpolatorSegregated::_Ainv
protected

A map functor from element IDs to $1/A_i$.

Where $A_i$ is the diagonal of the system matrix for the momentum equation.

Definition at line 111 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeCellVelocity(), computeFaceVelocity(), computeHbyA(), initialize(), and meshChanged().

◆ _dim

const unsigned int RhieChowInterpolatorBase::_dim
protectedinherited

◆ _displaced

const bool RhieChowInterpolatorBase::_displaced
protectedinherited

Whether this object is operating on the displaced mesh.

Definition at line 146 of file RhieChowInterpolatorBase.h.

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

◆ _face_velocity

FaceCenteredMapFunctor<RealVectorValue, std::unordered_map<dof_id_type, RealVectorValue> > INSFVRhieChowInterpolatorSegregated::_face_velocity
protected

A map functor from faces to face velocities which are used in the advection terms.

Definition at line 120 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeFaceVelocity(), getVelocity(), initFaceVelocities(), and meshChanged().

◆ _HbyA

FaceCenteredMapFunctor<RealVectorValue, std::unordered_map<dof_id_type, RealVectorValue> > INSFVRhieChowInterpolatorSegregated::_HbyA
protected

A map functor from faces to $HbyA_{ij} = (A_{offdiag}*\mathrm{(predicted~velocity)} - \mathrm{Source})_{ij}/A_{ij}$.

So this contains the off-diagonal part of the system matrix multiplied by the predicted velocity minus the source terms from the right hand side of the linearized momentum predictor step.

Definition at line 98 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeFaceVelocity(), initialize(), meshChanged(), and populateHbyA().

◆ _HbyA_raw

std::vector<std::unique_ptr<NumericVector<Number> > > INSFVRhieChowInterpolatorSegregated::_HbyA_raw
protected

We hold on to the cell-based HbyA vectors so that we can easily reconstruct the cell velocities as well.

This vector might be either of size 1 or DIM depending on if we segregate the velocity components as well.

Definition at line 105 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeCellVelocity(), and computeHbyA().

◆ _mesh

const libMesh::MeshBase& RhieChowInterpolatorBase::_mesh
protectedinherited

◆ _momentum_implicit_systems

std::vector<libMesh::NonlinearImplicitSystem *> INSFVRhieChowInterpolatorSegregated::_momentum_implicit_systems
protected

Pointers to the momentum equation implicit system(s)

Definition at line 129 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeCellVelocity(), computeHbyA(), linkMomentumSystem(), and populateHbyA().

◆ _momentum_system_numbers

std::vector<unsigned int> INSFVRhieChowInterpolatorSegregated::_momentum_system_numbers
protected

Numbers of the momentum system(s)

Definition at line 126 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeHbyA(), and linkMomentumSystem().

◆ _momentum_systems

std::vector<NonlinearSystemBase *> INSFVRhieChowInterpolatorSegregated::_momentum_systems
protected

Pointers to the nonlinear system(s) corresponding to the momentum equation(s)

Definition at line 123 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeCellVelocity(), computeHbyA(), and linkMomentumSystem().

◆ _moose_mesh

MooseMesh& RhieChowInterpolatorBase::_moose_mesh
protectedinherited

◆ _p

INSFVPressureVariable* const RhieChowInterpolatorBase::_p
protectedinherited

◆ _pressure_gradient_tag

TagID INSFVRhieChowInterpolatorSegregated::_pressure_gradient_tag
protected

Residual tag corresponding to the pressure gradient contribution.

Definition at line 132 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by computeHbyA(), and linkMomentumSystem().

◆ _ps

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

◆ _u

INSFVVelocityVariable* const RhieChowInterpolatorBase::_u
protectedinherited

◆ _unity_functor

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

A unity functor used in the epsilon virtual method.

Definition at line 150 of file RhieChowInterpolatorBase.h.

150{1};

Referenced by RhieChowInterpolatorBase::epsilon().

◆ _us

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

◆ _v

INSFVVelocityVariable* const RhieChowInterpolatorBase::_v
protectedinherited

The thread 0 copy of the y-velocity variable (null if the problem is 1D)

Definition at line 122 of file RhieChowInterpolatorBase.h.

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

◆ _var_numbers

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

◆ _vel

std::unique_ptr<PiecewiseByBlockLambdaFunctor<ADRealVectorValue> > INSFVRhieChowInterpolatorSegregated::_vel
protected

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

Definition at line 114 of file INSFVRhieChowInterpolatorSegregated.h.

Referenced by initFaceVelocities(), and populateHbyA().

◆ _velocity_interp_method

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

◆ _vs

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

◆ _w

INSFVVelocityVariable* const RhieChowInterpolatorBase::_w
protectedinherited

The thread 0 copy of the z-velocity variable (null if the problem is not 3D)

Definition at line 125 of file RhieChowInterpolatorBase.h.

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

◆ _ws

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

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