Merge pull request #879 from atgeirr/add-foammob
Add FOAMMOB and friends
This commit is contained in:
@@ -482,6 +482,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Tables/AqutabTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp
|
||||
opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp
|
||||
|
||||
39
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
Normal file
39
opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
Copyright (C) 2014 by Andreas Lauser
|
||||
Copyright 2019 SINTEF Digital, Mathematics and Cybernetics.
|
||||
|
||||
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_FOAMMOBTABLE_HEADER_INCLUDED
|
||||
#define OPM_FOAMMOBTABLE_HEADER_INCLUDED
|
||||
|
||||
#include "SimpleTable.hpp"
|
||||
|
||||
namespace Opm {
|
||||
|
||||
class DeckItem;
|
||||
|
||||
class FoammobTable : public SimpleTable {
|
||||
public:
|
||||
FoammobTable( const DeckItem& item );
|
||||
|
||||
const TableColumn& getFoamConcentrationColumn() const;
|
||||
const TableColumn& getMobilityMultiplierColumn() const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif // OPM_FOAMMOBTABLE_HEADER_INCLUDED
|
||||
@@ -109,6 +109,7 @@ namespace Opm {
|
||||
const TableContainer& getPlyshlogTables() const;
|
||||
const TableContainer& getAqutabTables() const;
|
||||
const TableContainer& getFoamadsTables() const;
|
||||
const TableContainer& getFoammobTables() const;
|
||||
|
||||
const TableContainer& getSorwmisTables() const;
|
||||
const TableContainer& getSgcwmisTables() const;
|
||||
|
||||
@@ -78,6 +78,18 @@ FoamData::rockDensity() const
|
||||
|
||||
FoamConfig::FoamConfig(const Deck& deck)
|
||||
{
|
||||
if (deck.hasKeyword<ParserKeywords::FOAMOPTS>()) {
|
||||
// We only support the default (GAS transport phase, TAB mobility reduction model)
|
||||
// setup for foam at this point, so we detect and deal with it here even though we
|
||||
// do not store any data related to it.
|
||||
const auto& kw_foamopts = deck.getKeyword<ParserKeywords::FOAMOPTS>();
|
||||
if (kw_foamopts.getRecord(0).getItem(0).get<std::string>(0) != "GAS") {
|
||||
throw std::runtime_error("In FOAMOPTS, only the GAS transport phase is supported.");
|
||||
}
|
||||
if (kw_foamopts.getRecord(0).getItem(1).get<std::string>(0) != "TAB") {
|
||||
throw std::runtime_error("In FOAMOPTS, only the TAB gas mobility reduction model is supported.");
|
||||
}
|
||||
}
|
||||
if (deck.hasKeyword<ParserKeywords::FOAMFSC>()) {
|
||||
const auto& kw_foamfsc = deck.getKeyword<ParserKeywords::FOAMFSC>();
|
||||
if (!deck.hasKeyword<ParserKeywords::FOAMROCK>()) {
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlyviscTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp>
|
||||
@@ -230,6 +231,7 @@ namespace Opm {
|
||||
addTables( "PLYDHFLF", m_tabdims.getNumPVTTables());
|
||||
|
||||
addTables( "FOAMADS", m_tabdims.getNumSatTables() );
|
||||
addTables( "FOAMMOB", m_tabdims.getNumPVTTables() );
|
||||
|
||||
addTables( "PVDG", m_tabdims.getNumPVTTables());
|
||||
addTables( "PVDO", m_tabdims.getNumPVTTables());
|
||||
@@ -364,6 +366,7 @@ namespace Opm {
|
||||
initSimpleTableContainer<PlydhflfTable>(deck, "PLYDHFLF", m_tabdims.getNumPVTTables());
|
||||
|
||||
initSimpleTableContainer<FoamadsTable>(deck, "FOAMADS", m_tabdims.getNumSatTables());
|
||||
initSimpleTableContainer<FoammobTable>(deck, "FOAMMOB", m_tabdims.getNumPVTTables());
|
||||
|
||||
initPlyrockTables(deck);
|
||||
initPlymaxTables(deck);
|
||||
@@ -778,6 +781,9 @@ namespace Opm {
|
||||
return getTables("FOAMADS");
|
||||
}
|
||||
|
||||
const TableContainer& TableManager::getFoammobTables() const {
|
||||
return getTables("FOAMMOB");
|
||||
}
|
||||
|
||||
const std::vector<PvtgTable>& TableManager::getPvtgTables() const {
|
||||
return m_pvtgTables;
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlyviscTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PmiscTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TlpmixpaTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp>
|
||||
@@ -470,7 +471,6 @@ FoamadsTable::FoamadsTable( const DeckItem& item ) {
|
||||
SimpleTable::init(item);
|
||||
}
|
||||
|
||||
|
||||
const TableColumn& FoamadsTable::getFoamConcentrationColumn() const {
|
||||
return SimpleTable::getColumn(0);
|
||||
}
|
||||
@@ -479,6 +479,21 @@ const TableColumn& FoamadsTable::getAdsorbedFoamColumn() const {
|
||||
return SimpleTable::getColumn(1);
|
||||
}
|
||||
|
||||
FoammobTable::FoammobTable( const DeckItem& item ) {
|
||||
m_schema.addColumn( ColumnSchema("FoamConcentration" , Table::STRICTLY_INCREASING , Table::DEFAULT_NONE ));
|
||||
m_schema.addColumn( ColumnSchema("MobilityMultiplier" , Table::DECREASING , Table::DEFAULT_NONE ));
|
||||
|
||||
SimpleTable::init(item);
|
||||
}
|
||||
|
||||
const TableColumn& FoammobTable::getFoamConcentrationColumn() const {
|
||||
return SimpleTable::getColumn(0);
|
||||
}
|
||||
|
||||
const TableColumn& FoammobTable::getMobilityMultiplierColumn() const {
|
||||
return SimpleTable::getColumn(1);
|
||||
}
|
||||
|
||||
PlymaxTable::PlymaxTable( const DeckRecord& record ) {
|
||||
m_schema.addColumn( ColumnSchema("C_POLYMER", Table::RANDOM , Table::DEFAULT_NONE) );
|
||||
m_schema.addColumn( ColumnSchema("C_POLYMER_MAX", Table::RANDOM , Table::DEFAULT_NONE) );
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"name" : "FOAMADS" , "sections" : ["SPECIAL", "PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"} , "items" :
|
||||
{"name" : "FOAMADS" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"} , "items" :
|
||||
[
|
||||
{"name":"DATA", "value_type":"DOUBLE","size_type":"ALL", "dimension":["FoamDensity", "1"]}
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{"name" : "FOAMFSC" , "sections" : ["SPECIAL", "PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"} , "items" :
|
||||
{"name" : "FOAMFSC" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"} , "items" :
|
||||
[
|
||||
{"name" : "REF_SURF_CONC", "value_type" : "DOUBLE", "dimension" : "FoamSurfactantConcentration"},
|
||||
{"name" : "EXPONENT", "value_type" : "DOUBLE", "default" : 1.0, "dimension" : "1"},
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
{"name" : "FOAMMOB" , "sections" : ["PROPS"], "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"} , "items" :
|
||||
[
|
||||
{"name":"DATA", "value_type":"DOUBLE","size_type":"ALL", "dimension":["FoamDensity", "1"]}
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{"name" : "FOAMOPTS" , "sections" : ["PROPS"], "size" : 1, "items" :
|
||||
[
|
||||
{"name" : "TRANSPORT_PHASE" , "value_type" : "STRING", "default" : "GAS"},
|
||||
{"name" : "MODEL" , "value_type" : "STRING"}
|
||||
]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{"name" : "FOAMROCK" , "sections" : ["SPECIAL", "PROPS"], "size" : {"keyword":"TABDIMS" , "item":"NTSFUN"}, "items":
|
||||
{"name" : "FOAMROCK" , "sections" : ["PROPS"], "size" : {"keyword":"TABDIMS" , "item":"NTSFUN"}, "items":
|
||||
[ {"name" : "ADSORPTION_INDEX", "value_type" : "INT", "default" : 1},
|
||||
{"name" : "ROCK_DENSITY", "value_type" : "DOUBLE", "dimension" : "Density"}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name" : "WFOAM",
|
||||
"sections" : [ "SCHEDULE" ],
|
||||
"items" :
|
||||
[{"name" : "WELL" , "value_type" : "STRING"},
|
||||
{"name" : "FOAM_CONCENTRATION" , "value_type" : "UDA" , "dimension" : "FoamDensity"}
|
||||
]
|
||||
}
|
||||
@@ -111,6 +111,8 @@ set( keywords
|
||||
000_Eclipse100/F/FOAM
|
||||
000_Eclipse100/F/FOAMADS
|
||||
000_Eclipse100/F/FOAMFSC
|
||||
000_Eclipse100/F/FOAMMOB
|
||||
000_Eclipse100/F/FOAMOPTS
|
||||
000_Eclipse100/F/FOAMROCK
|
||||
000_Eclipse100/F/FRICTION
|
||||
000_Eclipse100/F/FULLIMP
|
||||
@@ -407,6 +409,7 @@ set( keywords
|
||||
000_Eclipse100/W/WELSPECL
|
||||
000_Eclipse100/W/WELSPECS
|
||||
000_Eclipse100/W/WELTARG
|
||||
000_Eclipse100/W/WFOAM
|
||||
000_Eclipse100/W/WGASPROD
|
||||
000_Eclipse100/W/WGRUPCON
|
||||
000_Eclipse100/W/WHISTCTL
|
||||
|
||||
@@ -75,6 +75,10 @@ START
|
||||
8 MAR 1998 /
|
||||
|
||||
PROPS
|
||||
|
||||
FOAMOPTS
|
||||
GAS TAB /
|
||||
|
||||
FOAMFSC
|
||||
1 2 0.3 /
|
||||
4 5 /
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlyadsTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlymaxTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FoamadsTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/FoammobTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PbvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PdvdTable.hpp>
|
||||
|
||||
@@ -567,6 +568,64 @@ BOOST_AUTO_TEST_CASE(FoamadsTable_Tests) {
|
||||
}
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(FoammobTable_Tests) {
|
||||
{
|
||||
const char *correctDeckData =
|
||||
"TABDIMS\n"
|
||||
"/\n"
|
||||
"FOAMMOB\n"
|
||||
"0.00 1.0 \n"
|
||||
"0.01 0.5\n"
|
||||
"0.02 0.1\n"
|
||||
"0.03 0.1 /\n";
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseString(correctDeckData);
|
||||
const auto& foammobKeyword = deck.getKeyword("FOAMMOB");
|
||||
Opm::FoammobTable foammobTable(foammobKeyword.getRecord(0).getItem(0));
|
||||
|
||||
|
||||
BOOST_CHECK_CLOSE(foammobTable.getFoamConcentrationColumn().front(), 0.0, 1e-6);
|
||||
BOOST_CHECK_CLOSE(foammobTable.getFoamConcentrationColumn().back(), 0.03, 1e-6);
|
||||
|
||||
BOOST_CHECK_CLOSE(foammobTable.getMobilityMultiplierColumn().front(), 1.0, 1e-6);
|
||||
BOOST_CHECK_CLOSE(foammobTable.getMobilityMultiplierColumn().back(), 0.1, 1e-6);
|
||||
}
|
||||
|
||||
{
|
||||
// first column not strictly monotonic
|
||||
const char *incorrectDeckData =
|
||||
"TABDIMS\n"
|
||||
"/\n"
|
||||
"FOAMMOB\n"
|
||||
"0.00 1.0 \n"
|
||||
"0.01 0.5\n"
|
||||
"0.02 0.1\n"
|
||||
"0.02 0.1 /\n";
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseString(incorrectDeckData);
|
||||
const auto& foammobKeyword = deck.getKeyword("FOAMMOB");
|
||||
|
||||
BOOST_CHECK_THROW(Opm::FoammobTable(foammobKeyword.getRecord(0).getItem(0)), std::invalid_argument);
|
||||
}
|
||||
|
||||
{
|
||||
// second column not monotonic
|
||||
const char *incorrectDeckData =
|
||||
"TABDIMS\n"
|
||||
"/\n"
|
||||
"FOAMMOB\n"
|
||||
"0.00 1.0 \n"
|
||||
"0.01 0.5\n"
|
||||
"0.02 0.1\n"
|
||||
"0.03 0.11 /\n";
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseString(incorrectDeckData);
|
||||
const auto& foammobKeyword = deck.getKeyword("FOAMMOB");
|
||||
|
||||
BOOST_CHECK_THROW(Opm::FoammobTable(foammobKeyword.getRecord(0).getItem(0)), std::invalid_argument);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user