mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add SI/double preserving feature to restart I/O.
The parameter "restart_double_si" (defaults to false) will when true cause the RESTART_SOLUTION data (only) to be read/written with measure equal to measure::identity, thereby suppressing unit conversions. Also, the output layer will be told to output all (not just RESTART_SOLUTION but also RESTART_AUXILIARY) restart data as doubles.
This commit is contained in:
@@ -307,6 +307,7 @@ namespace Opm
|
||||
// Parameters for output.
|
||||
const std::string outputDir_;
|
||||
const int output_interval_;
|
||||
const bool restart_double_si_;
|
||||
|
||||
int lastBackupReportStep_;
|
||||
|
||||
@@ -338,6 +339,7 @@ namespace Opm
|
||||
parallelOutput_( output_ ? new ParallelDebugOutput< Grid >( grid, eclipseState, phaseUsage.num_phases, phaseUsage ) : 0 ),
|
||||
outputDir_( output_ ? param.getDefault("output_dir", std::string("output")) : "." ),
|
||||
output_interval_( output_ ? param.getDefault("output_interval", 1): 0 ),
|
||||
restart_double_si_( output_ ? param.getDefault("restart_double_si", false) : false ),
|
||||
lastBackupReportStep_( -1 ),
|
||||
phaseUsage_( phaseUsage ),
|
||||
eclipseState_(eclipseState),
|
||||
@@ -415,13 +417,20 @@ namespace Opm
|
||||
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},
|
||||
{"SWAT" , UnitSystem::measure::identity},
|
||||
{"SGAS" , UnitSystem::measure::identity},
|
||||
{"TEMP" , UnitSystem::measure::temperature},
|
||||
{"RS" , UnitSystem::measure::gas_oil_ratio},
|
||||
{"RV" , UnitSystem::measure::oil_gas_ratio},
|
||||
{"OPMEXTRA" , UnitSystem::measure::identity}};
|
||||
|
||||
if (restart_double_si_) {
|
||||
// Avoid any unit conversions, treat restart input as SI units.
|
||||
for (auto& elem : solution_keys) {
|
||||
elem.second = UnitSystem::measure::identity;
|
||||
}
|
||||
}
|
||||
|
||||
// gives a dummy dynamic_list_econ_limited
|
||||
DynamicListEconLimited dummy_list_econ_limited;
|
||||
WellsManager wellsmanager(eclipseState_,
|
||||
@@ -936,7 +945,7 @@ namespace Opm
|
||||
SimulationDataContainer sd =
|
||||
detail::convertToSimulationDataContainer( physicalModel.getSimulatorData(), localState, phaseUsage_ );
|
||||
|
||||
localCellData = simToSolution( sd, phaseUsage_); // Get "normal" data (SWAT, PRESSURE, ...);
|
||||
localCellData = simToSolution( sd, restart_double_si_, phaseUsage_); // Get "normal" data (SWAT, PRESSURE, ...);
|
||||
|
||||
detail::getRestartData( localCellData, std::move(sd), phaseUsage_, physicalModel,
|
||||
restartConfig, reportStepNum, logMessages );
|
||||
|
||||
Reference in New Issue
Block a user