From c736e71e46ffd96c833eb6d37f36ae27538f939e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Thu, 10 Oct 2019 22:28:41 -0500 Subject: [PATCH] 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. --- src/opm/output/eclipse/WriteInit.cpp | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/src/opm/output/eclipse/WriteInit.cpp b/src/opm/output/eclipse/WriteInit.cpp index dc45f92b0..3ce65a312 100644 --- a/src/opm/output/eclipse/WriteInit.cpp +++ b/src/opm/output/eclipse/WriteInit.cpp @@ -24,6 +24,8 @@ #include +#include + #include #include @@ -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); }