mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
BUGFIX Wellbore mixture calculations for multiphase injectors
Add phase rates and not total rates when calculating the wellbore rates.
This commit is contained in:
@@ -940,25 +940,15 @@ namespace detail {
|
|||||||
cq_ps[oilpos] += subset(state.rv,well_cells) * cq_psGas;
|
cq_ps[oilpos] += subset(state.rv,well_cells) * cq_psGas;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phase rates at std. condtions
|
|
||||||
std::vector<ADB> q_ps(np, ADB::null());
|
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
|
||||||
q_ps[phase] = wops_.p2w * cq_ps[phase];
|
|
||||||
}
|
|
||||||
|
|
||||||
// total rates at std
|
|
||||||
ADB qt_s = ADB::constant(V::Zero(nw));
|
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
|
||||||
qt_s += subset(state.qs, Span(nw, 1, phase*nw));
|
|
||||||
}
|
|
||||||
|
|
||||||
// compute avg. and total wellbore phase volumetric rates at std. conds
|
// compute avg. and total wellbore phase volumetric rates at std. conds
|
||||||
const DataBlock compi = Eigen::Map<const DataBlock>(wells().comp_frac, nw, np);
|
const DataBlock compi = Eigen::Map<const DataBlock>(wells().comp_frac, nw, np);
|
||||||
std::vector<ADB> wbq(np, ADB::null());
|
std::vector<ADB> wbq(np, ADB::null());
|
||||||
ADB wbqt = ADB::constant(V::Zero(nw));
|
ADB wbqt = ADB::constant(V::Zero(nw));
|
||||||
for (int phase = 0; phase < np; ++phase) {
|
for (int phase = 0; phase < np; ++phase) {
|
||||||
|
const ADB& q_ps = wops_.p2w * cq_ps[phase];
|
||||||
|
const ADB& q_s = subset(state.qs, Span(nw, 1, phase*nw));
|
||||||
const int pos = pu.phase_pos[phase];
|
const int pos = pu.phase_pos[phase];
|
||||||
wbq[phase] = (isInj * compi.col(pos)) * qt_s - q_ps[phase];
|
wbq[phase] = (isInj * compi.col(pos)) * q_s - q_ps;
|
||||||
wbqt += wbq[phase];
|
wbqt += wbq[phase];
|
||||||
}
|
}
|
||||||
// DUMPVAL(wbqt);
|
// DUMPVAL(wbqt);
|
||||||
|
|||||||
Reference in New Issue
Block a user