mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add restart I/O of suggested timestep length.
This commit is contained in:
@@ -197,6 +197,13 @@ namespace Opm
|
||||
const Grid& grid_;
|
||||
};
|
||||
|
||||
|
||||
struct ExtraData
|
||||
{
|
||||
double suggested_step;
|
||||
};
|
||||
|
||||
|
||||
/** \brief Wrapper class for VTK, Matlab, and ECL output. */
|
||||
class BlackoilOutputWriter
|
||||
{
|
||||
@@ -224,7 +231,8 @@ namespace Opm
|
||||
const SimulationDataContainer& reservoirState,
|
||||
const Opm::WellStateFullyImplicitBlackoil& wellState,
|
||||
const Model& physicalModel,
|
||||
bool substep = false);
|
||||
bool substep = false,
|
||||
const double nextstep = -1.0);
|
||||
|
||||
|
||||
/*!
|
||||
@@ -280,11 +288,12 @@ namespace Opm
|
||||
const int desiredReportStep);
|
||||
|
||||
|
||||
template <class Grid, class WellStateFullyImplicitBlackOel>
|
||||
template <class Grid, class WellState>
|
||||
void initFromRestartFile(const PhaseUsage& phaseUsage,
|
||||
const Grid& grid,
|
||||
SimulationDataContainer& simulatorstate,
|
||||
WellStateFullyImplicitBlackOel& wellstate);
|
||||
WellState& wellstate,
|
||||
ExtraData& extra);
|
||||
|
||||
bool isRestart() const;
|
||||
|
||||
@@ -401,14 +410,16 @@ namespace Opm
|
||||
initFromRestartFile( const PhaseUsage& phaseUsage,
|
||||
const Grid& grid,
|
||||
SimulationDataContainer& simulatorstate,
|
||||
WellState& wellstate)
|
||||
WellState& wellstate,
|
||||
ExtraData& extra )
|
||||
{
|
||||
std::map<std::string, UnitSystem::measure> solution_keys {{"PRESSURE" , UnitSystem::measure::pressure},
|
||||
{"SWAT" , UnitSystem::measure::identity},
|
||||
{"SGAS" , UnitSystem::measure::identity},
|
||||
{"TEMP" , UnitSystem::measure::temperature},
|
||||
{"RS" , UnitSystem::measure::gas_oil_ratio},
|
||||
{"RV" , UnitSystem::measure::oil_gas_ratio}};
|
||||
{"RV" , UnitSystem::measure::oil_gas_ratio},
|
||||
{"OPMEXTRA" , UnitSystem::measure::identity}};
|
||||
|
||||
// gives a dummy dynamic_list_econ_limited
|
||||
DynamicListEconLimited dummy_list_econ_limited;
|
||||
@@ -435,6 +446,12 @@ namespace Opm
|
||||
|
||||
solutionToSim( state.first, phaseUsage, simulatorstate );
|
||||
wellsToState( state.second, phaseUsage, wellstate );
|
||||
|
||||
if (state.first.has( "OPMEXTRA" ) ) {
|
||||
std::vector<double> opmextra = state.first.data( "OPMEXTRA" );
|
||||
assert(opmextra.size() == 1);
|
||||
extra.suggested_step = opmextra[0];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -899,7 +916,8 @@ namespace Opm
|
||||
const SimulationDataContainer& localState,
|
||||
const WellStateFullyImplicitBlackoil& localWellState,
|
||||
const Model& physicalModel,
|
||||
bool substep)
|
||||
bool substep,
|
||||
const double nextstep)
|
||||
{
|
||||
data::Solution localCellData{};
|
||||
const RestartConfig& restartConfig = eclipseState_.getRestartConfig();
|
||||
@@ -924,6 +942,13 @@ namespace Opm
|
||||
// sd will be invalid after getRestartData has been called
|
||||
}
|
||||
detail::getSummaryData( localCellData, phaseUsage_, physicalModel, summaryConfig );
|
||||
|
||||
// Hack: add suggested next timestep.
|
||||
assert(!localCellData.empty());
|
||||
localCellData.insert("OPMEXTRA",
|
||||
UnitSystem::measure::identity,
|
||||
std::vector<double>(1, nextstep),
|
||||
data::TargetType::RESTART_SOLUTION);
|
||||
}
|
||||
|
||||
writeTimeStepWithCellProperties(timer, localState, localCellData, localWellState, substep);
|
||||
|
||||
Reference in New Issue
Block a user