ebos: fix explicit init for twophase cases

since OPM/opm-material#310 has been merged, data for deactivated
phases is not stored anymore and can thus no longer be accessed/set.

this fixes OPM/opm-simulators#1686
This commit is contained in:
Andreas Lauser committed 2019-01-08 11:18:17 +01:00
1 parent 1706ae1ae4
commit 5d581bab7e
1 file changed
+18 -12
+18 -12
View File
@@ -1944,14 +1944,17 @@ private:
////// //////
// set saturations // set saturations
////// //////
dofFluidState.setSaturation(FluidSystem::waterPhaseIdx, if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))
waterSaturationData[cartesianDofIdx]); dofFluidState.setSaturation(FluidSystem::waterPhaseIdx,
dofFluidState.setSaturation(FluidSystem::gasPhaseIdx, waterSaturationData[cartesianDofIdx]);
gasSaturationData[cartesianDofIdx]); if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))
dofFluidState.setSaturation(FluidSystem::oilPhaseIdx, dofFluidState.setSaturation(FluidSystem::gasPhaseIdx,
1.0 gasSaturationData[cartesianDofIdx]);
- waterSaturationData[cartesianDofIdx] if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx))
- gasSaturationData[cartesianDofIdx]); dofFluidState.setSaturation(FluidSystem::oilPhaseIdx,
1.0
- waterSaturationData[cartesianDofIdx]
- gasSaturationData[cartesianDofIdx]);
////// //////
// set phase pressures // set phase pressures
@@ -1965,19 +1968,22 @@ private:
MaterialLaw::capillaryPressures(pc, matParams, dofFluidState); MaterialLaw::capillaryPressures(pc, matParams, dofFluidState);
Opm::Valgrind::CheckDefined(oilPressure); Opm::Valgrind::CheckDefined(oilPressure);
Opm::Valgrind::CheckDefined(pc); Opm::Valgrind::CheckDefined(pc);
for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) for (unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
if (!FluidSystem::phaseIsActive(phaseIdx))
continue;
dofFluidState.setPressure(phaseIdx, oilPressure + (pc[phaseIdx] - pc[oilPhaseIdx])); dofFluidState.setPressure(phaseIdx, oilPressure + (pc[phaseIdx] - pc[oilPhaseIdx]));
}
if (FluidSystem::enableDissolvedGas()) if (FluidSystem::enableDissolvedGas())
dofFluidState.setRs(rsData[cartesianDofIdx]); dofFluidState.setRs(rsData[cartesianDofIdx]);
else else if (Indices::gasEnabled && Indices::oilEnabled)
dofFluidState.setRs(0.0); dofFluidState.setRs(0.0);
if (FluidSystem::enableVaporizedOil()) if (FluidSystem::enableVaporizedOil())
dofFluidState.setRv(rvData[cartesianDofIdx]); dofFluidState.setRv(rvData[cartesianDofIdx]);
else else if (Indices::gasEnabled && Indices::oilEnabled)
dofFluidState.setRv(0.0); dofFluidState.setRv(0.0);
} }
} }