Merge pull request #2035 from joakim-hove/igrp-guide-rate

Igrp guide rate
This commit is contained in:
Joakim Hove 2020-10-22 08:06:56 +02:00 committed by GitHub
commit 5a91c73b8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 10 deletions

View File

@ -44,6 +44,7 @@ struct RstGroup {
int prod_cmode;
int winj_cmode;
int ginj_cmode;
int guide_rate_def;
float oil_rate_limit;
float water_rate_limit;

View File

@ -27,6 +27,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
namespace SGroup {
enum prod_index : std::vector<float>::size_type {
GuideRate = 2,
OilRateLimit = 6, // Group's oil production target/limit
WatRateLimit = 7, // Group's water production target/limit
GasRateLimit = 8, // Group's gas production target/limit
@ -52,12 +53,29 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
namespace IGroup {
// Observe that these value should not be used as ordinary indices into
// the the IGRP vector, they should all be used as IGRP[NWGMAX + $index]
enum index : std::vector<int>::size_type {
ProdCMode = 1,
GuideRateDef = 6,
WInjCMode = 16,
GInjCMode = 21,
ParentGroup = 28,
};
namespace Value {
enum GuideRateMode : int {
None = 0,
Oil = 1,
Water = 2,
Gas = 3,
Liquid = 4,
Potn = 7,
Form = 8,
Comb = 9,
};
}
}

View File

@ -43,6 +43,7 @@ RstGroup::RstGroup(const ::Opm::UnitSystem& unit_system,
prod_cmode(igrp[header.nwgmax + VI::IGroup::ProdCMode]),
winj_cmode(igrp[header.nwgmax + VI::IGroup::WInjCMode]),
ginj_cmode(igrp[header.nwgmax + VI::IGroup::GInjCMode]),
guide_rate_def(igrp[header.nwgmax + VI::IGroup::GuideRateDef]),
oil_rate_limit( unit_system.to_si(M::liquid_surface_rate, sgrp[VI::SGroup::OilRateLimit])),
water_rate_limit( unit_system.to_si(M::liquid_surface_rate, sgrp[VI::SGroup::WatRateLimit])),
gas_rate_limit( unit_system.to_si(M::gas_surface_rate, sgrp[VI::SGroup::GasRateLimit])),

View File

@ -573,6 +573,7 @@ void productionGroup(const Opm::Schedule& sched,
*/
using IGroup = ::Opm::RestartIO::Helpers::VectorItems::IGroup::index;
namespace Value = ::Opm::RestartIO::Helpers::VectorItems::IGroup::Value;
if (higher_lev_ctrl > 0 && (group.getGroupType() != Opm::Group::GroupType::NONE)) {
iGrp[nwgmax + IGroup::ProdCMode]
= (prod_guide_rate_def != Opm::Group::GuideRateTarget::NO_GUIDE_RATE) ? higher_lev_ctrl_mode : 0;
@ -605,47 +606,40 @@ void productionGroup(const Opm::Schedule& sched,
}
iGrp[nwgmax + 9] = iGrp[nwgmax + IGroup::ProdCMode];
iGrp[nwgmax + IGroup::GuideRateDef] = Value::GuideRateMode::None;
switch (prod_cmode) {
case Opm::Group::ProductionCMode::NONE:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? 0 : 4;
iGrp[nwgmax + 10] = 0;
break;
case Opm::Group::ProductionCMode::ORAT:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -40000 : 4;
iGrp[nwgmax + 10] = 1;
break;
case Opm::Group::ProductionCMode::WRAT:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -4000 : 4;
iGrp[nwgmax + 10] = 2;
break;
case Opm::Group::ProductionCMode::GRAT:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -400 : 4;
iGrp[nwgmax + 10] = 3;
break;
case Opm::Group::ProductionCMode::LRAT:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -40 : 4;
iGrp[nwgmax + 10] = 4;
break;
case Opm::Group::ProductionCMode::RESV:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -4 : 4; // need to be checked
iGrp[nwgmax + 10] = 5;
break;
case Opm::Group::ProductionCMode::FLD:
iGrp[nwgmax + 6] = 0;
if ((higher_lev_ctrl > 0) && (prod_guide_rate_def != Opm::Group::GuideRateTarget::NO_GUIDE_RATE)) {
iGrp[nwgmax + 6] = 8;
iGrp[nwgmax + IGroup::GuideRateDef] = Value::GuideRateMode::Form;
}
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? 4 : 4;
iGrp[nwgmax + 10] = 0; // need to be checked!!
break;
default:
iGrp[nwgmax + 6] = 0;
iGrp[nwgmax + 7] = 0;
iGrp[nwgmax + 10] = 0; // need to be checked!!
}
@ -1026,7 +1020,7 @@ void staticContrib(const Opm::Group& group,
}
if ((group.name() == "FIELD") && (group.getGroupType() == Opm::Group::GroupType::NONE)) {
sGrp[2] = 0.;
sGrp[Isp::GuideRate] = 0.;
sGrp[14] = 0.;
sGrp[19] = 0.;
sGrp[24] = 0.;