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",
32 Moose::RelationshipManagerType::GEOMETRIC,
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");
45 _eps(getFunctor<
ADReal>(
NS::porosity)),
46 _smoothed_eps(_moose_mesh,
NS::smoothed_porosity, true),
47 _epss(
libMesh::n_threads(), nullptr),
48 _smoothed_epss(
libMesh::n_threads(), nullptr),
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");
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())
DualNumber< Real, DNDerivativeType, true > ADReal
const ExecFlagType EXEC_INITIAL
registerMooseObject("NavierStokesApp", PINSFVRhieChowInterpolator)
A special variable class for pressure which flags faces at which porosity jumps occur as extrapolated...
virtual const std::set< SubdomainID > & blockIDs() const
const Elem & elem() const
const Elem * neighborPtr() const
const Elem & neighbor() const
static std::string deduceFunctorName(const std::string &name, const InputParameters ¶ms)
This user-object gathers 'a' (on-diagonal velocity coefficients) data.
virtual void finalize() override
virtual void execute() override
static InputParameters validParams()
virtual void initialize() override
virtual void meshChanged() override
void paramError(const std::string ¶m, Args... args) const
const std::vector< FaceInfo > & allFaceInfo() const
void setAdditionalValue(const std::string &names)
A class that inherits the free-flow class's implementation of Rhie-Chow data gathering and adds the a...
virtual void finalize() override
const Moose::Functor< ADReal > & _eps
The thread 0 copy of the porosity functor held by the subproblem.
void pinsfvSetup()
called during the first initialize() and upon meshChanged(), this method performs the interpolations ...
virtual void execute() override
virtual void initialize() override
bool isFaceGeometricallyRelevant(const FaceInfo &fi) const
std::vector< const Moose::Functor< ADReal > * > _smoothed_epss
All the thread copies of the problem's smoothed porosity functor.
virtual void meshChanged() override
std::vector< const Moose::Functor< ADReal > * > _epss
All the thread copies of the problem's porosity functor.
const unsigned short _smoothing_layers
The number of interpolations and reconstructions that should be performed on the porosity functor/fie...
std::vector< const FaceInfo * > _geometric_fi
All the face information that are "geometrically" accessible on this process.
static InputParameters validParams()
PINSFVRhieChowInterpolator(const InputParameters ¶ms)
CellCenteredMapFunctor< ADReal, std::unordered_map< dof_id_type, ADReal > > _smoothed_eps
The smoothed porosity functor/field.
INSFVPressureVariable *const _p
The thread 0 copy of the pressure variable.
MooseMesh & _moose_mesh
The MooseMesh that this user object operates on.
const ExecFlagType & _current_execute_flag
const Moose::Functor< T > & getFunctor(const std::string &name, const THREAD_ID tid, const std::string &requestor_name, bool requestor_is_ad)
Moose::StateArg determineState() 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...
bool onBoundary(const SubdomainRestrictable &obj, const FaceInfo &fi)
static const std::string smoothed_porosity
static const std::string porosity
static const std::string pressure
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
const RemoteElem * remote_elem