mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-20 11:48:25 -06:00
Merge pull request #4110 from GitPaean/avoiding_overshoot_primary_variables
avoiding wrong sign for QTotal primary variable for top segment
This commit is contained in:
commit
fe19d94b4e
@ -463,6 +463,13 @@ updatePrimaryVariables(const WellState& well_state) const
|
||||
total_seg_rate += baseif_.scalingFactor(p) * segment_rates[baseif_.numPhases() * seg + p];
|
||||
}
|
||||
|
||||
if (seg == 0) {
|
||||
if (baseif_.isInjector()) {
|
||||
total_seg_rate = std::max(total_seg_rate, 0.);
|
||||
} else {
|
||||
total_seg_rate = std::min(total_seg_rate, 0.);
|
||||
}
|
||||
}
|
||||
primary_variables_[seg][GTotal] = total_seg_rate;
|
||||
if (std::abs(total_seg_rate) > 0.) {
|
||||
if (has_wfrac_variable) {
|
||||
|
Loading…
Reference in New Issue
Block a user