Load GLIFTOPT properties from restart file

This commit is contained in:
Joakim Hove
2021-10-28 16:17:31 +02:00
parent 589191f532
commit 1849e2230c
4 changed files with 27 additions and 6 deletions

View File

@@ -59,6 +59,8 @@ struct RstGroup {
float gas_reservoir_limit;
float gas_reinject_limit;
float gas_voidage_limit;
float glift_max_supply;
float glift_max_rate;
double oil_production_rate;
double water_production_rate;

View File

@@ -23,6 +23,7 @@
#include <string>
#include <map>
#include <opm/io/eclipse/rst/well.hpp>
#include <opm/io/eclipse/rst/group.hpp>
namespace Opm {
@@ -37,6 +38,19 @@ public:
m_name(name)
{}
static bool active(const RestartIO::RstGroup& rst_group) {
if ((rst_group.glift_max_rate + rst_group.glift_max_supply) != 0)
return false;
return true;
}
explicit Group(const RestartIO::RstGroup& rst_group)
: m_name(rst_group.name)
, m_max_lift_gas(rst_group.glift_max_supply)
, m_max_total_gas(rst_group.glift_max_rate)
{}
const std::optional<double>& max_lift_gas() const {
return this->m_max_lift_gas;
}

View File

@@ -69,6 +69,8 @@ RstGroup::RstGroup(const ::Opm::UnitSystem& unit_system,
gas_reservoir_limit( sgrp_value(sgrp[VI::SGroup::gasResRateLimit])),
gas_reinject_limit( sgrp_value(sgrp[VI::SGroup::gasReinjectionLimit])),
gas_voidage_limit( sgrp_value(sgrp[VI::SGroup::gasVoidageLimit])),
glift_max_supply( unit_system.to_si(M::gas_surface_rate, sgrp[VI::SGroup::GLOMaxSupply])),
glift_max_rate( unit_system.to_si(M::gas_surface_rate, sgrp[VI::SGroup::GLOMaxRate])),
oil_production_rate( unit_system.to_si(M::liquid_surface_rate, xgrp[VI::XGroup::OilPrRate])),
water_production_rate( unit_system.to_si(M::liquid_surface_rate, xgrp[VI::XGroup::WatPrRate])),
gas_production_rate( unit_system.to_si(M::gas_surface_rate, xgrp[VI::XGroup::GasPrRate])),

View File

@@ -1394,6 +1394,12 @@ namespace {
OpmLog::info(fmt::format("Adding group {} from restart file", rst_group.name));
}
auto glo = this->snapshots.back().glo();
glo.all_newton(rst_state.header.glift_all_nupcol);
glo.min_wait(rst_state.header.glift_min_wait);
glo.min_eco_gradient(rst_state.header.glift_min_eco_grad);
glo.gaslift_increment(rst_state.header.glift_rate_delta);
for (std::size_t group_index = 0; group_index < rst_state.groups.size(); group_index++) {
const auto& rst_group = rst_state.groups[group_index];
@@ -1405,13 +1411,10 @@ namespace {
const auto& parent_group = rst_state.groups[rst_group.parent_group - 1];
this->addGroupToGroup(parent_group.name, rst_group.name);
}
auto glo = this->snapshots.back().glo();
glo.all_newton(rst_state.header.glift_all_nupcol);
glo.min_wait(rst_state.header.glift_min_wait);
glo.min_eco_gradient(rst_state.header.glift_min_eco_grad);
glo.gaslift_increment(rst_state.header.glift_rate_delta);
if (GasLiftOpt::Group::active(rst_group))
glo.add_group(GasLiftOpt::Group(rst_group));
}
for (const auto& rst_well : rst_state.wells) {
Opm::Well well(rst_well, report_step, this->m_static.m_unit_system, udq_undefined);