mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #5668 from totto82/fixGWrestart
FIX gas-water restart
This commit is contained in:
commit
0d4b7ece0a
@ -497,19 +497,18 @@ public:
|
||||
const auto gasActive = FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx);
|
||||
const auto waterActive = FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx);
|
||||
const auto enableSwatinit = simulator_.vanguard().eclState().fieldProps().has_double("SWATINIT");
|
||||
const auto opm_rst_file = Parameters::Get<Parameters::EnableOpmRstFile>();
|
||||
const auto read_temp = enableEnergy || (opm_rst_file && enableTemperature);
|
||||
|
||||
std::vector<RestartKey> solutionKeys {
|
||||
{"PRESSURE", UnitSystem::measure::pressure},
|
||||
{"SWAT", UnitSystem::measure::identity, waterActive},
|
||||
{"SGAS", UnitSystem::measure::identity, gasActive},
|
||||
{"TEMP", UnitSystem::measure::temperature, read_temp},
|
||||
{"TEMP", UnitSystem::measure::temperature, enableEnergy},
|
||||
{"SSOLVENT", UnitSystem::measure::identity, enableSolvent},
|
||||
|
||||
{"RS", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGas()},
|
||||
{"RV", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedOil()},
|
||||
{"RVW", UnitSystem::measure::oil_gas_ratio, FluidSystem::enableVaporizedWater()},
|
||||
{"RSW", UnitSystem::measure::gas_oil_ratio, FluidSystem::enableDissolvedGasInWater()},
|
||||
|
||||
{"SGMAX", UnitSystem::measure::identity, enableNonWettingHysteresis && oilActive && gasActive},
|
||||
{"SHMAX", UnitSystem::measure::identity, enableWettingHysteresis && oilActive && gasActive},
|
||||
|
@ -802,9 +802,9 @@ setRestart(const data::Solution& sol,
|
||||
rswSol_[elemIdx] = sol.data<double>("RSWSOL")[globalDofIndex];
|
||||
|
||||
}
|
||||
|
||||
assert(!saturation_[oilPhaseIdx].empty());
|
||||
if (!saturation_[oilPhaseIdx].empty()) {
|
||||
saturation_[oilPhaseIdx][elemIdx] = so;
|
||||
}
|
||||
|
||||
auto assign = [elemIdx, globalDofIndex, &sol](const std::string& name,
|
||||
ScalarBuffer& data)
|
||||
|
@ -1146,12 +1146,18 @@ public:
|
||||
MaterialLaw::capillaryPressures(pc, matParams, fs);
|
||||
Valgrind::CheckDefined(this->fluidPressure_[elemIdx]);
|
||||
Valgrind::CheckDefined(pc);
|
||||
assert(FluidSystem::phaseIsActive(oilPhaseIdx));
|
||||
const auto& pressure = this->fluidPressure_[elemIdx];
|
||||
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
|
||||
if (!FluidSystem::phaseIsActive(phaseIdx))
|
||||
continue;
|
||||
|
||||
fs.setPressure(phaseIdx, this->fluidPressure_[elemIdx] + (pc[phaseIdx] - pc[oilPhaseIdx]));
|
||||
if (Indices::oilEnabled)
|
||||
fs.setPressure(phaseIdx, pressure + (pc[phaseIdx] - pc[oilPhaseIdx]));
|
||||
else if (Indices::gasEnabled)
|
||||
fs.setPressure(phaseIdx, pressure + (pc[phaseIdx] - pc[gasPhaseIdx]));
|
||||
else if (Indices::waterEnabled)
|
||||
//single (water) phase
|
||||
fs.setPressure(phaseIdx, pressure);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user