Add changes for WHISTCTL data in ECL restart

This commit is contained in:
Jostein Alvestad
2019-12-16 14:34:36 +01:00
parent ae47d39a1a
commit cf82a90815
6 changed files with 45 additions and 1 deletions

View File

@@ -143,6 +143,7 @@ namespace Opm { namespace RestartIO {
InteHEAD& actionParam(const ActionParam& act_par);
InteHEAD& variousUDQ_ACTIONXParam();
InteHEAD& nominatedPhaseGuideRate(GuideRateNominatedPhase nphase);
InteHEAD& whistControlMode(int mode);
const std::vector<int>& data() const
{

View File

@@ -83,6 +83,8 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
DAY = 64, // Calendar day of report step (1..31)
MONTH = 65, // Calendar month of report step (1..12)
YEAR = 66, // Calendar year of report step
WHISTC = 71, // Calendar year of report step
NOOFACTIONS = 156, // The number of actions in the dataset
MAXNOLINES = 157, // Maximum number of lines of schedule data for ACTION keyword - including ENDACTIO

View File

@@ -184,6 +184,7 @@ namespace Opm
std::vector<const Group*> getChildGroups2(const std::string& group_name, size_t timeStep) const;
std::vector<Well> getChildWells2(const std::string& group_name, size_t timeStep) const;
const OilVaporizationProperties& getOilVaporizationProperties(size_t timestep) const;
const Well::ProducerCMode& getGlobalWhistctlMmode(size_t timestep) const;
const UDQActive& udqActive(size_t timeStep) const;
const WellTestConfig& wtestConfig(size_t timestep) const;

View File

@@ -55,6 +55,17 @@ namespace {
{nph_enum::COMB, 9},
};
using prod_cmode = Opm::Well::ProducerCMode;
const std::map<prod_cmode, int> prod_cmodeToECL = {
{prod_cmode::NONE, 0},
{prod_cmode::ORAT, 1},
{prod_cmode::WRAT, 2},
{prod_cmode::GRAT, 3},
{prod_cmode::LRAT, 4},
{prod_cmode::RESV, 5},
{prod_cmode::BHP, 7},
};
int maxConnPerWell(const Opm::Schedule& sched,
const std::size_t lookup_step)
{
@@ -365,6 +376,20 @@ namespace {
return {nom_phase};
}
int getWhistctlMode(const ::Opm::Schedule& sched,
const std::size_t lookup_step)
{
int mode = 0;
const auto& w_hist_ctl_mode = sched.getGlobalWhistctlMmode(lookup_step);
const auto it_ctl = prod_cmodeToECL.find(w_hist_ctl_mode);
if (it_ctl != prod_cmodeToECL.end()) {
mode = it_ctl->second;
}
return mode;
}
} // Anonymous
// #####################################################################
@@ -416,6 +441,7 @@ createInteHead(const EclipseState& es,
.actionParam (getActionParam(rspec, acts))
.variousUDQ_ACTIONXParam()
.nominatedPhaseGuideRate(setGuideRateNominatedPhase(sched,lookup_step))
.whistControlMode(getWhistctlMode(sched,lookup_step))
;
return ih.data();

View File

@@ -90,7 +90,7 @@ enum index : std::vector<int>::size_type {
REPORT_STEP = 68 , // The sequence/report number for for this restart file.
ih_069 = 69 , // 0 0
ih_070 = 70 , // 0 0
ih_071 = 71 , // 0 0
NWHISTCTL = VI::intehead::WHISTC, // index for WHISTCTL keyword
ih_072 = 72 , // 0 0
ih_073 = 73 , // 0 0
ih_074 = 74 , // 0 0
@@ -740,6 +740,15 @@ nominatedPhaseGuideRate(GuideRateNominatedPhase nphase)
return *this;
}
Opm::RestartIO::InteHEAD&
Opm::RestartIO::InteHEAD::
whistControlMode(int mode)
{
this -> data_[NWHISTCTL] = mode;
return *this;
}
// =====================================================================
// Free functions (calendar/time utilities)
// =====================================================================

View File

@@ -2601,6 +2601,11 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
const OilVaporizationProperties& Schedule::getOilVaporizationProperties(size_t timestep) const {
return m_oilvaporizationproperties.get(timestep);
}
const Well::ProducerCMode& Schedule::getGlobalWhistctlMmode(size_t timestep) const {
return global_whistctl_mode.get(timestep);
}
bool Schedule::hasOilVaporizationProperties() const {
for( size_t i = 0; i < this->m_timeMap.size(); ++i )