mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
sim_fibo_ad: fix writing
the initial condition was written multiple times. We now fix this by not writing anything in the simulator and moving this logic to the main loop..
This commit is contained in:
parent
66d73083b2
commit
49a5b67137
@ -207,10 +207,11 @@ try
|
||||
WellStateFullyImplicitBlackoil well_state;
|
||||
Opm::TimeMapPtr timeMap(new Opm::TimeMap(newParserDeck));
|
||||
SimulatorTimer simtimer;
|
||||
|
||||
// Create new wells, well_state
|
||||
std::shared_ptr<EclipseState> eclipseState(new EclipseState(newParserDeck));
|
||||
|
||||
// initialize variables
|
||||
simtimer.init(timeMap, /*beginReportStepIdx=*/0, /*endReportStepIdx=*/0);
|
||||
|
||||
SimulatorReport fullReport;
|
||||
for (size_t episodeIdx = 0; episodeIdx < timeMap->numTimesteps(); ++episodeIdx) {
|
||||
WellsManager wells(eclipseState,
|
||||
@ -218,10 +219,19 @@ try
|
||||
*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);
|
||||
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,
|
||||
@ -232,10 +242,9 @@ try
|
||||
linsolver,
|
||||
grav,
|
||||
outputWriter);
|
||||
simtimer.init(timeMap,
|
||||
/*beginReportStepIdx=*/episodeIdx,
|
||||
/*endReportStepIdx=*/episodeIdx + 1);
|
||||
SimulatorReport episodeReport = simulator.run(simtimer, state, well_state);
|
||||
|
||||
outputWriter.writeTimeStep(simtimer, state, well_state.basicWellState());
|
||||
fullReport += episodeReport;
|
||||
|
||||
if (output) {
|
||||
@ -265,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.
|
||||
@ -296,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(),
|
||||
@ -305,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