From ca2dfc6136d7f629843712ae0fbd1fbd68007d3c Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Tue, 15 Sep 2020 14:58:12 +0200 Subject: [PATCH] scaling of the Alq values --- .../EclipseState/Schedule/VFPProdTable.hpp | 3 ++ .../EclipseState/Schedule/VFPProdTable.cpp | 31 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp b/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp index 14e6cf85b..f2976ebcd 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp @@ -205,6 +205,9 @@ private: static void convertGFRToSI(const GFR_TYPE& type, std::vector& values, const UnitSystem& unit_system); + static void convertAlqToSI(const ALQ_TYPE& type, + std::vector& values, + const UnitSystem& unit_system); }; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp index e10e4d384..26b47c5a8 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.cpp @@ -285,7 +285,7 @@ VFPProdTable::VFPProdTable( const DeckKeyword& table, const UnitSystem& deck_uni //Get actual gas fraction values m_alq_data = table.getRecord(5).getItem().getData< double >(); - + convertAlqToSI(m_alq_type, m_alq_data, deck_unit_system); //Finally, read the actual table itself. size_t nt = m_thp_data.size(); size_t nw = m_wfr_data.size(); @@ -525,6 +525,35 @@ void VFPProdTable::convertGFRToSI(const GFR_TYPE& type, } +void VFPProdTable::convertAlqToSI(const ALQ_TYPE& type, + std::vector& values, + const UnitSystem& unit_system) { + double scaling_factor = 1.0; + switch (type) { + case ALQ_IGLR: + scaling_factor = unit_system.parse("GasSurfaceVolume/LiquidSurfaceVolume * Time").getSIScaling(); + break; + case ALQ_TGLR: + scaling_factor = unit_system.parse("GasSurfaceVolume/LiquidSurfaceVolume").getSIScaling(); + break; + case ALQ_GRAT: + scaling_factor = unit_system.parse("GasSurfaceVolume/Time").getSIScaling(); + break; + case ALQ_UNDEF: + break; + case ALQ_PUMP: + case ALQ_COMP: + case ALQ_INVALID: + case ALQ_BEAN: + std::logic_error("scaling of the given ALQ type, not implemented "); + break; + default: + throw std::logic_error("Invalid ALQ type"); + } + scaleValues(values, scaling_factor); +} + + bool VFPProdTable::operator==(const VFPProdTable& data) const { return this->getTableNum() == data.getTableNum() && this->getDatumDepth () == data.getDatumDepth() &&