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")
46 ? &getFunctor<RealVectorValue>(
"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!");
245 ssf.limiter_type = Moose::FV::LimiterType::CentralDifference;
251 {fi, Moose::FV::LimiterType::CentralDifference,
true, correct_skewness, elem,
nullptr});
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");
const std::vector< double > y
registerMooseObject("NavierStokesApp", PressureDrop)
bool hasBoundary(const BoundaryName &name) const
virtual const std::set< BoundaryID > & boundaryIDs() const
const Point & normal() const
const Elem * neighborPtr() const
const Elem * elemPtr() const
const InputParameters & parameters() const
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
void mooseError(Args &&... args) const
void mooseWarning(Args &&... args) const
void setupFiniteVolumeMeshData() const
const std::string & getBoundaryName(const BoundaryID boundary_id) const
bool isFiniteVolumeInfoDirty() const
BoundaryID getBoundaryID(const BoundaryName &boundary_name) const
This postprocessor computes the pressure drop between an upstream and a downstream boundary.
Real computeFaceInfoWeightedPressureIntegral(const FaceInfo *fi) const
Computes the contribution on a face to the weighted pressure integral.
Real computeFaceInfoWeightIntegral(const FaceInfo *fi) const
Computes the contribution on a face to the integral of the weight.
Real _weighted_pressure_upstream
The weighted integral of the upstream pressure.
const Moose::Functor< Real > & _pressure
The pressure functor.
PressureDrop(const InputParameters ¶meters)
static InputParameters validParams()
std::vector< BoundaryID > _upstream_boundaries
Vector of the ids of the upstream boundaries.
Moose::FV::InterpMethod _weight_interp_method
The interpolation method to use for the weighting functor quantity.
virtual void finalize() override
virtual void execute() override
Real _weight_downstream
The integral of the weights on the downstream boundary, for normalization.
virtual void meshChanged() override
const Moose::Functor< RealVectorValue > *const _weighting_functor
A weighting functor if the pressure profile is not uniform.
virtual Real getValue() const override
Real computeQpWeightedPressureIntegral() const
Computes the contribution on a Qp to the weighted pressure integral.
virtual void initialize() override
virtual void threadJoin(const UserObject &y) override
Real _weighted_pressure_downstream
The weighted integral of the downstream pressure.
Real _weight_upstream
The integral of the weights on the upstream boundary, for normalization.
Real computeQpWeightIntegral() const
Computes the contribution on a Qp to the integral of the weight.
std::vector< BoundaryID > _downstream_boundaries
Vector of the ids of the downstream boundaries.
static InputParameters validParams()
const unsigned int & _current_side
const MooseArray< Real > & _coord
const QBase *const & _qrule
const MooseArray< Real > & _JxW
const MooseArray< Point > & _q_point
const MooseArray< Point > & _normals
const Elem *const & _current_elem
std::vector< const FaceInfo * > _face_infos
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
virtual bool hasVariable(const std::string &var_name) const=0
Moose::StateArg determineState() const
LimiterType limiterType(InterpMethod interp_method)
bool setInterpolationMethod(const MooseObject &obj, Moose::FV::InterpMethod &interp_method, const std::string ¶m_name)
MooseEnum interpolationMethods()