Separately load active and requested group control from restart file
Use named constants for access to IGRP vector
This commit is contained in:
parent
30a897e89d
commit
92bf4a96ea
@ -41,7 +41,8 @@ struct RstGroup {
|
|||||||
std::string name;
|
std::string name;
|
||||||
|
|
||||||
int parent_group;
|
int parent_group;
|
||||||
int prod_cmode;
|
int prod_active_cmode;
|
||||||
|
int gconprod_cmode;
|
||||||
int winj_cmode;
|
int winj_cmode;
|
||||||
int ginj_cmode;
|
int ginj_cmode;
|
||||||
int guide_rate_def;
|
int guide_rate_def;
|
||||||
|
@ -56,9 +56,10 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
|
|||||||
// Observe that these value should not be used as ordinary indices into
|
// 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]
|
// the the IGRP vector, they should all be used as IGRP[NWGMAX + $index]
|
||||||
enum index : std::vector<int>::size_type {
|
enum index : std::vector<int>::size_type {
|
||||||
ProdCMode = 1,
|
ProdActiveCMode = 1,
|
||||||
GuideRateDef = 6,
|
GuideRateDef = 6,
|
||||||
WInjCMode = 16,
|
WInjCMode = 16,
|
||||||
|
GConProdCMode = 10,
|
||||||
GInjCMode = 21,
|
GInjCMode = 21,
|
||||||
ParentGroup = 28,
|
ParentGroup = 28,
|
||||||
};
|
};
|
||||||
|
@ -40,7 +40,8 @@ RstGroup::RstGroup(const ::Opm::UnitSystem& unit_system,
|
|||||||
const double * xgrp) :
|
const double * xgrp) :
|
||||||
name(trim_copy(zwel[0])),
|
name(trim_copy(zwel[0])),
|
||||||
parent_group(igrp[header.nwgmax + VI::IGroup::ParentGroup] ),
|
parent_group(igrp[header.nwgmax + VI::IGroup::ParentGroup] ),
|
||||||
prod_cmode(igrp[header.nwgmax + VI::IGroup::ProdCMode]),
|
prod_active_cmode(igrp[header.nwgmax + VI::IGroup::ProdActiveCMode]),
|
||||||
|
gconprod_cmode(igrp[header.nwgmax + VI::IGroup::GConProdCMode]),
|
||||||
winj_cmode(igrp[header.nwgmax + VI::IGroup::WInjCMode]),
|
winj_cmode(igrp[header.nwgmax + VI::IGroup::WInjCMode]),
|
||||||
ginj_cmode(igrp[header.nwgmax + VI::IGroup::GInjCMode]),
|
ginj_cmode(igrp[header.nwgmax + VI::IGroup::GInjCMode]),
|
||||||
guide_rate_def(igrp[header.nwgmax + VI::IGroup::GuideRateDef]),
|
guide_rate_def(igrp[header.nwgmax + VI::IGroup::GuideRateDef]),
|
||||||
|
@ -574,73 +574,73 @@ void productionGroup(const Opm::Schedule& sched,
|
|||||||
using IGroup = ::Opm::RestartIO::Helpers::VectorItems::IGroup::index;
|
using IGroup = ::Opm::RestartIO::Helpers::VectorItems::IGroup::index;
|
||||||
namespace Value = ::Opm::RestartIO::Helpers::VectorItems::IGroup::Value;
|
namespace Value = ::Opm::RestartIO::Helpers::VectorItems::IGroup::Value;
|
||||||
if (higher_lev_ctrl > 0 && (group.getGroupType() != Opm::Group::GroupType::NONE)) {
|
if (higher_lev_ctrl > 0 && (group.getGroupType() != Opm::Group::GroupType::NONE)) {
|
||||||
iGrp[nwgmax + IGroup::ProdCMode]
|
iGrp[nwgmax + IGroup::ProdActiveCMode]
|
||||||
= (prod_guide_rate_def != Opm::Group::GuideRateTarget::NO_GUIDE_RATE) ? higher_lev_ctrl_mode : 0;
|
= (prod_guide_rate_def != Opm::Group::GuideRateTarget::NO_GUIDE_RATE) ? higher_lev_ctrl_mode : 0;
|
||||||
} else {
|
} else {
|
||||||
switch (pctl_mode) {
|
switch (pctl_mode) {
|
||||||
case Opm::Group::ProductionCMode::NONE:
|
case Opm::Group::ProductionCMode::NONE:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 0;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 0;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::ORAT:
|
case Opm::Group::ProductionCMode::ORAT:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 1;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 1;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::WRAT:
|
case Opm::Group::ProductionCMode::WRAT:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 2;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 2;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::GRAT:
|
case Opm::Group::ProductionCMode::GRAT:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 3;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 3;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::LRAT:
|
case Opm::Group::ProductionCMode::LRAT:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 4;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 4;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::RESV:
|
case Opm::Group::ProductionCMode::RESV:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 5;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 5;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::FLD:
|
case Opm::Group::ProductionCMode::FLD:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 0; // need to be checked!!
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 0; // need to be checked!!
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
iGrp[nwgmax + IGroup::ProdCMode] = 0;
|
iGrp[nwgmax + IGroup::ProdActiveCMode] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
iGrp[nwgmax + 9] = iGrp[nwgmax + IGroup::ProdCMode];
|
iGrp[nwgmax + 9] = iGrp[nwgmax + IGroup::ProdActiveCMode];
|
||||||
|
|
||||||
iGrp[nwgmax + IGroup::GuideRateDef] = Value::GuideRateMode::None;
|
iGrp[nwgmax + IGroup::GuideRateDef] = Value::GuideRateMode::None;
|
||||||
switch (prod_cmode) {
|
switch (prod_cmode) {
|
||||||
case Opm::Group::ProductionCMode::NONE:
|
case Opm::Group::ProductionCMode::NONE:
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? 0 : 4;
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? 0 : 4;
|
||||||
iGrp[nwgmax + 10] = 0;
|
iGrp[nwgmax + IGroup::GConProdCMode] = 0;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::ORAT:
|
case Opm::Group::ProductionCMode::ORAT:
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -40000 : 4;
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -40000 : 4;
|
||||||
iGrp[nwgmax + 10] = 1;
|
iGrp[nwgmax + IGroup::GConProdCMode] = 1;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::WRAT:
|
case Opm::Group::ProductionCMode::WRAT:
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -4000 : 4;
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -4000 : 4;
|
||||||
iGrp[nwgmax + 10] = 2;
|
iGrp[nwgmax + IGroup::GConProdCMode] = 2;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::GRAT:
|
case Opm::Group::ProductionCMode::GRAT:
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -400 : 4;
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -400 : 4;
|
||||||
iGrp[nwgmax + 10] = 3;
|
iGrp[nwgmax + IGroup::GConProdCMode] = 3;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::LRAT:
|
case Opm::Group::ProductionCMode::LRAT:
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -40 : 4;
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -40 : 4;
|
||||||
iGrp[nwgmax + 10] = 4;
|
iGrp[nwgmax + IGroup::GConProdCMode] = 4;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::RESV:
|
case Opm::Group::ProductionCMode::RESV:
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -4 : 4; // need to be checked
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? -4 : 4; // need to be checked
|
||||||
iGrp[nwgmax + 10] = 5;
|
iGrp[nwgmax + IGroup::GConProdCMode] = 5;
|
||||||
break;
|
break;
|
||||||
case Opm::Group::ProductionCMode::FLD:
|
case Opm::Group::ProductionCMode::FLD:
|
||||||
if ((higher_lev_ctrl > 0) && (prod_guide_rate_def != Opm::Group::GuideRateTarget::NO_GUIDE_RATE)) {
|
if ((higher_lev_ctrl > 0) && (prod_guide_rate_def != Opm::Group::GuideRateTarget::NO_GUIDE_RATE)) {
|
||||||
iGrp[nwgmax + IGroup::GuideRateDef] = Value::GuideRateMode::Form;
|
iGrp[nwgmax + IGroup::GuideRateDef] = Value::GuideRateMode::Form;
|
||||||
}
|
}
|
||||||
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? 4 : 4;
|
iGrp[nwgmax + 7] = (p_exceed_act == Opm::Group::ExceedAction::NONE) ? 4 : 4;
|
||||||
iGrp[nwgmax + 10] = 0; // need to be checked!!
|
iGrp[nwgmax + IGroup::GConProdCMode] = 0; // need to be checked!!
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
iGrp[nwgmax + 7] = 0;
|
iGrp[nwgmax + 7] = 0;
|
||||||
iGrp[nwgmax + 10] = 0; // need to be checked!!
|
iGrp[nwgmax + IGroup::GConProdCMode] = 0; // need to be checked!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user