Additional changes to accomodate for loop over several wells beloning to
either a group or the field in generation of the group or field production or injection potential rates
This commit is contained in:
@@ -655,7 +655,7 @@ quantity region_rate( const fn_args& args ) {
|
|||||||
return { -sum, rate_unit< phase >() };
|
return { -sum, rate_unit< phase >() };
|
||||||
}
|
}
|
||||||
|
|
||||||
template < rt phase, bool outputProducer = true, bool outputInjector = true>
|
/*template < rt phase, bool outputProducer = true, bool outputInjector = true>
|
||||||
quantity generic_well_rate (const fn_args& args ) {
|
quantity generic_well_rate (const fn_args& args ) {
|
||||||
const quantity zero = { 0, rate_unit< phase >() };
|
const quantity zero = { 0, rate_unit< phase >() };
|
||||||
if( args.schedule_wells.empty() ) return zero;
|
if( args.schedule_wells.empty() ) return zero;
|
||||||
@@ -669,6 +669,26 @@ quantity generic_well_rate (const fn_args& args ) {
|
|||||||
|
|
||||||
return p->second.rates.has(phase) ? quantity {p->second.rates.get(phase), rate_unit<phase>()} : zero;
|
return p->second.rates.has(phase) ? quantity {p->second.rates.get(phase), rate_unit<phase>()} : zero;
|
||||||
//return { p->second.rates.get(phase), rate_unit< phase >() };
|
//return { p->second.rates.get(phase), rate_unit< phase >() };
|
||||||
|
}*/
|
||||||
|
template < rt phase, bool outputProducer = true, bool outputInjector = true>
|
||||||
|
inline quantity generic_potential_rate( const fn_args& args ) {
|
||||||
|
double sum = 0.0;
|
||||||
|
|
||||||
|
for( const auto* sched_well : args.schedule_wells ) {
|
||||||
|
const auto& name = sched_well->name();
|
||||||
|
if( args.wells.count( name ) == 0 ) continue;
|
||||||
|
|
||||||
|
if (sched_well->isInjector(args.sim_step) && outputInjector) {
|
||||||
|
const auto v = args.wells.at(name).rates.get(phase, 0.0);
|
||||||
|
sum += v;
|
||||||
|
}
|
||||||
|
else if (sched_well->isProducer(args.sim_step) && outputProducer) {
|
||||||
|
const auto v = args.wells.at(name).rates.get(phase, 0.0);
|
||||||
|
sum += v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return { sum, rate_unit< phase >() };
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename F, typename G >
|
template< typename F, typename G >
|
||||||
@@ -787,12 +807,12 @@ static const std::unordered_map< std::string, ofun > funs = {
|
|||||||
{ "GVPT", mul( sum( sum( rate< rt::reservoir_water, producer >, rate< rt::reservoir_oil, producer > ),
|
{ "GVPT", mul( sum( sum( rate< rt::reservoir_water, producer >, rate< rt::reservoir_oil, producer > ),
|
||||||
rate< rt::reservoir_gas, producer > ), duration ) },
|
rate< rt::reservoir_gas, producer > ), duration ) },
|
||||||
// Group potential
|
// Group potential
|
||||||
{ "GWPP", generic_well_rate< rt::well_potential_water , true, false>},
|
{ "GWPP", generic_potential_rate< rt::well_potential_water , true, false>},
|
||||||
{ "GOPP", generic_well_rate< rt::well_potential_oil , true, false>},
|
{ "GOPP", generic_potential_rate< rt::well_potential_oil , true, false>},
|
||||||
{ "GGPP", generic_well_rate< rt::well_potential_gas , true, false>},
|
{ "GGPP", generic_potential_rate< rt::well_potential_gas , true, false>},
|
||||||
{ "GWPI", generic_well_rate< rt::well_potential_water , false, true>},
|
{ "GWPI", generic_potential_rate< rt::well_potential_water , false, true>},
|
||||||
{ "GOPI", generic_well_rate< rt::well_potential_oil , false, true>},
|
{ "GOPI", generic_potential_rate< rt::well_potential_oil , false, true>},
|
||||||
{ "GGPI", generic_well_rate< rt::well_potential_gas , false, true>},
|
{ "GGPI", generic_potential_rate< rt::well_potential_gas , false, true>},
|
||||||
|
|
||||||
{ "WWPRH", production_history< Phase::WATER > },
|
{ "WWPRH", production_history< Phase::WATER > },
|
||||||
{ "WOPRH", production_history< Phase::OIL > },
|
{ "WOPRH", production_history< Phase::OIL > },
|
||||||
@@ -934,12 +954,12 @@ static const std::unordered_map< std::string, ofun > funs = {
|
|||||||
{ "FVIT", mul( sum( sum( rate< rt::reservoir_water, injector>, rate< rt::reservoir_oil, injector >),
|
{ "FVIT", mul( sum( sum( rate< rt::reservoir_water, injector>, rate< rt::reservoir_oil, injector >),
|
||||||
rate< rt::reservoir_gas, injector>), duration)},
|
rate< rt::reservoir_gas, injector>), duration)},
|
||||||
// Field potential
|
// Field potential
|
||||||
{ "FWPP", generic_well_rate< rt::well_potential_water , true, false>},
|
{ "FWPP", generic_potential_rate< rt::well_potential_water , true, false>},
|
||||||
{ "FOPP", generic_well_rate< rt::well_potential_oil , true, false>},
|
{ "FOPP", generic_potential_rate< rt::well_potential_oil , true, false>},
|
||||||
{ "FGPP", generic_well_rate< rt::well_potential_gas , true, false>},
|
{ "FGPP", generic_potential_rate< rt::well_potential_gas , true, false>},
|
||||||
{ "FWPI", generic_well_rate< rt::well_potential_water , false, true>},
|
{ "FWPI", generic_potential_rate< rt::well_potential_water , false, true>},
|
||||||
{ "FOPI", generic_well_rate< rt::well_potential_oil , false, true>},
|
{ "FOPI", generic_potential_rate< rt::well_potential_oil , false, true>},
|
||||||
{ "FGPI", generic_well_rate< rt::well_potential_gas , false, true>},
|
{ "FGPI", generic_potential_rate< rt::well_potential_gas , false, true>},
|
||||||
|
|
||||||
|
|
||||||
{ "FWPRH", production_history< Phase::WATER > },
|
{ "FWPRH", production_history< Phase::WATER > },
|
||||||
@@ -997,17 +1017,17 @@ static const std::unordered_map< std::string, ofun > funs = {
|
|||||||
{ "SGFR", srate< rt::gas > },
|
{ "SGFR", srate< rt::gas > },
|
||||||
{ "SPR", spr },
|
{ "SPR", spr },
|
||||||
// Well productivity index
|
// Well productivity index
|
||||||
{ "WPIW", generic_well_rate< rt::productivity_index_water >},
|
{ "WPIW", generic_potential_rate< rt::productivity_index_water >},
|
||||||
{ "WPIO", generic_well_rate< rt::productivity_index_oil >},
|
{ "WPIO", generic_potential_rate< rt::productivity_index_oil >},
|
||||||
{ "WPIG", generic_well_rate< rt::productivity_index_gas >},
|
{ "WPIG", generic_potential_rate< rt::productivity_index_gas >},
|
||||||
{ "WPIL", sum( generic_well_rate< rt::productivity_index_water >, generic_well_rate< rt::productivity_index_oil>)},
|
{ "WPIL", sum( generic_potential_rate< rt::productivity_index_water >, generic_potential_rate< rt::productivity_index_oil>)},
|
||||||
// Well potential
|
// Well potential
|
||||||
{ "WWPP", generic_well_rate< rt::well_potential_water , true, false>},
|
{ "WWPP", generic_potential_rate< rt::well_potential_water , true, false>},
|
||||||
{ "WOPP", generic_well_rate< rt::well_potential_oil , true, false>},
|
{ "WOPP", generic_potential_rate< rt::well_potential_oil , true, false>},
|
||||||
{ "WGPP", generic_well_rate< rt::well_potential_gas , true, false>},
|
{ "WGPP", generic_potential_rate< rt::well_potential_gas , true, false>},
|
||||||
{ "WWPI", generic_well_rate< rt::well_potential_water , false, true>},
|
{ "WWPI", generic_potential_rate< rt::well_potential_water , false, true>},
|
||||||
{ "WOPI", generic_well_rate< rt::well_potential_oil , false, true>},
|
{ "WOPI", generic_potential_rate< rt::well_potential_oil , false, true>},
|
||||||
{ "WGPI", generic_well_rate< rt::well_potential_gas , false, true>},
|
{ "WGPI", generic_potential_rate< rt::well_potential_gas , false, true>},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user