From 0f78d3935c620c1db45a387730f80650949a5231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Mon, 18 Sep 2023 15:48:15 +0200 Subject: [PATCH] Calculate Hydrocarbon Pore-Volumes if Requested This commit separates the computation of hydrocarbon pore-volumes out from the context of average pressure values. These pore-volumes go into the xHPV summary vectors and are, therefore, useful in their own right-not just as a means to computing average pressure values. --- ebos/eclgenericoutputblackoilmodule.cc | 49 ++++++++++++++++++-------- 1 file changed, 34 insertions(+), 15 deletions(-) diff --git a/ebos/eclgenericoutputblackoilmodule.cc b/ebos/eclgenericoutputblackoilmodule.cc index d241e20c6..8f7ac7c67 100644 --- a/ebos/eclgenericoutputblackoilmodule.cc +++ b/ebos/eclgenericoutputblackoilmodule.cc @@ -683,15 +683,15 @@ regionSum(const ScalarBuffer& property, template void EclGenericOutputBlackoilModule:: -doAllocBuffers(unsigned bufferSize, - unsigned reportStepNum, - const bool substep, - const bool log, - const bool isRestart, - const bool vapparsActive, - const bool enableHysteresis, - unsigned numTracers, - unsigned numOutputNnc) +doAllocBuffers(const unsigned bufferSize, + const unsigned reportStepNum, + const bool substep, + const bool log, + const bool isRestart, + const bool vapparsActive, + const bool enableHysteresis, + const unsigned numTracers, + const unsigned numOutputNnc) { // Output RESTART_OPM_EXTENDED only when explicitly requested by user. std::map rstKeywords = schedule_.rst_keywords(reportStepNum); @@ -728,20 +728,30 @@ doAllocBuffers(unsigned bufferSize, } } - if (!substep || + const auto needAvgPress = !substep || + !this->RPRNodes_.empty() || this->summaryConfig_.hasKeyword("FPR") || - this->summaryConfig_.hasKeyword("FPRP") || - !this->RPRNodes_.empty()) - { + this->summaryConfig_.hasKeyword("FPRP"); + + const auto needPoreVolume = needAvgPress || + this->summaryConfig_.hasKeyword("FHPV") || + this->summaryConfig_.match("RHPV*"); + + if (needPoreVolume) { this->fip_[Inplace::Phase::PoreVolume].resize(bufferSize, 0.0); this->dynamicPoreVolume_.resize(bufferSize, 0.0); this->hydrocarbonPoreVolume_.resize(bufferSize, 0.0); - this->pressureTimesPoreVolume_.resize(bufferSize, 0.0); - this->pressureTimesHydrocarbonVolume_.resize(bufferSize, 0.0); } else { this->dynamicPoreVolume_.clear(); this->hydrocarbonPoreVolume_.clear(); + } + + if (needAvgPress) { + this->pressureTimesPoreVolume_.resize(bufferSize, 0.0); + this->pressureTimesHydrocarbonVolume_.resize(bufferSize, 0.0); + } + else { this->pressureTimesPoreVolume_.clear(); this->pressureTimesHydrocarbonVolume_.clear(); } @@ -1284,6 +1294,10 @@ updateSummaryRegionValues(const Inplace& inplace, } } + if (this->summaryConfig_.hasKeyword("FHPV")) { + miscSummaryData["FHPV"] = inplace.get(Inplace::Phase::HydroCarbonPV); + } + if (this->summaryConfig_.hasKeyword("FOE") && this->initialInplace_) { miscSummaryData["FOE"] = (this->initialInplace_.value().get(Inplace::Phase::OIL) - inplace.get(Inplace::Phase::OIL)) / this->initialInplace_.value().get(Inplace::Phase::OIL); @@ -1340,6 +1354,11 @@ updateSummaryRegionValues(const Inplace& inplace, get_vector(node, Inplace::Phase::DynamicPoreVolume), false); } + + for (const auto& node : this->summaryConfig_.keywords("RHPV*")) { + regionData[node.keyword()] = + get_vector(node, Inplace::Phase::HydroCarbonPV); + } } }