Skip to content

Commit

Permalink
Merge pull request OPM#2593 from plgbrts/salt_prec
Browse files Browse the repository at this point in the history
salt solubility table allowing specification of solubility per region
  • Loading branch information
bska authored Dec 8, 2021
2 parents 35ba2a3 + 48124f1 commit 84bf899
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 9 deletions.
1 change: 1 addition & 0 deletions CMakeLists_files.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,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
Expand Down
36 changes: 36 additions & 0 deletions opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
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

#include "SimpleTable.hpp"

namespace Opm {

class DeckItem;

class SaltsolTable : public SimpleTable {
public:
SaltsolTable( const DeckItem& item );

const TableColumn& getSaltsolColumn() const;
};
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_PARSER_SOLVENTDENSITY_TABLE_HPP
#define OPM_PARSER_SOLVENTDENSITY_TABLE_HPP
#define OPM_PARSER_SOLVENTDENSITY_TABLE_HPP

namespace Opm {

Expand Down
1 change: 1 addition & 0 deletions opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,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;
Expand Down
8 changes: 7 additions & 1 deletion src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -442,6 +443,7 @@ DensityTable make_density_table(const GravityTable& gravity) {
addTables( "PDVD", m_eqldims.getNumEquilRegions());
addTables( "SALTVD", m_eqldims.getNumEquilRegions());
addTables( "SALTPVD", m_eqldims.getNumEquilRegions());
addTables( "SALTSOL", m_tabdims.getNumPVTTables());
addTables( "PERMFACT", m_eqldims.getNumEquilRegions());

addTables( "AQUTAB", m_aqudims.getNumInfluenceTablesCT());
Expand Down Expand Up @@ -507,6 +509,7 @@ DensityTable make_density_table(const GravityTable& gravity) {
initSimpleTableContainer<PdvdTable>(deck, "PDVD" , m_eqldims.getNumEquilRegions());
initSimpleTableContainer<SaltpvdTable>(deck, "SALTPVD" , m_eqldims.getNumEquilRegions());
initSimpleTableContainer<SaltvdTable>(deck, "SALTVD" , m_eqldims.getNumEquilRegions());
initSimpleTableContainer<SaltsolTable>(deck, "SALTSOL" , m_tabdims.getNumPVTTables());
initSimpleTableContainer<SaltvdTable>(deck, "PERMFACT" , m_eqldims.getNumEquilRegions());
initSimpleTableContainer<AqutabTable>(deck, "AQUTAB" , m_aqudims.getNumInfluenceTablesCT());
{
Expand Down Expand Up @@ -932,6 +935,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");
}
Expand Down Expand Up @@ -1476,7 +1483,6 @@ DensityTable make_density_table(const GravityTable& gravity) {
assert(regionIdx == numTables);
}


template <class TableType>
void TableManager::initBrineTables(const Deck& deck, std::vector<TableType>& brinetables ) {

Expand Down
13 changes: 13 additions & 0 deletions src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,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>
Expand Down Expand Up @@ -1078,6 +1079,18 @@ const TableColumn& SaltpvdTable::getSaltpColumn() const {
return SimpleTable::getColumn(1);
}


SaltsolTable::SaltsolTable( const DeckItem& item ) {
m_schema.addColumn( ColumnSchema( "SALTSOLUBILITY" , Table::RANDOM , Table::DEFAULT_NONE ));

SimpleTable::init(item);
}

const TableColumn& SaltsolTable::getSaltsolColumn() const {
return SimpleTable::getColumn(0);
}


PermfactTable::PermfactTable( const DeckItem& item ) {
m_schema.addColumn( ColumnSchema( "POROSITYCHANGE" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE ));
m_schema.addColumn( ColumnSchema( "PERMEABILIYMULTIPLIER" , Table::RANDOM , Table::DEFAULT_NONE ));
Expand Down
16 changes: 12 additions & 4 deletions src/opm/parser/eclipse/share/keywords/900_OPM/S/SALTSOL
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"sections": [
"PROPS"
],
"data": {
"value_type": "DOUBLE",
"dimension": "Density"
}
"size": {
"keyword": "TABDIMS",
"item": "NTPVT"
},
"items": [
{
"name": "DATA",
"value_type": "DOUBLE",
"size_type": "ALL",
"dimension": "Density"
}
]
}
29 changes: 26 additions & 3 deletions tests/parser/SaltTableTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <opm/parser/eclipse/EclipseState/Tables/SaltvdTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltpvdTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PermfactTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SaltSolubilityTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>

// keyword specific table classes
Expand Down Expand Up @@ -80,7 +81,8 @@ BOOST_AUTO_TEST_CASE( Brine ) {
"\n"
"SALTPVD\n"
"500 0\n"
"550 0.5/\n";
"550 0.5/\n"
"\n";

Opm::Parser parser;
auto deck = parser.parseString(deckData);
Expand Down Expand Up @@ -144,10 +146,31 @@ BOOST_AUTO_TEST_CASE( Brine ) {

BOOST_CHECK_EQUAL(permfactTable.getPorosityChangeColumn().size(), 4U);
BOOST_CHECK_CLOSE(permfactTable.getPermeabilityMultiplierColumn() [3],1.5, 1e-5);


}

BOOST_AUTO_TEST_CASE( Saltsol ) {
const char *deckData =
"TABDIMS\n"
"1 2/\n"
"\n"
"SALTSOL\n"
"8.0/\n"
"9.0/\n"
"\n"
;

Opm::Parser parser;
auto deck = parser.parseString(deckData);

Opm::TableManager tables(deck);
const Opm::TableContainer& saltsolTables = tables.getSaltsolTables();
const auto& saltsolTable1 = saltsolTables.getTable<Opm::SaltsolTable>(0);

BOOST_CHECK_EQUAL(saltsolTable1.getSaltsolColumn().size(), 1U);
BOOST_CHECK_CLOSE(saltsolTable1.getSaltsolColumn() [0], 8.0, 1e-5);

const auto& saltsolTable2 = saltsolTables.getTable<Opm::SaltsolTable>(1);

BOOST_CHECK_EQUAL(saltsolTable2.getSaltsolColumn().size(), 1U);
BOOST_CHECK_CLOSE(saltsolTable2.getSaltsolColumn() [0], 9.0, 1e-5);
}

0 comments on commit 84bf899

Please sign in to comment.