INIT File: Bypass FILLEPS for Two-Phase Systems

Flow's saturation function finalizers don't currently handle models
with fewer than three active phases.  Don't attempt to fill in
scaled endpoint vectors in this case, but issue a warning that we're
ignoring FILLEPS here.
This commit is contained in:
Bård Skaflestad
2019-10-10 22:28:41 -05:00
parent e6e8b070d7
commit c736e71e46

View File

@@ -24,6 +24,8 @@
#include <opm/output/eclipse/WriteInit.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
#include <opm/io/eclipse/OutputStream.hpp>
#include <opm/output/data/Solution.hpp>
@@ -541,16 +543,34 @@ namespace {
const ::Opm::UnitSystem& units,
::Opm::EclIO::OutputStream::Init& initFile)
{
const auto& ph = es.runspec().phases();
const auto epsVectors = ScalingVectors{}
.withHysteresis(es.runspec().hysterPar().active())
.collect (es.runspec().phases());
.collect (ph);
const auto nactph = ph.active(::Opm::Phase::WATER)
+ ph.active(Opm::Phase::OIL)
+ ph.active(Opm::Phase::GAS);
const auto& props = es.get3DProperties().getDoubleProperties();
if (! es.cfg().init().filleps()) {
// No FILLEPS in input deck. Output those endpoint arrays that
// exist in the input deck. Write sentinel value if input
// defaulted.
if (! es.cfg().init().filleps() || (nactph < 3)) {
if (nactph < 3) {
const auto msg = "OPM-Flow does currently not support "
"FILLEPS for fewer than 3 active phases. "
"Ignoring FILLEPS for "
+ std::to_string(nactph)
+ " active phases.";
Opm::OpmLog::warning(msg);
}
// No FILLEPS in input deck or number of active phases
// unsupported by Flow's saturation function finalizers.
//
// Output only those endpoint arrays that exist in the input
// deck. Write sentinel value if input defaulted.
writeDoubleCellProperties(epsVectors.getVectors(), props,
grid, units, true, initFile);
}