Create symbol for IGRP parent group index

This commit is contained in:
Joakim Hove 2020-10-02 13:35:00 +02:00
parent 007ef0e94f
commit c2522fd5ce
2 changed files with 16 additions and 8 deletions

View File

@ -24,7 +24,7 @@
namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems {
namespace SGroup {
enum prod_index : std::vector<float>::size_type {
OilRateLimit = 6, // Group's oil production target/limit
@ -32,7 +32,7 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
GasRateLimit = 8, // Group's gas production target/limit
LiqRateLimit = 9, // Group's liquid production target/limit
};
enum inj_index : std::vector<float>::size_type {
oilSurfRateLimit = 10, // Group's oil surface volume injection rate target/limit
oilResRateLimit = 11, // Group's oil reservoir volume injection rate target/limit
@ -50,8 +50,14 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
};
} // SGroup
namespace IGroup {
enum index : std::vector<int>::size_type {
ParentGroup = 28,
};
}
namespace XGroup {
enum index : std::vector<double>::size_type {
OilPrRate = 0, // Group's oil production rate

View File

@ -892,15 +892,17 @@ void staticContrib(const Opm::Schedule& sched,
}
//find parent group and store index of parent group in
//location nwgmax + 28
//location nwgmax + IGroup::ParentGroup
using IGroup = ::Opm::RestartIO::Helpers::VectorItems::IGroup::index;
if (group.name() == "FIELD")
iGrp[nwgmax+28] = 0;
iGrp[nwgmax + IGroup::ParentGroup] = 0;
else {
const auto& parent_group = sched.getGroup(group.parent(), simStep);
if (parent_group.name() == "FIELD")
iGrp[nwgmax+28] = ngmaxz;
iGrp[nwgmax + IGroup::ParentGroup] = ngmaxz;
else
iGrp[nwgmax+28] = parent_group.insert_index();
iGrp[nwgmax + IGroup::ParentGroup] = parent_group.insert_index();
}
}