mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add FIP features to multisegment sim.
This commit is contained in:
parent
429baf082c
commit
e8bddf6de2
@ -88,6 +88,19 @@ namespace Opm
|
||||
unsigned int totalLinearIterations = 0;
|
||||
DynamicListEconLimited dynamic_list_econ_limited;
|
||||
|
||||
bool ooip_computed = false;
|
||||
std::vector<int> fipnum_global = eclipse_state_->get3DProperties().getIntGridProperty("FIPNUM").getData();
|
||||
//Get compressed cell fipnum.
|
||||
std::vector<int> fipnum(AutoDiffGrid::numCells(grid_));
|
||||
if (fipnum_global.empty()) {
|
||||
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<std::vector<double> > OOIP;
|
||||
|
||||
// Main simulation loop.
|
||||
while (!timer.done()) {
|
||||
// Report timestep.
|
||||
@ -147,6 +160,13 @@ namespace Opm
|
||||
|
||||
auto solver = createSolver(well_model);
|
||||
|
||||
// Compute orignal FIP;
|
||||
if (!ooip_computed) {
|
||||
OOIP = solver->computeFluidInPlace(state, fipnum);
|
||||
Base::FIPUnitConvert(eclipse_state_->getUnits(), OOIP);
|
||||
ooip_computed = true;
|
||||
}
|
||||
|
||||
// If sub stepping is enabled allow the solver to sub cycle
|
||||
// in case the report steps are too large for the solver to converge
|
||||
//
|
||||
@ -170,6 +190,25 @@ namespace Opm
|
||||
// Report timing.
|
||||
const double st = solver_timer.secsSinceStart();
|
||||
|
||||
// Compute current FIP.
|
||||
std::vector<std::vector<double> > COIP;
|
||||
COIP = solver->computeFluidInPlace(state, fipnum);
|
||||
std::vector<double> OOIP_totals = Base::FIPTotals(OOIP, state);
|
||||
std::vector<double> COIP_totals = Base::FIPTotals(COIP, state);
|
||||
|
||||
//Convert to correct units
|
||||
Base::FIPUnitConvert(eclipse_state_->getUnits(), COIP);
|
||||
Base::FIPUnitConvert(eclipse_state_->getUnits(), OOIP_totals);
|
||||
Base::FIPUnitConvert(eclipse_state_->getUnits(), COIP_totals);
|
||||
|
||||
if ( terminal_output_ )
|
||||
{
|
||||
Base::outputFluidInPlace(OOIP_totals, COIP_totals,eclipse_state_->getUnits(), 0);
|
||||
for (size_t reg = 0; reg < OOIP.size(); ++reg) {
|
||||
Base::outputFluidInPlace(OOIP[reg], COIP[reg], eclipse_state_->getUnits(), reg+1);
|
||||
}
|
||||
}
|
||||
|
||||
if ( terminal_output_ )
|
||||
{
|
||||
std::cout << "Fully implicit solver took: " << st << " seconds." << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user