24 "Computes the pressure drop between an upstream and a downstream boundary.");
26 params.
addRequiredParam<MooseFunctorName>(
"pressure",
"The pressure functor");
27 params.
addParam<MooseFunctorName>(
"weighting_functor",
28 "A vector functor to compute a flux to weigh the pressure for " 29 "the pressure average computations");
31 "upstream_boundary",
"The upstream surface (must also be specified in 'boundary' parameter");
33 "downstream_boundary",
34 "The downstream surface (must also be specified in 'boundary' parameter");
38 "The interpolation to use for the weighting functor.");
44 _pressure(getFunctor<
Real>(
"pressure")),
45 _weighting_functor(isParamValid(
"weighting_functor")
50 const auto pressure_name = getParam<MooseFunctorName>(
"pressure");
52 paramError(
"pressure",
"Pressure must be a variable");
58 checkFunctorSupportsSideIntegration<RealVectorValue>(
"weighting_functor",
_qp_integration);
64 paramError(
"weighting_interp_method",
"Face interpolation only specified for finite volume");
67 auto upstream_bdies = getParam<std::vector<BoundaryName>>(
"upstream_boundary");
68 auto downstream_bdies = getParam<std::vector<BoundaryName>>(
"downstream_boundary");
71 for (
auto i :
make_range(upstream_bdies.size()))
73 for (
auto i :
make_range(downstream_bdies.size()))
81 "' is not included in boundary restriction");
86 "' is not included in boundary restriction");
94 "' is not part of upstream or downstream boundaries");
100 "' is also a downstream boundary");
126 bool upstream =
false;
127 bool status_known =
false;
132 for (
const auto bdy : fi->boundaryIDs())
151 mooseError(
"Face info is part of both upstream and downstream boundaries");
221 mooseAssert(fi,
"We should have a face info in " +
name());
223 const bool correct_skewness =
227 mooseAssert(
_qp == 0,
"Only one quadrature point");
229 "Pressure must be defined at least on one side of the face!");
235 "Pressure and weighting functor have to be defined on the same side of the face!");
259 mooseAssert(fi,
"We should have a face info in " +
name());
261 mooseAssert(
_qp == 0,
"Only one quadrature point");
264 const bool correct_skewness =
332 mooseWarning(
"Weight integral is 0 (downstream or upstream), either :\n" 333 "- pressure drop value is queried before being computed\n" 334 "- the weight flux integral is simply 0, the weighting is not appropriate");
bool isFiniteVolumeInfoDirty() const
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
virtual void meshChanged() override
const Moose::Functor< Real > & _pressure
The pressure functor.
const unsigned int & _current_side
virtual void finalize() override
static InputParameters validParams()
Real computeQpWeightedPressureIntegral() const
Computes the contribution on a Qp to the weighted pressure integral.
Moose::StateArg determineState() const
const std::string & getBoundaryName(BoundaryID boundary_id)
Moose::FV::InterpMethod _weight_interp_method
The interpolation method to use for the weighting functor quantity.
Real computeFaceInfoWeightIntegral(const FaceInfo *fi) const
Computes the contribution on a face to the integral of the weight.
const MooseArray< Point > & _q_point
const std::vector< double > y
MooseEnum interpolationMethods()
virtual const std::string & name() const
static InputParameters validParams()
void mooseWarning(Args &&... args) const
Real _weighted_pressure_upstream
The weighted integral of the upstream pressure.
virtual void execute() override
std::vector< const FaceInfo *> _face_infos
const MooseArray< Real > & _JxW
LimiterType limiterType(InterpMethod interp_method)
const Elem * neighborPtr() const
registerMooseObject("NavierStokesApp", PressureDrop)
This postprocessor computes the pressure drop between an upstream and a downstream boundary...
const Moose::Functor< RealVectorValue > *const _weighting_functor
A weighting functor if the pressure profile is not uniform.
Real _weighted_pressure_downstream
The weighted integral of the downstream pressure.
Real _weight_downstream
The integral of the weights on the downstream boundary, for normalization.
PressureDrop(const InputParameters ¶meters)
const Point & normal() const
void paramError(const std::string ¶m, Args... args) const
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const=0
Real computeQpWeightIntegral() const
Computes the contribution on a Qp to the integral of the weight.
virtual void initialize() override
const MooseArray< Real > & _coord
virtual bool hasVariable(const std::string &var_name) const=0
const Elem * elemPtr() const
bool hasBoundary(const BoundaryName &name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Real _weight_upstream
The integral of the weights on the upstream boundary, for normalization.
std::vector< BoundaryID > _upstream_boundaries
Vector of the ids of the upstream boundaries.
const QBase *const & _qrule
const MooseArray< Point > & _normals
IntRange< T > make_range(T beg, T end)
virtual Real getValue() const override
void mooseError(Args &&... args) const
const InputParameters & parameters() const
std::vector< BoundaryID > _downstream_boundaries
Vector of the ids of the downstream boundaries.
Real computeFaceInfoWeightedPressureIntegral(const FaceInfo *fi) const
Computes the contribution on a face to the weighted pressure integral.
const Elem *const & _current_elem
virtual const std::set< BoundaryID > & boundaryIDs() const
bool setInterpolationMethod(const MooseObject &obj, Moose::FV::InterpMethod &interp_method, const std::string ¶m_name)
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
void setupFiniteVolumeMeshData() const
virtual void threadJoin(const UserObject &y) override