diff --git a/opm/simulators/flow/EclWriter.hpp b/opm/simulators/flow/EclWriter.hpp index b3bd59200..cf8b980a6 100644 --- a/opm/simulators/flow/EclWriter.hpp +++ b/opm/simulators/flow/EclWriter.hpp @@ -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(); - const auto read_temp = enableEnergy || (opm_rst_file && enableTemperature); std::vector 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}, diff --git a/opm/simulators/flow/GenericOutputBlackoilModule.cpp b/opm/simulators/flow/GenericOutputBlackoilModule.cpp index a40ea292e..73f006a13 100644 --- a/opm/simulators/flow/GenericOutputBlackoilModule.cpp +++ b/opm/simulators/flow/GenericOutputBlackoilModule.cpp @@ -802,9 +802,9 @@ setRestart(const data::Solution& sol, rswSol_[elemIdx] = sol.data("RSWSOL")[globalDofIndex]; } - - assert(!saturation_[oilPhaseIdx].empty()); - saturation_[oilPhaseIdx][elemIdx] = so; + if (!saturation_[oilPhaseIdx].empty()) { + saturation_[oilPhaseIdx][elemIdx] = so; + } auto assign = [elemIdx, globalDofIndex, &sol](const std::string& name, ScalarBuffer& data) diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index 60681842a..9104e7deb 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -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); } }