mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
flow_ebos: fix the calculation of the original fluid in place
for Norne the numbers are now very close to those of the ECL reference. ("very close" means < 0.01 % deviation of pressure and initial fluid volume for the field totals.)
This commit is contained in:
parent
55547a1b86
commit
9df4b21369
@ -191,7 +191,6 @@ public:
|
|||||||
SimulatorReport report;
|
SimulatorReport report;
|
||||||
SimulatorReport stepReport;
|
SimulatorReport stepReport;
|
||||||
|
|
||||||
bool ooip_computed = false;
|
|
||||||
std::vector<int> fipnum_global = eclState().get3DProperties().getIntGridProperty("FIPNUM").getData();
|
std::vector<int> fipnum_global = eclState().get3DProperties().getIntGridProperty("FIPNUM").getData();
|
||||||
//Get compressed cell fipnum.
|
//Get compressed cell fipnum.
|
||||||
std::vector<int> fipnum(Opm::UgGridHelpers::numCells(grid()));
|
std::vector<int> fipnum(Opm::UgGridHelpers::numCells(grid()));
|
||||||
@ -202,7 +201,9 @@ public:
|
|||||||
fipnum[c] = fipnum_global[Opm::UgGridHelpers::globalCell(grid())[c]];
|
fipnum[c] = fipnum_global[Opm::UgGridHelpers::globalCell(grid())[c]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::vector<std::vector<double>> OOIP;
|
std::vector<std::vector<double>> originalFluidInPlace;
|
||||||
|
std::vector<double> originalFluidInPlaceTotals;
|
||||||
|
|
||||||
// Main simulation loop.
|
// Main simulation loop.
|
||||||
while (!timer.done()) {
|
while (!timer.done()) {
|
||||||
// Report timestep.
|
// Report timestep.
|
||||||
@ -256,11 +257,15 @@ public:
|
|||||||
|
|
||||||
auto solver = createSolver(well_model);
|
auto solver = createSolver(well_model);
|
||||||
|
|
||||||
// Compute orignal FIP;
|
// Compute orignal fluid in place if this has not been done yet
|
||||||
if (!ooip_computed) {
|
if (originalFluidInPlace.empty()) {
|
||||||
OOIP = solver->computeFluidInPlace(fipnum);
|
solver->model().convertInput(/*iterationIdx=*/0, state, ebosSimulator_ );
|
||||||
FIPUnitConvert(eclState().getUnits(), OOIP);
|
ebosSimulator_.model().invalidateIntensiveQuantitiesCache(/*timeIdx=*/0);
|
||||||
ooip_computed = true;
|
|
||||||
|
originalFluidInPlace = solver->computeFluidInPlace(fipnum);
|
||||||
|
originalFluidInPlaceTotals = FIPTotals(originalFluidInPlace, state);
|
||||||
|
FIPUnitConvert(eclState().getUnits(), originalFluidInPlace);
|
||||||
|
FIPUnitConvert(eclState().getUnits(), originalFluidInPlaceTotals);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( terminal_output_ )
|
if( terminal_output_ )
|
||||||
@ -315,20 +320,18 @@ public:
|
|||||||
report.solver_time += solver_timer.secsSinceStart();
|
report.solver_time += solver_timer.secsSinceStart();
|
||||||
|
|
||||||
// Compute current fluid in place.
|
// Compute current fluid in place.
|
||||||
std::vector<std::vector<double>> COIP;
|
std::vector<std::vector<double>> currentFluidInPlace;
|
||||||
COIP = solver->computeFluidInPlace(fipnum);
|
currentFluidInPlace = solver->computeFluidInPlace(fipnum);
|
||||||
std::vector<double> OOIP_totals = FIPTotals(OOIP, state);
|
std::vector<double> currentFluidInPlaceTotals = FIPTotals(currentFluidInPlace, state);
|
||||||
std::vector<double> COIP_totals = FIPTotals(COIP, state);
|
|
||||||
|
|
||||||
FIPUnitConvert(eclState().getUnits(), COIP);
|
FIPUnitConvert(eclState().getUnits(), currentFluidInPlace);
|
||||||
FIPUnitConvert(eclState().getUnits(), OOIP_totals);
|
FIPUnitConvert(eclState().getUnits(), currentFluidInPlaceTotals);
|
||||||
FIPUnitConvert(eclState().getUnits(), COIP_totals);
|
|
||||||
|
|
||||||
if (terminal_output_ )
|
if (terminal_output_ )
|
||||||
{
|
{
|
||||||
outputFluidInPlace(OOIP_totals, COIP_totals,eclState().getUnits(), 0);
|
outputFluidInPlace(originalFluidInPlaceTotals, currentFluidInPlaceTotals,eclState().getUnits(), 0);
|
||||||
for (size_t reg = 0; reg < OOIP.size(); ++reg) {
|
for (size_t reg = 0; reg < originalFluidInPlace.size(); ++reg) {
|
||||||
outputFluidInPlace(OOIP[reg], COIP[reg], eclState().getUnits(), reg+1);
|
outputFluidInPlace(originalFluidInPlace[reg], currentFluidInPlace[reg], eclState().getUnits(), reg+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string msg;
|
std::string msg;
|
||||||
|
Loading…
Reference in New Issue
Block a user