Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : #include "SideIntegralPostprocessor.h" 13 : 14 : /** 15 : * This postprocessor computes the pressure drop between an upstream and a downstream boundary. 16 : * In case multiple boundaries are specified, or the pressure profile is not constant along the 17 : * boundaries, a vector weighting factor may be used. 18 : */ 19 : class PressureDrop : public SideIntegralPostprocessor 20 : { 21 : public: 22 : static InputParameters validParams(); 23 : 24 : PressureDrop(const InputParameters & parameters); 25 : 26 0 : virtual Real computeQpIntegral() override { mooseError("Not implemented"); }; 27 : 28 : virtual void initialize() override; 29 : virtual void meshChanged() override; 30 : virtual void execute() override; 31 : virtual void threadJoin(const UserObject & y) override; 32 : virtual void finalize() override; 33 : virtual Real getValue() const override; 34 : 35 : protected: 36 : /// Computes the contribution on a face to the weighted pressure integral 37 : Real computeFaceInfoWeightedPressureIntegral(const FaceInfo * fi) const; 38 : /// Computes the contribution on a face to the integral of the weight 39 : Real computeFaceInfoWeightIntegral(const FaceInfo * fi) const; 40 : 41 : /// Computes the contribution on a Qp to the weighted pressure integral 42 : Real computeQpWeightedPressureIntegral() const; 43 : /// Computes the contribution on a Qp to the integral of the weight 44 : Real computeQpWeightIntegral() const; 45 : 46 : /// The pressure functor 47 : const Moose::Functor<Real> & _pressure; 48 : /// A weighting functor if the pressure profile is not uniform 49 : const Moose::Functor<RealVectorValue> * const _weighting_functor; 50 : /// The interpolation method to use for the weighting functor quantity 51 : Moose::FV::InterpMethod _weight_interp_method; 52 : /// Vector of the ids of the upstream boundaries 53 : std::vector<BoundaryID> _upstream_boundaries; 54 : /// Vector of the ids of the downstream boundaries 55 : std::vector<BoundaryID> _downstream_boundaries; 56 : /// The weighted integral of the upstream pressure 57 : Real _weighted_pressure_upstream; 58 : /// The weighted integral of the downstream pressure 59 : Real _weighted_pressure_downstream; 60 : /// The integral of the weights on the upstream boundary, for normalization 61 : Real _weight_upstream; 62 : /// The integral of the weights on the downstream boundary, for normalization 63 : Real _weight_downstream; 64 : };