mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-09-05 04:40:19 -05:00
Merge pull request #2932 from atgeirr/glift-constify
Make consistent use of const for alq-related state.
This commit is contained in:
@@ -212,9 +212,8 @@ namespace Opm {
|
||||
continue;
|
||||
}
|
||||
|
||||
xwPos->second.current_control.isProducer = well.isProducer();
|
||||
|
||||
auto& grval = xwPos->second.guide_rates; grval.clear();
|
||||
auto& grval = xwPos->second.guide_rates;
|
||||
grval.clear();
|
||||
grval += this->getGuideRateValues(well);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace Opm
|
||||
const Simulator &ebos_simulator,
|
||||
const SummaryState &summary_state,
|
||||
DeferredLogger &deferred_logger,
|
||||
const WellState &well_state,
|
||||
WellState &well_state,
|
||||
const Well::ProductionControls &controls
|
||||
);
|
||||
void runOptimize();
|
||||
@@ -97,7 +97,7 @@ namespace Opm
|
||||
std::vector<double> potentials_;
|
||||
const StdWell &std_well_;
|
||||
const SummaryState &summary_state_;
|
||||
const WellState &well_state_;
|
||||
WellState &well_state_;
|
||||
std::string well_name_;
|
||||
bool debug; // extra debug output
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ GasLiftRuntime(
|
||||
const Simulator &ebos_simulator,
|
||||
const SummaryState &summary_state,
|
||||
DeferredLogger &deferred_logger,
|
||||
const WellState &well_state,
|
||||
WellState &well_state,
|
||||
const Well::ProductionControls &controls
|
||||
) :
|
||||
controls_{controls},
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace Opm
|
||||
virtual void initPrimaryVariablesEvaluation() const override;
|
||||
|
||||
virtual void maybeDoGasLiftOptimization (
|
||||
const WellState&,
|
||||
WellState&,
|
||||
const Simulator&,
|
||||
DeferredLogger&
|
||||
) const override {
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace Opm
|
||||
) const;
|
||||
|
||||
virtual void maybeDoGasLiftOptimization (
|
||||
const WellState& well_state,
|
||||
WellState& well_state,
|
||||
const Simulator& ebosSimulator,
|
||||
DeferredLogger& deferred_logger
|
||||
) const override;
|
||||
|
||||
@@ -2822,7 +2822,7 @@ namespace Opm
|
||||
void
|
||||
StandardWell<TypeTag>::
|
||||
maybeDoGasLiftOptimization(
|
||||
const WellState& well_state,
|
||||
WellState& well_state,
|
||||
const Simulator& ebos_simulator,
|
||||
Opm::DeferredLogger& deferred_logger) const
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace Opm
|
||||
) = 0;
|
||||
|
||||
virtual void maybeDoGasLiftOptimization (
|
||||
const WellState& well_state,
|
||||
WellState& well_state,
|
||||
const Simulator& ebosSimulator,
|
||||
DeferredLogger& deferred_logger
|
||||
) const = 0;
|
||||
|
||||
@@ -150,6 +150,11 @@ namespace Opm
|
||||
first_perf_index_[w+1] = connpos;
|
||||
}
|
||||
|
||||
is_producer_.resize(nw, false);
|
||||
for (int w = 0; w < nw; ++w) {
|
||||
is_producer_[w] = wells_ecl[w].isProducer();
|
||||
}
|
||||
|
||||
current_injection_controls_.resize(nw);
|
||||
current_production_controls_.resize(nw);
|
||||
|
||||
@@ -587,7 +592,7 @@ namespace Opm
|
||||
well.rates.set( rt::brine, brineWellRate(w) );
|
||||
}
|
||||
|
||||
if ( well.current_control.isProducer ) {
|
||||
if ( is_producer_[w] ) {
|
||||
well.rates.set( rt::alq, getALQ(/*wellName=*/wt.first) );
|
||||
}
|
||||
else {
|
||||
@@ -600,6 +605,7 @@ namespace Opm
|
||||
{
|
||||
auto& curr = well.current_control;
|
||||
|
||||
curr.isProducer = this->is_producer_[w];
|
||||
curr.prod = this->currentProductionControls()[w];
|
||||
curr.inj = this->currentInjectionControls() [w];
|
||||
}
|
||||
@@ -1135,25 +1141,15 @@ namespace Opm
|
||||
return globalIsProductionGrup_[it->second] != 0;
|
||||
}
|
||||
|
||||
void updateALQ( const WellStateFullyImplicitBlackoil © ) const
|
||||
{
|
||||
this->current_alq_ = copy.getCurrentALQ();
|
||||
}
|
||||
|
||||
std::map<std::string, double> getCurrentALQ() const
|
||||
{
|
||||
return current_alq_;
|
||||
}
|
||||
|
||||
double getALQ( const std::string& name) const
|
||||
{
|
||||
if (this->current_alq_.count(name) == 0) {
|
||||
this->current_alq_[name] = this->default_alq_[name];
|
||||
return this->default_alq_.at(name);
|
||||
}
|
||||
return this->current_alq_[name];
|
||||
return this->current_alq_.at(name);
|
||||
}
|
||||
|
||||
void setALQ( const std::string& name, double value) const
|
||||
void setALQ( const std::string& name, double value)
|
||||
{
|
||||
this->current_alq_[name] = value;
|
||||
}
|
||||
@@ -1162,16 +1158,17 @@ namespace Opm
|
||||
return do_glift_optimization_;
|
||||
}
|
||||
|
||||
void disableGliftOptimization() const {
|
||||
void disableGliftOptimization() {
|
||||
do_glift_optimization_ = false;
|
||||
}
|
||||
|
||||
void enableGliftOptimization() const {
|
||||
void enableGliftOptimization() {
|
||||
do_glift_optimization_ = true;
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<double> perfphaserates_;
|
||||
std::vector<bool> is_producer_; // Size equal to number of local wells.
|
||||
|
||||
// vector with size number of wells +1.
|
||||
// iterate over all perforations of a given well
|
||||
@@ -1197,9 +1194,9 @@ namespace Opm
|
||||
std::map<std::string, double> injection_group_vrep_rates;
|
||||
std::map<std::string, std::vector<double>> injection_group_rein_rates;
|
||||
std::map<std::string, double> group_grat_target_from_sales;
|
||||
mutable std::map<std::string, double> current_alq_;
|
||||
mutable std::map<std::string, double> default_alq_;
|
||||
mutable bool do_glift_optimization_;
|
||||
std::map<std::string, double> current_alq_;
|
||||
std::map<std::string, double> default_alq_;
|
||||
bool do_glift_optimization_;
|
||||
|
||||
std::vector<double> perfRateSolvent_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user