ResInsight/ApplicationLibCode/Commands/CompletionExportCommands/RicMswValveAccumulators.h
Magne Sjaastad f8c5cf389f
clang-format: Set column width to 140
* Set column width to 140
* Use c++20
* Remove redundant virtual
2023-02-26 10:48:40 +01:00

84 lines
3.3 KiB
C++

/////////////////////////////////////////////////////////////////////////////////
//
// 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 <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "RiaDefines.h"
#include "RiaWeightedMeanCalculator.h"
#include "RimWellPathAicdParameters.h"
#include <array>
class RimWellPathValve;
class RicMswValve;
//==================================================================================================
///
//==================================================================================================
class RicMswValveAccumulator
{
public:
RicMswValveAccumulator( RicMswValve* valve, RiaDefines::EclipseUnitSystem unitSystem )
: m_valve( valve )
, m_unitSystem( unitSystem )
, m_valid( false )
{
}
virtual bool accumulateValveParameters( const RimWellPathValve* wellPathValve, double overlapLength, double perforationCompsegsLength ) = 0;
virtual void applyToSuperValve() = 0;
RicMswValve* superValve() const { return m_valve; }
protected:
RicMswValve* m_valve;
RiaDefines::EclipseUnitSystem m_unitSystem;
bool m_valid;
};
//==================================================================================================
///
//==================================================================================================
class RicMswICDAccumulator : public RicMswValveAccumulator
{
public:
RicMswICDAccumulator( RicMswValve* valve, RiaDefines::EclipseUnitSystem unitSystem );
bool accumulateValveParameters( const RimWellPathValve* wellPathValve, double overlapLength, double perforationCompsegsLength ) override;
void applyToSuperValve() override;
private:
RiaWeightedMeanCalculator<double> m_coefficientCalculator;
double m_areaSum;
};
//==================================================================================================
///
//==================================================================================================
class RicMswAICDAccumulator : public RicMswValveAccumulator
{
public:
RicMswAICDAccumulator( RicMswValve* valve, RiaDefines::EclipseUnitSystem unitSystem );
bool accumulateValveParameters( const RimWellPathValve* wellPathValve, double overlapLength, double perforationCompsegsLength ) override;
void applyToSuperValve() override;
double accumulatedLength() const;
private:
bool m_deviceOpen;
std::array<RiaWeightedMeanCalculator<double>, AICD_NUM_PARAMS> m_meanCalculators;
double m_accumulatedLength;
double m_accumulatedFlowScalingFactorDivisor;
};