format fIP output for field units and check the phase is present or not.

This commit is contained in:
Liu Ming 2016-09-06 09:33:41 +08:00
parent 170607e60c
commit d5b4194a0e

View File

@ -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<const DataBlock>(& 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<const V>(& 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"