diff --git a/opm/output/eclipse/VectorItems/intehead.hpp b/opm/output/eclipse/VectorItems/intehead.hpp index 4241a9100..38c9271d6 100644 --- a/opm/output/eclipse/VectorItems/intehead.hpp +++ b/opm/output/eclipse/VectorItems/intehead.hpp @@ -161,6 +161,14 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems ISECND = 410 // ISECND = current simulation time HH:MM:SS - number of seconds (SS), reported in microseconds // (0-59,999,999) }; + + namespace InteheadValues { + enum LiftOpt : int { + NotActive = 0, // Gas lift not enabled (LIFTOPT not present) + FirstIterationOnly = 1, // Optimise gas lift in first Newton iteration only (LIFTOPT(4) = NO) + EachNupCol = 2, // Optimise gas lift in each of first NUPCOL Newton iterations (LIFTOPT(4) = YES) + }; + } // InteheadValues }}}} // Opm::RestartIO::Helpers::VectorItems #endif // OPM_OUTPUT_ECLIPSE_VECTOR_INTEHEAD_HPP diff --git a/src/opm/output/eclipse/CreateInteHead.cpp b/src/opm/output/eclipse/CreateInteHead.cpp index 6cad9f368..e5941480d 100755 --- a/src/opm/output/eclipse/CreateInteHead.cpp +++ b/src/opm/output/eclipse/CreateInteHead.cpp @@ -21,6 +21,7 @@ #include #include +#include #include #include @@ -462,11 +463,23 @@ namespace { } int getLiftOptPar(const ::Opm::Schedule& sched, - const std::size_t lookup_step) + const std::size_t report_step, + const std::size_t lookup_step) { - const auto& each_nupcol = sched.glo(lookup_step).all_newton(); - int in_enc = (each_nupcol) ? 2 : 1; - return in_enc; + using Value = ::Opm::RestartIO::Helpers::VectorItems::InteheadValues::LiftOpt; + + if (report_step == std::size_t{0}) { + return Value::NotActive; + } + + const auto& gasLiftOpt = sched.glo(lookup_step); + if (! gasLiftOpt.active()) { + return Value::NotActive; + } + + return gasLiftOpt.all_newton() + ? Value::EachNupCol + : Value::FirstIterationOnly; } Opm::RestartIO::InteHEAD::NetworkDims @@ -546,7 +559,7 @@ createInteHead(const EclipseState& es, .aquiferDimensions (inferAquiferDimensions(es)) .stepParam (num_solver_steps, report_step) .tuningParam (getTuningPars(sched[lookup_step].tuning())) - .liftOptParam (getLiftOptPar(sched, lookup_step)) + .liftOptParam (getLiftOptPar(sched, report_step, lookup_step)) .wellSegDimensions (getWellSegDims(rspec, sched, report_step, lookup_step)) .regionDimensions (getRegDims(tdim, rdim)) .ngroups ({ ngmax })