22 params.addClassDescription(
"Performs interpolations and reconstructions of porosity and computes " 23 "the Rhie-Chow face velocities.");
26 params.addRequiredParam<MooseFunctorName>(
NS::porosity,
"The porosity");
27 params.addParam<
unsigned short>(
30 "The number of interpolation-reconstruction operations to perform on the porosity");
31 params.addRelationshipManager(
"ElementSideNeighborLayers",
35 rm_params.
set<
unsigned short>(
"layers") =
36 obj_params.
get<
unsigned short>(
"smoothing_layers");
37 rm_params.
set<
bool>(
"use_displaced_mesh") =
38 obj_params.
get<
bool>(
"use_displaced_mesh");
49 _smoothing_layers(getParam<unsigned short>(
"smoothing_layers"))
54 "If we are reconstructing porosity, then the input porosity to this user object cannot " 55 "be a Moose variable. There are issues with reconstructing Moose variables: 1) initial " 56 "conditions are run after user objects initial setup 2) reconstructing from a variable " 57 "requires ghosting the solution vectors 3) it's difficult to restrict the face " 58 "informations we evaluate interpolations and reconstructions on such that we never query " 59 "an algebraically remote element due to things like two-term extrapolated boundary faces " 60 "which trigger gradient evaluations which trigger neighbor element evaluation");
93 if (dynamic_cast<BernoulliPressureVariable *>(
_p))
96 "If 'smoothing_layers' is non-zero, e.g. if the porosity is smooth(ed), " 97 "then the pressure drop should be computed automatically. The " 98 "'BernoulliPressureVariable' class enforces a pressure drop according to the Bernoulli " 99 "equation on any face which has different pressure values on either side. This is " 100 "undesirable when the porosity is varying smoothing and there may be pressure drops " 101 "corresponding to viscous effects. Please just use the 'INSFVPressureVariable' " 102 "class for pressure when the porosity is smooth.");
107 for (
const auto & fi : all_fi)
113 const auto saved_do_derivatives = ADReal::do_derivatives;
114 ADReal::do_derivatives =
true;
117 ADReal::do_derivatives = saved_do_derivatives;
134 bool on_us =
blockIDs().count(fi.
elem().subdomain_id());
165 for (
auto *
const neighbor : boundary_elem.neighbor_ptr_range())
PINSFVRhieChowInterpolator(const InputParameters ¶ms)
INSFVPressureVariable *const _p
The thread 0 copy of the pressure variable.
virtual void initialize() override
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)
virtual void execute() override
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
virtual void meshChanged() override
bool isFaceGeometricallyRelevant(const FaceInfo &fi) const
void setAdditionalValue(const std::string &names)
const Elem & elem() const
static const std::string smoothed_porosity
Moose::StateArg determineState() const
const ExecFlagType & _current_execute_flag
std::vector< const FaceInfo * > _geometric_fi
All the face information that are "geometrically" accessible on this process.
std::vector< const Moose::Functor< ADReal > * > _epss
All the thread copies of the problem's porosity functor.
virtual const std::set< SubdomainID > & blockIDs() const
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
virtual const std::string & name() const
static const std::string porosity
const std::vector< FaceInfo > & allFaceInfo() const
void interpolateReconstruct(CellCenteredMapFunctor< T, Map > &output_functor, const Moose::FunctorBase< T > &input_functor, const unsigned int num_int_recs, const bool weight_with_sf, const std::vector< const FaceInfo *> &faces, const Moose::StateArg &time)
Takes an input functor that can be evaluated at faces, typically by linearly interpolating between ad...
const Elem * neighborPtr() const
std::vector< const Moose::Functor< ADReal > * > _smoothed_epss
All the thread copies of the problem's smoothed porosity functor.
static InputParameters validParams()
virtual void initialize() override
const Elem & neighbor() const
virtual void finalize() override
void paramError(const std::string ¶m, Args... args) const
static InputParameters validParams()
CellCenteredMapFunctor< ADReal, std::unordered_map< dof_id_type, ADReal > > _smoothed_eps
The smoothed porosity functor/field.
bool onBoundary(const SubdomainRestrictable &obj, const FaceInfo &fi)
registerMooseObject("NavierStokesApp", PINSFVRhieChowInterpolator)
virtual void meshChanged() override
static const std::string pressure
IntRange< T > make_range(T beg, T end)
This user-object gathers 'a' (on-diagonal velocity coefficients) data.
void pinsfvSetup()
called during the first initialize() and upon meshChanged(), this method performs the interpolations ...
const unsigned short _smoothing_layers
The number of interpolations and reconstructions that should be performed on the porosity functor/fie...
const Moose::Functor< ADReal > & _eps
The thread 0 copy of the porosity functor held by the subproblem.
virtual void finalize() override
virtual void execute() override
A class that inherits the free-flow class's implementation of Rhie-Chow data gathering and adds the a...
static std::string deduceFunctorName(const std::string &name, const InputParameters ¶ms)
const RemoteElem * remote_elem
const ExecFlagType EXEC_INITIAL