Internalise TOLCRIT Keyword

This commit internalises the TOLCRIT keyword into the EclipseState
for subsequent use in determining critical saturations when
processing saturation function keywords such as SGOF and SOF3.
Specifically, we add a new type

    Opm::SatFuncControls

that, at present, stores only the TOLCRIT data item (defaulted to
the keyword's default value).  Client code can then retrieve the
value by calling the

    SatFuncControls::minimumRelpermMobilityThreshold()

member function.

Add a new data member of this type to the Opm::Runspec class so that
we complete the chain from EclipseState, and a few simple unit tests
to exercise the expected functionality.
This commit is contained in:
Bård Skaflestad
2020-01-24 13:52:12 +01:00
parent 4094e4957a
commit 7c1b77ec5d
3 changed files with 107 additions and 6 deletions

View File

@@ -477,6 +477,54 @@ BOOST_AUTO_TEST_CASE( SWATINIT ) {
}
BOOST_AUTO_TEST_CASE(TolCrit)
{
{
const auto sfctrl = ::Opm::SatFuncControls{};
BOOST_CHECK_CLOSE(sfctrl.minimumRelpermMobilityThreshold(), 1.0e-6, 1.0e-10);
BOOST_CHECK_MESSAGE(sfctrl == ::Opm::SatFuncControls{},
"Default-constructed SatFuncControl must equal itself");
}
{
const auto sfctrl = ::Opm::SatFuncControls{ 5.0e-7 };
BOOST_CHECK_CLOSE(sfctrl.minimumRelpermMobilityThreshold(), 5.0e-7, 1.0e-10);
BOOST_CHECK_MESSAGE(!(sfctrl == ::Opm::SatFuncControls{}),
"Default-constructed SatFuncControl must NOT equal non-default");
const auto deck = ::Opm::Parser{}.parseString(R"(
TOLCRIT
5.0E-7 /
)");
BOOST_CHECK_CLOSE(sfctrl.minimumRelpermMobilityThreshold(),
::Opm::SatFuncControls{deck}.minimumRelpermMobilityThreshold(),
1.0e-10);
}
{
const auto deck = ::Opm::Parser{}.parseString(R"(
RUNSPEC
END
)");
const auto rspec = ::Opm::Runspec{deck};
const auto sfctrl = rspec.saturationFunctionControls();
BOOST_CHECK_CLOSE(sfctrl.minimumRelpermMobilityThreshold(), 1.0e-6, 1.0e-10);
}
{
const auto deck = ::Opm::Parser{}.parseString(R"(
TOLCRIT
5.0E-7 /
)");
const auto rspec = ::Opm::Runspec{deck};
const auto sfctrl = rspec.saturationFunctionControls();
BOOST_CHECK_CLOSE(sfctrl.minimumRelpermMobilityThreshold(), 5.0e-7, 1.0e-10);
}
}
BOOST_AUTO_TEST_CASE(Solvent) {
const std::string input = R"(