mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -1944,14 +1944,17 @@ private:
|
||||
//////
|
||||
// set saturations
|
||||
//////
|
||||
dofFluidState.setSaturation(FluidSystem::waterPhaseIdx,
|
||||
waterSaturationData[cartesianDofIdx]);
|
||||
dofFluidState.setSaturation(FluidSystem::gasPhaseIdx,
|
||||
gasSaturationData[cartesianDofIdx]);
|
||||
dofFluidState.setSaturation(FluidSystem::oilPhaseIdx,
|
||||
1.0
|
||||
- waterSaturationData[cartesianDofIdx]
|
||||
- gasSaturationData[cartesianDofIdx]);
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::waterPhaseIdx))
|
||||
dofFluidState.setSaturation(FluidSystem::waterPhaseIdx,
|
||||
waterSaturationData[cartesianDofIdx]);
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::gasPhaseIdx))
|
||||
dofFluidState.setSaturation(FluidSystem::gasPhaseIdx,
|
||||
gasSaturationData[cartesianDofIdx]);
|
||||
if (FluidSystem::phaseIsActive(FluidSystem::oilPhaseIdx))
|
||||
dofFluidState.setSaturation(FluidSystem::oilPhaseIdx,
|
||||
1.0
|
||||
- waterSaturationData[cartesianDofIdx]
|
||||
- gasSaturationData[cartesianDofIdx]);
|
||||
|
||||
//////
|
||||
// set phase pressures
|
||||
@@ -1965,19 +1968,22 @@ private:
|
||||
MaterialLaw::capillaryPressures(pc, matParams, dofFluidState);
|
||||
Opm::Valgrind::CheckDefined(oilPressure);
|
||||
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]));
|
||||
}
|
||||
|
||||
if (FluidSystem::enableDissolvedGas())
|
||||
dofFluidState.setRs(rsData[cartesianDofIdx]);
|
||||
else
|
||||
else if (Indices::gasEnabled && Indices::oilEnabled)
|
||||
dofFluidState.setRs(0.0);
|
||||
|
||||
if (FluidSystem::enableVaporizedOil())
|
||||
dofFluidState.setRv(rvData[cartesianDofIdx]);
|
||||
else
|
||||
else if (Indices::gasEnabled && Indices::oilEnabled)
|
||||
dofFluidState.setRv(0.0);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user