Go to the documentation of this file.
31#ifndef OPM_EQUIL_COMP_REPORT_HPP
32#define OPM_EQUIL_COMP_REPORT_HPP
34#include <opm/input/eclipse/Units/UnitSystem.hpp>
36#include <fmt/format.h>
49template < class Scalar, std:: size_t NumComponents>
66 std::array<Scalar, NumComponents> oil{};
67 std::array<Scalar, NumComponents> gas{};
68 std::array<Scalar, NumComponents> total{};
80template < class Scalar, std:: size_t NumComponents>
85 const std::array<std::string_view, NumComponents>& componentNames,
86 const UnitSystem& units)
88 using Measure = UnitSystem::measure;
91 const auto out = std::back_inserter(report);
93 fmt::format_to(out, "\nComposition versus depth in equilibration region {} "
94 "(saturation table {})\n\n", region, satTable);
95 fmt::format_to(out, "{:>10} {:>10} {:>10} {:>10} {:>9} {:>9} {:>9} "
96 "{:>7} {:>7} {:>7} {:>9} {:>9}\n",
97 "Depth", "Poil", "Pwat", "Pgas", "Deno", "Denw", "Deng",
98 "Soil", "Swat", "Sgas", "Psat", "Ps(obs)");
99 const auto length = units.name(Measure::length);
100 const auto pressure = units.name(Measure::pressure);
101 const auto density = units.name(Measure::density);
102 fmt::format_to(out, "{:>10} {:>10} {:>10} {:>10} {:>9} {:>9} {:>9} "
103 "{:>7} {:>7} {:>7} {:>9} {:>9}\n",
104 length, pressure, pressure, pressure, density, density, density,
105 "", "", "", pressure, pressure);
106 fmt::format_to(out, "{:->10} {:->10} {:->10} {:->10} {:->9} {:->9} {:->9} "
107 "{:->7} {:->7} {:->7} {:->9} {:->9}\n",
108 "", "", "", "", "", "", "", "", "", "", "", "");
109 for ( const auto& row : rows) {
110 fmt::format_to(out, "{:10.2f} {:10.3f} {:10.3f} {:10.3f} {:9.3f} {:9.3f} {:9.3f} "
111 "{:7.4f} {:7.4f} {:7.4f} {:9.2f} {:9.2f}\n",
112 units.from_si(Measure::length, row.depth),
113 units.from_si(Measure::pressure, row.poil),
114 units.from_si(Measure::pressure, row.pwat),
115 units.from_si(Measure::pressure, row.pgas),
116 units.from_si(Measure::density, row.deno),
117 units.from_si(Measure::density, row.denw),
118 units.from_si(Measure::density, row.deng),
119 row.soil, row.swat, row.sgas,
120 units.from_si(Measure::pressure, row.psat),
121 units.from_si(Measure::pressure, row.statedPsat));
124 for ( const auto& [phase, fractions] :
125 {std::pair{ "Oil", &Row::oil},
126 std::pair{ "Gas", &Row::gas},
127 std::pair{ "Total", &Row::total}}) {
128 fmt::format_to(out, "\n{} composition\n\n{:>10}", phase, "Depth");
129 for ( const auto name : componentNames) {
130 fmt::format_to(out, " {:>8.8}", name);
132 fmt::format_to(out, "\n{:>10}\n{:->10}", length, "");
133 for (std::size_t c = 0; c < NumComponents; ++c) {
134 fmt::format_to(out, " {:->8}", "");
136 fmt::format_to(out, "\n");
137 for ( const auto& row : rows) {
138 fmt::format_to(out, "{:10.2f}", units.from_si(Measure::length, row.depth));
139 for ( const auto fraction : row.*fractions) {
140 fmt::format_to(out, " {:8.5f}", fraction);
142 fmt::format_to(out, "\n");
Definition: EquilCompReport.hpp:46
std::string formatCompositionVersusDepth(const std::size_t region, const int satTable, const std::vector< CompositionVersusDepthRow< Scalar, NumComponents > > &rows, const std::array< std::string_view, NumComponents > &componentNames, const UnitSystem &units) Definition: EquilCompReport.hpp:82
One depth of the composition versus depth report, in SI units. Definition: EquilCompReport.hpp:51
std::array< Scalar, NumComponents > total Definition: EquilCompReport.hpp:68
Scalar deng Definition: EquilCompReport.hpp:58
Scalar depth Definition: EquilCompReport.hpp:52
Scalar sgas Definition: EquilCompReport.hpp:61
Scalar psat Bubble point of the oil composition, zero when none is reported. Definition: EquilCompReport.hpp:63
Scalar pwat Definition: EquilCompReport.hpp:54
Scalar denw Definition: EquilCompReport.hpp:57
Scalar statedPsat Saturation pressure that COMPVD states, zero without one. Definition: EquilCompReport.hpp:65
Scalar soil Definition: EquilCompReport.hpp:59
Scalar swat Definition: EquilCompReport.hpp:60
Scalar poil Definition: EquilCompReport.hpp:53
std::array< Scalar, NumComponents > oil Definition: EquilCompReport.hpp:66
Scalar pgas Definition: EquilCompReport.hpp:55
Scalar deno Definition: EquilCompReport.hpp:56
std::array< Scalar, NumComponents > gas Definition: EquilCompReport.hpp:67
|