From 8320a9abdf00b05f2b6b606ae49a4d61c98f1077 Mon Sep 17 00:00:00 2001 From: David Landa Marban Date: Wed, 17 Jul 2024 12:57:40 +0200 Subject: [PATCH] Output support for RSWSAT and RVWSAT --- opm/simulators/flow/GenericOutputBlackoilModule.cpp | 10 ++++++++++ opm/simulators/flow/GenericOutputBlackoilModule.hpp | 2 ++ opm/simulators/flow/OutputBlackoilModule.hpp | 13 +++++++++++++ 3 files changed, 25 insertions(+) diff --git a/opm/simulators/flow/GenericOutputBlackoilModule.cpp b/opm/simulators/flow/GenericOutputBlackoilModule.cpp index c18022d55..5e46b6ec3 100644 --- a/opm/simulators/flow/GenericOutputBlackoilModule.cpp +++ b/opm/simulators/flow/GenericOutputBlackoilModule.cpp @@ -556,8 +556,10 @@ assignToSolution(data::Solution& sol) DataEntry{"PRESPOTF", UnitSystem::measure::pressure, mechPotentialPressForce_}, DataEntry{"PRES_OVB", UnitSystem::measure::pressure, overburdenPressure_}, DataEntry{"RSW", UnitSystem::measure::gas_oil_ratio, rsw_}, + DataEntry{"RSWSAT", UnitSystem::measure::gas_oil_ratio, gasDissolutionFactorInWater_}, DataEntry{"RSWSOL", UnitSystem::measure::gas_oil_ratio, rswSol_}, DataEntry{"RVW", UnitSystem::measure::oil_gas_ratio, rvw_}, + DataEntry{"RVWSAT", UnitSystem::measure::oil_gas_ratio, waterVaporizationFactor_}, DataEntry{"SALTP", UnitSystem::measure::identity, pSalt_}, DataEntry{"SS_X", UnitSystem::measure::identity, extboX_}, DataEntry{"SS_Y", UnitSystem::measure::identity, extboY_}, @@ -1186,6 +1188,14 @@ doAllocBuffers(const unsigned bufferSize, rstKeywords["RVSAT"] = 0; oilVaporizationFactor_.resize(bufferSize, 0.0); } + if (FluidSystem::enableDissolvedGasInWater() && rstKeywords["RSWSAT"] > 0) { + rstKeywords["RSWSAT"] = 0; + gasDissolutionFactorInWater_.resize(bufferSize, 0.0); + } + if (FluidSystem::enableVaporizedWater() && rstKeywords["RVWSAT"] > 0) { + rstKeywords["RVWSAT"] = 0; + waterVaporizationFactor_.resize(bufferSize, 0.0); + } if (FluidSystem::phaseIsActive(waterPhaseIdx) && rstKeywords["BW"] > 0) { rstKeywords["BW"] = 0; diff --git a/opm/simulators/flow/GenericOutputBlackoilModule.hpp b/opm/simulators/flow/GenericOutputBlackoilModule.hpp index 36652e9ad..76cd8ee6c 100644 --- a/opm/simulators/flow/GenericOutputBlackoilModule.hpp +++ b/opm/simulators/flow/GenericOutputBlackoilModule.hpp @@ -459,6 +459,8 @@ protected: ScalarBuffer ppcw_; ScalarBuffer gasDissolutionFactor_; ScalarBuffer oilVaporizationFactor_; + ScalarBuffer gasDissolutionFactorInWater_; + ScalarBuffer waterVaporizationFactor_; ScalarBuffer bubblePointPressure_; ScalarBuffer dewPointPressure_; ScalarBuffer rockCompPorvMultiplier_; diff --git a/opm/simulators/flow/OutputBlackoilModule.hpp b/opm/simulators/flow/OutputBlackoilModule.hpp index 4d5c9557d..7ac7842fe 100644 --- a/opm/simulators/flow/OutputBlackoilModule.hpp +++ b/opm/simulators/flow/OutputBlackoilModule.hpp @@ -362,6 +362,19 @@ public: fs, gasPhaseIdx, pvtRegionIdx, SoMax); Valgrind::CheckDefined(this->oilVaporizationFactor_[globalDofIdx]); } + if (!this->gasDissolutionFactorInWater_.empty()) { + Scalar SwMax = elemCtx.problem().maxWaterSaturation(globalDofIdx); + this->gasDissolutionFactorInWater_[globalDofIdx] + = FluidSystem::template saturatedDissolutionFactor( + fs, waterPhaseIdx, pvtRegionIdx, SwMax); + Valgrind::CheckDefined(this->gasDissolutionFactorInWater_[globalDofIdx]); + } + if (!this->waterVaporizationFactor_.empty()) { + this->waterVaporizationFactor_[globalDofIdx] + = FluidSystem::template saturatedVaporizationFactor( + fs, gasPhaseIdx, pvtRegionIdx); + Valgrind::CheckDefined(this->waterVaporizationFactor_[globalDofIdx]); + } if (!this->gasFormationVolumeFactor_.empty()) { this->gasFormationVolumeFactor_[globalDofIdx] = 1.0 / FluidSystem::template inverseFormationVolumeFactor(