use a separate function to output fip and compress fipnum from eclipseState.

This commit is contained in:
Liu Ming 2016-08-09 15:17:49 +08:00 committed by Atgeirr Flø Rasmussen
parent 59a2668152
commit aa96931f69
2 changed files with 28 additions and 8 deletions

View File

@ -165,6 +165,8 @@ namespace Opm
V V
FIPTotals(const std::vector<V>& fip); FIPTotals(const std::vector<V>& fip);
void
outputFluidInPlace(const V& oip, const V& cip);
void computeWellPotentials(const Wells* wells, void computeWellPotentials(const Wells* wells,
const WellState& xw, const WellState& xw,

View File

@ -136,10 +136,15 @@ namespace Opm
DynamicListEconLimited dynamic_list_econ_limited; DynamicListEconLimited dynamic_list_econ_limited;
bool ooip_computed = false; bool ooip_computed = false;
std::vector<int> fipnum = eclipse_state_->get3DProperties().getIntGridProperty("FIPNUM").getData(); std::vector<int> fipnum_global = eclipse_state_->get3DProperties().getIntGridProperty("FIPNUM").getData();
if (fipnum.empty()) { //Get compressed cell fipnum.
fipnum.resize(AutoDiffGrid::numCells(grid_)); std::vector<int> fipnum(AutoDiffGrid::numCells(grid_));
if (fipnum_global.empty()) {
std::fill(fipnum.begin(), fipnum.end(), 0); std::fill(fipnum.begin(), fipnum.end(), 0);
} else {
for (size_t c = 0; c < fipnum.size(); ++c) {
fipnum[c] = fipnum_global[AutoDiffGrid::globalCell(grid_)[c]];
}
} }
std::vector<V> OOIP; std::vector<V> OOIP;
// Main simulation loop. // Main simulation loop.
@ -268,10 +273,13 @@ namespace Opm
FIPUnitConvert(eclipse_state_->getUnits(), COIP); FIPUnitConvert(eclipse_state_->getUnits(), COIP);
V OOIP_totals = FIPTotals(OOIP); V OOIP_totals = FIPTotals(OOIP);
V COIP_totals = FIPTotals(COIP); V COIP_totals = FIPTotals(COIP);
OpmLog::info("*****************************Field Totals**************************"); OpmLog::note("*****************************Field Totals**************************");
OpmLog::info(" Liquid VAPOUR Water Free Gas Dissolved Gas"); outputFluidInPlace(OOIP_totals, COIP_totals);
OpmLog::info("Currently in place: " + std::to_string(COIP_totals[1]) + " " + std::to_string(COIP_totals[4]) + " " + std::to_string(COIP_totals[0]) + " " + std::to_string(COIP_totals[2]) + " " + std::to_string(COIP_totals[3])); for (size_t reg = 0; reg < OOIP.size(); ++reg) {
OpmLog::info("Originally in place: " + std::to_string(OOIP_totals[1]) + " " + std::to_string(OOIP_totals[4]) + " " + std::to_string(OOIP_totals[0]) + " " + std::to_string(OOIP_totals[2]) + " " + std::to_string(OOIP_totals[3]) + "\n"); OpmLog::note("*****************************FIPNUM report region " + std::to_string(reg+1) + "**************************");
outputFluidInPlace(OOIP[reg], COIP[reg]);
}
// accumulate total time // accumulate total time
stime += st; stime += st;
@ -683,6 +691,16 @@ namespace Opm
template <class Implementation>
void
SimulatorBase<Implementation>::outputFluidInPlace(const V& oip, const V& cip)
{
OpmLog::note(" Liquid VAPOUR Water Free Gas Dissolved Gas");
OpmLog::note("Currently in place: " + std::to_string(cip[1]) + " " + std::to_string(cip[4]) + " " + std::to_string(cip[0]) + " " + std::to_string(cip[2]) + " " + std::to_string(cip[3]));
OpmLog::note("Originaly in place: " + std::to_string(oip[1]) + " " + std::to_string(oip[4]) + " " + std::to_string(oip[0]) + " " + std::to_string(oip[2]) + " " + std::to_string(oip[3]));
}
template <class Implementation> template <class Implementation>
void void
SimulatorBase<Implementation>:: SimulatorBase<Implementation>::