mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-26 19:36:25 -06:00
Merge pull request #4239 from GitPaean/well_state_change_num_segments
we do not copy SegmentState if the segment number changes
This commit is contained in:
commit
6607121bcc
@ -372,6 +372,8 @@ updatePrimaryVariables(const WellState& well_state) const
|
||||
// the index of the top segment in the WellState
|
||||
const auto& ws = well_state.well(baseif_.indexOfWell());
|
||||
const auto& segments = ws.segments;
|
||||
// maybe a throw for parallel running?
|
||||
assert(int(segments.size()) == this->numberOfSegments());
|
||||
const auto& segment_rates = segments.rates;
|
||||
const auto& segment_pressure = segments.pressure;
|
||||
const PhaseUsage& pu = baseif_.phaseUsage();
|
||||
|
@ -703,10 +703,11 @@ void WellState::initWellStateMSWell(const std::vector<Well>& wells_ecl,
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: the well with same name can change a lot, like they might not have same number of segments
|
||||
// we need to handle that later.
|
||||
// for now, we just copy them.
|
||||
ws.segments = prev_ws.segments;
|
||||
// we do not copy the segment information if the number of segments have changed
|
||||
// safer way should be to check the relevant Event
|
||||
if (ws.segments.size() == prev_ws.segments.size()) {
|
||||
ws.segments = prev_ws.segments;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user