mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2911 from atgeirr/network-add-glift
Add the option to include gas lift for network calculations.
This commit is contained in:
commit
ea34c2c2df
@ -1282,7 +1282,8 @@ namespace Opm {
|
|||||||
if (!network.active()) {
|
if (!network.active()) {
|
||||||
return;
|
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
|
// Set the thp limits of wells
|
||||||
for (auto& well : well_container_) {
|
for (auto& well : well_container_) {
|
||||||
@ -1344,6 +1345,16 @@ namespace Opm {
|
|||||||
|
|
||||||
// We use the rates from the privious time-step to reduce oscilations
|
// We use the rates from the privious time-step to reduce oscilations
|
||||||
WellGroupHelpers::updateWellRates(fieldGroup, schedule(), reportStepIdx, previous_well_state_, well_state_);
|
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);
|
well_state_.communicateGroupRates(comm);
|
||||||
|
|
||||||
// compute wsolvent fraction for REIN wells
|
// compute wsolvent fraction for REIN wells
|
||||||
|
@ -592,7 +592,9 @@ namespace WellGroupHelpers
|
|||||||
std::map<std::string, double>
|
std::map<std::string, double>
|
||||||
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
||||||
const WellStateFullyImplicitBlackoil& well_state,
|
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.
|
// TODO: Only dealing with production networks for now.
|
||||||
|
|
||||||
@ -628,6 +630,13 @@ namespace WellGroupHelpers
|
|||||||
std::map<std::string, std::vector<double>> node_inflows;
|
std::map<std::string, std::vector<double>> node_inflows;
|
||||||
for (const auto& node : leaf_nodes) {
|
for (const auto& node : leaf_nodes) {
|
||||||
node_inflows[node] = well_state.currentProductionGroupRates(node);
|
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
|
// Accumulate in the network, towards the roots. Note that a
|
||||||
|
@ -264,7 +264,9 @@ namespace WellGroupHelpers
|
|||||||
std::map<std::string, double>
|
std::map<std::string, double>
|
||||||
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
computeNetworkPressures(const Opm::Network::ExtNetwork& network,
|
||||||
const WellStateFullyImplicitBlackoil& well_state,
|
const WellStateFullyImplicitBlackoil& well_state,
|
||||||
const VFPProdProperties& vfp_prod_props);
|
const VFPProdProperties& vfp_prod_props,
|
||||||
|
const Schedule& schedule,
|
||||||
|
const int report_time_step);
|
||||||
|
|
||||||
GuideRate::RateVector
|
GuideRate::RateVector
|
||||||
getRateVector(const WellStateFullyImplicitBlackoil& well_state, const PhaseUsage& pu, const std::string& name);
|
getRateVector(const WellStateFullyImplicitBlackoil& well_state, const PhaseUsage& pu, const std::string& name);
|
||||||
|
@ -1042,7 +1042,7 @@ namespace Opm
|
|||||||
iterateContainer(injection_group_reduction_rates, func);
|
iterateContainer(injection_group_reduction_rates, func);
|
||||||
iterateContainer(injection_group_reservoir_rates, func);
|
iterateContainer(injection_group_reservoir_rates, func);
|
||||||
iterateContainer(production_group_rates, func);
|
iterateContainer(production_group_rates, func);
|
||||||
iterateContainer(well_rates,func);
|
iterateContainer(well_rates, func);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Compute the size of the data.
|
// Compute the size of the data.
|
||||||
@ -1052,6 +1052,7 @@ namespace Opm
|
|||||||
};
|
};
|
||||||
forAllGroupData(computeSize);
|
forAllGroupData(computeSize);
|
||||||
sz += injection_group_vrep_rates.size();
|
sz += injection_group_vrep_rates.size();
|
||||||
|
sz += current_alq_.size();
|
||||||
|
|
||||||
// Make a vector and collect all data into it.
|
// Make a vector and collect all data into it.
|
||||||
std::vector<double> data(sz);
|
std::vector<double> data(sz);
|
||||||
@ -1065,6 +1066,9 @@ namespace Opm
|
|||||||
for (const auto& x : injection_group_vrep_rates) {
|
for (const auto& x : injection_group_vrep_rates) {
|
||||||
data[pos++] = x.second;
|
data[pos++] = x.second;
|
||||||
}
|
}
|
||||||
|
for (const auto& x : current_alq_) {
|
||||||
|
data[pos++] = x.second;
|
||||||
|
}
|
||||||
assert(pos == sz);
|
assert(pos == sz);
|
||||||
|
|
||||||
// Communicate it with a single sum() call.
|
// Communicate it with a single sum() call.
|
||||||
@ -1081,6 +1085,9 @@ namespace Opm
|
|||||||
for (auto& x : injection_group_vrep_rates) {
|
for (auto& x : injection_group_vrep_rates) {
|
||||||
x.second = data[pos++];
|
x.second = data[pos++];
|
||||||
}
|
}
|
||||||
|
for (auto& x : current_alq_) {
|
||||||
|
x.second = data[pos++];
|
||||||
|
}
|
||||||
assert(pos == sz);
|
assert(pos == sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user