move output of fip reservoir log to LogOutputHelper

This commit is contained in:
Arne Morten Kvarving
2023-08-04 12:37:48 +02:00
parent daced47301
commit e2d4bae78d
4 changed files with 76 additions and 116 deletions

View File

@@ -246,6 +246,34 @@ fip(const Inplace& inplace,
}
}
template<class Scalar>
void LogOutputHelper<Scalar>::
fipResv(const Inplace& inplace) const
{
{
std::unordered_map<Inplace::Phase, Scalar> current_values;
for (const auto& phase : Inplace::phases()) {
current_values[phase] = inplace.get(phase);
}
this->fipUnitConvert_(current_values);
this->outputResvFluidInPlace_(current_values, 0);
}
for (size_t reg = 1; reg <= inplace.max_region("FIPNUM"); ++reg) {
std::unordered_map<Inplace::Phase, Scalar> current_values;
for (const auto& phase : Inplace::phases()) {
current_values[phase] = inplace.get("FIPNUM", phase, reg);
}
current_values[Inplace::Phase::DynamicPoreVolume] =
inplace.get("FIPNUM", Inplace::Phase::DynamicPoreVolume, reg);
this->fipUnitConvert_(current_values);
this->outputResvFluidInPlace_(current_values, reg);
}
}
template<class Scalar>
void LogOutputHelper<Scalar>::
injection(const std::size_t reportStepNum,
@@ -726,6 +754,45 @@ outputRegionFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> oip,
OpmLog::note(ss.str());
}
template<class Scalar>
void LogOutputHelper<Scalar>::
outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr,
const int reg) const
{
// don't output FIPNUM report if the region has no porv.
if (cipr[Inplace::Phase::PoreVolume] == 0) {
return;
}
const UnitSystem& units = eclState_.getUnits();
std::ostringstream ss;
if (reg == 0) {
ss << " ===================================\n";
if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_METRIC) {
ss << " : RESERVOIR VOLUMES M3 :\n";
} else if (units.getType() == UnitSystem::UnitType::UNIT_TYPE_FIELD) {
ss << " : RESERVOIR VOLUMES RB :\n";
}
ss << ":---------:---------------:---------------:---------------:---------------:---------------:\n"
<< ": REGION : TOTAL PORE : PORE VOLUME : PORE VOLUME : PORE VOLUME : PORE VOLUME :\n"
<< ": : VOLUME : CONTAINING : CONTAINING : CONTAINING : CONTAINING :\n"
<< ": : : OIL : WATER : GAS : HYDRO-CARBON :\n"
<< ":---------:---------------:---------------:---------------:---------------:---------------\n";
}
else {
ss << std::right << std::fixed << std::setprecision(0) << ":"
<< std::setw (9) << reg << ":"
<< std::setw(15) << cipr[Inplace::Phase::DynamicPoreVolume] << ":"
<< std::setw(15) << cipr[Inplace::Phase::OilResVolume] << ":"
<< std::setw(15) << cipr[Inplace::Phase::WaterResVolume] << ":"
<< std::setw(15) << cipr[Inplace::Phase::GasResVolume] << ":"
<< std::setw(15) << cipr[Inplace::Phase::OilResVolume] +
cipr[Inplace::Phase::GasResVolume] << ":\n"
<< ":---------:---------------:---------------:---------------:---------------:---------------:\n";
}
OpmLog::note(ss.str());
}
template<class Scalar>
void LogOutputHelper<Scalar>::
fipUnitConvert_(std::unordered_map<Inplace::Phase, Scalar>& fip) const

View File

@@ -51,6 +51,9 @@ public:
void fip(const Inplace& inplace,
const Inplace& initialInplace) const;
//! \brief Write fluid-in-place reservoir reports to output.
void fipResv(const Inplace& inplace) const;
//! \brief Write injection report to output.
void injection(const std::size_t reportStepNum,
std::function<bool(const std::string&)> isDefunct) const;
@@ -68,6 +71,9 @@ private:
const Scalar pav,
const int reg) const;
void outputResvFluidInPlace_(std::unordered_map<Inplace::Phase, Scalar> cipr,
const int reg) const;
void outputInjectionReport_(const std::vector<Scalar>& wellInj,
const std::vector<std::string>& wellInjNames) const;