Write options for GLIFTOPT to restart file
This commit is contained in:
parent
d96e5308a1
commit
589191f532
@ -32,6 +32,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
|
||||
WatRateLimit = 7, // Group's water production target/limit
|
||||
GasRateLimit = 8, // Group's gas production target/limit
|
||||
LiqRateLimit = 9, // Group's liquid production target/limit
|
||||
GLOMaxSupply = 34, // Group's maximum supply of lift gas
|
||||
GLOMaxRate = 91, // Group's maximum lift gas rate
|
||||
};
|
||||
|
||||
enum inj_index : std::vector<float>::size_type {
|
||||
|
@ -755,6 +755,7 @@ allocate(const std::vector<int>& inteHead)
|
||||
|
||||
template <class SGrpArray>
|
||||
void staticContrib(const Opm::Group& group,
|
||||
const Opm::GasLiftOpt& glo,
|
||||
const Opm::SummaryState& sumState,
|
||||
const Opm::UnitSystem& units,
|
||||
SGrpArray& sGrp)
|
||||
@ -830,6 +831,12 @@ void staticContrib(const Opm::Group& group,
|
||||
}
|
||||
}
|
||||
|
||||
if (glo.has_group(group.name())) {
|
||||
const auto& glo_group = glo.group(group.name());
|
||||
sGrp[Isp::GLOMaxSupply] = sgprop(M::gas_surface_rate, glo_group.max_lift_gas().value());
|
||||
sGrp[Isp::GLOMaxRate] = sgprop(M::gas_surface_rate, glo_group.max_total_gas().value());
|
||||
}
|
||||
|
||||
if ((group.name() == "FIELD") && (group.getGroupType() == Opm::Group::GroupType::NONE)) {
|
||||
sGrp[Isp::GuideRate] = 0.;
|
||||
sGrp[14] = 0.;
|
||||
@ -1011,6 +1018,7 @@ captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
const std::vector<int>& inteHead)
|
||||
{
|
||||
const auto& curGroups = sched.restart_groups(simStep);
|
||||
const auto& sched_state = sched[simStep];
|
||||
|
||||
groupLoop(curGroups, [&sched, simStep, sumState, this]
|
||||
(const Group& group, const std::size_t groupID) -> void
|
||||
@ -1022,10 +1030,10 @@ captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
|
||||
// Define Static Contributions to SGrp Array.
|
||||
groupLoop(curGroups,
|
||||
[&sumState, &units, this](const Group& group , const std::size_t groupID) -> void
|
||||
[&sumState, &units, &sched_state, this](const Group& group , const std::size_t groupID) -> void
|
||||
{
|
||||
auto sw = this->sGroup_[groupID];
|
||||
SGrp::staticContrib(group, sumState, units, sw);
|
||||
SGrp::staticContrib(group, sched_state.glo(), sumState, units, sw);
|
||||
});
|
||||
|
||||
// Define Dynamic Contributions to XGrp Array.
|
||||
|
@ -425,6 +425,13 @@ Opm::Deck first_sim()
|
||||
/
|
||||
/
|
||||
|
||||
LIFTOPT
|
||||
1 2 /
|
||||
|
||||
GLIFTOPT
|
||||
'WGRP1' 100 200 /
|
||||
/
|
||||
|
||||
TSTEP
|
||||
4
|
||||
/
|
||||
@ -671,6 +678,16 @@ BOOST_AUTO_TEST_CASE (Declared_Group_Data)
|
||||
BOOST_CHECK_EQUAL(iGrp[start + ih.nwgmax + 27] , 0); // Group FIELD - Group level (FIELD level is 0)
|
||||
}
|
||||
|
||||
// SGRP
|
||||
{
|
||||
using Ix = ::Opm::RestartIO::Helpers::VectorItems::SGroup::prod_index;
|
||||
auto start = 1*ih.nsgrpz;
|
||||
|
||||
const auto& sGrp = agrpd.getSGroup();
|
||||
BOOST_CHECK_CLOSE(sGrp[start + Ix::GLOMaxSupply], 100, 1e-6);
|
||||
BOOST_CHECK_CLOSE(sGrp[start + Ix::GLOMaxRate], 200, 1e-6);
|
||||
}
|
||||
|
||||
|
||||
// XGRP (PROD)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user