mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #101 from andlaus/sim_fibo_ad_use_new_wellmanager
sim_fibo_ad: convert to the new-style wells manager
This commit is contained in:
commit
f99b9b90a4
@ -200,7 +200,6 @@ try
|
||||
param.writeParam(output_dir + "/simulation.param");
|
||||
}
|
||||
|
||||
#warning "TODO: convert the well handling code to the new parser"
|
||||
#if USE_NEW_PARSER
|
||||
std::cout << "\n\n================ Starting main simulation loop ===============\n"
|
||||
<< std::flush;
|
||||
@ -208,38 +207,59 @@ try
|
||||
WellStateFullyImplicitBlackoil well_state;
|
||||
Opm::TimeMapPtr timeMap(new Opm::TimeMap(newParserDeck));
|
||||
SimulatorTimer simtimer;
|
||||
std::shared_ptr<EclipseState> eclipseState(new EclipseState(newParserDeck));
|
||||
|
||||
// Create new wells, well_state
|
||||
WellsManager wells(*deck, *grid->c_grid(), props->permeability());
|
||||
// @@@ HACK: we should really make a new well state and
|
||||
// properly transfer old well state to it every epoch,
|
||||
// since number of wells may change etc.
|
||||
well_state.init(wells.c_wells(), state);
|
||||
// initialize variables
|
||||
simtimer.init(timeMap, /*beginReportStepIdx=*/0, /*endReportStepIdx=*/0);
|
||||
|
||||
// Create and run simulator.
|
||||
SimulatorFullyImplicitBlackoil simulator(param,
|
||||
*grid->c_grid(),
|
||||
*new_props,
|
||||
rock_comp->isActive() ? rock_comp.get() : 0,
|
||||
wells,
|
||||
linsolver,
|
||||
grav,
|
||||
outputWriter);
|
||||
simtimer.init(timeMap);
|
||||
SimulatorReport report = simulator.run(simtimer, state, well_state);
|
||||
SimulatorReport fullReport;
|
||||
for (size_t episodeIdx = 0; episodeIdx < timeMap->numTimesteps(); ++episodeIdx) {
|
||||
WellsManager wells(eclipseState,
|
||||
episodeIdx,
|
||||
*grid->c_grid(),
|
||||
props->permeability());
|
||||
|
||||
if (output) {
|
||||
report.reportParam(outStream);
|
||||
warnIfUnusedParams(param);
|
||||
if (episodeIdx == 0) {
|
||||
// @@@ HACK: we should really make a new well state and
|
||||
// properly transfer old well state to it every epoch,
|
||||
// since number of wells may change etc.
|
||||
well_state.init(wells.c_wells(), state);
|
||||
}
|
||||
|
||||
simtimer.init(timeMap,
|
||||
/*beginReportStepIdx=*/episodeIdx,
|
||||
/*endReportStepIdx=*/episodeIdx + 1);
|
||||
|
||||
if (episodeIdx == 0)
|
||||
outputWriter.writeInit(simtimer, state, well_state.basicWellState());
|
||||
|
||||
// Create and run simulator.
|
||||
SimulatorFullyImplicitBlackoil simulator(param,
|
||||
*grid->c_grid(),
|
||||
*new_props,
|
||||
rock_comp->isActive() ? rock_comp.get() : 0,
|
||||
wells,
|
||||
linsolver,
|
||||
grav,
|
||||
outputWriter);
|
||||
SimulatorReport episodeReport = simulator.run(simtimer, state, well_state);
|
||||
|
||||
outputWriter.writeTimeStep(simtimer, state, well_state.basicWellState());
|
||||
fullReport += episodeReport;
|
||||
|
||||
if (output) {
|
||||
episodeReport.reportParam(outStream);
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "\n\n================ End of simulation ===============\n\n";
|
||||
report.report(std::cout);
|
||||
fullReport.report(std::cout);
|
||||
|
||||
if (output) {
|
||||
std::string filename = output_dir + "/walltime.param";
|
||||
std::fstream tot_os(filename.c_str(),std::fstream::trunc | std::fstream::out);
|
||||
report.reportParam(tot_os);
|
||||
fullReport.reportParam(tot_os);
|
||||
warnIfUnusedParams(param);
|
||||
}
|
||||
#else
|
||||
std::cout << "\n\n================ Starting main simulation loop ===============\n"
|
||||
@ -254,6 +274,7 @@ try
|
||||
// Use timer for last epoch to obtain total time.
|
||||
deck->setCurrentEpoch(deck->numberOfEpochs() - 1);
|
||||
simtimer.init(*deck);
|
||||
|
||||
const double total_time = simtimer.totalTime();
|
||||
for (int epoch = 0; epoch < deck->numberOfEpochs(); ++epoch) {
|
||||
// Set epoch index.
|
||||
@ -285,6 +306,9 @@ try
|
||||
well_state.init(wells.c_wells(), state);
|
||||
}
|
||||
|
||||
if (epoch == 0)
|
||||
outputWriter.writeInit(simtimer, state, well_state.basicWellState());
|
||||
|
||||
// Create and run simulator.
|
||||
SimulatorFullyImplicitBlackoil simulator(param,
|
||||
*grid->c_grid(),
|
||||
@ -294,6 +318,8 @@ try
|
||||
linsolver,
|
||||
grav,
|
||||
outputWriter);
|
||||
outputWriter.writeTimeStep(simtimer, state, well_state.basicWellState());
|
||||
|
||||
if (epoch == 0) {
|
||||
warnIfUnusedParams(param);
|
||||
}
|
||||
|
@ -314,9 +314,6 @@ namespace Opm
|
||||
BlackoilState& state,
|
||||
WellStateFullyImplicitBlackoil& well_state)
|
||||
{
|
||||
eclipseWriter_.writeInit(timer, state, well_state.basicWellState());
|
||||
eclipseWriter_.writeTimeStep(timer, state, well_state.basicWellState());
|
||||
|
||||
// Initialisation.
|
||||
std::vector<double> porevol;
|
||||
if (rock_comp_props_ && rock_comp_props_->isActive()) {
|
||||
|
Loading…
Reference in New Issue
Block a user