mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Change condition under which stage 2 is done.
It only makes sense to try to optimize the distribution of lift gas if the amount of lift gas is constrained either by the maximum allowed gaslift or total gas or the group is under individual control.
This commit is contained in:
parent
686a6a969d
commit
43244c2132
@ -1053,6 +1053,7 @@ gasLiftOptimizationStage2(DeferredLogger& deferred_logger,
|
|||||||
summaryState_,
|
summaryState_,
|
||||||
deferred_logger,
|
deferred_logger,
|
||||||
this->wellState(),
|
this->wellState(),
|
||||||
|
this->groupState(),
|
||||||
prod_wells,
|
prod_wells,
|
||||||
glift_wells,
|
glift_wells,
|
||||||
glift_well_state_map,
|
glift_well_state_map,
|
||||||
|
@ -986,6 +986,7 @@ namespace Opm {
|
|||||||
phase_usage_,
|
phase_usage_,
|
||||||
deferred_logger,
|
deferred_logger,
|
||||||
this->wellState(),
|
this->wellState(),
|
||||||
|
this->groupState(),
|
||||||
ebosSimulator_.vanguard().grid().comm(),
|
ebosSimulator_.vanguard().grid().comm(),
|
||||||
this->glift_debug
|
this->glift_debug
|
||||||
};
|
};
|
||||||
|
@ -25,11 +25,13 @@ namespace Opm {
|
|||||||
GasLiftCommon::
|
GasLiftCommon::
|
||||||
GasLiftCommon(
|
GasLiftCommon(
|
||||||
WellState &well_state,
|
WellState &well_state,
|
||||||
|
const GroupState &group_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
) :
|
) :
|
||||||
well_state_{well_state},
|
well_state_{well_state},
|
||||||
|
group_state_{group_state},
|
||||||
deferred_logger_{deferred_logger},
|
deferred_logger_{deferred_logger},
|
||||||
comm_{comm},
|
comm_{comm},
|
||||||
debug{glift_debug}
|
debug{glift_debug}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <opm/simulators/utils/DeferredLogger.hpp>
|
#include <opm/simulators/utils/DeferredLogger.hpp>
|
||||||
#include <opm/simulators/wells/WellState.hpp>
|
#include <opm/simulators/wells/WellState.hpp>
|
||||||
|
#include <opm/simulators/wells/GroupState.hpp>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <fmt/format.h>
|
#include <fmt/format.h>
|
||||||
@ -36,6 +37,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
GasLiftCommon(
|
GasLiftCommon(
|
||||||
WellState &well_state,
|
WellState &well_state,
|
||||||
|
const GroupState &group_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool debug
|
bool debug
|
||||||
@ -51,6 +53,7 @@ protected:
|
|||||||
MessageType msg_type = MessageType::INFO) const;
|
MessageType msg_type = MessageType::INFO) const;
|
||||||
|
|
||||||
WellState &well_state_;
|
WellState &well_state_;
|
||||||
|
const GroupState& group_state_;
|
||||||
DeferredLogger &deferred_logger_;
|
DeferredLogger &deferred_logger_;
|
||||||
const Parallel::Communication& comm_;
|
const Parallel::Communication& comm_;
|
||||||
bool debug;
|
bool debug;
|
||||||
|
@ -32,10 +32,11 @@ GasLiftGroupInfo(
|
|||||||
const PhaseUsage &phase_usage,
|
const PhaseUsage &phase_usage,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
WellState &well_state,
|
WellState &well_state,
|
||||||
|
const GroupState &group_state,
|
||||||
const Communication &comm,
|
const Communication &comm,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
) :
|
) :
|
||||||
GasLiftCommon(well_state, deferred_logger, comm, glift_debug)
|
GasLiftCommon(well_state, group_state, deferred_logger, comm, glift_debug)
|
||||||
, ecl_wells_{ecl_wells}
|
, ecl_wells_{ecl_wells}
|
||||||
, schedule_{schedule}
|
, schedule_{schedule}
|
||||||
, summary_state_{summary_state}
|
, summary_state_{summary_state}
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
|
#include <opm/input/eclipse/Schedule/SummaryState.hpp>
|
||||||
#include <opm/simulators/wells/GasLiftCommon.hpp>
|
#include <opm/simulators/wells/GasLiftCommon.hpp>
|
||||||
#include <opm/simulators/wells/WellState.hpp>
|
#include <opm/simulators/wells/WellState.hpp>
|
||||||
|
#include <opm/simulators/wells/GroupState.hpp>
|
||||||
#include <opm/simulators/utils/DeferredLogger.hpp>
|
#include <opm/simulators/utils/DeferredLogger.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -81,6 +82,7 @@ public:
|
|||||||
const PhaseUsage& phase_usage,
|
const PhaseUsage& phase_usage,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
|
const GroupState& group_state,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
);
|
);
|
||||||
|
@ -49,8 +49,7 @@ GasLiftSingleWellGeneric::GasLiftSingleWellGeneric(DeferredLogger& deferred_logg
|
|||||||
GLiftSyncGroups& sync_groups,
|
GLiftSyncGroups& sync_groups,
|
||||||
const Parallel::Communication& comm,
|
const Parallel::Communication& comm,
|
||||||
bool glift_debug)
|
bool glift_debug)
|
||||||
: GasLiftCommon(well_state, deferred_logger, comm, glift_debug)
|
: GasLiftCommon(well_state, group_state, deferred_logger, comm, glift_debug)
|
||||||
, group_state_ {group_state}
|
|
||||||
, ecl_well_ {ecl_well}
|
, ecl_well_ {ecl_well}
|
||||||
, summary_state_ {summary_state}
|
, summary_state_ {summary_state}
|
||||||
, group_info_ {group_info}
|
, group_info_ {group_info}
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
|
#include <opm/input/eclipse/Schedule/Well/Well.hpp>
|
||||||
#include <opm/simulators/wells/GasLiftGroupInfo.hpp>
|
#include <opm/simulators/wells/GasLiftGroupInfo.hpp>
|
||||||
#include <opm/simulators/wells/GasLiftCommon.hpp>
|
#include <opm/simulators/wells/GasLiftCommon.hpp>
|
||||||
|
#include <opm/simulators/wells/GroupState.hpp>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
@ -329,7 +330,6 @@ protected:
|
|||||||
Rate rate_type, const std::string& gr_name, double rate, double target) const;
|
Rate rate_type, const std::string& gr_name, double rate, double target) const;
|
||||||
void warnMaxIterationsExceeded_();
|
void warnMaxIterationsExceeded_();
|
||||||
|
|
||||||
const GroupState& group_state_;
|
|
||||||
const Well& ecl_well_;
|
const Well& ecl_well_;
|
||||||
const SummaryState& summary_state_;
|
const SummaryState& summary_state_;
|
||||||
GasLiftGroupInfo& group_info_;
|
GasLiftGroupInfo& group_info_;
|
||||||
|
@ -44,12 +44,13 @@ GasLiftStage2::GasLiftStage2(
|
|||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger &deferred_logger,
|
DeferredLogger &deferred_logger,
|
||||||
WellState &well_state,
|
WellState &well_state,
|
||||||
|
const GroupState &group_state,
|
||||||
GLiftProdWells &prod_wells,
|
GLiftProdWells &prod_wells,
|
||||||
GLiftOptWells &glift_wells,
|
GLiftOptWells &glift_wells,
|
||||||
GLiftWellStateMap &state_map,
|
GLiftWellStateMap &state_map,
|
||||||
bool glift_debug
|
bool glift_debug
|
||||||
) :
|
) :
|
||||||
GasLiftCommon(well_state, deferred_logger, comm, glift_debug)
|
GasLiftCommon(well_state, group_state, deferred_logger, comm, glift_debug)
|
||||||
, prod_wells_{prod_wells}
|
, prod_wells_{prod_wells}
|
||||||
, stage1_wells_{glift_wells}
|
, stage1_wells_{glift_wells}
|
||||||
, well_state_map_{state_map}
|
, well_state_map_{state_map}
|
||||||
@ -545,10 +546,16 @@ optimizeGroup_(const Group &group)
|
|||||||
{
|
{
|
||||||
const auto max_glift = getGroupMaxALQ_(group);
|
const auto max_glift = getGroupMaxALQ_(group);
|
||||||
const auto max_total_gas = getGroupMaxTotalGas_(group);
|
const auto max_total_gas = getGroupMaxTotalGas_(group);
|
||||||
if (group.has_control(Group::ProductionCMode::ORAT) || group.has_control(Group::ProductionCMode::LRAT)
|
const auto& group_name = group.name();
|
||||||
|| max_glift || max_total_gas)
|
const auto prod_control = this->group_state_.production_control(group_name);
|
||||||
|
//if (group.has_control(Group::ProductionCMode::ORAT) || group.has_control(Group::ProductionCMode::LRAT)
|
||||||
|
// || max_glift || max_total_gas)
|
||||||
|
// NOTE: it only makes sense to try to optimize the distribution of the gaslift if the amount
|
||||||
|
// of gaslift is constrained either by the maximum allowed gaslift or total gas
|
||||||
|
// or the group is under individual control
|
||||||
|
if ((prod_control != Group::ProductionCMode::NONE) && (prod_control != Group::ProductionCMode::FLD))
|
||||||
{
|
{
|
||||||
displayDebugMessage_("optimizing", group.name());
|
displayDebugMessage_("optimizing", group_name);
|
||||||
auto wells = getGroupGliftWells_(group);
|
auto wells = getGroupGliftWells_(group);
|
||||||
std::vector<GradPair> inc_grads;
|
std::vector<GradPair> inc_grads;
|
||||||
std::vector<GradPair> dec_grads;
|
std::vector<GradPair> dec_grads;
|
||||||
@ -556,7 +563,7 @@ optimizeGroup_(const Group &group)
|
|||||||
removeSurplusALQ_(group, inc_grads, dec_grads);
|
removeSurplusALQ_(group, inc_grads, dec_grads);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
displayDebugMessage_("skipping", group.name());
|
displayDebugMessage_("skipping", group_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <opm/core/props/BlackoilPhases.hpp>
|
#include <opm/core/props/BlackoilPhases.hpp>
|
||||||
#include <opm/simulators/wells/GasLiftSingleWellGeneric.hpp>
|
#include <opm/simulators/wells/GasLiftSingleWellGeneric.hpp>
|
||||||
|
#include <opm/simulators/wells/GroupState.hpp>
|
||||||
|
|
||||||
#include <dune/common/version.hh>
|
#include <dune/common/version.hh>
|
||||||
#include <dune/common/parallel/mpihelper.hh>
|
#include <dune/common/parallel/mpihelper.hh>
|
||||||
@ -66,6 +67,7 @@ public:
|
|||||||
const SummaryState& summary_state,
|
const SummaryState& summary_state,
|
||||||
DeferredLogger& deferred_logger,
|
DeferredLogger& deferred_logger,
|
||||||
WellState& well_state,
|
WellState& well_state,
|
||||||
|
const GroupState& group_state,
|
||||||
GLiftProdWells& prod_wells,
|
GLiftProdWells& prod_wells,
|
||||||
GLiftOptWells& glift_wells,
|
GLiftOptWells& glift_wells,
|
||||||
GLiftWellStateMap& state_map,
|
GLiftWellStateMap& state_map,
|
||||||
|
@ -181,6 +181,7 @@ BOOST_AUTO_TEST_CASE(G1)
|
|||||||
well_model.phaseUsage(),
|
well_model.phaseUsage(),
|
||||||
deferred_logger,
|
deferred_logger,
|
||||||
well_state,
|
well_state,
|
||||||
|
group_state,
|
||||||
comm,
|
comm,
|
||||||
/*glift_debug=*/false
|
/*glift_debug=*/false
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user