salt solubility table allowing specification of solubility per region

This commit is contained in:
Paul Egberts 2021-08-04 13:48:57 +02:00
parent 6e6b438405
commit e40fdf75ba
6 changed files with 159 additions and 4 deletions

View File

@ -196,6 +196,7 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.cpp
src/opm/parser/eclipse/EclipseState/Tables/Tabdims.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQASTNode.cpp
@ -711,6 +712,7 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp
opm/parser/eclipse/EclipseState/Tables/PermfactTable.hpp
opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SaltpvdTable.hpp
opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp

View File

@ -0,0 +1,58 @@
/*
Copyright (C) 2020 Equinor ASA.
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 <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_PARSER_SALTSOLUBILITY_TABLE_HPP
#define OPM_PARSER_SALTSOLUBILITY_TABLE_HPP
namespace Opm {
class DeckItem;
class SaltSolubilityTable {
public:
static SaltSolubilityTable serializeObject();
void init(const Opm::DeckRecord& record);
const std::vector<double>& getSaltSolubilityColumn() const;
bool operator==(const SaltSolubilityTable& data) const;
std::vector<double>::const_iterator begin() const {
return m_tableValues.begin();
}
std::vector<double>::const_iterator end() const {
return m_tableValues.end();
}
std::size_t size() const {
return this->m_tableValues.size();
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(m_tableValues);
}
private:
std::vector<double> m_tableValues;
};
}
#endif

View File

@ -37,6 +37,7 @@
#include <opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvtwsaltTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/RwgsaltTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/BrineDensityTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SolventDensityTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/StandardCond.hpp>
@ -97,6 +98,7 @@ namespace Opm {
const TableContainer& getPdvdTables() const;
const TableContainer& getSaltvdTables() const;
const TableContainer& getSaltpvdTables() const;
const TableContainer& getSaltsolTables() const;
const TableContainer& getPermfactTables() const;
const TableContainer& getEnkrvdTables() const;
const TableContainer& getEnptvdTables() const;
@ -149,6 +151,7 @@ namespace Opm {
const PvtwTable& getPvtwTable() const;
const std::vector<PvtwsaltTable>& getPvtwSaltTables() const;
const std::vector<RwgsaltTable>& getRwgSaltTables() const;
const std::vector<SaltSolubilityTable>& getSaltSolubilityTables() const;
const std::vector<BrineDensityTable>& getBrineDensityTables() const;
const std::vector<SolventDensityTable>& getSolventDensityTables() const;
@ -218,6 +221,7 @@ namespace Opm {
m_watdentTable.serializeOp(serializer);
serializer.vector(m_pvtwsaltTables);
serializer.vector(m_rwgsaltTables);
serializer.vector(m_saltsolTables);
serializer.vector(m_bdensityTables);
serializer.vector(m_sdensityTables);
serializer.map(m_plymwinjTables);
@ -290,6 +294,9 @@ namespace Opm {
template <class TableType>
void initRwgsaltTables(const Deck& deck, std::vector<TableType>& rwgtables );
template <class TableType>
void initSaltsolTables(const Deck& deck, std::vector<TableType>& saltsoltables);
template <class TableType>
void initBrineTables(const Deck& deck, std::vector<TableType>& brinetables );
@ -357,6 +364,7 @@ namespace Opm {
WatdentTable m_watdentTable;
std::vector<PvtwsaltTable> m_pvtwsaltTables;
std::vector<RwgsaltTable> m_rwgsaltTables;
std::vector<SaltSolubilityTable> m_saltsolTables;
std::vector<BrineDensityTable> m_bdensityTables;
std::vector<SolventDensityTable> m_sdensityTables;
std::map<int, PlymwinjTable> m_plymwinjTables;

View File

@ -0,0 +1,52 @@
/*
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 <http://www.gnu.org/licenses/>.
*/
#include <vector>
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.hpp>
namespace Opm {
SaltSolubilityTable SaltSolubilityTable::serializeObject()
{
SaltSolubilityTable result;
result.m_tableValues = {1.0, 2.0, 3.0};
return result;
}
void SaltSolubilityTable::init(const Opm::DeckRecord& record )
{
m_tableValues = record.getItem("SALT_SOLUBILITY").getSIDoubleData();
}
const std::vector<double>& SaltSolubilityTable::getSaltSolubilityColumn() const
{
return m_tableValues;
}
bool SaltSolubilityTable::operator==(const SaltSolubilityTable& data) const
{
return m_tableValues == data.m_tableValues;
}
}

View File

@ -85,6 +85,7 @@
#include <opm/parser/eclipse/EclipseState/Tables/PermfactTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltpvdTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SgcwmisTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SgfnTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp>
@ -230,6 +231,9 @@ DensityTable make_density_table(const GravityTable& gravity) {
if ( deck.hasKeyword( "RWGSALT") )
initRwgsaltTables(deck, m_rwgsaltTables );
if ( deck.hasKeyword( "SALTSOL") )
initSaltsolTables(deck, m_saltsolTables );
if ( deck.hasKeyword( "BDENSITY") )
initBrineTables(deck, m_bdensityTables );
@ -298,6 +302,7 @@ DensityTable make_density_table(const GravityTable& gravity) {
result.m_watdentTable = WatdentTable::serializeObject();
result.m_pvtwsaltTables = {PvtwsaltTable::serializeObject()};
result.m_rwgsaltTables = {RwgsaltTable::serializeObject()};
result.m_saltsolTables = {SaltSolubilityTable::serializeObject()};
result.m_bdensityTables = {BrineDensityTable::serializeObject()};
result.m_sdensityTables = {SolventDensityTable::serializeObject()};
result.m_plymwinjTables = {{1, Opm::PlymwinjTable::serializeObject()}};
@ -932,6 +937,10 @@ DensityTable make_density_table(const GravityTable& gravity) {
return getTables("SALTPVD");
}
const TableContainer& TableManager::getSaltsolTables() const {
return getTables("SALTSOL");
}
const TableContainer& TableManager::getPermfactTables() const {
return getTables("PERMFACT");
}
@ -1078,6 +1087,10 @@ DensityTable make_density_table(const GravityTable& gravity) {
return this->m_rwgsaltTables;
}
const std::vector<SaltSolubilityTable>& TableManager::getSaltSolubilityTables() const {
return this->m_saltsolTables;
}
const std::vector<BrineDensityTable>& TableManager::getBrineDensityTables() const {
return this->m_bdensityTables;
}
@ -1236,6 +1249,7 @@ DensityTable make_density_table(const GravityTable& gravity) {
m_watdentTable == data.m_watdentTable &&
m_pvtwsaltTables == data.m_pvtwsaltTables &&
m_rwgsaltTables == data.m_rwgsaltTables &&
m_saltsolTables == data.m_saltsolTables &&
m_bdensityTables == data.m_bdensityTables &&
m_sdensityTables == data.m_sdensityTables &&
m_plymwinjTables == data.m_plymwinjTables &&
@ -1476,6 +1490,19 @@ DensityTable make_density_table(const GravityTable& gravity) {
assert(regionIdx == numTables);
}
template <class TableType>
void TableManager::initSaltsolTables(const Deck& deck, std::vector<TableType>& saltsoltables) {
size_t numTables = m_tabdims.getNumPVTTables();
saltsoltables.resize(numTables);
const auto& keyword = deck.getKeyword("SALTSOL");
size_t numEntries = keyword.size();
assert(numEntries == numTables);
for (unsigned lineIdx = 0; lineIdx < numEntries; ++lineIdx) {
saltsoltables[lineIdx].init(keyword.getRecord(lineIdx));
}
}
template <class TableType>
void TableManager::initBrineTables(const Deck& deck, std::vector<TableType>& brinetables ) {

View File

@ -3,8 +3,16 @@
"sections": [
"PROPS"
],
"data": {
"value_type": "DOUBLE",
"dimension": "Density"
}
"size": {
"keyword": "TABDIMS",
"item": "NTPVT"
},
"items": [
{
"name": "SALT_SOLUBILITY",
"value_type": "DOUBLE",
"size_type": "ALL",
"dimension": "Density"
}
]
}