mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix bug in access order for state.qs.
State.qs is called well_phase_flow_rate in this function. It is stored with wells running fastest, not phases.
This commit is contained in:
parent
cb50728ac2
commit
dcb59a2fab
@ -945,9 +945,12 @@ namespace {
|
|||||||
const int num_phases,
|
const int num_phases,
|
||||||
const double* distr)
|
const double* distr)
|
||||||
{
|
{
|
||||||
|
const int num_wells = well_phase_flow_rate.size() / num_phases;
|
||||||
double rate = 0.0;
|
double rate = 0.0;
|
||||||
for (int phase = 0; phase < num_phases; ++phase) {
|
for (int phase = 0; phase < num_phases; ++phase) {
|
||||||
rate += well_phase_flow_rate.value()[well*num_phases + phase] * distr[phase];
|
// Important: well_phase_flow_rate is ordered with all rates for first
|
||||||
|
// phase coming first, then all for second phase etc.
|
||||||
|
rate += well_phase_flow_rate.value()[well + phase*num_wells] * distr[phase];
|
||||||
}
|
}
|
||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user