mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Fix bug in two-phase case.
This commit is contained in:
@@ -699,15 +699,20 @@ namespace Opm
|
|||||||
std::vector<double> so(nc);
|
std::vector<double> so(nc);
|
||||||
std::vector<double> sg(nc);
|
std::vector<double> sg(nc);
|
||||||
std::vector<double> hydrocarbon(nc);
|
std::vector<double> hydrocarbon(nc);
|
||||||
const auto& soCol = s.col(BlackoilPhases::Liquid);
|
// Using dummy indices if phase not used, the columns will not be accessed below if unused.
|
||||||
const auto& sgCol = s.col(BlackoilPhases::Vapour);
|
const int oilpos = pu.phase_used[BlackoilPhases::Liquid] ? pu.phase_pos[BlackoilPhases::Liquid] : 0;
|
||||||
|
const int gaspos = pu.phase_used[BlackoilPhases::Vapour] ? pu.phase_pos[BlackoilPhases::Vapour] : 0;
|
||||||
|
const auto& soCol = s.col(oilpos);
|
||||||
|
const auto& sgCol = s.col(gaspos);
|
||||||
for (unsigned c = 0; c < so.size(); ++ c) {
|
for (unsigned c = 0; c < so.size(); ++ c) {
|
||||||
double mySo = 0.0;
|
double mySo = 0.0;
|
||||||
if (pu.phase_used[BlackoilPhases::Liquid])
|
if (pu.phase_used[BlackoilPhases::Liquid]) {
|
||||||
mySo = soCol[c];
|
mySo = soCol[c];
|
||||||
|
}
|
||||||
double mySg = 0.0;
|
double mySg = 0.0;
|
||||||
if (pu.phase_used[BlackoilPhases::Vapour])
|
if (pu.phase_used[BlackoilPhases::Vapour]) {
|
||||||
mySg = sgCol[c];
|
mySg = sgCol[c];
|
||||||
|
}
|
||||||
so[c] = mySo;
|
so[c] = mySo;
|
||||||
sg[c] = mySg;
|
sg[c] = mySg;
|
||||||
hydrocarbon[c] = mySo + mySg;
|
hydrocarbon[c] = mySo + mySg;
|
||||||
|
|||||||
Reference in New Issue
Block a user