Load MSW pressure drop model fro restart file

This commit is contained in:
Joakim Hove 2020-10-29 11:34:02 +01:00
parent 30a897e89d
commit 00af07ceed
3 changed files with 19 additions and 1 deletions

View File

@ -75,6 +75,7 @@ struct RstWell {
int msw_index; int msw_index;
int completion_ordering; int completion_ordering;
int pvt_table; int pvt_table;
int msw_pressure_drop_model;
float orat_target; float orat_target;
float wrat_target; float wrat_target;

View File

@ -70,6 +70,7 @@ RstWell::RstWell(const ::Opm::UnitSystem& unit_system,
msw_index( iwel[VI::IWell::MsWID]), msw_index( iwel[VI::IWell::MsWID]),
completion_ordering( iwel[VI::IWell::CompOrd]), completion_ordering( iwel[VI::IWell::CompOrd]),
pvt_table( def_pvt_table), pvt_table( def_pvt_table),
msw_pressure_drop_model( iwel[VI::IWell::MSW_PlossMod]),
orat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::OilRateTarget]))), orat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::OilRateTarget]))),
wrat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::WatRateTarget]))), wrat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::WatRateTarget]))),
grat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::GasRateTarget]))), grat_target( unit_system.to_si(M::identity, swel_value(swel[VI::SWell::GasRateTarget]))),

View File

@ -28,6 +28,7 @@
#include <opm/parser/eclipse/Deck/DeckItem.hpp> #include <opm/parser/eclipse/Deck/DeckItem.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp> #include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp> #include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/output/eclipse/VectorItems/well.hpp>
#include <opm/io/eclipse/rst/well.hpp> #include <opm/io/eclipse/rst/well.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp> #include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
@ -356,6 +357,21 @@ namespace {
} }
} }
WellSegments::CompPressureDrop pressure_drop_from_int(int ecl_id) {
using PLM = RestartIO::Helpers::VectorItems::IWell::Value::PLossMod;
switch (ecl_id) {
case PLM::HFA:
return WellSegments::CompPressureDrop::HFA;
case PLM::HF_:
return WellSegments::CompPressureDrop::HF_;
case PLM::H__:
return WellSegments::CompPressureDrop::H__;
default:
throw std::logic_error("Converting to pressure loss value failed");
}
}
} }
std::pair<WellConnections, WellSegments> std::pair<WellConnections, WellSegments>
@ -391,7 +407,7 @@ namespace {
segments_list.push_back( std::move(segment_pair.second) ); segments_list.push_back( std::move(segment_pair.second) );
std::sort( segments_list.begin(), segments_list.end(),[](const Segment& seg1, const Segment& seg2) { return seg1.segmentNumber() < seg2.segmentNumber(); } ); std::sort( segments_list.begin(), segments_list.end(),[](const Segment& seg1, const Segment& seg2) { return seg1.segmentNumber() < seg2.segmentNumber(); } );
auto comp_pressure_drop = WellSegments::CompPressureDrop::HFA; auto comp_pressure_drop = pressure_drop_from_int(rst_well.msw_pressure_drop_model);
WellSegments segments( comp_pressure_drop, segments_list); WellSegments segments( comp_pressure_drop, segments_list);
segments.updatePerfLength( connections ); segments.updatePerfLength( connections );