Simulation Config: Add Predicate for Thermal Simulations
This commit introduces a new predicate,
bool SimulationConfig::isThermal() const
that determines whether or not either of the keywords
TEMP or THERMAL
are specified in the RUNSPEC section of a simulation run.
This commit is contained in:
@@ -104,6 +104,32 @@ const std::string& inputStr_vap_dis = "RUNSPEC\n"
|
||||
"REGIONS\n"
|
||||
"\n";
|
||||
|
||||
namespace {
|
||||
std::string simDeckStringTEMP()
|
||||
{
|
||||
return R"(
|
||||
RUNSPEC
|
||||
|
||||
TEMP
|
||||
|
||||
DIMENS
|
||||
10 3 4 /
|
||||
)";
|
||||
}
|
||||
|
||||
std::string simDeckStringTHERMAL()
|
||||
{
|
||||
return R"(
|
||||
RUNSPEC
|
||||
|
||||
THERMAL
|
||||
|
||||
DIMENS
|
||||
10 3 4 /
|
||||
)";
|
||||
}
|
||||
}
|
||||
|
||||
static Deck createDeck(const ParseContext& parseContext , const std::string& input) {
|
||||
Opm::Parser parser;
|
||||
return parser.parseString(input, parseContext);
|
||||
@@ -211,3 +237,39 @@ BOOST_AUTO_TEST_CASE(SimulationConfig_VAPOIL_DISGAS) {
|
||||
BOOST_CHECK_EQUAL( true , simulationConfig_vd.hasDISGAS());
|
||||
BOOST_CHECK_EQUAL( true , simulationConfig_vd.hasVAPOIL());
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(SimulationConfig_TEMP_THERMAL)
|
||||
{
|
||||
const auto parseContext = Opm::ParseContext {};
|
||||
|
||||
{
|
||||
const auto deck = createDeck(parseContext, inputStr);
|
||||
const auto tm = Opm::TableManager(deck);
|
||||
const auto eg = Opm::EclipseGrid(10, 3, 4);
|
||||
const auto ep = Opm::Eclipse3DProperties(deck, tm, eg);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, ep);
|
||||
|
||||
BOOST_CHECK(! simulationConfig.isThermal());
|
||||
}
|
||||
|
||||
{
|
||||
const auto deck = createDeck(parseContext, simDeckStringTEMP());
|
||||
const auto tm = Opm::TableManager(deck);
|
||||
const auto eg = Opm::EclipseGrid(10, 3, 4);
|
||||
const auto ep = Opm::Eclipse3DProperties(deck, tm, eg);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, ep);
|
||||
|
||||
BOOST_CHECK(simulationConfig.isThermal());
|
||||
}
|
||||
|
||||
{
|
||||
const auto deck = createDeck(parseContext, simDeckStringTHERMAL());
|
||||
const auto tm = Opm::TableManager(deck);
|
||||
const auto eg = Opm::EclipseGrid(10, 3, 4);
|
||||
const auto ep = Opm::Eclipse3DProperties(deck, tm, eg);
|
||||
const auto simulationConfig = Opm::SimulationConfig(false, deck, ep);
|
||||
|
||||
BOOST_CHECK(simulationConfig.isThermal());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user