mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
FIX gas-water restart
This commit is contained in:
parent
c228f31287
commit
438e40b143
@ -802,9 +802,9 @@ setRestart(const data::Solution& sol,
|
||||
rswSol_[elemIdx] = sol.data<double>("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)
|
||||
|
@ -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