Don't Output Gas Lift Parameters Unless Active

This commit checks that gas lift is active before outputting a
positive value in INTEHEAD[EACHNC].  Unless gas lift is activated
through keyword LIFTOPT, that item in INTEHEAD must be zero.
This commit is contained in:
Bård Skaflestad
2021-04-29 11:05:17 +02:00
parent 04622a13a5
commit c76f1364c2
2 changed files with 26 additions and 5 deletions

View File

@@ -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

View File

@@ -21,6 +21,7 @@
#include <opm/output/eclipse/WriteRestartHelpers.hpp>
#include <opm/output/eclipse/InteHEAD.hpp>
#include <opm/output/eclipse/VectorItems/intehead.hpp>
#include <opm/parser/eclipse/EclipseState/Aquifer/AquiferConfig.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
@@ -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 })