22#define OPM_BLACKOILWELLMODEL_GASLIFT_IMPL_HEADER_INCLUDED
23#define OPM_BLACKOILWELLMODEL_GASLIFT_IMPL_HEADER_INCLUDED
26#ifndef OPM_BLACKOILWELLMODEL_GASLIFT_HEADER_INCLUDED
28#include <opm/simulators/wells/BlackoilWellModelGasLift.hpp>
30#include <opm/common/TimingMacros.hpp>
31#include <opm/simulators/wells/GasLiftSingleWell.hpp>
34#include <opm/simulators/utils/MPISerializer.hpp>
39template<
typename TypeTag>
41BlackoilWellModelGasLift<TypeTag>::
42maybeDoGasLiftOptimize(
const Simulator& simulator,
49 const auto&
glo = simulator.vanguard().schedule().glo(simulator.episodeIndex());
83 simulator.vanguard().schedule(),
84 simulator.vanguard().summaryState(),
85 simulator.episodeIndex(),
86 simulator.model().newtonMethod().numIterations(),
91 simulator.vanguard().grid().comm(),
96 gasLiftOptimizationStage1(simulator,
106 this->gasLiftOptimizationStage2(simulator.vanguard().gridView().comm(),
107 simulator.vanguard().schedule(),
108 simulator.vanguard().summaryState(),
115 simulator.episodeIndex(),
118 if constexpr (glift_debug) {
119 std::vector<WellInterfaceGeneric<Scalar>*>
wc;
124 this->gliftDebugShowALQ(
wc,
134template<
typename TypeTag>
136BlackoilWellModelGasLift<TypeTag>::
137gasLiftOptimizationStage1(
const Simulator& simulator,
148 auto comm = simulator.vanguard().grid().comm();
178 if (comm.rank() == i) {
183 gasLiftOptimizationStage1SingleWell(well.get(),
213 if (comm.rank() == i) {
215 auto [oil_rate, gas_rate, water_rate, alq] =
group_info.getRates(
idx);
230 Parallel::MpiSerializer
ser(comm);
234 if (comm.rank() != i) {
243 if constexpr (glift_debug) {
245 if (comm.rank() == i) {
246 counter = wellState.gliftGetDebugCounter();
249 if (comm.rank() != i) {
250 wellState.gliftSetDebugCounter(
counter);
260template<
typename TypeTag>
262BlackoilWellModelGasLift<TypeTag>::
264 const Simulator& simulator,
275 const auto&
summary_state = simulator.vanguard().summaryState();
276 auto glift = std::make_unique<GasLiftSingleWell<TypeTag>>(*well,
284 simulator.vanguard().gridView().comm(),
286 auto state =
glift->runOptimize(simulator.model().newtonMethod().numIterations());
295template<
typename TypeTag>
297BlackoilWellModelGasLift<TypeTag>::
298initGliftEclWellMap(
const std::vector<WellInterfacePtr>&
well_container,
302 ecl_well_map.try_emplace(well->name(), &well->wellEcl(), well->indexOfWell());
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242