Merge pull request #1968 from hakonhagland/wglir

Add support for WGLIR.
This commit is contained in:
Tor Harald Sandve 2020-10-02 14:48:18 +02:00 committed by GitHub
commit 8210bcde34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 23 additions and 4 deletions

View File

@ -69,6 +69,7 @@ namespace Opm {
well_potential_oil = (1 << 15), well_potential_oil = (1 << 15),
well_potential_gas = (1 << 16), well_potential_gas = (1 << 16),
brine = (1 << 17), brine = (1 << 17),
alq = (1 << 18)
}; };
using enum_size = std::underlying_type< opt >::type; using enum_size = std::underlying_type< opt >::type;
@ -121,6 +122,7 @@ namespace Opm {
double well_potential_oil = 0.0; double well_potential_oil = 0.0;
double well_potential_gas = 0.0; double well_potential_gas = 0.0;
double brine = 0.0; double brine = 0.0;
double alq = 0.0;
}; };
struct Connection { struct Connection {
@ -411,7 +413,8 @@ namespace Opm {
well_potential_water == rate.well_potential_water && well_potential_water == rate.well_potential_water &&
well_potential_oil == rate.well_potential_oil && well_potential_oil == rate.well_potential_oil &&
well_potential_gas == rate.well_potential_gas && well_potential_gas == rate.well_potential_gas &&
brine == rate.brine; brine == rate.brine &&
alq == rate.alq;
} }
@ -444,6 +447,7 @@ namespace Opm {
case opt::well_potential_oil: return this->well_potential_oil; case opt::well_potential_oil: return this->well_potential_oil;
case opt::well_potential_gas: return this->well_potential_gas; case opt::well_potential_gas: return this->well_potential_gas;
case opt::brine: return this->brine; case opt::brine: return this->brine;
case opt::alq: return this->alq;
} }
throw std::invalid_argument( throw std::invalid_argument(
@ -491,6 +495,7 @@ namespace Opm {
buffer.write(this->well_potential_oil); buffer.write(this->well_potential_oil);
buffer.write(this->well_potential_gas); buffer.write(this->well_potential_gas);
buffer.write(this->brine); buffer.write(this->brine);
buffer.write(this->alq);
} }
template <class MessageBufferType> template <class MessageBufferType>
@ -571,6 +576,7 @@ namespace Opm {
buffer.read(this->well_potential_oil); buffer.read(this->well_potential_oil);
buffer.read(this->well_potential_gas); buffer.read(this->well_potential_gas);
buffer.read(this->brine); buffer.read(this->brine);
buffer.read(this->alq);
} }
template <class MessageBufferType> template <class MessageBufferType>

View File

@ -467,6 +467,16 @@ double efac( const std::vector<std::pair<std::string,double>>& eff_factors, cons
return (it != eff_factors.end()) ? it->second : 1; return (it != eff_factors.end()) ? it->second : 1;
} }
inline quantity alqrate( const fn_args& args ) {
const auto& well = args.schedule_wells.front();
auto xwPos = args.wells.find(well.name());
if (xwPos == args.wells.end()) {
return { 0.0, measure::gas_surface_rate };
}
return { xwPos->second.rates.get(rt::alq, 0.0), measure::gas_surface_rate };
}
template< rt phase, bool injection = true > template< rt phase, bool injection = true >
inline quantity rate( const fn_args& args ) { inline quantity rate( const fn_args& args ) {
double sum = 0.0; double sum = 0.0;
@ -1008,6 +1018,7 @@ static const std::unordered_map< std::string, ofun > funs = {
{ "WOPR", rate< rt::oil, producer > }, { "WOPR", rate< rt::oil, producer > },
{ "WGPR", rate< rt::gas, producer > }, { "WGPR", rate< rt::gas, producer > },
{ "WEPR", rate< rt::energy, producer > }, { "WEPR", rate< rt::energy, producer > },
{ "WGLIR", alqrate },
{ "WNPR", rate< rt::solvent, producer > }, { "WNPR", rate< rt::solvent, producer > },
{ "WCPR", rate< rt::polymer, producer > }, { "WCPR", rate< rt::polymer, producer > },
{ "WSPR", rate< rt::brine, producer > }, { "WSPR", rate< rt::brine, producer > },
@ -1089,6 +1100,7 @@ static const std::unordered_map< std::string, ofun > funs = {
{ "GWPR", rate< rt::wat, producer > }, { "GWPR", rate< rt::wat, producer > },
{ "GOPR", rate< rt::oil, producer > }, { "GOPR", rate< rt::oil, producer > },
{ "GGPR", rate< rt::gas, producer > }, { "GGPR", rate< rt::gas, producer > },
{ "GGLIR", alqrate },
{ "GNPR", rate< rt::solvent, producer > }, { "GNPR", rate< rt::solvent, producer > },
{ "GCPR", rate< rt::polymer, producer > }, { "GCPR", rate< rt::polymer, producer > },
{ "GSPR", rate< rt::brine, producer > }, { "GSPR", rate< rt::brine, producer > },
@ -1242,6 +1254,7 @@ static const std::unordered_map< std::string, ofun > funs = {
{ "FWPR", rate< rt::wat, producer > }, { "FWPR", rate< rt::wat, producer > },
{ "FOPR", rate< rt::oil, producer > }, { "FOPR", rate< rt::oil, producer > },
{ "FGPR", rate< rt::gas, producer > }, { "FGPR", rate< rt::gas, producer > },
{ "FGLIR", alqrate },
{ "FNPR", rate< rt::solvent, producer > }, { "FNPR", rate< rt::solvent, producer > },
{ "FCPR", rate< rt::polymer, producer > }, { "FCPR", rate< rt::polymer, producer > },
{ "FSPR", rate< rt::brine, producer > }, { "FSPR", rate< rt::brine, producer > },

View File

@ -69,7 +69,7 @@ namespace {
"WBHP", "WGIR", "WGIT", "WGOR", "WGPR", "WGPT", "WOIR", "WBHP", "WGIR", "WGIT", "WGOR", "WGPR", "WGPT", "WOIR",
"WOIT", "WOPR", "WOPT", "WPI", "WTHP", "WVIR", "WVIT", "WOIT", "WOPR", "WOPT", "WPI", "WTHP", "WVIR", "WVIT",
"WVPR", "WVPT", "WWCT", "WWGR", "WWIR", "WWIT", "WWPR", "WVPR", "WVPT", "WWCT", "WWGR", "WWIR", "WWIT", "WWPR",
"WWPT", "WWPT", "WGLIR",
// ALL will not expand to these keywords yet // ALL will not expand to these keywords yet
"AAQR", "AAQRG", "AAQT", "AAQTG" "AAQR", "AAQRG", "AAQT", "AAQTG"
}; };
@ -196,7 +196,7 @@ namespace {
bool is_rate(const std::string& keyword) { bool is_rate(const std::string& keyword) {
static const keyword_set ratekw { static const keyword_set ratekw {
"OPR", "GPR", "WPR", "LPR", "NPR", "VPR", "OPR", "GPR", "WPR", "GLIR", "LPR", "NPR", "VPR",
"OPGR", "GPGR", "WPGR", "VPGR", "OPGR", "GPGR", "WPGR", "VPGR",
"OPRH", "GPRH", "WPRH", "LPRH", "OPRH", "GPRH", "WPRH", "LPRH",
"OVPR", "GVPR", "WVPR", "OVPR", "GVPR", "WVPR",

View File

@ -393,7 +393,7 @@ static const auto ALL_keywords = {
"WBHP", "WGIR", "WGIT", "WGOR", "WGPR", "WGPT", "WOIR", "WBHP", "WGIR", "WGIT", "WGOR", "WGPR", "WGPT", "WOIR",
"WOIT", "WOPR", "WOPT", "WPI", "WTHP", "WVIR", "WVIT", "WOIT", "WOPR", "WOPT", "WPI", "WTHP", "WVIR", "WVIT",
"WVPR", "WVPT", "WWCT", "WWGR", "WWIR", "WWIT", "WWPR", "WVPR", "WVPT", "WWCT", "WWGR", "WWIR", "WWIT", "WWPR",
"WWPT", "WWPT", "WGLIR",
// ALL will not expand to these keywords yet // ALL will not expand to these keywords yet
"AAQR", "AAQRG", "AAQT", "AAQTG" "AAQR", "AAQRG", "AAQT", "AAQTG"
}; };