diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index ab8b1d922..21d7263c4 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -128,6 +128,7 @@ if(ENABLE_ECL_INPUT) src/opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.cpp src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp src/opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.cpp + src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.cpp src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp src/opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.cpp @@ -148,6 +149,8 @@ if(ENABLE_ECL_INPUT) src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp src/opm/parser/eclipse/EclipseState/Tables/Rock2dTable.cpp src/opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.cpp + src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp + src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.cpp src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParser.cpp @@ -321,6 +324,7 @@ if(ENABLE_ECL_INPUT) tests/parser/RestartConfigTests.cpp tests/parser/RockTableTests.cpp tests/parser/RunspecTests.cpp + tests/parser/SaltTableTests.cpp tests/parser/SatfuncPropertyInitializersTests.cpp tests/parser/ScheduleTests.cpp tests/parser/SectionTests.cpp @@ -537,6 +541,8 @@ if(ENABLE_ECL_INPUT) opm/parser/eclipse/EclipseState/Tables/Regdims.hpp opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp opm/parser/eclipse/EclipseState/Tables/SpecrockTable.hpp + opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp + opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp opm/parser/eclipse/EclipseState/Tables/PlymwinjTable.hpp opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp @@ -621,6 +627,7 @@ if(ENABLE_ECL_INPUT) opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp + opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp diff --git a/opm/parser/eclipse/EclipseState/Runspec.hpp b/opm/parser/eclipse/EclipseState/Runspec.hpp index d35acf1ed..69c6510f6 100644 --- a/opm/parser/eclipse/EclipseState/Runspec.hpp +++ b/opm/parser/eclipse/EclipseState/Runspec.hpp @@ -39,11 +39,12 @@ enum class Phase { POLYMER = 4, ENERGY = 5, POLYMW = 6, - FOAM = 7 + FOAM = 7, + BRINE = 8 // If you add more entries to this enum, remember to update NUM_PHASES_IN_ENUM below. }; -constexpr int NUM_PHASES_IN_ENUM = static_cast(Phase::FOAM) + 1; // Used to get correct size of the bitset in class Phases. +constexpr int NUM_PHASES_IN_ENUM = static_cast(Phase::BRINE) + 1; // Used to get correct size of the bitset in class Phases. Phase get_phase( const std::string& ); std::ostream& operator<<( std::ostream&, const Phase& ); @@ -52,7 +53,7 @@ class Phases { public: Phases() noexcept = default; Phases( bool oil, bool gas, bool wat, bool solvent = false, bool polymer = false, bool energy = false, - bool polymw = false, bool foam = false ) noexcept; + bool polymw = false, bool foam = false, bool brine = false ) noexcept; Phases(const std::bitset& bbits); unsigned long getBits() const; diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp index 475d38c27..ba6f7d4e1 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp @@ -338,6 +338,7 @@ namespace Opm void handleWCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWFOAM( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); + void handleWSALT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWSOLVENT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWTRACER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWTEMP( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp b/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp index 81178d036..967fd822a 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -419,6 +420,7 @@ public: std::shared_ptr econLimits, std::shared_ptr foamProperties, std::shared_ptr polymerProperties, + std::shared_ptr brineProperties, std::shared_ptr tracerProperties, std::shared_ptr connections, std::shared_ptr production, @@ -453,6 +455,7 @@ public: const WellEconProductionLimits& getEconLimits() const; const WellFoamProperties& getFoamProperties() const; const WellPolymerProperties& getPolymerProperties() const; + const WellBrineProperties& getBrineProperties() const; const WellTracerProperties& getTracerProperties() const; const WellConnections& getConnections() const; const WellSegments& getSegments() const; @@ -504,6 +507,7 @@ public: bool updateTracer(std::shared_ptr tracer_properties); bool updateFoamProperties(std::shared_ptr foam_properties); bool updatePolymerProperties(std::shared_ptr polymer_properties); + bool updateBrineProperties(std::shared_ptr brine_properties); bool updateEconLimits(std::shared_ptr econ_limits); bool updateProduction(std::shared_ptr production); bool updateInjection(std::shared_ptr injection); @@ -557,6 +561,7 @@ private: std::shared_ptr econ_limits; std::shared_ptr foam_properties; std::shared_ptr polymer_properties; + std::shared_ptr brine_properties; std::shared_ptr tracer_properties; std::shared_ptr connections; // The WellConnections object can not be const because of the filterConnections method - would be beneficial to rewrite to enable const std::shared_ptr production; diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp b/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp new file mode 100644 index 000000000..2fb0a7512 --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp @@ -0,0 +1,38 @@ +/* + Copyright 2019 by Norce. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#ifndef OPM_WELLBRINEPROPERTIES_HEADER_INCLUDED +#define OPM_WELLBRINEPROPERTIES_HEADER_INCLUDED + +namespace Opm +{ + +class DeckRecord; + +struct WellBrineProperties +{ + double m_saltConcentration = 0.0; + void handleWSALT(const DeckRecord& rec); + bool operator!=(const WellBrineProperties& other) const; + bool operator==(const WellBrineProperties& other) const; +}; + +} // namespace Opm + +#endif // OPM_WELLBRINEPROPERTIES_HEADER_INCLUDED diff --git a/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp b/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp new file mode 100644 index 000000000..cfbc5dfa5 --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp @@ -0,0 +1,42 @@ +/* + Copyright (C) 2015 Statoil ASA. + 2015 IRIS AS + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ +#ifndef OPM_PARSER_BRINEDENSITY_TABLE_HPP +#define OPM_PARSER_BRINEDENSITY_TABLE_HPP + +namespace Opm { + + class DeckItem; + + class BrineDensityTable { + public: + BrineDensityTable(); + BrineDensityTable(const std::vector& tableValues); + + void init(const Opm::DeckRecord& record); + const std::vector& getBrineDensityColumn() const; + + bool operator==(const BrineDensityTable& data) const; + + private: + std::vector m_tableValues; + }; +} + +#endif diff --git a/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp b/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp new file mode 100644 index 000000000..929da6d4d --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp @@ -0,0 +1,58 @@ +/* + Copyright (C) 2019 by Norce + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ +#ifndef OPM_PARSER_PVTWSALT_TABLE_HPP +#define OPM_PARSER_PVTWSALT_TABLE_HPP + +#include + +namespace Opm { + + class DeckKeyword; + + class PvtwsaltTable { + public: + PvtwsaltTable(); + PvtwsaltTable(double refPressValue, + double refSaltConValue, + const std::vector& tableValues); + + void init(const Opm::DeckRecord& record0, const Opm::DeckRecord& record1); + size_t size() const; + std::vector getSaltConcentrationColumn() const; + std::vector getFormationVolumeFactorColumn() const; + std::vector getCompressibilityColumn() const; + std::vector getViscosityColumn() const; + std::vector getViscosibilityColumn() const; + double getReferencePressureValue() const; + double getReferenceSaltConcentrationValue() const; + const std::vector& getTableValues() const; + + bool operator==(const PvtwsaltTable& data) const; + + protected: + + double m_pRefValues; + double m_saltConsRefValues; + std::vector m_tableValues; + + }; + +} + +#endif diff --git a/opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp b/opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp new file mode 100644 index 000000000..9a400f4b2 --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp @@ -0,0 +1,37 @@ +/* + Copyright (C) 2019 by Norce. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ +#ifndef OPM_PARSER_SALTVD_TABLE_HPP +#define OPM_PARSER_SALTVD_TABLE_HPP + +#include "SimpleTable.hpp" + +namespace Opm { + + class DeckItem; + + class SaltvdTable : public SimpleTable { + public: + SaltvdTable( const DeckItem& item ); + + const TableColumn& getDepthColumn() const; + const TableColumn& getSaltColumn() const; + }; +} + +#endif diff --git a/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp b/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp index 2d9c78b91..aca4d2f4d 100644 --- a/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp +++ b/opm/parser/eclipse/EclipseState/Tables/TableManager.hpp @@ -34,6 +34,9 @@ #include #include #include +#include +#include + #include #include @@ -69,6 +72,8 @@ namespace Opm { const RockTable& rockTable, const ViscrefTable& viscrefTable, const WatdentTable& watdentTable, + const std::vector& pvtwsaltTables, + const std::vector& bdensityTables, const std::map& plymwinjTables, const std::map& skprwatTables, const std::map& skprpolyTables, @@ -111,6 +116,7 @@ namespace Opm { const TableContainer& getRvvdTables() const; const TableContainer& getPbvdTables() const; const TableContainer& getPdvdTables() const; + const TableContainer& getSaltvdTables() const; const TableContainer& getEnkrvdTables() const; const TableContainer& getEnptvdTables() const; const TableContainer& getImkrvdTables() const; @@ -152,6 +158,9 @@ namespace Opm { const TableContainer& getOverburdTables() const; const PvtwTable& getPvtwTable() const; + const std::vector& getPvtwSaltTables() const; + const std::vector& getBrineDensityTables() const; + const PvcdoTable& getPvcdoTable() const; const DensityTable& getDensityTable() const; const RockTable& getRockTable() const; @@ -235,6 +244,38 @@ namespace Opm { } + template + void initPvtwsaltTables(const Deck& deck, std::vector& pvtwtables ) { + + size_t numTables = m_tabdims.getNumPVTTables(); + pvtwtables.resize(numTables); + + const auto& keyword = deck.getKeyword("PVTWSALT"); + size_t numEntries = keyword.size(); + size_t regionIdx = 0; + for (unsigned lineIdx = 0; lineIdx < numEntries; ++lineIdx) { + pvtwtables[regionIdx].init(keyword.getRecord(lineIdx), keyword.getRecord(lineIdx+1)); + ++regionIdx; + ++lineIdx; + } + assert(regionIdx == numTables); + } + + template + void initBrineTables(const Deck& deck, std::vector& brinetables ) { + + size_t numTables = m_tabdims.getNumPVTTables(); + brinetables.resize(numTables); + + const auto& keyword = deck.getKeyword("BDENSITY"); + size_t numEntries = keyword.size(); + assert(numEntries == numTables); + for (unsigned lineIdx = 0; lineIdx < numEntries; ++lineIdx) { + brinetables[lineIdx].init(keyword.getRecord(lineIdx)); + } + } + + /** * JFUNC */ @@ -371,6 +412,8 @@ namespace Opm { RockTable m_rockTable; ViscrefTable m_viscrefTable; WatdentTable m_watdentTable; + std::vector m_pvtwsaltTables; + std::vector m_bdensityTables; std::map m_plymwinjTables; std::map m_skprwatTables; std::map m_skprpolyTables; diff --git a/src/opm/parser/eclipse/EclipseState/Runspec.cpp b/src/opm/parser/eclipse/EclipseState/Runspec.cpp index a9227f8de..546102155 100644 --- a/src/opm/parser/eclipse/EclipseState/Runspec.cpp +++ b/src/opm/parser/eclipse/EclipseState/Runspec.cpp @@ -35,6 +35,7 @@ Phase get_phase( const std::string& str ) { if( str == "ENERGY" ) return Phase::ENERGY; if( str == "POLYMW" ) return Phase::POLYMW; if( str == "FOAM" ) return Phase::FOAM; + if( str == "BRINE" ) return Phase::BRINE; throw std::invalid_argument( "Unknown phase '" + str + "'" ); } @@ -49,6 +50,7 @@ std::ostream& operator<<( std::ostream& stream, const Phase& p ) { case Phase::ENERGY: return stream << "ENERGY"; case Phase::POLYMW: return stream << "POLYMW"; case Phase::FOAM: return stream << "FOAM"; + case Phase::BRINE: return stream << "BRINE"; } @@ -57,7 +59,7 @@ std::ostream& operator<<( std::ostream& stream, const Phase& p ) { using un = std::underlying_type< Phase >::type; -Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, bool polymw, bool foam ) noexcept : +Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, bool polymw, bool foam, bool brine) noexcept : bits( (oil ? (1 << static_cast< un >( Phase::OIL ) ) : 0) | (gas ? (1 << static_cast< un >( Phase::GAS ) ) : 0) | (wat ? (1 << static_cast< un >( Phase::WATER ) ) : 0) | @@ -65,7 +67,8 @@ Phases::Phases( bool oil, bool gas, bool wat, bool sol, bool pol, bool energy, b (pol ? (1 << static_cast< un >( Phase::POLYMER ) ) : 0) | (energy ? (1 << static_cast< un >( Phase::ENERGY ) ) : 0) | (polymw ? (1 << static_cast< un >( Phase::POLYMW ) ) : 0) | - (foam ? (1 << static_cast< un >( Phase::FOAM ) ) : 0) ) + (foam ? (1 << static_cast< un >( Phase::FOAM ) ) : 0) | + (brine ? (1 << static_cast< un >( Phase::BRINE ) ) : 0) ) {} @@ -239,7 +242,8 @@ Runspec::Runspec( const Deck& deck ) : deck.hasKeyword( "POLYMER" ), deck.hasKeyword( "THERMAL" ), deck.hasKeyword( "POLYMW" ), - deck.hasKeyword( "FOAM" ) ) ), + deck.hasKeyword( "FOAM" ), + deck.hasKeyword( "BRINE" ) ) ), m_tabdims( deck ), endscale( deck ), welldims( deck ), diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 3b11006f0..8b320b4b7 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -63,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -341,6 +342,9 @@ namespace { else if (keyword.name() == "WPOLYMER") handleWPOLYMER(keyword, currentStep, parseContext, errors); + else if (keyword.name() == "WSALT") + handleWSALT(keyword, currentStep, parseContext, errors); + else if (keyword.name() == "WSOLVENT") handleWSOLVENT(keyword, currentStep, parseContext, errors); @@ -1107,6 +1111,25 @@ namespace { } } + void Schedule::handleWSALT( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors) { + for (const auto& record : keyword) { + const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0); + const auto well_names = wellNames(wellNamePattern, currentStep ); + + if (well_names.empty()) + invalidNamePattern(wellNamePattern, parseContext, errors, keyword); + + for (const auto& well_name : well_names) { + const auto& dynamic_state = this->wells_static.at(well_name); + auto well2 = std::make_shared(*dynamic_state[currentStep]); + auto brine_properties = std::make_shared(well2->getBrineProperties()); + brine_properties->handleWSALT(record); + if (well2->updateBrineProperties(brine_properties)) + this->updateWell(well2, currentStep); + } + } + } + void Schedule::handleWPMITAB( const DeckKeyword& keyword, const size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors) { diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp index 2e4ca5c0c..673b9a417 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp @@ -126,6 +126,7 @@ Well::Well(const std::string& wname_arg, econ_limits(std::make_shared()), foam_properties(std::make_shared()), polymer_properties(std::make_shared()), + brine_properties(std::make_shared()), tracer_properties(std::make_shared()), connections(std::make_shared(headI, headJ)), production(std::make_shared(wname)), @@ -159,6 +160,7 @@ Well::Well(const std::string& wname_arg, std::shared_ptr econLimits, std::shared_ptr foamProperties, std::shared_ptr polymerProperties, + std::shared_ptr brineProperties, std::shared_ptr tracerProperties, std::shared_ptr connections_arg, std::shared_ptr production_arg, @@ -187,6 +189,7 @@ Well::Well(const std::string& wname_arg, econ_limits(econLimits), foam_properties(foamProperties), polymer_properties(polymerProperties), + brine_properties(brineProperties), tracer_properties(tracerProperties), connections(connections_arg), production(production_arg), @@ -241,6 +244,19 @@ bool Well::updatePolymerProperties(std::shared_ptr polyme return false; } +bool Well::updateBrineProperties(std::shared_ptr brine_properties_arg) { + if (this->producer) { + throw std::runtime_error("Not allowed to set brine injection properties for well " + name() + + " since it is a production well"); + } + if (*this->brine_properties != *brine_properties_arg) { + this->brine_properties = brine_properties_arg; + return true; + } + + return false; +} + bool Well::updateEconLimits(std::shared_ptr econ_limits_arg) { if (*this->econ_limits != *econ_limits_arg) { @@ -556,6 +572,9 @@ const WellPolymerProperties& Well::getPolymerProperties() const { return *this->polymer_properties; } +const WellBrineProperties& Well::getBrineProperties() const { + return *this->brine_properties; +} const WellTracerProperties& Well::getTracerProperties() const { return *this->tracer_properties; @@ -833,6 +852,8 @@ double Well::production_rate(const SummaryState& st, Phase prod_phase) const { throw std::invalid_argument( "Production of 'POLYMW' requested."); case Phase::FOAM: throw std::invalid_argument( "Production of 'FOAM' requested."); + case Phase::BRINE: + throw std::invalid_argument( "Production of 'BRINE' requested."); } throw std::logic_error( "Unreachable state. Invalid Phase value. " diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp new file mode 100644 index 000000000..4f82aee03 --- /dev/null +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.cpp @@ -0,0 +1,38 @@ +/* + Copyright 2019 by Norce. + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . +*/ + +#include + +#include +#include + +void Opm::WellBrineProperties::handleWSALT(const DeckRecord& rec) +{ + this->m_saltConcentration = rec.getItem("CONCENTRATION").get(0).get(); +} + +bool Opm::WellBrineProperties::operator!=(const WellBrineProperties& other) const +{ + return this->m_saltConcentration != other.m_saltConcentration; +} + +bool Opm::WellBrineProperties::operator==(const WellBrineProperties& other) const +{ + return this->m_saltConcentration == other.m_saltConcentration; +} diff --git a/src/opm/parser/eclipse/EclipseState/Tables/Bdensity.cpp b/src/opm/parser/eclipse/EclipseState/Tables/Bdensity.cpp new file mode 100644 index 000000000..c883f86d2 --- /dev/null +++ b/src/opm/parser/eclipse/EclipseState/Tables/Bdensity.cpp @@ -0,0 +1,117 @@ +/* + Copyright (C) 2019 by Norce + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ + +#include +#include +#include +#include +#include + +namespace Opm { + + static const size_t numEntries = 5; + PvtwsaltTable::PvtwsaltTable() + { + } + + void PvtwsaltTable::init(const Opm::DeckRecord& record0, const Opm::DeckRecord& record1) + { + + m_pRefValues = record0.getItem("P_REF").getSIDoubleData()[0]; + m_saltConsRefValues = record0.getItem("SALT_CONCENTRATION_REF").getSIDoubleData()[0]; + m_tableValues = record1.getItem("DATA").getSIDoubleData(); + } + + size_t PvtwsaltTable::size() const + { + return m_tableValues.size()/numEntries; + } + + double PvtwsaltTable::getReferencePressureValue() const + { + return m_pRefValues; + } + + double PvtwsaltTable::getReferenceSaltConcentrationValue() const + { + return m_saltConsRefValues; + } + + std::vector PvtwsaltTable::getSaltConcentrationColumn() const + { + size_t tableindex = 0; + std::vector saltCons(this->size()); + for(size_t i=0; isize(); ++i){ + saltCons[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return saltCons; + + } + + std::vector PvtwsaltTable::getFormationVolumeFactorColumn() const + { + size_t tableindex = 1; + std::vector formationvolumefactor(this->size()); + for(size_t i=0; isize(); ++i){ + formationvolumefactor[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return formationvolumefactor; + + } + + std::vector PvtwsaltTable::getCompressibilityColumn() const + { + size_t tableindex = 2; + std::vector compresibility(this->size()); + for(size_t i=0; isize(); ++i){ + compresibility[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return compresibility; + + } + + std::vector PvtwsaltTable::getViscosityColumn() const + { + size_t tableindex = 3; + std::vector viscosity(this->size()); + for(size_t i=0; isize(); ++i){ + viscosity[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return viscosity; + + } + + std::vector PvtwsaltTable::getViscosibilityColumn() const + { + size_t tableindex = 4; + std::vector viscosibility(this->size()); + for(size_t i=0; isize(); ++i){ + viscosibility[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return viscosibility; + + } + +} + diff --git a/src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp b/src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp new file mode 100644 index 000000000..ccd243986 --- /dev/null +++ b/src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp @@ -0,0 +1,54 @@ +/* + Copyright (C) 2019 by Norce + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ + +#include +#include +#include +#include +#include + +namespace Opm { + + BrineDensityTable::BrineDensityTable() + { + } + + BrineDensityTable::BrineDensityTable(const std::vector& tableValues) + : m_tableValues(tableValues) + { + } + + void BrineDensityTable::init(const Opm::DeckRecord& record ) + { + m_tableValues = record.getItem("BRINE_DENSITY").getSIDoubleData(); + } + + const std::vector& BrineDensityTable::getBrineDensityColumn() const + { + return m_tableValues; + } + + bool BrineDensityTable::operator==(const BrineDensityTable& data) const + { + return m_tableValues == data.m_tableValues; + } + + +} + diff --git a/src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp b/src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp new file mode 100644 index 000000000..03e461579 --- /dev/null +++ b/src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp @@ -0,0 +1,138 @@ +/* + Copyright (C) 2019 by Norce + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ + +#include +#include +#include +#include +#include + +namespace Opm { + + static const size_t numEntries = 5; + PvtwsaltTable::PvtwsaltTable() + { + } + + PvtwsaltTable::PvtwsaltTable(double refPressValue, + double refSaltConValue, + const std::vector& tableValues) + : m_pRefValues(refPressValue) + , m_saltConsRefValues(refSaltConValue) + , m_tableValues(tableValues) + { + } + + void PvtwsaltTable::init(const Opm::DeckRecord& record0, const Opm::DeckRecord& record1) + { + + m_pRefValues = record0.getItem("P_REF").getSIDoubleData()[0]; + m_saltConsRefValues = record0.getItem("SALT_CONCENTRATION_REF").getSIDoubleData()[0]; + m_tableValues = record1.getItem("DATA").getSIDoubleData(); + } + + size_t PvtwsaltTable::size() const + { + return m_tableValues.size()/numEntries; + } + + const std::vector& PvtwsaltTable::getTableValues() const + { + return m_tableValues; + } + + double PvtwsaltTable::getReferencePressureValue() const + { + return m_pRefValues; + } + + double PvtwsaltTable::getReferenceSaltConcentrationValue() const + { + return m_saltConsRefValues; + } + + std::vector PvtwsaltTable::getSaltConcentrationColumn() const + { + size_t tableindex = 0; + std::vector saltCons(this->size()); + for(size_t i=0; isize(); ++i){ + saltCons[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return saltCons; + + } + + std::vector PvtwsaltTable::getFormationVolumeFactorColumn() const + { + size_t tableindex = 1; + std::vector formationvolumefactor(this->size()); + for(size_t i=0; isize(); ++i){ + formationvolumefactor[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return formationvolumefactor; + + } + + std::vector PvtwsaltTable::getCompressibilityColumn() const + { + size_t tableindex = 2; + std::vector compresibility(this->size()); + for(size_t i=0; isize(); ++i){ + compresibility[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return compresibility; + + } + + std::vector PvtwsaltTable::getViscosityColumn() const + { + size_t tableindex = 3; + std::vector viscosity(this->size()); + for(size_t i=0; isize(); ++i){ + viscosity[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return viscosity; + + } + + std::vector PvtwsaltTable::getViscosibilityColumn() const + { + size_t tableindex = 4; + std::vector viscosibility(this->size()); + for(size_t i=0; isize(); ++i){ + viscosibility[i] = m_tableValues[tableindex]; + tableindex = tableindex+numEntries; + } + return viscosibility; + + } + + bool PvtwsaltTable::operator==(const PvtwsaltTable& data) const + { + return m_pRefValues == data.m_pRefValues && + m_saltConsRefValues == data.m_saltConsRefValues && + m_tableValues == data.m_tableValues; + } + +} + diff --git a/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp b/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp index dfee54f76..e260ad7d2 100644 --- a/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp +++ b/src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -65,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -103,6 +105,8 @@ namespace Opm { const RockTable& rockTable, const ViscrefTable& viscrefTable, const WatdentTable& watdentTable, + const std::vector& pvtwsaltTables, + const std::vector& bdensityTables, const std::map& plymwinjTables, const std::map& skprwatTables, const std::map& skprpolyTables, @@ -127,6 +131,8 @@ namespace Opm { m_rockTable(rockTable), m_viscrefTable(viscrefTable), m_watdentTable(watdentTable), + m_pvtwsaltTables(pvtwsaltTables), + m_bdensityTables(bdensityTables), m_plymwinjTables(plymwinjTables), m_skprwatTables(skprwatTables), m_skprpolyTables(skprpolyTables), @@ -162,6 +168,7 @@ namespace Opm { initSimpleTables( deck ); initFullTables(deck, "PVTG", m_pvtgTables); initFullTables(deck, "PVTO", m_pvtoTables); + if( deck.hasKeyword( "PVTW" ) ) this->m_pvtwTable = PvtwTable( deck.getKeyword( "PVTW" ) ); @@ -191,6 +198,14 @@ namespace Opm { if ( deck.hasKeyword( "ROCK2DTR") ) initRockTables(deck, "ROCK2DTR", m_rock2dtrTables ); + if ( deck.hasKeyword( "PVTWSALT") ) + initPvtwsaltTables(deck, m_pvtwsaltTables ); + + if ( deck.hasKeyword( "BDENSITY") ) + initBrineTables(deck, m_bdensityTables ); + + + } TableManager& TableManager::operator=(const TableManager& data) { @@ -204,6 +219,8 @@ namespace Opm { m_densityTable = data.m_densityTable; m_viscrefTable = data.m_viscrefTable; m_watdentTable = data.m_watdentTable; + m_pvtwsaltTables = data.m_pvtwsaltTables; + m_bdensityTables = data.m_bdensityTables; m_plymwinjTables = data.m_plymwinjTables; m_skprwatTables = data.m_skprwatTables; m_skprpolyTables = data.m_skprpolyTables; @@ -290,6 +307,7 @@ namespace Opm { } void TableManager::initSimpleTables(const Deck& deck) { + addTables( "SWOF" , m_tabdims.getNumSatTables() ); addTables( "SGWFN", m_tabdims.getNumSatTables() ); addTables( "SGOF", m_tabdims.getNumSatTables() ); @@ -325,6 +343,7 @@ namespace Opm { addTables( "RVVD", m_eqldims->getNumEquilRegions()); addTables( "PBVD", m_eqldims->getNumEquilRegions()); addTables( "PDVD", m_eqldims->getNumEquilRegions()); + addTables( "SALTVD", m_eqldims->getNumEquilRegions()); addTables( "AQUTAB", m_aqudims.getNumInfluenceTablesCT()); { @@ -387,6 +406,7 @@ namespace Opm { initSimpleTableContainer(deck, "RVVD" , m_eqldims->getNumEquilRegions()); initSimpleTableContainer(deck, "PBVD" , m_eqldims->getNumEquilRegions()); initSimpleTableContainer(deck, "PDVD" , m_eqldims->getNumEquilRegions()); + initSimpleTableContainer(deck, "SALTVD" , m_eqldims->getNumEquilRegions()); initSimpleTableContainer(deck, "AQUTAB" , m_aqudims.getNumInfluenceTablesCT()); { size_t numEndScaleTables = ParserKeywords::ENDSCALE::NUM_TABLES::defaultValue; @@ -767,6 +787,10 @@ namespace Opm { return getTables("PDVD"); } + const TableContainer& TableManager::getSaltvdTables() const { + return getTables("SALTVD"); + } + const TableContainer& TableManager::getEnkrvdTables() const { return getTables("ENKRVD"); } @@ -889,6 +913,14 @@ namespace Opm { return this->m_pvtwTable; } + const std::vector& TableManager::getPvtwSaltTables() const { + return this->m_pvtwsaltTables; + } + + const std::vector& TableManager::getBrineDensityTables() const { + return this->m_bdensityTables; + } + const PvcdoTable& TableManager::getPvcdoTable() const { return this->m_pvcdoTable; } @@ -1001,6 +1033,8 @@ namespace Opm { m_densityTable == data.m_densityTable && m_viscrefTable == data.m_viscrefTable && m_watdentTable == data.m_watdentTable && + m_pvtwsaltTables == data.m_pvtwsaltTables && + m_bdensityTables == data.m_bdensityTables && m_plymwinjTables == data.m_plymwinjTables && m_skprwatTables == data.m_skprwatTables && m_skprpolyTables == data.m_skprpolyTables && diff --git a/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp b/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp index 6dde4c8e3..8d66ea91c 100644 --- a/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp +++ b/src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -900,6 +901,21 @@ const TableColumn& PdvdTable::getPdewColumn() const { return SimpleTable::getColumn(1); } +SaltvdTable::SaltvdTable( const DeckItem& item ) { + m_schema.addColumn( ColumnSchema( "DEPTH" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE )); + m_schema.addColumn( ColumnSchema( "SALT" , Table::RANDOM , Table::DEFAULT_NONE )); + + SimpleTable::init(item); +} + +const TableColumn& SaltvdTable::getDepthColumn() const { + return SimpleTable::getColumn(0); +} + +const TableColumn& SaltvdTable::getSaltColumn() const { + return SimpleTable::getColumn(1); +} + AqutabTable::AqutabTable( const DeckItem& item ) { m_schema.addColumn( ColumnSchema( "TD" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE ) ); m_schema.addColumn( ColumnSchema( "PD" , Table::RANDOM , Table::DEFAULT_LINEAR ) ); diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BDENSITY b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BDENSITY index eac0059c8..9b590eaee 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BDENSITY +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BDENSITY @@ -1,5 +1,3 @@ -{"name" : "BDENSITY" , "sections" : ["PROPS"] , "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"} , "items" : - [ - {"name" : "DATA" , "value_type":"DOUBLE" , "size_type":"ALL", "dimension" : "Mass/LiquidSurfaceVolume"} - ] -} +{"name" : "BDENSITY", "sections" : ["PROPS"], "size" : {"keyword":"TABDIMS", "item":"NTPVT" }, "items" : + [{"name": "BRINE_DENSITY" , "value_type" : "DOUBLE" ,"size_type" : "ALL" , "dimension" : "Density"} + ]} diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BRINE b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BRINE index 02e94d73b..20ccd8799 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BRINE +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/B/BRINE @@ -1 +1,2 @@ -{"name" : "BRINE" , "sections" : ["RUNSPEC"], "data" : {"value_type" : "STRING" }} +{"name" : "BRINE" , "sections" : ["RUNSPEC"], "comment" : "Multi-Component Brine Model not supported" +} diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/P/PVTWSALT b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/P/PVTWSALT index 916ce3ca5..a4256ffb8 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/P/PVTWSALT +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/P/PVTWSALT @@ -5,6 +5,6 @@ {"name":"SALT_CONCENTRATION_REF", "value_type" : "DOUBLE", "default" : 0.0,"dimension":"Density"} ], [ - {"name" : "table", "value_type" : "DOUBLE", "size_type" : "ALL", "dimension" : ["Density","1","1/Pressure","Viscosity", "1/Pressure"]} + {"name" : "DATA", "value_type" : "DOUBLE", "size_type" : "ALL", "dimension" : ["Density","1","1/Pressure","Viscosity", "1/Pressure"]} ]] } diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/S/SALTVD b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/S/SALTVD index cc70879ef..dd7fc7985 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/S/SALTVD +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/S/SALTVD @@ -1,4 +1,7 @@ {"name" : "SALTVD" , - "sections" : ["SOLUTION"], - "size" : {"keyword" : "EQLDIMS", "item" : "NTEQUL"}, - "items" : [{"name" : "DATA", "value_type" : "DOUBLE", "size_type" : "ALL"}]} +"comment" : "Hardcoded two columns. Multi-Component Brine Model not supported", +"sections" : ["SOLUTION"], "size" : {"keyword" : "EQLDIMS" , "item" : "NTEQUL"}, + "items" : [{"name" : "DATA" , + "value_type" : "DOUBLE" , + "size_type" : "ALL", + "dimension" : ["Length" , "Density"]}]} diff --git a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/W/WSALT b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/W/WSALT index a1565b452..5e4bf3f41 100644 --- a/src/opm/parser/eclipse/share/keywords/000_Eclipse100/W/WSALT +++ b/src/opm/parser/eclipse/share/keywords/000_Eclipse100/W/WSALT @@ -1,5 +1,5 @@ {"name" : "WSALT", "sections" : ["SCHEDULE"], -"comment" : "The CONCENTRATION item should be UDA - but UDA & size_type:ALL is not supported", +"comment" : "UDA & size_type:ALL is not supported i.e Multi-Component Brine Model not supported", "items" : [{"name" : "WELL" , "value_type" : "STRING"}, - {"name" : "CONCENTRATION" , "value_type" : "DOUBLE" , "size_type" : "ALL"}]} + {"name" : "CONCENTRATION" , "value_type" : "UDA"}]} diff --git a/tests/parser/SaltTableTests.cpp b/tests/parser/SaltTableTests.cpp new file mode 100644 index 000000000..9a1e6626c --- /dev/null +++ b/tests/parser/SaltTableTests.cpp @@ -0,0 +1,111 @@ +/* + Copyright (C) 2019 by Norce + + This file is part of the Open Porous Media project (OPM). + + OPM is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OPM is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with OPM. If not, see . + */ + +#define BOOST_TEST_MODULE SaltTableTests + +#include + +#include +#include +#include +#include + +// generic table classes +#include +#include +#include +#include + +// keyword specific table classes + +#include +#include + +#include +#include + +using namespace Opm; + +inline std::string prefix() { + return boost::unit_test::framework::master_test_suite().argv[1]; +} + + +BOOST_AUTO_TEST_CASE( Brine ) { + const char *deckData = + "TABDIMS\n" + "1 1/\n" + "\n" + "PVTWSALT\n" + " 1000/\n" + " 0 1 2 3 4 \n" + " 10 11 12 13 14/\n" + " \n" + "BDENSITY\n" + " 1000 1050 /\n" + "\n" + "EQLDIMS\n" + "1 /\n" + "\n" + "SALTVD\n" + "500 0\n" + "550 50/\n"; + + Opm::Parser parser; + auto deck = parser.parseString(deckData); + + Opm::TableManager tables(deck); + const auto& PvtwsaltTables = tables.getPvtwSaltTables( ); + BOOST_CHECK_EQUAL( 1 , PvtwsaltTables.size() ); + BOOST_CHECK_EQUAL(2, PvtwsaltTables[0].size()); + + const auto& PvtwsaltTable1 = PvtwsaltTables[0]; + BOOST_CHECK_EQUAL (PvtwsaltTable1.getSaltConcentrationColumn().size(), 2); + BOOST_CHECK_CLOSE (PvtwsaltTable1.getSaltConcentrationColumn()[1], 10, 1e-5); + + BOOST_CHECK_EQUAL (PvtwsaltTable1.getFormationVolumeFactorColumn().size(), 2); + BOOST_CHECK_CLOSE (PvtwsaltTable1.getFormationVolumeFactorColumn()[0], 1, 1e-5); + + BOOST_CHECK_EQUAL (PvtwsaltTable1.getCompressibilityColumn().size(), 2); + BOOST_CHECK_CLOSE (PvtwsaltTable1.getCompressibilityColumn()[1], 12/1e5, 1e-5); + + BOOST_CHECK_EQUAL (PvtwsaltTable1.getViscosityColumn().size(), 2); + BOOST_CHECK_CLOSE (PvtwsaltTable1.getViscosityColumn()[1], 13*0.001, 1e-5); + + BOOST_CHECK_CLOSE (PvtwsaltTable1.getReferencePressureValue(), 1000*1e5, 1e-5); + + const auto& BdensityTables = tables.getBrineDensityTables( ); + const auto& BdensityTable1 = BdensityTables[0]; + + BOOST_CHECK_EQUAL( 1 , BdensityTables.size() ); + BOOST_CHECK_EQUAL (BdensityTable1.getBrineDensityColumn().size(), 2); + BOOST_CHECK_CLOSE (BdensityTable1.getBrineDensityColumn()[1], 1050, 1e-5); + + const Opm::TableContainer& saltvdTables = tables.getSaltvdTables(); + const auto& saltvdTable = saltvdTables.getTable(0); + + BOOST_CHECK_EQUAL(saltvdTable.getDepthColumn() .size(), 2); + BOOST_CHECK_CLOSE (saltvdTable.getSaltColumn() [1],50, 1e-5); + + +} + + + +