diff --git a/opm/autodiff/SimulatorBase_impl.hpp b/opm/autodiff/SimulatorBase_impl.hpp index cf6bbde49..bf49c88df 100644 --- a/opm/autodiff/SimulatorBase_impl.hpp +++ b/opm/autodiff/SimulatorBase_impl.hpp @@ -691,11 +691,15 @@ namespace Opm } } const int nc = Opm::AutoDiffGrid::numCells(grid_); - const int np = state.numPhases(); + const int np = state.numPhases(); + const PhaseUsage& pu = props_.phaseUsage(); const DataBlock s = Eigen::Map(& state.saturation()[0], nc, np); + const V so = pu.phase_used[BlackoilPhases::Liquid] ? V(s.col(BlackoilPhases::Liquid)) : V::Zero(nc); + const V sg = pu.phase_used[BlackoilPhases::Vapour] ? V(s.col(BlackoilPhases::Vapour)) : V::Zero(nc); + const V hydrocarbon = so + sg; const V p = Eigen::Map(& state.pressure()[0], nc); - totals[5] = (geo_.poreVolume() * (s.col(Oil) + s.col(Gas))).sum(); - totals[6] = unit::convert::to((p * geo_.poreVolume() * (s.col(Oil) + s.col(Gas))).sum() / totals[5], unit::barsa); + totals[5] = (geo_.poreVolume() * hydrocarbon).sum(); + totals[6] = unit::convert::to((p * geo_.poreVolume() * hydrocarbon).sum() / totals[5], unit::barsa); return totals; } @@ -708,27 +712,27 @@ namespace Opm { std::ostringstream ss; if (!reg) { - ss << " ==================================================\n" - << " : Field Totals :\n"; + ss << " ===================================================\n" + << " : Field Totals :\n"; } else { - ss << " ==================================================\n" + ss << " ===================================================\n" << " : FIPNUM report region " - << std::setw(2) << reg << " :\n"; + << std::setw(2) << reg << " :\n"; } if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) { - ss << " : PAV =" << std::setw(14) << cip[6] << " BARSA :\n" + ss << " : PAV =" << std::setw(14) << cip[6] << " BARSA :\n" << std::fixed << std::setprecision(0) - << " : PORV =" << std::setw(14) << cip[5] << " RM3 :\n" - << " : Pressure is weighted by hydrocarbon pore volume:\n" + << " : PORV =" << std::setw(14) << cip[5] << " RM3 :\n" + << " : Pressure is weighted by hydrocarbon pore volume :\n" << " : Porv volumes are taken at reference conditions :\n" << " :--------------- Oil SM3 ---------------:-- Wat SM3 --:--------------- Gas SM3 ---------------:\n"; } if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) { - ss << " : PAV =" << std::setw(14) << cip[6] << " PSIA :" + ss << " : PAV =" << std::setw(14) << cip[6] << " PSIA :\n" << std::fixed << std::setprecision(0) - << " : PORV =" << std::setprecision(14) << cip[5] << " STB :" - << " : Pressure is weighted by hydrocarbon pore voulme :" - << " : Pore volume are taken at reference conditions :" + << " : PORV =" << std::setw(14) << cip[5] << " RB :\n" + << " : Pressure is weighted by hydrocarbon pore voulme :\n" + << " : Pore volumes are taken at reference conditions :\n" << " :--------------- Oil STB ---------------:-- Wat STB --:--------------- Gas MSCF ---------------:\n"; } ss << " : Liquid Vapour Total : Total : Free Dissolved Total :" << "\n"