mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #1084 from babrodtk/hysteresis_output
Adds hysteresis output and input (for restarting)
This commit is contained in:
@@ -151,17 +151,7 @@ public:
|
||||
// This is a restart, populate WellState and ReservoirState state objects from restart file
|
||||
output_writer_.initFromRestartFile(props_.phaseUsage(), grid(), state, prev_well_state, extra);
|
||||
initHydroCarbonState(state, props_.phaseUsage(), Opm::UgGridHelpers::numCells(grid()), has_disgas_, has_vapoil_);
|
||||
{
|
||||
const int num_cells = Opm::UgGridHelpers::numCells(grid());
|
||||
|
||||
typedef std::vector<double> VectorType;
|
||||
|
||||
const VectorType& somax = state.getCellData( "SOMAX" );
|
||||
|
||||
for (int cellIdx = 0; cellIdx < num_cells; ++cellIdx) {
|
||||
ebosSimulator_.model().setMaxOilSaturation(somax[cellIdx], cellIdx);
|
||||
}
|
||||
}
|
||||
initHysteresisParams(state);
|
||||
}
|
||||
|
||||
// Create timers and file for writing timing info.
|
||||
@@ -799,6 +789,40 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void initHysteresisParams(ReservoirState& state) {
|
||||
const int num_cells = Opm::UgGridHelpers::numCells(grid());
|
||||
|
||||
typedef std::vector<double> VectorType;
|
||||
|
||||
const VectorType& somax = state.getCellData( "SOMAX" );
|
||||
|
||||
for (int cellIdx = 0; cellIdx < num_cells; ++cellIdx) {
|
||||
ebosSimulator_.model().setMaxOilSaturation(somax[cellIdx], cellIdx);
|
||||
}
|
||||
|
||||
if (ebosSimulator_.problem().materialLawManager()->enableHysteresis()) {
|
||||
auto matLawManager = ebosSimulator_.problem().materialLawManager();
|
||||
|
||||
VectorType& pcSwMdc_ow = state.getCellData( "PCSWMDC_OW" );
|
||||
VectorType& krnSwMdc_ow = state.getCellData( "KRNSWMDC_OW" );
|
||||
|
||||
VectorType& pcSwMdc_go = state.getCellData( "PCSWMDC_GO" );
|
||||
VectorType& krnSwMdc_go = state.getCellData( "KRNSWMDC_GO" );
|
||||
|
||||
for (int cellIdx = 0; cellIdx < num_cells; ++cellIdx) {
|
||||
matLawManager->setOilWaterHysteresisParams(
|
||||
pcSwMdc_ow[cellIdx],
|
||||
krnSwMdc_ow[cellIdx],
|
||||
cellIdx);
|
||||
matLawManager->setGasOilHysteresisParams(
|
||||
pcSwMdc_go[cellIdx],
|
||||
krnSwMdc_go[cellIdx],
|
||||
cellIdx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Data.
|
||||
Simulator& ebosSimulator_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user