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); }