Skip to content

Commit

Permalink
Output summary vectors for free and solution tracers
Browse files Browse the repository at this point in the history
  • Loading branch information
svenn-t committed May 16, 2024
1 parent 6492874 commit a685674
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 3 deletions.
9 changes: 8 additions & 1 deletion opm/input/eclipse/EclipseState/TracerConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,14 @@ bool TracerConfig::operator==(const TracerConfig& other) const {

std::string TracerConfig::get_unit_string(const UnitSystem& unit_system, const std::string & tracer_kw) const {
if (tracer_kw.length() > 4 ) {
std::string tracer_name = tracer_kw.substr(4);
int istart;
if (tracer_kw[4] == 'F' || tracer_kw[4] == 'S') {
istart = 5;
}
else {
istart = 4;
}
std::string tracer_name = tracer_kw.substr(istart);
for (const auto& tracer : tracers) {
if (tracer.name == tracer_name) {
std::string unit_string(tracer.unit_string);
Expand Down
6 changes: 6 additions & 0 deletions opm/input/eclipse/EclipseState/TracerConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ class TracerConfig {
std::string sname() const {
return this->name + "S";
}
std::string wellfname() const {
return "F" + this->name;
}
std::string wellsname() const {
return "S" + this->name;
}


TracerEntry() = default;
Expand Down
84 changes: 82 additions & 2 deletions opm/output/eclipse/Summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1984,9 +1984,21 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "WTIR#W", ratetracer< rt::tracer, rt::wat, injector > }, // #W: Water tracers
{ "WTIR#O", ratetracer< rt::tracer, rt::oil, injector > }, // #O: Oil tracers
{ "WTIR#G", ratetracer< rt::tracer, rt::gas, injector > }, // #G: Gas tracers
{ "WTIRF#W", ratetracer< rt::tracer, rt::wat, injector > }, // #W: Water tracers
{ "WTIRF#O", ratetracer< rt::tracer, rt::oil, injector > }, // #O: Oil tracers
{ "WTIRF#G", ratetracer< rt::tracer, rt::gas, injector > }, // #G: Gas tracers
{ "WTIRS#W", ratetracer< rt::tracer, rt::wat, injector > }, // #W: Water tracers
{ "WTIRS#O", ratetracer< rt::tracer, rt::oil, injector > }, // #O: Oil tracers
{ "WTIRS#G", ratetracer< rt::tracer, rt::gas, injector > }, // #G: Gas tracers
{ "WTIC#W", div( ratetracer< rt::tracer, rt::wat, injector >, rate< rt::wat, injector >) },
{ "WTIC#O", div( ratetracer< rt::tracer, rt::oil, injector >, rate< rt::oil, injector >) },
{ "WTIC#G", div( ratetracer< rt::tracer, rt::gas, injector >, rate< rt::gas, injector >) },
{ "WTICF#W", div( ratetracer< rt::tracer, rt::wat, injector >, rate< rt::wat, injector >) },
{ "WTICF#O", div( ratetracer< rt::tracer, rt::oil, injector >, rate< rt::oil, injector >) },
{ "WTICF#G", div( ratetracer< rt::tracer, rt::gas, injector >, rate< rt::gas, injector >) },
{ "WTICS#W", div( ratetracer< rt::tracer, rt::wat, injector >, rate< rt::wat, injector >) },
{ "WTICS#O", div( ratetracer< rt::tracer, rt::oil, injector >, rate< rt::oil, injector >) },
{ "WTICS#G", div( ratetracer< rt::tracer, rt::gas, injector >, rate< rt::gas, injector >) },
{ "WVIR", sum( sum( rate< rt::reservoir_water, injector >, rate< rt::reservoir_oil, injector > ),
rate< rt::reservoir_gas, injector > ) },
{ "WGIGR", well_guiderate<injector, Opm::data::GuideRateValue::Item::Gas> },
Expand All @@ -2003,6 +2015,12 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "WTIT#W", mul( ratetracer< rt::tracer, rt::wat, injector >, duration ) },
{ "WTIT#O", mul( ratetracer< rt::tracer, rt::oil, injector >, duration ) },
{ "WTIT#G", mul( ratetracer< rt::tracer, rt::gas, injector >, duration ) },
{ "WTITF#W", mul( ratetracer< rt::tracer, rt::wat, injector >, duration ) },
{ "WTITF#O", mul( ratetracer< rt::tracer, rt::oil, injector >, duration ) },
{ "WTITF#G", mul( ratetracer< rt::tracer, rt::gas, injector >, duration ) },
{ "WTITS#W", mul( ratetracer< rt::tracer, rt::wat, injector >, duration ) },
{ "WTITS#O", mul( ratetracer< rt::tracer, rt::oil, injector >, duration ) },
{ "WTITS#G", mul( ratetracer< rt::tracer, rt::gas, injector >, duration ) },
{ "WVIT", mul( sum( sum( rate< rt::reservoir_water, injector >, rate< rt::reservoir_oil, injector > ),
rate< rt::reservoir_gas, injector > ), duration ) },

Expand Down Expand Up @@ -2034,9 +2052,21 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "WTPR#W", ratetracer< rt::tracer, rt::wat, producer > },
{ "WTPR#O", ratetracer< rt::tracer, rt::oil, producer > },
{ "WTPR#G", ratetracer< rt::tracer, rt::gas, producer > },
{ "WTPRF#W", ratetracer< rt::tracer, rt::wat, producer> },
{ "WTPRF#O", ratetracer< rt::tracer, rt::oil, producer> },
{ "WTPRF#G", ratetracer< rt::tracer, rt::gas, producer> },
{ "WTPRS#W", ratetracer< rt::tracer, rt::wat, producer> },
{ "WTPRS#O", ratetracer< rt::tracer, rt::oil, producer> },
{ "WTPRS#G", ratetracer< rt::tracer, rt::gas, producer> },
{ "WTPC#W", div( ratetracer< rt::tracer, rt::wat, producer >, rate< rt::wat, producer >) },
{ "WTPC#O", div( ratetracer< rt::tracer, rt::oil, producer >, rate< rt::oil, producer >) },
{ "WTPC#G", div( ratetracer< rt::tracer, rt::gas, producer >, rate< rt::gas, producer >) },
{ "WTPCF#W", div( ratetracer< rt::tracer, rt::wat, producer >, rate< rt::wat, producer >) },
{ "WTPCF#O", div( ratetracer< rt::tracer, rt::oil, producer >, rate< rt::oil, producer >) },
{ "WTPCF#G", div( ratetracer< rt::tracer, rt::gas, producer >, rate< rt::gas, producer >) },
{ "WTPCS#W", div( ratetracer< rt::tracer, rt::wat, producer >, rate< rt::wat, producer >) },
{ "WTPCS#O", div( ratetracer< rt::tracer, rt::oil, producer >, rate< rt::oil, producer >) },
{ "WTPCS#G", div( ratetracer< rt::tracer, rt::gas, producer >, rate< rt::gas, producer >) },
{ "WCPC", div( rate< rt::polymer, producer >, rate< rt::wat, producer >) },
{ "WSPC", div( rate< rt::brine, producer >, rate< rt::wat, producer >) },

Expand Down Expand Up @@ -2065,6 +2095,12 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "WTPT#W", mul( ratetracer< rt::tracer, rt::wat, producer >, duration ) },
{ "WTPT#O", mul( ratetracer< rt::tracer, rt::oil, producer >, duration ) },
{ "WTPT#G", mul( ratetracer< rt::tracer, rt::gas, producer >, duration ) },
{ "WTPTF#W", mul( ratetracer< rt::tracer, rt::wat, producer >, duration ) },
{ "WTPTF#O", mul( ratetracer< rt::tracer, rt::oil, producer >, duration ) },
{ "WTPTF#G", mul( ratetracer< rt::tracer, rt::gas, producer >, duration ) },
{ "WTPTS#W", mul( ratetracer< rt::tracer, rt::wat, producer >, duration ) },
{ "WTPTS#O", mul( ratetracer< rt::tracer, rt::oil, producer >, duration ) },
{ "WTPTS#G", mul( ratetracer< rt::tracer, rt::gas, producer >, duration ) },
{ "WLPT", mul( sum( rate< rt::wat, producer >, rate< rt::oil, producer > ),
duration ) },
{ "WGPTS", mul( rate< rt::dissolved_gas, producer >, duration )},
Expand Down Expand Up @@ -2340,9 +2376,21 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "FTPR#W", ratetracer< rt::tracer, rt::wat, producer > },
{ "FTPR#O", ratetracer< rt::tracer, rt::oil, producer > },
{ "FTPR#G", ratetracer< rt::tracer, rt::gas, producer > },
{ "FTPRF#W", ratetracer< rt::tracer, rt::wat, producer > },
{ "FTPRF#O", ratetracer< rt::tracer, rt::oil, producer > },
{ "FTPRF#G", ratetracer< rt::tracer, rt::gas, producer > },
{ "FTPRS#W", ratetracer< rt::tracer, rt::wat, producer > },
{ "FTPRS#O", ratetracer< rt::tracer, rt::oil, producer > },
{ "FTPRS#G", ratetracer< rt::tracer, rt::gas, producer > },
{ "FTPC#W", div( ratetracer< rt::tracer, rt::wat, producer >, rate< rt::wat, producer >) },
{ "FTPC#O", div( ratetracer< rt::tracer, rt::oil, producer >, rate< rt::oil, producer >) },
{ "FTPC#G", div( ratetracer< rt::tracer, rt::gas, producer >, rate< rt::gas, producer >) },
{ "FTPCF#W", div( ratetracer< rt::tracer, rt::wat, producer >, rate< rt::wat, producer >) },
{ "FTPCF#O", div( ratetracer< rt::tracer, rt::oil, producer >, rate< rt::oil, producer >) },
{ "FTPCF#G", div( ratetracer< rt::tracer, rt::gas, producer >, rate< rt::gas, producer >) },
{ "FTPCS#W", div( ratetracer< rt::tracer, rt::wat, producer >, rate< rt::wat, producer >) },
{ "FTPCS#O", div( ratetracer< rt::tracer, rt::oil, producer >, rate< rt::oil, producer >) },
{ "FTPCS#G", div( ratetracer< rt::tracer, rt::gas, producer >, rate< rt::gas, producer >) },
{ "FVPR", sum( sum( rate< rt::reservoir_water, producer>, rate< rt::reservoir_oil, producer >),
rate< rt::reservoir_gas, producer>)},
{ "FGPRS", rate< rt::dissolved_gas, producer > },
Expand All @@ -2362,6 +2410,12 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "FTPT#W", mul( ratetracer< rt::tracer, rt::wat, producer >, duration ) },
{ "FTPT#O", mul( ratetracer< rt::tracer, rt::oil, producer >, duration ) },
{ "FTPT#G", mul( ratetracer< rt::tracer, rt::gas, producer >, duration ) },
{ "FTPTF#W", mul( ratetracer< rt::tracer, rt::wat, producer >, duration ) },
{ "FTPTF#O", mul( ratetracer< rt::tracer, rt::oil, producer >, duration ) },
{ "FTPTF#G", mul( ratetracer< rt::tracer, rt::gas, producer >, duration ) },
{ "FTPTS#W", mul( ratetracer< rt::tracer, rt::wat, producer >, duration ) },
{ "FTPTS#O", mul( ratetracer< rt::tracer, rt::oil, producer >, duration ) },
{ "FTPTS#G", mul( ratetracer< rt::tracer, rt::gas, producer >, duration ) },
{ "FLPT", mul( sum( rate< rt::wat, producer >, rate< rt::oil, producer > ),
duration ) },
{ "FVPT", mul(sum (sum( rate< rt::reservoir_water, producer>, rate< rt::reservoir_oil, producer >),
Expand All @@ -2384,9 +2438,21 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "FTIR#W", ratetracer< rt::tracer, rt::wat, injector > },
{ "FTIR#O", ratetracer< rt::tracer, rt::oil, injector > },
{ "FTIR#G", ratetracer< rt::tracer, rt::gas, injector > },
{ "FTIRF#W", ratetracer< rt::tracer, rt::wat, injector > },
{ "FTIRF#O", ratetracer< rt::tracer, rt::oil, injector > },
{ "FTIRF#G", ratetracer< rt::tracer, rt::gas, injector > },
{ "FTIRS#W", ratetracer< rt::tracer, rt::wat, injector > },
{ "FTIRS#O", ratetracer< rt::tracer, rt::oil, injector > },
{ "FTIRS#G", ratetracer< rt::tracer, rt::gas, injector > },
{ "FTIC#W", div( ratetracer< rt::tracer, rt::wat, injector >, rate< rt::wat, injector >) },
{ "FTIC#O", div( ratetracer< rt::tracer, rt::oil, injector >, rate< rt::oil, injector >) },
{ "FTIC#G", div( ratetracer< rt::tracer, rt::gas, injector >, rate< rt::gas, injector >) },
{ "FTICF#W", div( ratetracer< rt::tracer, rt::wat, injector >, rate< rt::wat, injector >) },
{ "FTICF#O", div( ratetracer< rt::tracer, rt::oil, injector >, rate< rt::oil, injector >) },
{ "FTICF#G", div( ratetracer< rt::tracer, rt::gas, injector >, rate< rt::gas, injector >) },
{ "FTICS#W", div( ratetracer< rt::tracer, rt::wat, injector >, rate< rt::wat, injector >) },
{ "FTICS#O", div( ratetracer< rt::tracer, rt::oil, injector >, rate< rt::oil, injector >) },
{ "FTICS#G", div( ratetracer< rt::tracer, rt::gas, injector >, rate< rt::gas, injector >) },
{ "FVIR", sum( sum( rate< rt::reservoir_water, injector>, rate< rt::reservoir_oil, injector >),
rate< rt::reservoir_gas, injector>)},

Expand All @@ -2402,6 +2468,12 @@ static const auto funs = std::unordered_map<std::string, ofun> {
{ "FTIT#W", mul( ratetracer< rt::tracer, rt::wat, injector >, duration ) },
{ "FTIT#O", mul( ratetracer< rt::tracer, rt::oil, injector >, duration ) },
{ "FTIT#G", mul( ratetracer< rt::tracer, rt::gas, injector >, duration ) },
{ "FTITF#W", mul( ratetracer< rt::tracer, rt::wat, injector >, duration ) },
{ "FTITF#O", mul( ratetracer< rt::tracer, rt::oil, injector >, duration ) },
{ "FTITF#G", mul( ratetracer< rt::tracer, rt::gas, injector >, duration ) },
{ "FTITS#W", mul( ratetracer< rt::tracer, rt::wat, injector >, duration ) },
{ "FTITS#O", mul( ratetracer< rt::tracer, rt::oil, injector >, duration ) },
{ "FTITS#G", mul( ratetracer< rt::tracer, rt::gas, injector >, duration ) },
{ "FLIT", mul( sum( rate< rt::wat, injector >, rate< rt::oil, injector > ),
duration ) },
{ "FVIT", mul( sum( sum( rate< rt::reservoir_water, injector>, rate< rt::reservoir_oil, injector >),
Expand Down Expand Up @@ -3837,7 +3909,15 @@ namespace Evaluator {
return false;
}

const auto tracer_name = normKw.substr(4);
int istart;
if (normKw[4] == 'F' || normKw[4] == 'S') {
istart = 5;
}
else {
istart = 4;
}

const auto tracer_name = normKw.substr(istart);

const auto& tracers = this->es_.tracer();
auto trPos = std::find_if(tracers.begin(), tracers.end(),
Expand All @@ -3850,7 +3930,7 @@ namespace Evaluator {
return false;
}

auto tracer_tag = normKw.substr(0, 4);
auto tracer_tag = normKw.substr(0, istart);
switch (trPos->phase) {
case Opm::Phase::WATER:
tracer_tag += "#W";
Expand Down

0 comments on commit a685674

Please sign in to comment.