Add rst_ prefix to restart variables

This commit is contained in:
Joakim Hove 2021-05-19 09:15:50 +02:00
parent 91dae1aa6f
commit 1e9a5195e9

View File

@ -2013,21 +2013,21 @@ namespace Opm {
const WellSegments& segment_set = well_ecl.getSegments();
const int top_segment_index = well_state.topSegmentIndex(well_index);
const auto& segments = rst_well.segments;
const auto& rst_segments = rst_well.segments;
// \Note: eventually we need to hanlde the situations that some segments are shut
assert(0u + segment_set.size() == segments.size());
assert(0u + segment_set.size() == rst_segments.size());
for (const auto& segment : segments) {
const int segment_index = segment_set.segmentNumberToIndex(segment.first);
for (const auto& rst_segment : rst_segments) {
const int segment_index = segment_set.segmentNumberToIndex(rst_segment.first);
// recovering segment rates and pressure from the restart values
const auto pres_idx = data::SegmentPressures::Value::Pressure;
well_state.segPress()[top_segment_index + segment_index] = segment.second.pressures[pres_idx];
well_state.segPress()[top_segment_index + segment_index] = rst_segment.second.pressures[pres_idx];
const auto& segment_rates = segment.second.rates;
const auto& rst_segment_rates = rst_segment.second.rates;
for (int p = 0; p < np; ++p) {
well_state.segRates()[(top_segment_index + segment_index) * np + p] = segment_rates.get(phs[p]);
well_state.segRates()[(top_segment_index + segment_index) * np + p] = rst_segment_rates.get(phs[p]);
}
}
}