Merge pull request #2911 from atgeirr/network-add-glift

Add the option to include gas lift for network calculations.
This commit is contained in:
Atgeirr Flø Rasmussen 2020-11-20 15:23:12 +01:00 committed by GitHub
commit ea34c2c2df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 4 deletions

View File

@ -1282,7 +1282,8 @@ namespace Opm {
if (!network.active()) {
return;
}
node_pressures_ = WellGroupHelpers::computeNetworkPressures(network, well_state_, *(vfp_properties_->getProd()));
node_pressures_ = WellGroupHelpers::computeNetworkPressures(
network, well_state_, *(vfp_properties_->getProd()), schedule(), reportStepIdx);
// Set the thp limits of wells
for (auto& well : well_container_) {
@ -1344,6 +1345,16 @@ namespace Opm {
// We use the rates from the privious time-step to reduce oscilations
WellGroupHelpers::updateWellRates(fieldGroup, schedule(), reportStepIdx, previous_well_state_, well_state_);
// Set ALQ for off-process wells to zero
for (const auto& wname : schedule().wellNames(reportStepIdx)) {
const bool is_producer = schedule().getWell(wname, reportStepIdx).isProducer();
const bool not_on_this_process = well_state_.wellMap().count(wname) == 0;
if (is_producer && not_on_this_process) {
well_state_.setALQ(wname, 0.0);
}
}
well_state_.communicateGroupRates(comm);
// compute wsolvent fraction for REIN wells

View File

@ -592,7 +592,9 @@ namespace WellGroupHelpers
std::map<std::string, double>
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
const WellStateFullyImplicitBlackoil& well_state,
const VFPProdProperties& vfp_prod_props)
const VFPProdProperties& vfp_prod_props,
const Schedule& schedule,
const int report_time_step)
{
// TODO: Only dealing with production networks for now.
@ -628,6 +630,13 @@ namespace WellGroupHelpers
std::map<std::string, std::vector<double>> node_inflows;
for (const auto& node : leaf_nodes) {
node_inflows[node] = well_state.currentProductionGroupRates(node);
// Add the ALQ amounts to the gas rates if requested.
if (network.node(node).add_gas_lift_gas()) {
const auto& group = schedule.getGroup(node, report_time_step);
for (const std::string& wellname : group.wells()) {
node_inflows[node][BlackoilPhases::Vapour] += well_state.getALQ(wellname);
}
}
}
// Accumulate in the network, towards the roots. Note that a

View File

@ -264,7 +264,9 @@ namespace WellGroupHelpers
std::map<std::string, double>
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
const WellStateFullyImplicitBlackoil& well_state,
const VFPProdProperties& vfp_prod_props);
const VFPProdProperties& vfp_prod_props,
const Schedule& schedule,
const int report_time_step);
GuideRate::RateVector
getRateVector(const WellStateFullyImplicitBlackoil& well_state, const PhaseUsage& pu, const std::string& name);

View File

@ -1042,7 +1042,7 @@ namespace Opm
iterateContainer(injection_group_reduction_rates, func);
iterateContainer(injection_group_reservoir_rates, func);
iterateContainer(production_group_rates, func);
iterateContainer(well_rates,func);
iterateContainer(well_rates, func);
};
// Compute the size of the data.
@ -1052,6 +1052,7 @@ namespace Opm
};
forAllGroupData(computeSize);
sz += injection_group_vrep_rates.size();
sz += current_alq_.size();
// Make a vector and collect all data into it.
std::vector<double> data(sz);
@ -1065,6 +1066,9 @@ namespace Opm
for (const auto& x : injection_group_vrep_rates) {
data[pos++] = x.second;
}
for (const auto& x : current_alq_) {
data[pos++] = x.second;
}
assert(pos == sz);
// Communicate it with a single sum() call.
@ -1081,6 +1085,9 @@ namespace Opm
for (auto& x : injection_group_vrep_rates) {
x.second = data[pos++];
}
for (auto& x : current_alq_) {
x.second = data[pos++];
}
assert(pos == sz);
}