mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Update Sw in fluid state after normalization
This commit is contained in:
@@ -222,7 +222,6 @@ public:
|
||||
Evaluation Sw = 0.0;
|
||||
if constexpr (waterEnabled) {
|
||||
Sw = priVars.makeEvaluation(water0Idx, timeIdx);
|
||||
fluidState_.setSaturation(FluidSystem::waterPhaseIdx, Sw);
|
||||
}
|
||||
Evaluation L = fluidState_.L();
|
||||
Evaluation So = Opm::max((1 - Sw) * (L * Z_L / ( L * Z_L + (1 - L) * Z_V)), 0.0);
|
||||
@@ -230,10 +229,13 @@ public:
|
||||
Scalar sumS = Opm::getValue(So) + Opm::getValue(Sg) + Opm::getValue(Sw);
|
||||
So /= sumS;
|
||||
Sg /= sumS;
|
||||
Sw /= sumS;
|
||||
|
||||
fluidState_.setSaturation(FluidSystem::oilPhaseIdx, So);
|
||||
fluidState_.setSaturation(FluidSystem::gasPhaseIdx, Sg);
|
||||
if constexpr (waterEnabled) {
|
||||
Sw /= sumS;
|
||||
fluidState_.setSaturation(FluidSystem::waterPhaseIdx, Sw);
|
||||
}
|
||||
|
||||
fluidState_.setCompressFactor(FluidSystem::oilPhaseIdx, Z_L);
|
||||
fluidState_.setCompressFactor(FluidSystem::gasPhaseIdx, Z_V);
|
||||
|
||||
Reference in New Issue
Block a user