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.
This commit is contained in:
Bård Skaflestad 2023-09-18 15:48:15 +02:00
parent ae1e5f56f6
commit 0f78d3935c

View File

@ -683,15 +683,15 @@ regionSum(const ScalarBuffer& property,
template<class FluidSystem, class Scalar> template<class FluidSystem, class Scalar>
void EclGenericOutputBlackoilModule<FluidSystem,Scalar>:: void EclGenericOutputBlackoilModule<FluidSystem,Scalar>::
doAllocBuffers(unsigned bufferSize, doAllocBuffers(const unsigned bufferSize,
unsigned reportStepNum, const unsigned reportStepNum,
const bool substep, const bool substep,
const bool log, const bool log,
const bool isRestart, const bool isRestart,
const bool vapparsActive, const bool vapparsActive,
const bool enableHysteresis, const bool enableHysteresis,
unsigned numTracers, const unsigned numTracers,
unsigned numOutputNnc) const unsigned numOutputNnc)
{ {
// Output RESTART_OPM_EXTENDED only when explicitly requested by user. // Output RESTART_OPM_EXTENDED only when explicitly requested by user.
std::map<std::string, int> rstKeywords = schedule_.rst_keywords(reportStepNum); std::map<std::string, int> 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("FPR") ||
this->summaryConfig_.hasKeyword("FPRP") || this->summaryConfig_.hasKeyword("FPRP");
!this->RPRNodes_.empty())
{ const auto needPoreVolume = needAvgPress ||
this->summaryConfig_.hasKeyword("FHPV") ||
this->summaryConfig_.match("RHPV*");
if (needPoreVolume) {
this->fip_[Inplace::Phase::PoreVolume].resize(bufferSize, 0.0); this->fip_[Inplace::Phase::PoreVolume].resize(bufferSize, 0.0);
this->dynamicPoreVolume_.resize(bufferSize, 0.0); this->dynamicPoreVolume_.resize(bufferSize, 0.0);
this->hydrocarbonPoreVolume_.resize(bufferSize, 0.0); this->hydrocarbonPoreVolume_.resize(bufferSize, 0.0);
this->pressureTimesPoreVolume_.resize(bufferSize, 0.0);
this->pressureTimesHydrocarbonVolume_.resize(bufferSize, 0.0);
} }
else { else {
this->dynamicPoreVolume_.clear(); this->dynamicPoreVolume_.clear();
this->hydrocarbonPoreVolume_.clear(); this->hydrocarbonPoreVolume_.clear();
}
if (needAvgPress) {
this->pressureTimesPoreVolume_.resize(bufferSize, 0.0);
this->pressureTimesHydrocarbonVolume_.resize(bufferSize, 0.0);
}
else {
this->pressureTimesPoreVolume_.clear(); this->pressureTimesPoreVolume_.clear();
this->pressureTimesHydrocarbonVolume_.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_) { if (this->summaryConfig_.hasKeyword("FOE") && this->initialInplace_) {
miscSummaryData["FOE"] = (this->initialInplace_.value().get(Inplace::Phase::OIL) - inplace.get(Inplace::Phase::OIL)) miscSummaryData["FOE"] = (this->initialInplace_.value().get(Inplace::Phase::OIL) - inplace.get(Inplace::Phase::OIL))
/ this->initialInplace_.value().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), get_vector(node, Inplace::Phase::DynamicPoreVolume),
false); false);
} }
for (const auto& node : this->summaryConfig_.keywords("RHPV*")) {
regionData[node.keyword()] =
get_vector(node, Inplace::Phase::HydroCarbonPV);
}
} }
} }