From b5836354c228b234b668662d00be16484e5e6983 Mon Sep 17 00:00:00 2001 From: Paul Egberts Date: Sun, 6 Mar 2022 18:07:32 +0100 Subject: [PATCH] clean up --- opm/models/blackoil/blackoilintensivequantities.hh | 4 +--- opm/models/blackoil/blackoilprimaryvariables.hh | 10 ++++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/opm/models/blackoil/blackoilintensivequantities.hh b/opm/models/blackoil/blackoilintensivequantities.hh index 94613996e..438983e40 100644 --- a/opm/models/blackoil/blackoilintensivequantities.hh +++ b/opm/models/blackoil/blackoilintensivequantities.hh @@ -266,13 +266,11 @@ public: fluidState_.setRv(0.0); if (FluidSystem::enableVaporizedWater()) { - const Evaluation& RvwSat = FluidSystem::saturatedWaterVaporationFactor(fluidState_, + const Evaluation& RvwSat = FluidSystem::saturatedVaporizationFactor(fluidState_, gasPhaseIdx, pvtRegionIdx); fluidState_.setRvw(RvwSat); } - else //if (compositionSwitchEnabled) - fluidState_.setRvw(0.0); } else if (priVars.primaryVarsMeaning() == PrimaryVariables::Rvw_po_Sg) { // The switching variable is the water-gas ratio Rvw diff --git a/opm/models/blackoil/blackoilprimaryvariables.hh b/opm/models/blackoil/blackoilprimaryvariables.hh index 37a184747..395045d14 100644 --- a/opm/models/blackoil/blackoilprimaryvariables.hh +++ b/opm/models/blackoil/blackoilprimaryvariables.hh @@ -488,7 +488,8 @@ public: T, pg); setPrimaryVarsMeaning(Rvw_po_Sg); - //Sw = 0.0; //check + (*this)[Indices::waterSaturationIdx] = RvwSat; //primary variable becomes Rvw + return true; } @@ -607,9 +608,14 @@ public: Scalar po = (*this)[Indices::pressureSwitchIdx]; Scalar T = asImp_().temperature_(); + Scalar Sg = 0.0; + if (compositionSwitchEnabled) + Sg = (*this)[Indices::compositionSwitchIdx]; + + Scalar So = 1.0 - Sg - solventSaturation_(); Scalar pC[numPhases] = { 0.0 }; const MaterialLawParams& matParams = problem.materialLawParams(globalDofIdx); - computeCapillaryPressures_(pC, So, Sg + solventSaturation_(), Sw, matParams); + computeCapillaryPressures_(pC, So, Sg + solventSaturation_(), /*Sw=*/ 0.0, matParams); Scalar pg = po + (pC[gasPhaseIdx] - pC[oilPhaseIdx]); Scalar RvwSat = FluidSystem::gasPvt().saturatedWaterVaporizationFactor(pvtRegionIdx_, T,