Merge pull request #3634 from akva2/mech_runspec
-- added MECH to runspec
This commit is contained in:
@@ -472,6 +472,7 @@ public:
|
||||
bool co2Storage() const noexcept;
|
||||
bool h2Storage() const noexcept;
|
||||
bool micp() const noexcept;
|
||||
bool mech() const noexcept;
|
||||
|
||||
bool operator==(const Runspec& data) const;
|
||||
static bool rst_cmp(const Runspec& full_state, const Runspec& rst_state);
|
||||
@@ -496,6 +497,7 @@ public:
|
||||
serializer(m_co2storage);
|
||||
serializer(m_h2storage);
|
||||
serializer(m_micp);
|
||||
serializer(m_mech);
|
||||
}
|
||||
|
||||
private:
|
||||
@@ -517,6 +519,7 @@ private:
|
||||
bool m_co2storage;
|
||||
bool m_h2storage;
|
||||
bool m_micp;
|
||||
bool m_mech;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -624,6 +624,7 @@ Runspec::Runspec( const Deck& deck )
|
||||
, m_co2storage (false)
|
||||
, m_h2storage (false)
|
||||
, m_micp (false)
|
||||
, m_mech (false)
|
||||
{
|
||||
if (DeckSection::hasRUNSPEC(deck)) {
|
||||
const RUNSPECSection runspecSection{deck};
|
||||
@@ -671,6 +672,12 @@ Runspec::Runspec( const Deck& deck )
|
||||
"for details on the used model.";
|
||||
OpmLog::note(msg);
|
||||
}
|
||||
|
||||
if (runspecSection.hasKeyword<ParserKeywords::MECH>()) {
|
||||
m_mech = true;
|
||||
const std::string msg = "Simulation will solve for mechanical quantities";
|
||||
OpmLog::note(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -692,6 +699,7 @@ Runspec Runspec::serializationTestObject()
|
||||
result.m_co2storage = true;
|
||||
result.m_h2storage = true;
|
||||
result.m_micp = true;
|
||||
result.m_mech = true;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -766,6 +774,11 @@ bool Runspec::micp() const noexcept
|
||||
return this->m_micp;
|
||||
}
|
||||
|
||||
bool Runspec::mech() const noexcept
|
||||
{
|
||||
return this->m_mech;
|
||||
}
|
||||
|
||||
std::time_t Runspec::start_time() const noexcept
|
||||
{
|
||||
return this->m_start_time;
|
||||
@@ -805,6 +818,7 @@ bool Runspec::rst_cmp(const Runspec& full_spec, const Runspec& rst_spec) {
|
||||
full_spec.m_co2storage == rst_spec.m_co2storage &&
|
||||
full_spec.m_h2storage == rst_spec.m_h2storage &&
|
||||
full_spec.m_micp == rst_spec.m_micp &&
|
||||
full_spec.m_mech == rst_spec.m_mech &&
|
||||
Welldims::rst_cmp(full_spec.wellDimensions(), rst_spec.wellDimensions());
|
||||
}
|
||||
|
||||
@@ -822,7 +836,8 @@ bool Runspec::operator==(const Runspec& data) const {
|
||||
this->m_nupcol == data.m_nupcol &&
|
||||
this->m_co2storage == data.m_co2storage &&
|
||||
this->m_h2storage == data.m_h2storage &&
|
||||
this->m_micp == data.m_micp;
|
||||
this->m_micp == data.m_micp &&
|
||||
this->m_mech == data.m_mech;
|
||||
}
|
||||
|
||||
|
||||
|
||||
6
src/opm/input/eclipse/share/keywords/900_OPM/M/MECH
Normal file
6
src/opm/input/eclipse/share/keywords/900_OPM/M/MECH
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "MECH",
|
||||
"sections": [
|
||||
"RUNSPEC"
|
||||
]
|
||||
}
|
||||
@@ -1113,6 +1113,7 @@ set( keywords
|
||||
900_OPM/G/GCOMPIDX
|
||||
900_OPM/G/GASDENT
|
||||
900_OPM/G/GASJT
|
||||
900_OPM/M/MECH
|
||||
900_OPM/M/MICP
|
||||
900_OPM/M/MICPPARA
|
||||
900_OPM/M/MINNPCOL
|
||||
|
||||
@@ -1112,3 +1112,25 @@ BOOST_AUTO_TEST_CASE(NUPCOL) {
|
||||
BOOST_CHECK_EQUAL(np.value(), min_value);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Mech) {
|
||||
const std::string input = R"(
|
||||
RUNSPEC
|
||||
OIL
|
||||
GAS
|
||||
WATER
|
||||
MECH
|
||||
)";
|
||||
|
||||
Parser parser;
|
||||
|
||||
auto deck = parser.parseString(input);
|
||||
|
||||
Runspec runspec( deck );
|
||||
const auto& phases = runspec.phases();
|
||||
BOOST_CHECK_EQUAL( 3U, phases.size() );
|
||||
BOOST_CHECK( phases.active( Phase::OIL ) );
|
||||
BOOST_CHECK( phases.active( Phase::GAS ) );
|
||||
BOOST_CHECK( phases.active( Phase::WATER ) );
|
||||
BOOST_CHECK( runspec.mech() );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user