diff --git a/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp b/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp index c0f212b7d..768fed88d 100644 --- a/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp +++ b/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.hpp @@ -27,6 +27,7 @@ namespace Opm { class EclipseGrid; class Deck; class FieldProps; +class Phases; class TableManager; class FieldPropsManager { @@ -60,7 +61,7 @@ public: // The default constructor should be removed when the FieldPropsManager is mandatory // The default constructed fieldProps object is **NOT** usable FieldPropsManager() = default; - FieldPropsManager(const Deck& deck, const EclipseGrid& grid, const TableManager& tables); + FieldPropsManager(const Deck& deck, const Phases& ph, const EclipseGrid& grid, const TableManager& tables); void reset_actnum(const std::vector& actnum); const std::string& default_region() const; std::vector actnum() const; diff --git a/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp b/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp index df32cab1f..445d24109 100644 --- a/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp +++ b/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.hpp @@ -19,185 +19,226 @@ #ifndef ECLIPSE_SATFUNCPROPERTY_INITIALIZERS_HPP #define ECLIPSE_SATFUNCPROPERTY_INITIALIZERS_HPP -#include #include - +#include namespace Opm { + class Phases; + class TableManager; + namespace satfunc { std::vector SGLEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISGLEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SGUEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISGUEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SWLEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISWLEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SWUEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISWUEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SGCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISGCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SOWCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISOWCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SOGCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISOGCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector SWCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector ISWCREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector PCWEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IPCWEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector PCGEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IPCGEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KRWEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKRWEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KRWREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKRWREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KROEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKROEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KRORWEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKRORWEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KRORGEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKRORGEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KRGEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKRGEndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector KRGREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); std::vector IKRGREndpoint(const TableManager&, + const Phases&, const std::vector&, const std::vector&, const std::vector&); - std::vector init(const std::string& kewyord, const TableManager& tables, const std::vector& cell_depth, const std::vector& num, const std::vector& endnum); + std::vector init(const std::string& kewyord, + const TableManager& tables, + const Phases& phases, + const std::vector& cell_depth, + const std::vector& num, + const std::vector& endnum); } } diff --git a/src/opm/parser/eclipse/EclipseState/EclipseState.cpp b/src/opm/parser/eclipse/EclipseState/EclipseState.cpp index ffa268484..50fdd22c4 100644 --- a/src/opm/parser/eclipse/EclipseState/EclipseState.cpp +++ b/src/opm/parser/eclipse/EclipseState/EclipseState.cpp @@ -73,7 +73,7 @@ bool enable3DPropsTesting() { m_inputNnc( deck ), m_inputEditNnc( deck ), m_inputGrid( deck, nullptr ), - field_props( deck, m_inputGrid, m_tables), + field_props( deck, m_runspec.phases(), m_inputGrid, m_tables), m_simulationConfig( m_eclipseConfig.getInitConfig().restartRequested(), deck, field_props), m_transMult( GridDims(deck), deck, field_props) { diff --git a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp index ff645eecf..459018533 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include "FieldProps.hpp" #include "Operate.hpp" @@ -404,13 +405,14 @@ std::vector extract_cell_depth(const EclipseGrid& grid) { -FieldProps::FieldProps(const Deck& deck, const EclipseGrid& grid, const TableManager& tables_arg) : +FieldProps::FieldProps(const Deck& deck, const Phases& phases, const EclipseGrid& grid, const TableManager& tables_arg) : active_size(grid.getNumActive()), global_size(grid.getCartesianSize()), unit_system(deck.getActiveUnitSystem()), nx(grid.getNX()), ny(grid.getNY()), nz(grid.getNZ()), + m_phases(phases), m_actnum(grid.getACTNUM()), cell_volume(extract_cell_volume(grid)), cell_depth(extract_cell_depth(grid)), @@ -1053,10 +1055,10 @@ void FieldProps::init_satfunc(const std::string& keyword, FieldData& sat const auto& endnum = this->get("ENDNUM"); if (keyword[0] == 'I') { const auto& imbnum = this->get("IMBNUM"); - satfunc.default_update(satfunc::init(keyword, this->tables, this->cell_depth, imbnum, endnum)); + satfunc.default_update(satfunc::init(keyword, this->tables, this->m_phases, this->cell_depth, imbnum, endnum)); } else { const auto& satnum = this->get("SATNUM"); - satfunc.default_update(satfunc::init(keyword, this->tables, this->cell_depth, satnum, endnum)); + satfunc.default_update(satfunc::init(keyword, this->tables, this->m_phases, this->cell_depth, satnum, endnum)); } } diff --git a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp index 116102c9d..c4e9271df 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace Opm { @@ -213,7 +214,7 @@ public: - FieldProps(const Deck& deck, const EclipseGrid& grid, const TableManager& table_arg); + FieldProps(const Deck& deck, const Phases& phases, const EclipseGrid& grid, const TableManager& table_arg); void reset_actnum(const std::vector& actnum); const std::string& default_region() const; @@ -354,6 +355,7 @@ private: const UnitSystem unit_system; std::size_t nx,ny,nz; + Phases m_phases; std::vector m_actnum; std::vector cell_volume; std::vector cell_depth; @@ -367,4 +369,3 @@ private: } #endif - diff --git a/src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp b/src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp index 62d59cd24..90aada40b 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/FieldPropsManager.cpp @@ -20,14 +20,15 @@ #include #include #include +#include #include "FieldProps.hpp" namespace Opm { -FieldPropsManager::FieldPropsManager(const Deck& deck, const EclipseGrid& grid_arg, const TableManager& tables) : - fp(std::make_shared(deck, grid_arg, tables)) +FieldPropsManager::FieldPropsManager(const Deck& deck, const Phases& phases, const EclipseGrid& grid_arg, const TableManager& tables) : + fp(std::make_shared(deck, phases, grid_arg, tables)) {} void FieldPropsManager::reset_actnum(const std::vector& actnum) { diff --git a/src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp b/src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp index 2d9205b55..f188960b8 100644 --- a/src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp +++ b/src/opm/parser/eclipse/EclipseState/Grid/SatfuncPropertyInitializers.cpp @@ -14,6 +14,7 @@ OPM. If not, see . */ +#include #include #include @@ -23,9 +24,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -47,31 +50,38 @@ namespace Opm { */ enum class SatfuncFamily { none = 0, I = 1, II = 2 }; - static SatfuncFamily getSaturationFunctionFamily( const TableManager& tm ) { - const TableContainer& swofTables = tm.getSwofTables(); - const TableContainer& sgofTables = tm.getSgofTables(); - const TableContainer& slgofTables = tm.getSlgofTables(); - const TableContainer& sof3Tables = tm.getSof3Tables(); - const TableContainer& swfnTables = tm.getSwfnTables(); - const TableContainer& sgfnTables = tm.getSgfnTables(); + static SatfuncFamily + getSaturationFunctionFamily(const TableManager& tm, + const Phases& ph) + { + const auto wat = ph.active(::Opm::Phase::WATER); + const auto oil = ph.active(::Opm::Phase::OIL); + const auto gas = ph.active(::Opm::Phase::GAS); + const auto threeP = gas && oil && wat; + const auto family1 = // SGOF/SLGOF and/or SWOF + (gas && (tm.hasTables("SGOF") || tm.hasTables("SLGOF"))) || + (wat && tm.hasTables("SWOF")); - bool family1 = !sgofTables.empty() || !swofTables.empty() || !slgofTables.empty(); - bool family2 = !swfnTables.empty() || !sgfnTables.empty() || !sof3Tables.empty(); + const auto family2 = // SGFN, SOF{2,3}, SWFN + (gas && tm.hasTables("SGFN")) || + (oil && ((threeP && tm.hasTables("SOF3")) || + tm.hasTables("SOF2"))) || + (wat && tm.hasTables("SWFN")); - if (!sgofTables.empty() && !slgofTables.empty()) { - throw std::invalid_argument("Both, the SGOF and SLGOF have been specified but they are mutually exclusive!"); + if (gas && tm.hasTables("SGOF") && tm.hasTables("SLGOF")) { + throw std::invalid_argument("Both SGOF and SLGOF have been specified but these tables are mutually exclusive!"); } if (family1 && family2) { - throw std::invalid_argument("Saturation families should not be mixed \n" - "Use either SGOF (or SLGOF) and SWOF or SGFN, SWFN and SOF3"); + throw std::invalid_argument("Saturation families should not be mixed\n" + "Use either SGOF (or SLGOF) and/or SWOF or SGFN/SWFN and SOF2/SOF3"); } if (!family1 && !family2) { throw std::invalid_argument("Saturations function must be specified using either " - "family 1 or family 2 keywords \n" - "Use either SGOF (or SLGOF) and SWOF or SGFN, SWFN and SOF3" ); + "family 1 or family 2 keywords\n" + "Use either SGOF (or SLGOF) and/or SWOF or SGFN/SWFN and SOF2/SOF3"); } if( family1 ) return SatfuncFamily::I; @@ -81,8 +91,15 @@ namespace Opm { enum class limit { min, max }; - static std::vector< double > findMinWaterSaturation( const TableManager& tm ) { + static std::vector< double > + findMinWaterSaturation(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); const auto& swfnTables = tm.getSwfnTables(); @@ -94,7 +111,7 @@ namespace Opm { return swfnTables.getTable< SwfnTable >( i ).getSwColumn().front(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: return map( famII, fun::iota( num_tables ) ); default: @@ -102,8 +119,15 @@ namespace Opm { } } - static std::vector< double > findMaxWaterSaturation( const TableManager& tm ) { + static std::vector< double > + findMaxWaterSaturation(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); const auto& swfnTables = tm.getSwfnTables(); @@ -115,7 +139,7 @@ namespace Opm { return swfnTables.getTable< SwfnTable >( i ).getSwColumn().back(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: return map( famII, fun::iota( num_tables ) ); default: @@ -123,8 +147,15 @@ namespace Opm { } } - static std::vector< double > findMinGasSaturation( const TableManager& tm ) { + static std::vector< double > + findMinGasSaturation(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); const auto& sgfnTables = tm.getSgfnTables(); @@ -141,10 +172,8 @@ namespace Opm { return sgfnTables.getTable< SgfnTable >( i ).getSgColumn().front(); }; - - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: - if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -158,13 +187,18 @@ namespace Opm { default: throw std::domain_error("No valid saturation keyword family specified"); - } - } - static std::vector< double > findMaxGasSaturation( const TableManager& tm ) { + static std::vector< double > + findMaxGasSaturation(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); const auto& sgfnTables = tm.getSgfnTables(); @@ -181,8 +215,7 @@ namespace Opm { return sgfnTables.getTable< SgfnTable >( i ).getSgColumn().back(); }; - - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -230,9 +263,15 @@ namespace Opm { return table.getSwColumn()[ index - 1 ]; } - static std::vector< double > findCriticalWater( const TableManager& tm ) { - + static std::vector< double > + findCriticalWater(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); const auto& swfnTables = tm.getSwfnTables(); @@ -244,7 +283,7 @@ namespace Opm { return critical_water( swfnTables.getTable< SwfnTable >( i ) ); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: return fun::map( famII, fun::iota( num_tables ) ); default: throw std::domain_error("No valid saturation keyword family specified"); @@ -273,9 +312,15 @@ namespace Opm { return slgofTable.getSlColumn()[ index - 1 ]; } - static std::vector< double > findCriticalGas( const TableManager& tm ) { - + static std::vector< double > + findCriticalGas(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgfnTables = tm.getSgfnTables(); const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); @@ -292,7 +337,7 @@ namespace Opm { return critical_gas( sgfnTables.getTable< SgfnTable >( i ) ); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -324,6 +369,16 @@ namespace Opm { return 1 - swofTable.getSwColumn()[ index + 1 ]; } + static inline double critical_oil( const Sof2Table& sof2Table ) { + const auto& col = sof2Table.getKroColumn(); + const auto critical = std::upper_bound( col.begin(), col.end(), 0.0 ); + const auto index = std::distance( col.begin(), critical ); + + if( index == 0 || critical == col.end() ) return 0.0; + + return sof2Table.getSoColumn()[ index - 1 ]; + } + static inline double critical_oil( const Sof3Table& sof3Table, const TableColumn& col ) { const auto critical = std::upper_bound( col.begin(), col.end(), 0.0 ); const auto index = std::distance( col.begin(), critical ); @@ -333,23 +388,40 @@ namespace Opm { return sof3Table.getSoColumn()[ index - 1 ]; } - static std::vector< double > findCriticalOilWater( const TableManager& tm ) { + static std::vector< double > + findCriticalOilWater(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::OIL) || + ! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); - const auto& sof3Tables= tm.getSof3Tables(); + const auto& sof2Tables = tm.getSof2Tables(); + const auto& sof3Tables = tm.getSof3Tables(); const auto famI = [&swofTables]( int i ) { return critical_oil_water( swofTables.getTable< SwofTable >( i ) ); }; - const auto famII = [&sof3Tables]( int i ) { + const auto famII_2p = [&sof2Tables]( int i ) { + return critical_oil( sof2Tables.getTable< Sof2Table >( i ) ); + }; + + const auto famII_3p = [&sof3Tables]( int i ) { const auto& tb = sof3Tables.getTable< Sof3Table >( i ); return critical_oil( tb, tb.getKrowColumn() ); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); - case SatfuncFamily::II: return fun::map( famII, fun::iota( num_tables ) ); + case SatfuncFamily::II: + return ph.active(::Opm::Phase::GAS) + ? fun::map( famII_3p, fun::iota( num_tables ) ) + : fun::map( famII_2p, fun::iota( num_tables ) ); + default: throw std::domain_error("No valid saturation keyword family specified"); } } @@ -379,12 +451,19 @@ namespace Opm { return sgofTable.getSlColumn()[ index ]; } - - static std::vector< double > findCriticalOilGas( const TableManager& tm ) { - + static std::vector< double > + findCriticalOilGas(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::OIL) || + ! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); + const auto& sof2Tables = tm.getSof2Tables(); const auto& sof3Tables = tm.getSof3Tables(); const auto famI_sgof = [&sgofTables]( int i ) { @@ -395,12 +474,16 @@ namespace Opm { return critical_oil_gas( slgofTables.getTable< SlgofTable >( i ) ); }; - const auto famII = [&sof3Tables]( int i ) { + const auto famII_2p = [&sof2Tables]( int i ) { + return critical_oil( sof2Tables.getTable< Sof2Table >( i ) ); + }; + + const auto famII_3p = [&sof3Tables]( int i ) { const auto& tb = sof3Tables.getTable< Sof3Table >( i ); return critical_oil( tb, tb.getKrogColumn() ); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -411,15 +494,24 @@ namespace Opm { return fun::map( famI_slgof, fun::iota( num_tables ) ); case SatfuncFamily::II: - return fun::map( famII, fun::iota( num_tables ) ); + return ph.active(::Opm::Phase::WATER) + ? fun::map( famII_3p, fun::iota( num_tables ) ) + : fun::map( famII_2p, fun::iota( num_tables ) ); default: throw std::domain_error("No valid saturation keyword family specified"); } } - static std::vector< double > findMaxKrg( const TableManager& tm ) { + static std::vector< double > + findMaxKrg(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); const auto& sgfnTables = tm.getSgfnTables(); @@ -436,7 +528,7 @@ namespace Opm { return sgfnTables.getTable< SgfnTable >( i ).getKrgColumn().back(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -451,8 +543,15 @@ namespace Opm { } } - static std::vector< double > findKrgr( const TableManager& tm ) { + static std::vector< double > + findKrgr(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); const auto& sgfnTables = tm.getSgfnTables(); @@ -469,7 +568,7 @@ namespace Opm { return sgfnTables.getTable< SgfnTable >( i ).getKrgColumn().back(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -484,8 +583,15 @@ namespace Opm { } } - static std::vector< double > findKrwr( const TableManager& tm ) { + static std::vector< double > + findKrwr(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); const auto& swfnTables = tm.getSwfnTables(); @@ -497,7 +603,7 @@ namespace Opm { return swfnTables.getTable< SwfnTable >( i ).getKrwColumn().front(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: @@ -507,9 +613,18 @@ namespace Opm { } } - static std::vector< double > findKrorw( const TableManager& tm ) { + static std::vector< double > + findKrorw(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::OIL) || + ! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); + const auto& sof2Tables = tm.getSof2Tables(); const auto& sof3Tables = tm.getSof3Tables(); const auto& famI = [&swofTables]( int i ) { @@ -523,28 +638,45 @@ namespace Opm { return swofTable.getKrowColumn()[ index - 1 ]; }; - const auto crit_water = findCriticalWater( tm ); - const auto min_gas = findMinGasSaturation( tm ); - const auto& famII = [&sof3Tables,&crit_water,&min_gas]( int i ) { + const auto crit_water = findCriticalWater( tm, ph ); + const auto min_gas = findMinGasSaturation( tm, ph ); + const auto& famII_3p = [&sof3Tables,&crit_water,&min_gas]( int i ) { const double OilSatAtcritialWaterSat = 1.0 - crit_water[ i ] - min_gas[ i ]; return sof3Tables.getTable< Sof3Table >( i ) .evaluate("KROW", OilSatAtcritialWaterSat); }; - switch( getSaturationFunctionFamily( tm ) ) { + const auto famII_2p = [&sof2Tables,&crit_water,&min_gas]( int i ) { + const double OilSatAtcritialWaterSat = 1.0 - crit_water[ i ] - min_gas[ i ]; + return sof2Tables.getTable< Sof2Table >( i ) + .evaluate("KRO", OilSatAtcritialWaterSat); + }; + + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: - return fun::map( famII, fun::iota( num_tables ) ); + return ph.active(::Opm::Phase::GAS) + ? fun::map( famII_3p, fun::iota( num_tables ) ) + : fun::map( famII_2p, fun::iota( num_tables ) ); default: throw std::domain_error("No valid saturation keyword family specified"); } } - static std::vector< double > findKrorg( const TableManager& tm ) { + static std::vector< double > + findKrorg(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::OIL) || + ! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); + const auto& sof2Tables = tm.getSof2Tables(); const auto& sof3Tables = tm.getSof3Tables(); const auto& famI_sgof = [&sgofTables]( int i ) { @@ -573,15 +705,21 @@ namespace Opm { return slgofTable.getKrogColumn()[ index ]; }; - const auto crit_gas = findCriticalGas( tm ); - const auto min_water = findMinWaterSaturation( tm ); - const auto& famII = [&sof3Tables,&crit_gas,&min_water]( int i ) { + const auto crit_gas = findCriticalGas( tm, ph ); + const auto min_water = findMinWaterSaturation( tm, ph ); + const auto& famII_3p = [&sof3Tables,&crit_gas,&min_water]( int i ) { const double OilSatAtcritialGasSat = 1.0 - crit_gas[ i ] - min_water[ i ]; return sof3Tables.getTable< Sof3Table >( i ) .evaluate("KROG", OilSatAtcritialGasSat); }; - switch( getSaturationFunctionFamily( tm ) ) { + const auto famII_2p = [&sof2Tables,&crit_gas,&min_water]( int i ) { + const double OilSatAtcritialGasSat = 1.0 - crit_gas[ i ] - min_water[ i ]; + return sof2Tables.getTable< Sof2Table >( i ) + .evaluate("KRO", OilSatAtcritialGasSat); + }; + + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -590,7 +728,9 @@ namespace Opm { else return fun::map( famI_slgof, fun::iota( num_tables ) ); case SatfuncFamily::II: - return fun::map( famII, fun::iota( num_tables ) ); + return ph.active(::Opm::Phase::WATER) + ? fun::map( famII_3p, fun::iota( num_tables ) ) + : fun::map( famII_2p, fun::iota( num_tables ) ); default: throw std::domain_error("No valid saturation keyword family specified"); } @@ -605,8 +745,16 @@ namespace Opm { * is not taken into account which means that some twophase quantity must be * scaled. */ - static std::vector< double > findMaxPcog( const TableManager& tm ) { + static std::vector< double > + findMaxPcog(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::OIL) || + ! ph.active(::Opm::Phase::GAS)) + return std::vector(num_tables, 0.0); + const auto& sgofTables = tm.getSgofTables(); const auto& slgofTables = tm.getSlgofTables(); const auto& sgfnTables = tm.getSgfnTables(); @@ -623,7 +771,7 @@ namespace Opm { return sgfnTables.getTable< SgfnTable >( i ).getPcogColumn().back(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: if( sgofTables.empty() && slgofTables.empty() ) throw std::runtime_error( "Saturation keyword family I requires either sgof or slgof non-empty" ); @@ -638,8 +786,16 @@ namespace Opm { } } - static std::vector< double > findMaxPcow( const TableManager& tm ) { + static std::vector< double > + findMaxPcow(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::OIL) || + ! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); const auto& swfnTables = tm.getSwfnTables(); @@ -651,7 +807,7 @@ namespace Opm { return swfnTables.getTable< SwfnTable >( i ).getPcowColumn().front(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: @@ -661,31 +817,59 @@ namespace Opm { } } - static std::vector< double > findMaxKro( const TableManager& tm ) { + static std::vector< double > + findMaxKro(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); - const auto& swofTables = tm.getSwofTables(); + + if (! ph.active(::Opm::Phase::OIL)) + return std::vector(num_tables, 0.0); + + const auto wat = ph.active(::Opm::Phase::WATER); + + const auto& other_f1 = wat ? tm.getSwofTables() : tm.getSgofTables(); + const auto& sof2Tables = tm.getSof2Tables(); const auto& sof3Tables = tm.getSof3Tables(); - const auto& famI = [&swofTables]( int i ) { - return swofTables.getTable< SwofTable >( i ).getKrowColumn().front(); + const auto& famI = [&other_f1,wat]( int i ) { + // In O/W/G runs this relies on Krog(Sg=0) == Krow(Sw=Swco), + // meaning that the first entry in the KRO column--in each + // saturation region--is equal in keywords SGOF and SWOF. + return wat + ? other_f1.getTable< SwofTable >( i ).getKrowColumn().front() + : other_f1.getTable< SgofTable >( i ).getKrogColumn().front(); }; - const auto& famII = [&sof3Tables]( int i ) { + const auto& famII_2p = [&sof2Tables]( int i ) { + return sof2Tables.getTable< Sof2Table >( i ).getKroColumn().back(); + }; + + const auto& famII_3p = [&sof3Tables]( int i ) { return sof3Tables.getTable< Sof3Table >( i ).getKrowColumn().back(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: - return fun::map( famII, fun::iota( num_tables ) ); + return ph.active(::Opm::Phase::GAS) && ph.active(::Opm::Phase::WATER) + ? fun::map( famII_3p, fun::iota( num_tables ) ) + : fun::map( famII_2p, fun::iota( num_tables ) ); default: throw std::domain_error("No valid saturation keyword family specified"); } } - static std::vector< double > findMaxKrw( const TableManager& tm ) { + static std::vector< double > + findMaxKrw(const TableManager& tm, + const Phases& ph) + { const auto num_tables = tm.getTabdims().getNumSatTables(); + + if (! ph.active(::Opm::Phase::WATER)) + return std::vector(num_tables, 0.0); + const auto& swofTables = tm.getSwofTables(); const auto& swfnTables = tm.getSwfnTables(); @@ -697,7 +881,7 @@ namespace Opm { return swfnTables.getTable< SwfnTable >( i ).getKrwColumn().back(); }; - switch( getSaturationFunctionFamily( tm ) ) { + switch( getSaturationFunctionFamily( tm, ph ) ) { case SatfuncFamily::I: return fun::map( famI, fun::iota( num_tables ) ); case SatfuncFamily::II: @@ -755,7 +939,7 @@ namespace Opm { int satTableIdx = satnum_data[cellIdx] - 1; int endNum = endnum_data[cellIdx] - 1; - if (actnum && (actnum->operator[](cellIdx) == 0)) { + if (actnum && ((*actnum)[cellIdx] == 0)) { // Pick from appropriate saturation region if defined // in this cell, else use region 1 (satTableIdx == 0). values[cellIdx] = (satTableIdx >= 0) @@ -809,7 +993,7 @@ namespace Opm { int imbTableIdx = imbnum_data[ cellIdx ] - 1; int endNum = endnum_data[ cellIdx ] - 1; - if (actnum && (actnum->operator[](cellIdx) == 0)) { + if (actnum && ((*actnum)[cellIdx] == 0)) { // Pick from appropriate saturation region if defined // in this cell, else use region 1 (imbTableIdx == 0). values[cellIdx] = (imbTableIdx >= 0) @@ -839,357 +1023,391 @@ namespace Opm { } - namespace satfunc { std::vector< double > SGLEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto min_gas = findMinGasSaturation( tableManager ); - return satnumApply( cell_depth.size(), "SGCO", min_gas, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto min_gas = findMinGasSaturation( tableManager, phases ); + return satnumApply( cell_depth.size(), "SGCO", min_gas, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISGLEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto min_gas = findMinGasSaturation( tableManager ); - return imbnumApply( cell_depth.size(), "SGCO", min_gas, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto min_gas = findMinGasSaturation( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SGCO", min_gas, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > SGUEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto max_gas = findMaxGasSaturation( tableManager ); - return satnumApply( cell_depth.size(), "SGMAX", max_gas, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto max_gas = findMaxGasSaturation( tableManager, phases ); + return satnumApply( cell_depth.size(), "SGMAX", max_gas, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISGUEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto max_gas = findMaxGasSaturation( tableManager ); - return imbnumApply( cell_depth.size(), "SGMAX", max_gas, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto max_gas = findMaxGasSaturation( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SGMAX", max_gas, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > SWLEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto min_water = findMinWaterSaturation( tableManager ); - return satnumApply( cell_depth.size(), "SWCO", min_water, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto min_water = findMinWaterSaturation( tableManager, phases ); + return satnumApply( cell_depth.size(), "SWCO", min_water, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISWLEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto min_water = findMinWaterSaturation( tableManager ); - return imbnumApply( cell_depth.size(), "SWCO", min_water, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto min_water = findMinWaterSaturation( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SWCO", min_water, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > SWUEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto max_water = findMaxWaterSaturation( tableManager ); - return satnumApply( cell_depth.size(), "SWMAX", max_water, tableManager, cell_depth, nullptr, - satnum, endnum, true ); + const auto max_water = findMaxWaterSaturation( tableManager, phases ); + return satnumApply( cell_depth.size(), "SWMAX", max_water, tableManager, + cell_depth, nullptr, satnum, endnum, true ); } std::vector< double > ISWUEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto max_water = findMaxWaterSaturation( tableManager ); - return imbnumApply( cell_depth.size(), "SWMAX", max_water, tableManager, cell_depth, nullptr, - imbnum, endnum, true); + const auto max_water = findMaxWaterSaturation( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SWMAX", max_water, tableManager, + cell_depth, nullptr, imbnum, endnum, true); } std::vector< double > SGCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto crit_gas = findCriticalGas( tableManager ); - return satnumApply( cell_depth.size(), "SGCRIT", crit_gas, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto crit_gas = findCriticalGas( tableManager, phases ); + return satnumApply( cell_depth.size(), "SGCRIT", crit_gas, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISGCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto crit_gas = findCriticalGas( tableManager ); - return imbnumApply( cell_depth.size(), "SGCRIT", crit_gas, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto crit_gas = findCriticalGas( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SGCRIT", crit_gas, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > SOWCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto oil_water = findCriticalOilWater( tableManager ); - return satnumApply( cell_depth.size(), "SOWCRIT", oil_water, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto oil_water = findCriticalOilWater( tableManager, phases ); + return satnumApply( cell_depth.size(), "SOWCRIT", oil_water, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISOWCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto oil_water = findCriticalOilWater( tableManager ); - return imbnumApply( cell_depth.size(), "SOWCRIT", oil_water, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto oil_water = findCriticalOilWater( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SOWCRIT", oil_water, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > SOGCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto crit_oil_gas = findCriticalOilGas( tableManager ); - return satnumApply( cell_depth.size(), "SOGCRIT", crit_oil_gas, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto crit_oil_gas = findCriticalOilGas( tableManager, phases ); + return satnumApply( cell_depth.size(), "SOGCRIT", crit_oil_gas, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISOGCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto crit_oil_gas = findCriticalOilGas( tableManager ); - return imbnumApply( cell_depth.size(), "SOGCRIT", crit_oil_gas, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto crit_oil_gas = findCriticalOilGas( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SOGCRIT", crit_oil_gas, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > SWCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto crit_water = findCriticalWater( tableManager ); - return satnumApply( cell_depth.size(), "SWCRIT", crit_water, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto crit_water = findCriticalWater( tableManager, phases ); + return satnumApply( cell_depth.size(), "SWCRIT", crit_water, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > ISWCREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto crit_water = findCriticalWater( tableManager ); - return imbnumApply( cell_depth.size(), "SWCRIT", crit_water, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto crit_water = findCriticalWater( tableManager, phases ); + return imbnumApply( cell_depth.size(), "SWCRIT", crit_water, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > PCWEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto max_pcow = findMaxPcow( tableManager ); - return satnumApply( cell_depth.size(), "PCW", max_pcow, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto max_pcow = findMaxPcow( tableManager, phases ); + return satnumApply( cell_depth.size(), "PCW", max_pcow, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IPCWEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto max_pcow = findMaxPcow( tableManager ); - return imbnumApply( cell_depth.size(), "IPCW", max_pcow, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto max_pcow = findMaxPcow( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IPCW", max_pcow, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > PCGEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& imbnum) { - const auto max_pcog = findMaxPcog( tableManager ); - return satnumApply( cell_depth.size(), "PCG", max_pcog, tableManager, cell_depth, nullptr, - satnum, imbnum, false ); + const auto max_pcog = findMaxPcog( tableManager, phases ); + return satnumApply( cell_depth.size(), "PCG", max_pcog, tableManager, + cell_depth, nullptr, satnum, imbnum, false ); } std::vector< double > IPCGEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto max_pcog = findMaxPcog( tableManager ); - return imbnumApply( cell_depth.size(), "IPCG", max_pcog, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto max_pcog = findMaxPcog( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IPCG", max_pcog, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KRWEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto max_krw = findMaxKrw( tableManager ); - return satnumApply( cell_depth.size(), "KRW", max_krw, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto max_krw = findMaxKrw( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRW", max_krw, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKRWEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto krwr = findKrwr( tableManager ); - return imbnumApply( cell_depth.size(), "IKRW", krwr, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto krwr = findKrwr( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IKRW", krwr, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KRWREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto krwr = findKrwr( tableManager ); - return satnumApply( cell_depth.size(), "KRWR", krwr, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto krwr = findKrwr( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRWR", krwr, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKRWREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto krwr = findKrwr( tableManager ); - return imbnumApply( cell_depth.size(), "IKRWR", krwr, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto krwr = findKrwr( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IKRWR", krwr, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KROEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto max_kro = findMaxKro( tableManager ); - return satnumApply( cell_depth.size(), "KRO", max_kro, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto max_kro = findMaxKro( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRO", max_kro, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKROEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto max_kro = findMaxKro( tableManager ); - return imbnumApply( cell_depth.size(), "IKRO", max_kro, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto max_kro = findMaxKro( tableManager,phases ); + return imbnumApply( cell_depth.size(), "IKRO", max_kro, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KRORWEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto krorw = findKrorw( tableManager ); - return satnumApply( cell_depth.size(), "KRORW", krorw, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto krorw = findKrorw( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRORW", krorw, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKRORWEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto krorw = findKrorw( tableManager ); - return imbnumApply( cell_depth.size(), "IKRORW", krorw, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto krorw = findKrorw( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IKRORW", krorw, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KRORGEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto krorg = findKrorg( tableManager ); - return satnumApply( cell_depth.size(), "KRORG", krorg, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto krorg = findKrorg( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRORG", krorg, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKRORGEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto krorg = findKrorg( tableManager ); - return imbnumApply( cell_depth.size(), "IKRORG", krorg, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto krorg = findKrorg( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IKRORG", krorg, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KRGEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto max_krg = findMaxKrg( tableManager ); - return satnumApply( cell_depth.size(), "KRG", max_krg, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto max_krg = findMaxKrg( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRG", max_krg, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKRGEndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto max_krg = findMaxKrg( tableManager ); - return imbnumApply( cell_depth.size(), "IKRG", max_krg, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto max_krg = findMaxKrg( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IKRG", max_krg, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector< double > KRGREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& satnum, const std::vector& endnum) { - const auto krgr = findKrgr( tableManager ); - return satnumApply( cell_depth.size(), "KRGR", krgr, tableManager, cell_depth, nullptr, - satnum, endnum, false ); + const auto krgr = findKrgr( tableManager, phases ); + return satnumApply( cell_depth.size(), "KRGR", krgr, tableManager, + cell_depth, nullptr, satnum, endnum, false ); } std::vector< double > IKRGREndpoint( const TableManager & tableManager, + const Phases& phases, const std::vector& cell_depth, const std::vector& imbnum, const std::vector& endnum) { - const auto krgr = findKrgr( tableManager ); - return imbnumApply( cell_depth.size(), "IKRGR", krgr, tableManager, cell_depth, nullptr, - imbnum, endnum, false ); + const auto krgr = findKrgr( tableManager, phases ); + return imbnumApply( cell_depth.size(), "IKRGR", krgr, tableManager, + cell_depth, nullptr, imbnum, endnum, false ); } std::vector init(const std::string& keyword, const TableManager& tables, + const Phases& phases, const std::vector& cell_depth, const std::vector& num, - const std::vector& endnum) { - + const std::vector& endnum) + { using func_type = decltype(&IKRGEndpoint); #define dirfunc(base, func) {base, func}, \ @@ -1197,46 +1415,43 @@ namespace satfunc { {base "Y", func}, {base "Y-", func}, \ {base "Z", func}, {base "Z-", func} - static std::map func_table = {{"SGLPC", SGLEndpoint}, - {"ISGLPC", ISGLEndpoint}, - {"SWLPC", SWLEndpoint}, - {"ISWLPC", ISWLEndpoint}, - dirfunc("SGL", SGLEndpoint), - dirfunc("ISGL", ISGLEndpoint), - dirfunc("SGU", SGUEndpoint), - dirfunc("ISGU", ISGUEndpoint), - dirfunc("SWL", SWLEndpoint), - dirfunc("ISWL", ISWLEndpoint), - dirfunc("SWU", SWUEndpoint), - dirfunc("ISWU", ISWUEndpoint), - dirfunc("SGCR", SGCREndpoint), - dirfunc("ISGCR", ISGCREndpoint), - dirfunc("SOWCR", SOWCREndpoint), - dirfunc("ISOWCR", ISOWCREndpoint), - dirfunc("SOGCR", SOGCREndpoint), - dirfunc("ISOGCR", ISOGCREndpoint), - dirfunc("SWCR", SWCREndpoint), - dirfunc("ISWCR", ISWCREndpoint), - dirfunc("PCW", PCWEndpoint), - dirfunc("IPCW", IPCWEndpoint), - dirfunc("PCG", PCGEndpoint), - dirfunc("IPCG", IPCGEndpoint), - dirfunc("KRW", KRWEndpoint), - dirfunc("IKRW", IKRWEndpoint), - dirfunc("KRWR", KRWREndpoint), - dirfunc("IKRWR", IKRWREndpoint), - dirfunc("KRO", KROEndpoint), - dirfunc("IKRO", IKROEndpoint), - dirfunc("KRORW", KRORWEndpoint), - dirfunc("IKRORW", IKRORWEndpoint), - dirfunc("KRORG", KRORGEndpoint), - dirfunc("IKRORG", IKRORGEndpoint), - dirfunc("KRG", KRGEndpoint), - dirfunc("IKRG", IKRGEndpoint), - dirfunc("KRGR", KRGREndpoint), - dirfunc("IKRGR", IKRGREndpoint)}; - const auto& func = func_table[keyword]; - return func(tables, cell_depth, num, endnum); + static const std::map func_table = { + // Drainage Imbibition + {"SGLPC", SGLEndpoint}, {"ISGLPC", ISGLEndpoint}, + {"SWLPC", SWLEndpoint}, {"ISWLPC", ISWLEndpoint}, + + dirfunc("SGL", SGLEndpoint), dirfunc("ISGL", ISGLEndpoint), + dirfunc("SGU", SGUEndpoint), dirfunc("ISGU", ISGUEndpoint), + dirfunc("SWL", SWLEndpoint), dirfunc("ISWL", ISWLEndpoint), + dirfunc("SWU", SWUEndpoint), dirfunc("ISWU", ISWUEndpoint), + + dirfunc("SGCR", SGCREndpoint), dirfunc("ISGCR", ISGCREndpoint), + dirfunc("SOGCR", SOGCREndpoint), dirfunc("ISOGCR", ISOGCREndpoint), + dirfunc("SOWCR", SOWCREndpoint), dirfunc("ISOWCR", ISOWCREndpoint), + dirfunc("SWCR", SWCREndpoint), dirfunc("ISWCR", ISWCREndpoint), + + dirfunc("PCG", PCGEndpoint), dirfunc("IPCG", IPCGEndpoint), + dirfunc("PCW", PCWEndpoint), dirfunc("IPCW", IPCWEndpoint), + + dirfunc("KRG", KRGEndpoint), dirfunc("IKRG", IKRGEndpoint), + dirfunc("KRGR", KRGREndpoint), dirfunc("IKRGR", IKRGREndpoint), + dirfunc("KRO", KROEndpoint), dirfunc("IKRO", IKROEndpoint), + dirfunc("KRORW", KRORWEndpoint), dirfunc("IKRORW", IKRORWEndpoint), + dirfunc("KRORG", KRORGEndpoint), dirfunc("IKRORG", IKRORGEndpoint), + dirfunc("KRW", KRWEndpoint), dirfunc("IKRW", IKRWEndpoint), + dirfunc("KRWR", KRWREndpoint), dirfunc("IKRWR", IKRWREndpoint), + }; + +#undef dirfunc + + auto func = func_table.find(keyword); + if (func == func_table.end()) + throw std::invalid_argument { + "Unsupported saturation function scaling '" + + keyword + '\'' + }; + + return func->second(tables, phases, cell_depth, num, endnum); } -} -} +} // namespace satfunc +} // namespace Opm diff --git a/tests/parser/ACTIONX.cpp b/tests/parser/ACTIONX.cpp index 4cd10c715..559350b78 100644 --- a/tests/parser/ACTIONX.cpp +++ b/tests/parser/ACTIONX.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -127,7 +128,7 @@ TSTEP auto deck3 = parser.parseString(WITH_GRID); EclipseGrid grid1(10,10,10); TableManager table ( deck1 ); - FieldPropsManager fp( deck1 , grid1, table); + FieldPropsManager fp( deck1, Phases{true, true, true}, grid1, table); Runspec runspec (deck1); // The ACTIONX keyword has no matching 'ENDACTIO' -> exception @@ -221,7 +222,7 @@ TSTEP auto deck = parser.parseString(deck_string); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec(deck); return Schedule(deck, grid1, fp, runspec); @@ -691,7 +692,7 @@ TSTEP auto deck = parser.parseString(deck_string); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule sched(deck, grid1, fp, runspec); diff --git a/tests/parser/ConnectionTests.cpp b/tests/parser/ConnectionTests.cpp index d3e6e8cfd..9600e1a0c 100644 --- a/tests/parser/ConnectionTests.cpp +++ b/tests/parser/ConnectionTests.cpp @@ -38,6 +38,7 @@ #include #include +#include #include namespace Opm { @@ -152,7 +153,7 @@ Opm::WellConnections loadCOMPDAT(const std::string& compdat_keyword) { Opm::TableManager tables; Opm::Parser parser; const auto deck = parser.parseString(compdat_keyword); - Opm::FieldPropsManager field_props(deck, grid, Opm::TableManager()); + Opm::FieldPropsManager field_props(deck, Opm::Phases{true, true, true}, grid, Opm::TableManager()); const auto& keyword = deck.getKeyword("COMPDAT", 0); Opm::WellConnections connections(10,10); for (const auto& rec : keyword) diff --git a/tests/parser/FieldPropsTests.cpp b/tests/parser/FieldPropsTests.cpp index 5150cbd26..71c5f68d9 100644 --- a/tests/parser/FieldPropsTests.cpp +++ b/tests/parser/FieldPropsTests.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include "src/opm/parser/eclipse/EclipseState/Grid/FieldProps.hpp" @@ -46,7 +47,7 @@ using namespace Opm; BOOST_AUTO_TEST_CASE(CreateFieldProps) { EclipseGrid grid(10,10,10); Deck deck; - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); BOOST_CHECK(!fpm.try_get("PORO")); BOOST_CHECK(!fpm.try_get("PORO")); BOOST_CHECK(!fpm.try_get("NO_SUCH_KEYWOWRD")); @@ -90,7 +91,7 @@ PERMX actnum[i] = 0; EclipseGrid grid(EclipseGrid(10,10,10), actnum); Deck deck = Parser{}.parseString(deck_string); - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); BOOST_CHECK(!fpm.has_double("NO-PORO")); BOOST_CHECK(fpm.has_double("PORO")); @@ -136,7 +137,7 @@ COPY EclipseGrid grid(EclipseGrid(10,10,10)); Deck deck = Parser{}.parseString(deck_string); - BOOST_CHECK_THROW( FieldPropsManager(deck, grid, TableManager()), std::out_of_range); + BOOST_CHECK_THROW( FieldPropsManager(deck, Phases{true, true, true}, grid, TableManager()), std::out_of_range); } BOOST_AUTO_TEST_CASE(GRID_RESET) { @@ -150,7 +151,7 @@ SATNUM std::vector actnum1 = {1,1,1,0,0,0,1,1,1}; EclipseGrid grid(3,1,3); grid.resetACTNUM(actnum1); Deck deck = Parser{}.parseString(deck_string); - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); const auto& s1 = fpm.get_int("SATNUM"); BOOST_CHECK_EQUAL(s1.size(), 6); BOOST_CHECK_EQUAL(s1[0], 0); @@ -192,7 +193,7 @@ ADDREG std::vector actnum1 = {1,1,0,0,1,1}; EclipseGrid grid(3,2,1); grid.resetACTNUM(actnum1); Deck deck = Parser{}.parseString(deck_string); - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); const auto& poro = fpm.get_double("PORO"); BOOST_CHECK_EQUAL(poro.size(), 4); BOOST_CHECK_EQUAL(poro[0], 0.10); @@ -230,7 +231,7 @@ NTG EclipseGrid grid(EclipseGrid(10,10, 2)); Deck deck = Parser{}.parseString(deck_string); - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); const auto& ntg = fpm.get_double("NTG"); const auto& defaulted = fpm.defaulted("NTG"); @@ -300,7 +301,7 @@ ENDBOX EclipseGrid grid(10,10, 5); Deck deck = Parser{}.parseString(deck_string); - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); const auto& poro = fpm.get_double("PORO"); const auto& ntg = fpm.get_double("NTG"); const auto& multpv = fpm.get_double("MULTPV"); @@ -477,7 +478,7 @@ BOOST_AUTO_TEST_CASE(LATE_GET_SATFUNC) { auto deck = parser.parseString(deckString); Opm::TableManager tm(deck); Opm::EclipseGrid eg(deck); - Opm::FieldPropsManager fp(deck, eg, tm); + Opm::FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); const auto& fp_swu = fp.get_global_double("SWU"); BOOST_CHECK_EQUAL(fp_swu[1 + 0 * 3*3], 0.93); @@ -504,7 +505,7 @@ PORO Deck deck = Parser{}.parseString(deck_string); std::vector actnum(200, 1); actnum[0] = 0; grid.resetACTNUM(actnum); - FieldPropsManager fpm(deck, grid, TableManager()); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, TableManager()); BOOST_CHECK(!fpm.has_double("NTG")); const auto& ntg = fpm.get_copy("NTG"); @@ -548,7 +549,7 @@ RTEMPVD EclipseGrid grid(1,1, 2); Deck deck = Parser{}.parseString(deck_string); Opm::TableManager tm(deck); - FieldPropsManager fpm(deck, grid, tm); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, tm); const auto& tempi = fpm.get_double("TEMPI"); double celcius_offset = 273.15; @@ -578,7 +579,7 @@ MULTZ Opm::Deck deck = parser.parseString(deck_string); Opm::EclipseGrid grid(5,5,5); Opm::TableManager tm(deck); - FieldPropsManager fpm(deck, grid, tm); + FieldPropsManager fpm(deck, Phases{true, true, true}, grid, tm); const auto& multz = fpm.get_double("MULTZ"); const auto& multx = fpm.get_double("MULTX"); diff --git a/tests/parser/GeomodifierTests.cpp b/tests/parser/GeomodifierTests.cpp index 4147e92fd..24e76e705 100644 --- a/tests/parser/GeomodifierTests.cpp +++ b/tests/parser/GeomodifierTests.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include #include @@ -76,7 +78,7 @@ BOOST_AUTO_TEST_CASE( CheckUnsoppertedInSCHEDULE ) { auto deck = parser.parseString( deckString, parseContext, errors); EclipseGrid grid( deck ); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); parseContext.update( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , InputError::IGNORE ); { diff --git a/tests/parser/GroupTests.cpp b/tests/parser/GroupTests.cpp index f12c918a0..a61ad50f9 100644 --- a/tests/parser/GroupTests.cpp +++ b/tests/parser/GroupTests.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -129,7 +130,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithGEFAC) { EclipseGrid grid(10,10,10); TableManager table ( deck ); Runspec runspec (deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Opm::Schedule schedule(deck, grid, fp, runspec); auto group_names = schedule.groupNames("PRODUC"); @@ -181,7 +182,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithWGRUPCONandWCONPROD) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck ); Opm::Schedule schedule(deck, grid, fp, runspec); const auto& currentWell = schedule.getWell("B-37T2", 0); @@ -225,7 +226,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithGRUPNET) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck ); Opm::Schedule schedule(deck, grid, fp, runspec); @@ -283,7 +284,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithGCONPROD) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck ); Opm::Schedule schedule(deck, grid, fp, runspec); SummaryState st(std::chrono::system_clock::now()); @@ -336,7 +337,7 @@ BOOST_AUTO_TEST_CASE(TESTGuideRateLINCOM) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck ); /* The 'COMB' target mode is not supported */ @@ -373,7 +374,7 @@ BOOST_AUTO_TEST_CASE(TESTGuideRate) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck ); Schedule schedule(deck, grid, fp, runspec); @@ -406,7 +407,7 @@ BOOST_AUTO_TEST_CASE(TESTGCONSALE) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck ); Schedule schedule(deck, grid, fp, runspec); diff --git a/tests/parser/MULTREGTScannerTests.cpp b/tests/parser/MULTREGTScannerTests.cpp index 9193f93f5..8a1362786 100644 --- a/tests/parser/MULTREGTScannerTests.cpp +++ b/tests/parser/MULTREGTScannerTests.cpp @@ -35,6 +35,8 @@ #include #include #include +#include +#include #include @@ -107,7 +109,7 @@ BOOST_AUTO_TEST_CASE(InvalidInput) { Opm::EclipseGrid grid( deck ); Opm::TableManager tm(deck); Opm::EclipseGrid eg( deck ); - Opm::FieldPropsManager fp(deck, eg, tm); + Opm::FieldPropsManager fp(deck, Opm::Phases{true, true, true}, eg, tm); // Invalid direction std::vector keywords0; @@ -173,7 +175,7 @@ BOOST_AUTO_TEST_CASE(NotSupported) { Opm::EclipseGrid grid( deck ); Opm::TableManager tm(deck); Opm::EclipseGrid eg( deck ); - Opm::FieldPropsManager fp(deck, eg, tm); + Opm::FieldPropsManager fp(deck, Opm::Phases{true, true, true}, eg, tm); // Not support NOAQUNNC behaviour @@ -234,7 +236,7 @@ BOOST_AUTO_TEST_CASE(DefaultedRegions) { Opm::EclipseGrid grid( deck ); Opm::TableManager tm(deck); Opm::EclipseGrid eg( deck ); - Opm::FieldPropsManager fp(deck, eg, tm); + Opm::FieldPropsManager fp(deck, Opm::Phases{true, true, true}, eg, tm); std::vector keywords0; @@ -294,7 +296,7 @@ BOOST_AUTO_TEST_CASE(MULTREGT_COPY_MULTNUM) { Opm::Deck deck = createCopyMULTNUMDeck(); Opm::TableManager tm(deck); Opm::EclipseGrid eg(deck); - Opm::FieldPropsManager fp(deck, eg, tm); + Opm::FieldPropsManager fp(deck, Opm::Phases{true, true, true}, eg, tm); BOOST_CHECK_NO_THROW(fp.has_int("FLUXNUM")); BOOST_CHECK_NO_THROW(fp.has_int("MULTNUM")); diff --git a/tests/parser/MessageLimitTests.cpp b/tests/parser/MessageLimitTests.cpp index 1b7cdfff2..bc56f3658 100644 --- a/tests/parser/MessageLimitTests.cpp +++ b/tests/parser/MessageLimitTests.cpp @@ -27,6 +27,8 @@ #include #include +#include +#include #include #include #include @@ -78,7 +80,7 @@ BOOST_AUTO_TEST_CASE(MESSAGES) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid, fp, runspec); const MessageLimits limits = schedule.getMessageLimits(); @@ -93,4 +95,3 @@ BOOST_AUTO_TEST_CASE(MESSAGES) { BOOST_CHECK_EQUAL( limits.getCommentPrintLimit( 2 ) , 2 ); BOOST_CHECK_EQUAL( limits.getBugPrintLimit( 2 ) , 77 ); } - diff --git a/tests/parser/MultiRegTests.cpp b/tests/parser/MultiRegTests.cpp index e812ffcb8..7ab8aabca 100644 --- a/tests/parser/MultiRegTests.cpp +++ b/tests/parser/MultiRegTests.cpp @@ -32,7 +32,8 @@ #include #include #include - +#include +#include static Opm::Deck createDeckInvalidArray() { const char* deckData = @@ -231,7 +232,7 @@ BOOST_AUTO_TEST_CASE(Test_OPERATER) { Opm::Deck deck = createValidIntDeck(); Opm::TableManager tm(deck); Opm::EclipseGrid eg(deck); - Opm::FieldPropsManager fp(deck, eg, tm); + Opm::FieldPropsManager fp(deck, Opm::Phases{true, true, true}, eg, tm); const auto& porv = fp.porv(true); const auto& permx = fp.get_global_double("PERMX"); diff --git a/tests/parser/ParseContextTests.cpp b/tests/parser/ParseContextTests.cpp index 87ba06b21..a420309e9 100644 --- a/tests/parser/ParseContextTests.cpp +++ b/tests/parser/ParseContextTests.cpp @@ -39,6 +39,7 @@ #include #include +#include #include using namespace Opm; @@ -332,7 +333,7 @@ BOOST_AUTO_TEST_CASE( CheckUnsupportedInSCHEDULE ) { auto deckUnSupported = parser.parseString( deckStringUnSupported , parseContext, errors ); EclipseGrid grid( deckSupported ); TableManager table ( deckSupported ); - FieldPropsManager fp(deckSupported, grid, table); + FieldPropsManager fp(deckSupported, Phases{true, true, true}, grid, table); Runspec runspec(deckSupported); parseContext.update( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , InputError::IGNORE ); @@ -410,7 +411,7 @@ BOOST_AUTO_TEST_CASE(TestCOMPORD) { EclipseGrid grid( deck ); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); parseContext.update( ParseContext::UNSUPPORTED_COMPORD_TYPE , InputError::IGNORE); @@ -760,7 +761,7 @@ BOOST_AUTO_TEST_CASE( test_invalid_wtemplate_config ) { EclipseGrid grid( deckUnSupported ); TableManager table ( deckUnSupported ); - FieldPropsManager fp( deckUnSupported , grid, table); + FieldPropsManager fp( deckUnSupported, Phases{true, true, true}, grid, table); Runspec runspec( deckUnSupported); BOOST_CHECK_THROW( Schedule( deckUnSupported , grid , fp, runspec , parseContext, errors), std::invalid_argument ); diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index f3e326c50..06a1de18e 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -362,7 +363,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckMissingReturnsDefaults) { deck.addKeyword( DeckKeyword( parser.getKeyword("SCHEDULE" ))); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec ); BOOST_CHECK_EQUAL( schedule.getStartTime() , TimeMap::mkdate(1983, 1 , 1)); @@ -372,7 +373,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrdered) { auto deck = createDeckWithWellsOrdered(); EclipseGrid grid(100,100,100); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); auto well_names = schedule.wellNames(); @@ -401,7 +402,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsOrderedGRUPTREE) { auto deck = createDeckWithWellsOrderedGRUPTREE(); EclipseGrid grid(100,100,100); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -452,7 +453,7 @@ BOOST_AUTO_TEST_CASE(GroupTree2TEST) { auto deck = createDeckWithWellsOrderedGRUPTREE(); EclipseGrid grid(100,100,100); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -482,7 +483,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithStart) { auto deck = createDeck(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -494,7 +495,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithSCHEDULENoThrow) { Deck deck; EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); deck.addKeyword( DeckKeyword( parser.getKeyword("SCHEDULE" ))); Runspec runspec (deck); @@ -505,7 +506,7 @@ BOOST_AUTO_TEST_CASE(EmptyScheduleHasNoWells) { EclipseGrid grid(10,10,10); auto deck = createDeck(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck);; Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK_EQUAL( 0U , schedule.numWells() ); @@ -519,7 +520,7 @@ BOOST_AUTO_TEST_CASE(EmptyScheduleHasFIELDGroup) { EclipseGrid grid(10,10,10); auto deck = createDeck(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck , grid , fp, runspec); @@ -614,7 +615,7 @@ BOOST_AUTO_TEST_CASE(WellsIterator_Empty_EmptyVectorReturned) { EclipseGrid grid(10,10,10); auto deck = createDeck(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck , grid , fp, runspec); @@ -632,7 +633,7 @@ BOOST_AUTO_TEST_CASE(WellsIterator_HasWells_WellsReturned) { EclipseGrid grid(10,10,10); auto deck = createDeckWithWells(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck , grid , fp, runspec); size_t timeStep = 0; @@ -651,7 +652,7 @@ BOOST_AUTO_TEST_CASE(ReturnNumWellsTimestep) { EclipseGrid grid(10,10,10); auto deck = createDeckWithWells(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -665,7 +666,7 @@ BOOST_AUTO_TEST_CASE(TestCrossFlowHandling) { EclipseGrid grid(10,10,10); auto deck = createDeckForTestingCrossFlow(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -738,7 +739,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWellsAndConnectionDataWithWELOPEN) { EclipseGrid grid(10,10,10); auto deck = createDeckWithWellsAndConnectionDataWithWELOPEN(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck ,grid , fp, runspec); { @@ -822,7 +823,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWELOPEN_TryToOpenWellWithShutCompleti EclipseGrid grid(10,10,10); auto deck = parser.parseString(input); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck , grid , fp, runspec); const auto& well2_3 = schedule.getWell("OP_1",3); @@ -882,7 +883,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWELOPEN_CombineShutCompletionsAndAddN EclipseGrid grid(10,10,10); auto deck = parser.parseString(input); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); const auto& well_3 = schedule.getWell("OP_1", 3); @@ -940,7 +941,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWRFT) { EclipseGrid grid(10,10,10); auto deck = parser.parseString(input); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); const auto& rft_config = schedule.rftConfig(); @@ -998,7 +999,7 @@ BOOST_AUTO_TEST_CASE(CreateScheduleDeckWithWRFTPLT) { EclipseGrid grid(10,10,10); auto deck = parser.parseString(input); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); const auto& well = schedule.getWell("OP_1", 4); @@ -1048,7 +1049,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArg) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); Opm::UnitSystem unitSystem = deck.getActiveUnitSystem(); @@ -1088,7 +1089,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArgException) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); BOOST_CHECK_THROW(Schedule(deck, grid , fp, runspec), @@ -1107,7 +1108,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithWeltArgException2) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); BOOST_CHECK_THROW(Schedule(deck, grid , fp, runspec), std::invalid_argument); } @@ -1153,7 +1154,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithWPIMULT) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -1224,7 +1225,7 @@ BOOST_AUTO_TEST_CASE(WELSPECS_WGNAME_SPACE) { auto deck = parser.parseString(input); EclipseGrid grid( deck ); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); ParseContext parseContext; ErrorGuard errors; @@ -1276,7 +1277,7 @@ BOOST_AUTO_TEST_CASE(createDeckModifyMultipleGCONPROD) { auto deck = parser.parseString(input); EclipseGrid grid( deck ); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Opm::Schedule schedule(deck, grid, fp, runspec); Opm::SummaryState st(std::chrono::system_clock::now()); @@ -1325,7 +1326,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithDRSDT) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); size_t currentStep = 1; @@ -1359,7 +1360,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithDRSDTR) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); size_t currentStep = 1; @@ -1406,7 +1407,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithDRSDTthenDRVDT) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK_EQUAL(schedule.hasOilVaporizationProperties(), true); @@ -1447,7 +1448,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithVAPPARS) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); size_t currentStep = 1; @@ -1478,7 +1479,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithOutOilVaporizationProperties) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -1539,7 +1540,7 @@ BOOST_AUTO_TEST_CASE(changeBhpLimitInHistoryModeWithWeltarg) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); SummaryState st(std::chrono::system_clock::now()); const auto& unit_system = deck.getActiveUnitSystem(); @@ -1636,7 +1637,7 @@ BOOST_AUTO_TEST_CASE(changeModeWithWHISTCTL) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -1742,7 +1743,7 @@ BOOST_AUTO_TEST_CASE(fromWCONHISTtoWCONPROD) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -1830,7 +1831,7 @@ BOOST_AUTO_TEST_CASE(WHISTCTL_NEW_WELL) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -1906,7 +1907,7 @@ BOOST_AUTO_TEST_CASE(unsupportedOptionWHISTCTL) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); BOOST_CHECK_THROW(Schedule(deck, grid, fp, runspec), std::invalid_argument); } @@ -1935,7 +1936,7 @@ BOOST_AUTO_TEST_CASE(move_HEAD_I_location) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); BOOST_CHECK_EQUAL(2, schedule.getWell("W1", 1).getHeadI()); @@ -1966,7 +1967,7 @@ BOOST_AUTO_TEST_CASE(change_ref_depth) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); BOOST_CHECK_CLOSE(2873.94, schedule.getWell("W1", 1).getRefDepth(), 1e-5); @@ -2005,7 +2006,7 @@ BOOST_AUTO_TEST_CASE(WTEMP_well_template) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -2051,7 +2052,7 @@ BOOST_AUTO_TEST_CASE(WTEMPINJ_well_template) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -2103,7 +2104,7 @@ BOOST_AUTO_TEST_CASE( COMPDAT_sets_automatic_complnum ) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); const auto& cs1 = schedule.getWell( "W1", 1 ).getConnections( ); @@ -2153,7 +2154,7 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_wells ) { auto deck = Parser().parseString( input); EclipseGrid grid( 10, 10, 10 ); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -2222,7 +2223,7 @@ BOOST_AUTO_TEST_CASE( COMPDAT_multiple_records_same_completion ) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); const auto& cs = schedule.getWell( "W1", 1 ).getConnections(); @@ -2262,7 +2263,7 @@ BOOST_AUTO_TEST_CASE( complump_less_than_1 ) { auto deck = Parser().parseString( input); EclipseGrid grid( 10, 10, 10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); BOOST_CHECK_THROW( Schedule( deck , grid, fp, runspec), std::invalid_argument ); } @@ -2314,7 +2315,7 @@ BOOST_AUTO_TEST_CASE( complump ) { auto deck = Parser().parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -2404,7 +2405,7 @@ BOOST_AUTO_TEST_CASE( COMPLUMP_specific_coordinates ) { auto deck = Parser().parseString( input); EclipseGrid grid( 10, 10, 10 ); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -2874,7 +2875,7 @@ BOOST_AUTO_TEST_CASE(handleWEFAC) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -2919,7 +2920,7 @@ BOOST_AUTO_TEST_CASE(historic_BHP_and_THP) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -2952,7 +2953,7 @@ BOOST_AUTO_TEST_CASE(FilterCompletions2) { std::vector actnum(1000,1); auto deck = createDeckWithWellsAndCompletionData(); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); { @@ -3045,7 +3046,7 @@ VFPINJ \n \ auto deck = parser.parseString(deckData); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); @@ -3172,7 +3173,7 @@ BOOST_AUTO_TEST_CASE(POLYINJ_TEST) { auto deck = parser.parseString(deckData); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); @@ -3232,7 +3233,7 @@ BOOST_AUTO_TEST_CASE(WFOAM_TEST) { auto deck = parser.parseString(deckData); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); @@ -3250,7 +3251,7 @@ BOOST_AUTO_TEST_CASE(WTEST_CONFIG) { auto deck = createDeckWTEST(); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); @@ -3279,7 +3280,7 @@ BOOST_AUTO_TEST_CASE(WELL_STATIC) { auto deck = createDeckWithWells(); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); BOOST_CHECK_THROW( schedule.getWell("NO_SUCH_WELL", 0), std::invalid_argument); @@ -3327,7 +3328,7 @@ BOOST_AUTO_TEST_CASE(WellNames) { auto deck = createDeckWTEST(); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); @@ -3444,7 +3445,7 @@ BOOST_AUTO_TEST_CASE(RFT_CONFIG2) { auto deck = createDeckRFTConfig(); EclipseGrid grid1(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid1, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid1, table); Runspec runspec (deck); Schedule schedule(deck, grid1 , fp, runspec); const auto& rft_config = schedule.rftConfig(); @@ -3478,7 +3479,7 @@ BOOST_AUTO_TEST_CASE(nupcol) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); @@ -3570,7 +3571,7 @@ DATES -- 4 auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid, fp, runspec); diff --git a/tests/parser/SimulationConfigTest.cpp b/tests/parser/SimulationConfigTest.cpp index c810c10c5..1f01e9455 100644 --- a/tests/parser/SimulationConfigTest.cpp +++ b/tests/parser/SimulationConfigTest.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -142,7 +143,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfigGetThresholdPressureTableTest) { auto deck = createDeck(inputStr); TableManager tm(deck); EclipseGrid eg(10, 3, 4); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); BOOST_CHECK_NO_THROW( SimulationConfig(false, deck, fp) ); } @@ -151,7 +152,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfigNOTHPRES) { auto deck = createDeck(inputStr_noTHPRES); TableManager tm(deck); EclipseGrid eg(10, 3, 4); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig(false, deck, fp); BOOST_CHECK( !simulationConfig.useThresholdPressure() ); } @@ -160,7 +161,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRNotUsed) { auto deck = createDeck(inputStr_noTHPRES); TableManager tm(deck); EclipseGrid eg(10, 3, 4); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig(false, deck, fp); BOOST_CHECK( ! simulationConfig.useCPR()); } @@ -170,7 +171,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRUsed) { TableManager tm(deck); EclipseGrid eg(10, 3, 4); SUMMARYSection summary(deck); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig(false, deck, fp); BOOST_CHECK( simulationConfig.useCPR() ); BOOST_CHECK( ! summary.hasKeyword("CPR") ); @@ -182,7 +183,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRInSUMMARYSection) { TableManager tm(deck); EclipseGrid eg(10, 3, 4); SUMMARYSection summary(deck); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig(false, deck, fp); BOOST_CHECK( ! simulationConfig.useCPR()); BOOST_CHECK( summary.hasKeyword("CPR")); @@ -194,7 +195,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfigCPRBoth) { TableManager tm(deck); EclipseGrid eg(10, 3, 4); SUMMARYSection summary(deck); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig(false, deck, fp); BOOST_CHECK( simulationConfig.useCPR()); BOOST_CHECK( summary.hasKeyword("CPR")); @@ -218,7 +219,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_VAPOIL_DISGAS) { auto deck = createDeck(inputStr); TableManager tm(deck); EclipseGrid eg(10, 3, 4); - FieldPropsManager fp(deck, eg, tm); + FieldPropsManager fp(deck, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig(false, deck, fp); BOOST_CHECK_EQUAL( false , simulationConfig.hasDISGAS()); BOOST_CHECK_EQUAL( false , simulationConfig.hasVAPOIL()); @@ -226,7 +227,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_VAPOIL_DISGAS) { auto deck_vd = createDeck(inputStr_vap_dis); TableManager tm_vd(deck_vd); EclipseGrid eg_vd(10, 3, 4); - FieldPropsManager fp_vd(deck_vd, eg, tm); + FieldPropsManager fp_vd(deck_vd, Phases{true, true, true}, eg, tm); SimulationConfig simulationConfig_vd(false, deck_vd, fp_vd); BOOST_CHECK_EQUAL( true , simulationConfig_vd.hasDISGAS()); BOOST_CHECK_EQUAL( true , simulationConfig_vd.hasVAPOIL()); @@ -239,7 +240,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL) const auto deck = createDeck(inputStr); const auto tm = TableManager(deck); const auto eg = EclipseGrid(10, 3, 4); - const auto fp = FieldPropsManager(deck, eg, tm); + const auto fp = FieldPropsManager(deck, Phases{true, true, true}, eg, tm); const auto simulationConfig = Opm::SimulationConfig(false, deck, fp); BOOST_CHECK(! simulationConfig.isThermal()); @@ -249,7 +250,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL) const auto deck = createDeck(simDeckStringTEMP()); const auto tm = TableManager(deck); const auto eg = EclipseGrid(10, 3, 4); - const auto fp = FieldPropsManager(deck, eg, tm); + const auto fp = FieldPropsManager(deck, Phases{true, true, true}, eg, tm); const auto simulationConfig = Opm::SimulationConfig(false, deck, fp); BOOST_CHECK(simulationConfig.isThermal()); @@ -259,7 +260,7 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL) const auto deck = createDeck(simDeckStringTHERMAL()); const auto tm = TableManager(deck); const auto eg = EclipseGrid(10, 3, 4); - const auto fp = FieldPropsManager(deck, eg, tm); + const auto fp = FieldPropsManager(deck, Phases{true, true, true}, eg, tm); const auto simulationConfig = Opm::SimulationConfig(false, deck, fp); BOOST_CHECK(simulationConfig.isThermal()); @@ -288,7 +289,7 @@ ROCKOPTS Opm::Parser parser; const auto deck = parser.parseString(deck_string); EclipseGrid grid(10,10,10); - FieldPropsManager fp(deck, grid, TableManager()); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, TableManager()); RockConfig rc(deck, fp); BOOST_CHECK_EQUAL(rc.rocknum_property(), "SATNUM"); const auto& comp = rc.comp(); diff --git a/tests/parser/ThresholdPressureTest.cpp b/tests/parser/ThresholdPressureTest.cpp index 6f713e015..f7e8d583b 100644 --- a/tests/parser/ThresholdPressureTest.cpp +++ b/tests/parser/ThresholdPressureTest.cpp @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -214,7 +215,7 @@ struct Setup deck(createDeck(ParseContext(), input)), tablemanager(deck), grid(10, 3, 4), - fp(deck, grid, tablemanager), + fp(deck, Opm::Phases{true, true, true}, grid, tablemanager), initConfig(deck), threshPres(initConfig.restartRequested(), deck, fp) { @@ -224,7 +225,7 @@ struct Setup deck(createDeck(parseContextArg, input)), tablemanager(deck), grid(10, 3, 4), - fp(deck, grid, tablemanager), + fp(deck, Opm::Phases{true, true, true}, grid, tablemanager), initConfig(deck), threshPres(initConfig.restartRequested(), deck, fp) { diff --git a/tests/parser/TransMultTests.cpp b/tests/parser/TransMultTests.cpp index eeadab994..2ff043119 100644 --- a/tests/parser/TransMultTests.cpp +++ b/tests/parser/TransMultTests.cpp @@ -32,10 +32,11 @@ #include #include #include +#include BOOST_AUTO_TEST_CASE(Empty) { Opm::EclipseGrid grid(10,10,10); - Opm::FieldPropsManager fp(Opm::Deck(), grid, Opm::TableManager()); + Opm::FieldPropsManager fp(Opm::Deck(), Opm::Phases{true, true, true}, grid, Opm::TableManager()); Opm::TransMult transMult(grid ,{} , fp); BOOST_CHECK_THROW( transMult.getMultiplier(12,10,10 , Opm::FaceDir::XPlus) , std::invalid_argument ); @@ -69,7 +70,7 @@ MULTZ Opm::Deck deck = parser.parseString(deck_string); Opm::TableManager tables(deck); Opm::EclipseGrid grid(5,5,5); - Opm::FieldPropsManager fp(deck, grid, tables); + Opm::FieldPropsManager fp(deck, Opm::Phases{true, true, true}, grid, tables); Opm::TransMult transMult(grid, deck, fp); transMult.applyMULT(fp.get_global_double("MULTZ"), Opm::FaceDir::ZPlus); diff --git a/tests/parser/TuningTests.cpp b/tests/parser/TuningTests.cpp index d7ef1d1d1..4eed5f0e1 100644 --- a/tests/parser/TuningTests.cpp +++ b/tests/parser/TuningTests.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -71,7 +72,7 @@ BOOST_AUTO_TEST_CASE(TuningTest) { auto deck = createDeck(deckStr); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule( deck, grid , fp, runspec); auto tuning = schedule.getTuning(); @@ -330,7 +331,7 @@ BOOST_AUTO_TEST_CASE(TuningInitTest) { auto deck = createDeck(deckStr); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck , grid , fp, runspec); auto tuning = schedule.getTuning(); @@ -361,7 +362,7 @@ BOOST_AUTO_TEST_CASE(TuningResetTest) { auto deck = createDeck(deckStr); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); auto tuning = schedule.getTuning(); diff --git a/tests/parser/UDQTests.cpp b/tests/parser/UDQTests.cpp index ccb94132c..c90d12dc7 100644 --- a/tests/parser/UDQTests.cpp +++ b/tests/parser/UDQTests.cpp @@ -19,6 +19,7 @@ Copyright 2018 Statoil ASA. #include #include #include +#include #include #include #include @@ -144,7 +145,7 @@ Schedule make_schedule(const std::string& input) { } else { EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); return Schedule(deck, grid , fp, runspec); } diff --git a/tests/parser/WLIST.cpp b/tests/parser/WLIST.cpp index 3787dd5af..aac46e369 100644 --- a/tests/parser/WLIST.cpp +++ b/tests/parser/WLIST.cpp @@ -143,7 +143,7 @@ static Opm::Schedule createSchedule(const std::string& schedule) { auto deck = parser.parseString(input); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); return Schedule(deck, grid , fp, runspec ); } diff --git a/tests/parser/WellSolventTests.cpp b/tests/parser/WellSolventTests.cpp index c73ed823c..c4c615b41 100644 --- a/tests/parser/WellSolventTests.cpp +++ b/tests/parser/WellSolventTests.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -176,7 +177,7 @@ BOOST_AUTO_TEST_CASE(TestNoSolvent) { auto deck = createDeckWithOutSolvent(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK(!deck.hasKeyword("WSOLVENT")); @@ -186,18 +187,17 @@ BOOST_AUTO_TEST_CASE(TestGasInjector) { auto deck = createDeckWithGasInjector(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK(deck.hasKeyword("WSOLVENT")); - } BOOST_AUTO_TEST_CASE(TestDynamicWSOLVENT) { auto deck = createDeckWithDynamicWSOLVENT(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK(deck.hasKeyword("WSOLVENT")); @@ -216,7 +216,7 @@ BOOST_AUTO_TEST_CASE(TestOilInjector) { auto deck = createDeckWithOilInjector(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); BOOST_CHECK_THROW (Schedule(deck , grid , fp, runspec), std::invalid_argument); } @@ -225,7 +225,7 @@ BOOST_AUTO_TEST_CASE(TestWaterInjector) { auto deck = createDeckWithWaterInjector(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); BOOST_CHECK_THROW (Schedule(deck, grid , fp, runspec), std::invalid_argument); } diff --git a/tests/parser/WellTests.cpp b/tests/parser/WellTests.cpp index fe46a0db5..db234b8b1 100644 --- a/tests/parser/WellTests.cpp +++ b/tests/parser/WellTests.cpp @@ -33,6 +33,7 @@ #include #include +#include #include #include #include @@ -86,7 +87,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestTRACK) { auto deck = parser.parseString(input); Opm::EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Opm::Runspec runspec (deck); Opm::Schedule schedule(deck, grid , fp, runspec); const auto& op_1 = schedule.getWell("OP_1", 2); @@ -126,7 +127,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestDefaultTRACK) { auto deck = parser.parseString(input); Opm::EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Opm::Runspec runspec (deck); Opm::Schedule schedule(deck, grid , fp, runspec); const auto& op_1 = schedule.getWell("OP_1", 2); @@ -169,7 +170,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestINPUT) { Opm::EclipseGrid grid(10,10,10); Opm::ErrorGuard errors; TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Opm::Runspec runspec (deck); Opm::Schedule schedule(deck, grid , fp, runspec, Opm::ParseContext(), errors); const auto& op_1 = schedule.getWell("OP_1", 2); @@ -844,7 +845,7 @@ BOOST_AUTO_TEST_CASE(WELOPEN) { auto deck = parser.parseString(input); Opm::EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Opm::Runspec runspec (deck); Opm::Schedule schedule(deck, grid , fp, runspec); { @@ -855,5 +856,4 @@ BOOST_AUTO_TEST_CASE(WELOPEN) { const auto& op_1 = schedule.getWell("OP_1", 2); BOOST_CHECK(op_1.getStatus() == Well::Status::SHUT); } - } diff --git a/tests/parser/WellTracerTests.cpp b/tests/parser/WellTracerTests.cpp index 325e57293..4249dc4ce 100644 --- a/tests/parser/WellTracerTests.cpp +++ b/tests/parser/WellTracerTests.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -133,7 +134,7 @@ BOOST_AUTO_TEST_CASE(TestNoTracer) { auto deck = createDeckWithOutTracer(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec ( deck ); Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK(!deck.hasKeyword("WTRACER")); @@ -144,7 +145,7 @@ BOOST_AUTO_TEST_CASE(TestDynamicWTRACER) { auto deck = createDeckWithDynamicWTRACER(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec ( deck ); Schedule schedule(deck, grid , fp, runspec); BOOST_CHECK(deck.hasKeyword("WTRACER")); @@ -166,9 +167,8 @@ BOOST_AUTO_TEST_CASE(TestTracerInProducerTHROW) { auto deck = createDeckWithTracerInProducer(); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec ( deck ); BOOST_CHECK_THROW(Schedule(deck, grid, fp, runspec), std::invalid_argument); } - diff --git a/tests/parser/integration/ParseKEYWORD.cpp b/tests/parser/integration/ParseKEYWORD.cpp index e201c5562..22dda1b26 100644 --- a/tests/parser/integration/ParseKEYWORD.cpp +++ b/tests/parser/integration/ParseKEYWORD.cpp @@ -22,6 +22,8 @@ #include #include +#include +#include #include #include #include @@ -1366,7 +1368,7 @@ BOOST_AUTO_TEST_CASE( WCONPROD ) { auto deck = parser.parseFile(wconprodFile); EclipseGrid grid(30,30,30); TableManager table ( deck ); - FieldPropsManager fp( deck , grid, table); + FieldPropsManager fp( deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid, fp, runspec ); @@ -1412,7 +1414,7 @@ BOOST_AUTO_TEST_CASE( WCONINJE ) { auto deck = parser.parseFile(wconprodFile); EclipseGrid grid(30,30,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched( deck, grid, fp, runspec); SummaryState st(std::chrono::system_clock::now()); diff --git a/tests/parser/integration/ScheduleCreateFromDeck.cpp b/tests/parser/integration/ScheduleCreateFromDeck.cpp index 0571901e9..99d1c4f53 100644 --- a/tests/parser/integration/ScheduleCreateFromDeck.cpp +++ b/tests/parser/integration/ScheduleCreateFromDeck.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include #include #include @@ -53,7 +55,7 @@ BOOST_AUTO_TEST_CASE(CreateSchedule) { auto deck2 = parser.parseString( ss.str()); for (const auto& deck : {deck1 , deck2}) { TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); const auto& timeMap = sched.getTimeMap(); @@ -70,7 +72,7 @@ BOOST_AUTO_TEST_CASE(CreateSchedule_Comments_After_Keywords) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); const auto& timeMap = sched.getTimeMap(); @@ -85,7 +87,7 @@ BOOST_AUTO_TEST_CASE(WCONPROD_MissingCmode) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,3); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); BOOST_CHECK_NO_THROW( Schedule(deck, grid , fp, runspec) ); } @@ -97,7 +99,7 @@ BOOST_AUTO_TEST_CASE(WCONPROD_Missing_DATA) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,3); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); BOOST_CHECK_THROW( Schedule(deck, grid , fp, runspec) , std::invalid_argument ); } @@ -109,7 +111,7 @@ BOOST_AUTO_TEST_CASE(WellTestRefDepth) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(40,60,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck , grid , fp, runspec); @@ -131,7 +133,7 @@ BOOST_AUTO_TEST_CASE(WellTesting) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(40,60,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -276,7 +278,7 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT_DEFAULTED_ITEMS) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); } @@ -288,7 +290,7 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(40,60,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -323,7 +325,7 @@ BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_correct) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,3); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule schedule(deck, grid , fp, runspec); @@ -345,7 +347,7 @@ BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_WITH_REPARENT_correct_tree) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,3); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -366,7 +368,7 @@ BOOST_AUTO_TEST_CASE( WellTestGroups ) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,3); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); SummaryState st(std::chrono::system_clock::now()); @@ -417,7 +419,7 @@ BOOST_AUTO_TEST_CASE( WellTestGroupAndWellRelation ) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,3); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -479,7 +481,7 @@ BOOST_AUTO_TEST_CASE(WellTestWGRUPCONWellPropertiesSet) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -527,7 +529,7 @@ COMPDAT \n\ auto deck = parser.parseString(deckString); EclipseGrid grid(30,30,10); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); const auto& connections = sched.getWell("W1", 0).getConnections(); @@ -546,8 +548,8 @@ BOOST_AUTO_TEST_CASE(OpmCode) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(10,10,5); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); Runspec runspec (deck); + FieldPropsManager fp(deck, runspec.phases(), grid, table); BOOST_CHECK_NO_THROW( Schedule(deck , grid , fp, runspec) ); } @@ -559,7 +561,7 @@ BOOST_AUTO_TEST_CASE(WELLS_SHUT) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(20,40,1); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -589,7 +591,7 @@ BOOST_AUTO_TEST_CASE(WellTestWPOLYMER) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(30,30,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -656,7 +658,7 @@ BOOST_AUTO_TEST_CASE(WellTestWFOAM) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(30,30,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -723,7 +725,7 @@ BOOST_AUTO_TEST_CASE(WellTestWECON) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(30,30,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, runspec); @@ -833,7 +835,7 @@ BOOST_AUTO_TEST_CASE(TestEvents) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(40,40,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec (deck); Schedule sched(deck , grid , fp, runspec); const Events& events = sched.getEvents(); @@ -867,7 +869,7 @@ BOOST_AUTO_TEST_CASE(TestWellEvents) { auto deck = parser.parseFile(scheduleFile); EclipseGrid grid(40,40,30); TableManager table ( deck ); - FieldPropsManager fp(deck, grid, table); + FieldPropsManager fp(deck, Phases{true, true, true}, grid, table); Runspec runspec(deck); Schedule sched(deck , grid , fp, runspec);