mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
commit
56597a9238
@ -191,7 +191,7 @@ namespace Opm
|
||||
|
||||
// No per cell data is written for initial step, but will be
|
||||
// for subsequent steps, when we have started simulating
|
||||
output_writer_.writeTimeStepWithoutCellProperties( timer, state, well_state, {} );
|
||||
output_writer_.writeTimeStepWithoutCellProperties( timer, state, well_state, {}, {} );
|
||||
|
||||
report.output_write_time += perfTimer.stop();
|
||||
}
|
||||
|
@ -389,7 +389,7 @@ public:
|
||||
Dune::Timer perfTimer;
|
||||
perfTimer.start();
|
||||
const double nextstep = adaptiveTimeStepping ? adaptiveTimeStepping->suggestedNextStep() : -1.0;
|
||||
output_writer_.writeTimeStep( timer, state, well_state, solver->model(), false, nextstep );
|
||||
output_writer_.writeTimeStep( timer, state, well_state, solver->model(), false, nextstep, report);
|
||||
report.output_write_time += perfTimer.stop();
|
||||
|
||||
prev_well_state = well_state;
|
||||
|
@ -145,7 +145,7 @@ namespace Opm
|
||||
if (timer.initialStep()) {
|
||||
// No per cell data is written for initial step, but will be
|
||||
// for subsequent steps, when we have started simulating
|
||||
output_writer_.writeTimeStepWithoutCellProperties( timer, state, well_state, {} );
|
||||
output_writer_.writeTimeStepWithoutCellProperties( timer, state, well_state, {}, {} );
|
||||
}
|
||||
|
||||
// Max oil saturation (for VPPARS), hysteresis update.
|
||||
|
@ -185,7 +185,8 @@ namespace Opm
|
||||
const SimulationDataContainer state_;
|
||||
const WellStateFullyImplicitBlackoil wellState_;
|
||||
data::Solution simProps_;
|
||||
std::map<std::string, std::vector<double>> extraData_;
|
||||
std::map<std::string, double> miscSummaryData_;
|
||||
std::map<std::string, std::vector<double>> extraRestartData_;
|
||||
const bool substep_;
|
||||
|
||||
explicit WriterCall( BlackoilOutputWriter& writer,
|
||||
@ -193,14 +194,16 @@ namespace Opm
|
||||
const SimulationDataContainer& state,
|
||||
const WellStateFullyImplicitBlackoil& wellState,
|
||||
const data::Solution& simProps,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep )
|
||||
: writer_( writer ),
|
||||
timer_( timer.clone() ),
|
||||
state_( state ),
|
||||
wellState_( wellState ),
|
||||
simProps_( simProps ),
|
||||
extraData_( extraData ),
|
||||
miscSummaryData_( miscSummaryData ),
|
||||
extraRestartData_( extraRestartData ),
|
||||
substep_( substep )
|
||||
{
|
||||
}
|
||||
@ -209,7 +212,7 @@ namespace Opm
|
||||
void run ()
|
||||
{
|
||||
// write data
|
||||
writer_.writeTimeStepSerial( *timer_, state_, wellState_, simProps_, extraData_, substep_ );
|
||||
writer_.writeTimeStepSerial( *timer_, state_, wellState_, simProps_, miscSummaryData_, extraRestartData_, substep_ );
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -223,7 +226,8 @@ namespace Opm
|
||||
const SimulatorTimerInterface& timer,
|
||||
const SimulationDataContainer& localState,
|
||||
const WellStateFullyImplicitBlackoil& localWellState,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep)
|
||||
{
|
||||
data::Solution localCellData{};
|
||||
@ -232,7 +236,7 @@ namespace Opm
|
||||
localCellData = simToSolution(localState, restart_double_si_, phaseUsage_); // Get "normal" data (SWAT, PRESSURE, ...);
|
||||
}
|
||||
writeTimeStepWithCellProperties(timer, localState, localCellData ,
|
||||
localWellState, extraData, substep);
|
||||
localWellState, miscSummaryData, extraRestartData, substep);
|
||||
}
|
||||
|
||||
|
||||
@ -246,7 +250,8 @@ namespace Opm
|
||||
const SimulationDataContainer& localState,
|
||||
const data::Solution& localCellData,
|
||||
const WellStateFullyImplicitBlackoil& localWellState,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep)
|
||||
{
|
||||
// VTK output (is parallel if grid is parallel)
|
||||
@ -282,12 +287,12 @@ namespace Opm
|
||||
{
|
||||
if( asyncOutput_ ) {
|
||||
// dispatch the write call to the extra thread
|
||||
asyncOutput_->dispatch( detail::WriterCall( *this, timer, state, wellState, cellData, extraData, substep ) );
|
||||
asyncOutput_->dispatch( detail::WriterCall( *this, timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep ) );
|
||||
}
|
||||
else {
|
||||
// just write the data to disk
|
||||
try {
|
||||
writeTimeStepSerial( timer, state, wellState, cellData, extraData, substep );
|
||||
writeTimeStepSerial( timer, state, wellState, cellData, miscSummaryData, extraRestartData, substep );
|
||||
} catch (std::runtime_error& msg) {
|
||||
err = 1;
|
||||
emsg = msg.what();
|
||||
@ -317,7 +322,8 @@ namespace Opm
|
||||
const SimulationDataContainer& state,
|
||||
const WellStateFullyImplicitBlackoil& wellState,
|
||||
const data::Solution& simProps,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep)
|
||||
{
|
||||
// Matlab output
|
||||
@ -338,7 +344,8 @@ namespace Opm
|
||||
timer.simulationTimeElapsed(),
|
||||
simProps,
|
||||
wellState.report(phaseUsage_),
|
||||
extraData,
|
||||
miscSummaryData,
|
||||
extraRestartData,
|
||||
restart_double_si_);
|
||||
}
|
||||
}
|
||||
@ -407,7 +414,7 @@ namespace Opm
|
||||
|
||||
// No per cell data is written for restore steps, but will be
|
||||
// for subsequent steps, when we have started simulating
|
||||
writeTimeStepWithoutCellProperties( timer, state, wellState, {} );
|
||||
writeTimeStepWithoutCellProperties( timer, state, wellState, {}, {});
|
||||
|
||||
// some output
|
||||
std::cout << "Restored step " << timer.reportStepNum() << " at day "
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
||||
#include <opm/core/wells/DynamicListEconLimited.hpp>
|
||||
#include <opm/core/simulator/BlackoilState.hpp>
|
||||
#include <opm/core/simulator/SimulatorReport.hpp>
|
||||
|
||||
#include <opm/output/data/Cells.hpp>
|
||||
#include <opm/output/data/Solution.hpp>
|
||||
@ -228,21 +229,23 @@ namespace Opm
|
||||
const SimulationDataContainer& reservoirState,
|
||||
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
||||
const Model& physicalModel,
|
||||
bool substep = false,
|
||||
const double nextstep = -1.0);
|
||||
const bool substep = false,
|
||||
const double nextstep = -1.0,
|
||||
const SimulatorReport& simulatorReport = SimulatorReport());
|
||||
|
||||
|
||||
/*!
|
||||
* \brief Write a blackoil reservoir state to disk for later inspection with
|
||||
* visualization tools like ResInsight. This function will write all
|
||||
* CellData in simProps to the file as well as the extraData.
|
||||
* CellData in simProps to the file as well as the extraRestartData.
|
||||
*/
|
||||
void writeTimeStepWithCellProperties(
|
||||
const SimulatorTimerInterface& timer,
|
||||
const SimulationDataContainer& reservoirState,
|
||||
const data::Solution& cellData,
|
||||
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep = false);
|
||||
|
||||
/*!
|
||||
@ -254,7 +257,8 @@ namespace Opm
|
||||
const SimulatorTimerInterface& timer,
|
||||
const SimulationDataContainer& reservoirState,
|
||||
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep = false);
|
||||
|
||||
/*!
|
||||
@ -266,7 +270,8 @@ namespace Opm
|
||||
const SimulationDataContainer& reservoirState,
|
||||
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
||||
const data::Solution& simProps,
|
||||
const std::map<std::string, std::vector<double>>& extraData,
|
||||
const std::map<std::string, double>& miscSummaryData,
|
||||
const std::map<std::string, std::vector<double>>& extraRestartData,
|
||||
bool substep);
|
||||
|
||||
/** \brief return output directory */
|
||||
@ -986,15 +991,17 @@ namespace Opm
|
||||
const SimulationDataContainer& localState,
|
||||
const WellStateFullyImplicitBlackoil& localWellState,
|
||||
const Model& physicalModel,
|
||||
bool substep,
|
||||
const double nextstep)
|
||||
const bool substep,
|
||||
const double nextstep,
|
||||
const SimulatorReport& simulatorReport)
|
||||
{
|
||||
data::Solution localCellData{};
|
||||
const RestartConfig& restartConfig = eclipseState_.getRestartConfig();
|
||||
const SummaryConfig& summaryConfig = eclipseState_.getSummaryConfig();
|
||||
const int reportStepNum = timer.reportStepNum();
|
||||
bool logMessages = output_ && parallelOutput_->isIORank();
|
||||
std::map<std::string, std::vector<double>> extraData;
|
||||
std::map<std::string, std::vector<double>> extraRestartData;
|
||||
std::map<std::string, double> miscSummaryData;
|
||||
|
||||
if( output_ )
|
||||
{
|
||||
@ -1016,10 +1023,16 @@ namespace Opm
|
||||
assert(!localCellData.empty());
|
||||
|
||||
// Add suggested next timestep to extra data.
|
||||
extraData["OPMEXTRA"] = std::vector<double>(1, nextstep);
|
||||
extraRestartData["OPMEXTRA"] = std::vector<double>(1, nextstep);
|
||||
|
||||
// Add TCPU if simulatorReport is not defaulted.
|
||||
const double totalSolverTime = simulatorReport.solver_time;
|
||||
if (totalSolverTime != 0.0) {
|
||||
miscSummaryData["TCPU"] = totalSolverTime;
|
||||
}
|
||||
}
|
||||
|
||||
writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, extraData, substep);
|
||||
writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, miscSummaryData, extraRestartData, substep);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user