///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2018 Equinor ASA // // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. // // See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RiaEclipseUnitTools.h" #include "RiaWeightedMeanCalculator.h" #include "RimWellPathAicdParameters.h" #include #include class RimWellPathValve; class RicMswValve; //================================================================================================== /// //================================================================================================== class RicMswValveAccumulator { public: RicMswValveAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem) : m_unitSystem(unitSystem) {} virtual bool accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction) = 0; virtual void applyToSuperValve(std::shared_ptr valve) = 0; protected: RiaEclipseUnitTools::UnitSystem m_unitSystem; }; //================================================================================================== /// //================================================================================================== class RicMswICDAccumulator : public RicMswValveAccumulator { public: RicMswICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem); bool accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction) override; void applyToSuperValve(std::shared_ptr valve) override; private: RiaWeightedMeanCalculator m_coefficientCalculator; double m_areaSum; }; //================================================================================================== /// //================================================================================================== class RicMswAICDAccumulator : public RicMswValveAccumulator { public: RicMswAICDAccumulator(RiaEclipseUnitTools::UnitSystem unitSystem); bool accumulateValveParameters(const RimWellPathValve* wellPathValve, size_t subValve, double contributionFraction) override; void applyToSuperValve(std::shared_ptr valve) override; private: bool m_valid; bool m_deviceOpen; std::array, AICD_NUM_PARAMS> m_meanCalculators; double m_accumulatedLength; };