Add CO2STOR keyword in Runspec section

This commit is contained in:
Tor Harald Sandve
2020-09-14 11:26:04 +02:00
parent 0935aae02c
commit f3e209b740
5 changed files with 48 additions and 2 deletions

View File

@@ -279,6 +279,7 @@ public:
const Actdims& actdims() const noexcept;
const SatFuncControls& saturationFunctionControls() const noexcept;
int nupcol() const noexcept;
bool co2Storage() const noexcept;
bool operator==(const Runspec& data) const;
@@ -295,6 +296,7 @@ public:
m_actdims.serializeOp(serializer);
m_sfuncctrl.serializeOp(serializer);
serializer(m_nupcol);
serializer(m_co2storage);
}
private:
@@ -308,6 +310,7 @@ private:
Actdims m_actdims;
SatFuncControls m_sfuncctrl;
int m_nupcol;
bool m_co2storage;
};

View File

@@ -21,6 +21,7 @@
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckSection.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/C.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/N.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/S.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/T.hpp>
@@ -315,7 +316,8 @@ Runspec::Runspec( const Deck& deck ) :
hystpar( deck ),
m_actdims( deck ),
m_sfuncctrl( deck ),
m_nupcol( ParserKeywords::NUPCOL::NUM_ITER::defaultValue )
m_nupcol( ParserKeywords::NUPCOL::NUM_ITER::defaultValue ),
m_co2storage (false)
{
if (DeckSection::hasRUNSPEC(deck)) {
const RUNSPECSection runspecSection{deck};
@@ -328,6 +330,11 @@ Runspec::Runspec( const Deck& deck ) :
OpmLog::note(msg);
}
}
if (runspecSection.hasKeyword<ParserKeywords::CO2STOR>()) {
m_co2storage = true;
std::string msg = "The CO2 storage option is given. PVT properties from the Brine-CO2 system is used";
OpmLog::note(msg);
}
}
}
@@ -344,6 +351,7 @@ Runspec Runspec::serializeObject()
result.m_actdims = Actdims::serializeObject();
result.m_sfuncctrl = SatFuncControls::serializeObject();
result.m_nupcol = 2;
result.m_co2storage = true;
return result;
}
@@ -389,6 +397,11 @@ int Runspec::nupcol() const noexcept
return this->m_nupcol;
}
bool Runspec::co2Storage() const noexcept
{
return this->m_co2storage;
}
/*
Returns an integer in the range 0...7 which can be used to indicate
available phases in Eclipse restart and init files.
@@ -417,7 +430,8 @@ bool Runspec::operator==(const Runspec& data) const {
this->hysterPar() == data.hysterPar() &&
this->actdims() == data.actdims() &&
this->saturationFunctionControls() == data.saturationFunctionControls() &&
this->m_nupcol == data.m_nupcol;
this->m_nupcol == data.m_nupcol &&
this->m_co2storage == data.m_co2storage;
}
}

View File

@@ -0,0 +1,6 @@
{
"name": "CO2STOR",
"sections": [
"RUNSPEC"
]
}

View File

@@ -1085,6 +1085,7 @@ set( keywords
002_Frontsim/N/NOGRAV
900_OPM/B/BC
900_OPM/C/CO2STOR
900_OPM/E/EXIT
900_OPM/G/GCOMPIDX
900_OPM/G/GRUPRIG

View File

@@ -641,3 +641,25 @@ BOOST_AUTO_TEST_CASE(ACTDIMS) {
BOOST_CHECK_EQUAL(actdims.max_keywords(), 2);
BOOST_CHECK_EQUAL(actdims.max_conditions(), 14);
}
BOOST_AUTO_TEST_CASE(Co2Storage) {
const std::string input = R"(
RUNSPEC
OIL
GAS
CO2STOR
)";
Parser parser;
auto deck = parser.parseString(input);
Runspec runspec( deck );
const auto& phases = runspec.phases();
BOOST_CHECK_EQUAL( 2, phases.size() );
BOOST_CHECK( phases.active( Phase::OIL ) );
BOOST_CHECK( phases.active( Phase::GAS ) );
BOOST_CHECK( runspec.co2Storage() );
}