opm-simulators
Opm::MultisegmentWell< TypeTag > Class Template Reference
Inheritance diagram for Opm::MultisegmentWell< TypeTag >:
Opm::WellInterface< TypeTag > Opm::MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > > Opm::WellInterfaceIndices< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > > Opm::MultisegmentWellGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > > Opm::WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >

Public Types

using Base = WellInterface< TypeTag >
 
using MSWEval = MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
 
using FSInfo = std::tuple< Scalar, typename std::decay< decltype(std::declval< decltype(std::declval< const Simulator & >().model().intensiveQuantities(0, 0).fluidState())>().saltConcentration())>::type >
 
using Simulator = GetPropType< TypeTag, Properties::Simulator >
 
using IntensiveQuantities = GetPropType< TypeTag, Properties::IntensiveQuantities >
 
using FluidSystem = GetPropType< TypeTag, Properties::FluidSystem >
 
using IndexTraits = typename FluidSystem::IndexTraitsType
 
using ModelParameters = typename Base::ModelParameters
 
using MaterialLaw = GetPropType< TypeTag, Properties::MaterialLaw >
 
using Indices = GetPropType< TypeTag, Properties::Indices >
 
using RateConverterType = typename WellInterfaceFluidSystem< FluidSystem >::RateConverterType
 
using SparseMatrixAdapter = GetPropType< TypeTag, Properties::SparseMatrixAdapter >
 
using FluidState = BlackOilFluidState< Eval, FluidSystem, energyModuleType !=EnergyModules::NoTemperature, energyModuleType==EnergyModules::FullyImplicitThermal, Indices::compositionSwitchIdx >=0, has_watVapor, has_brine, has_saltPrecip, has_disgas_in_water, has_solvent, Indices::numPhases >
 
using WellStateType = WellState< Scalar, IndexTraits >
 
using GroupStateHelperType = GroupStateHelper< Scalar, IndexTraits >
 
using Scalar = GetPropType< TypeTag, Properties::Scalar >
 
using BVector = Dune::BlockVector< VectorBlockType >
 
using Eval = typename Base::Eval
 
using PressureMatrix = Dune::BCRSMatrix< Opm::MatrixBlock< Scalar, 1, 1 > >
 
- Public Types inherited from Opm::WellInterface< TypeTag >
enum  IndividualOrGroup { Individual, Group, Both }
 
using Grid = GetPropType< TypeTag, Properties::Grid >
 
using Simulator = GetPropType< TypeTag, Properties::Simulator >
 
using Scalar = GetPropType< TypeTag, Properties::Scalar >
 
using FluidSystem = GetPropType< TypeTag, Properties::FluidSystem >
 
using IndexTraits = typename FluidSystem::IndexTraitsType
 
using Indices = GetPropType< TypeTag, Properties::Indices >
 
using IntensiveQuantities = GetPropType< TypeTag, Properties::IntensiveQuantities >
 
using MaterialLaw = GetPropType< TypeTag, Properties::MaterialLaw >
 
using SparseMatrixAdapter = GetPropType< TypeTag, Properties::SparseMatrixAdapter >
 
using RateVector = GetPropType< TypeTag, Properties::RateVector >
 
using GasLiftSingleWell = ::Opm::GasLiftSingleWell< TypeTag >
 
using GLiftEclWells = typename GasLiftGroupInfo< Scalar, IndexTraits >::GLiftEclWells
 
using VectorBlockType = Dune::FieldVector< Scalar, Indices::numEq >
 
using MatrixBlockType = Dune::FieldMatrix< Scalar, Indices::numEq, Indices::numEq >
 
using Eval = typename Base::Eval
 
using BVector = Dune::BlockVector< VectorBlockType >
 
using PressureMatrix = Dune::BCRSMatrix< Opm::MatrixBlock< Scalar, 1, 1 > >
 
using WellStateType = WellState< Scalar, IndexTraits >
 
using SingleWellStateType = SingleWellState< Scalar, IndexTraits >
 
using GroupStateHelperType = GroupStateHelper< Scalar, IndexTraits >
 
using RateConverterType = typename WellInterfaceFluidSystem< FluidSystem >::RateConverterType
 
using ModelParameters = typename Base::ModelParameters
 
using FluidState = BlackOilFluidState< Eval, FluidSystem, energyModuleType !=EnergyModules::NoTemperature, energyModuleType==EnergyModules::FullyImplicitThermal, Indices::compositionSwitchIdx >=0, has_watVapor, has_brine, has_saltPrecip, has_disgas_in_water, has_solvent, Indices::numPhases >
 
- Public Types inherited from Opm::WellInterfaceIndices< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
using Scalar = typename GetPropType< TypeTag, Properties::FluidSystem > ::Scalar
 
using Eval = DenseAd::Evaluation< Scalar, GetPropType< TypeTag, Properties::Indices > ::numDerivatives >
 
using ModelParameters = typename WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >::ModelParameters
 
- Public Types inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
using Scalar = typename GetPropType< TypeTag, Properties::FluidSystem > ::Scalar
 
using IndexTraits = typename GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType
 
using ModelParameters = typename WellInterfaceGeneric< Scalar, IndexTraits >::ModelParameters
 
using GroupStateHelperType = GroupStateHelper< Scalar, IndexTraits >
 
using WellStateType = WellState< Scalar, IndexTraits >
 
- Public Types inherited from Opm::WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
using ModelParameters = BlackoilModelParameters< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar >
 
using WellStateType = WellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
 

Public Member Functions

 MultisegmentWell (const Well &well, const ParallelWellInfo< Scalar > &pw_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const std::vector< PerforationData< Scalar >> &perf_data)
 
void init (const std::vector< Scalar > &depth_arg, const Scalar gravity_arg, const std::vector< Scalar > &B_avg, const bool changed_to_open_this_step) override
 
void updateWellStateWithTarget (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, WellStateType &well_state) const override
 updating the well state based the current control mode
 
void scaleSegmentRatesAndPressure (WellStateType &well_state) const override
 updating the segment pressure and rates based the current bhp and well rates
 
ConvergenceReport getWellConvergence (const GroupStateHelperType &groupStateHelper, const std::vector< Scalar > &B_avg, const bool relax_tolerance) const override
 check whether the well equations get converged for this well
 
void apply (const BVector &x, BVector &Ax) const override
 Ax = Ax - C D^-1 B x.
 
void apply (BVector &r) const override
 r = r - C D^-1 Rw
 
void recoverWellSolutionAndUpdateWellState (const Simulator &simulator, const BVector &x, const GroupStateHelperType &groupStateHelper, WellStateType &well_state) override
 using the solution x to recover the solution xw for wells and applying xw to update Well State
 
void computeWellPotentials (const Simulator &simulator, const WellStateType &well_state, const GroupStateHelperType &groupStateHelper, std::vector< Scalar > &well_potentials) override
 computing the well potentials for group control
 
void updatePrimaryVariables (const GroupStateHelperType &groupStateHelper) override
 
void solveEqAndUpdateWellState (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, WellStateType &well_state) override
 
void calculateExplicitQuantities (const Simulator &simulator, const GroupStateHelperType &groupStateHelper) override
 
void updateIPRImplicit (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, WellStateType &well_state) override
 
void updateProductivityIndex (const Simulator &simulator, const WellProdIndexCalculator< Scalar > &wellPICalc, WellStateType &well_state, DeferredLogger &deferred_logger) const override
 
Scalar connectionDensity (const int globalConnIdx, const int openConnIdx) const override
 
void addWellContributions (SparseMatrixAdapter &jacobian) const override
 
void addWellPressureEquations (PressureMatrix &mat, const BVector &x, const int pressureVarIndex, const bool use_well_weights, const WellStateType &well_state) const override
 
std::vector< Scalar > computeCurrentWellRates (const Simulator &simulator, DeferredLogger &deferred_logger) const override
 Compute well rates based on current reservoir conditions and well variables. More...
 
std::optional< Scalar > computeBhpAtThpLimitProdWithAlq (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, const SummaryState &summary_state, const Scalar alq_value, bool iterate_if_no_solution) const override
 
std::vector< Scalar > getPrimaryVars () const override
 
int setPrimaryVars (typename std::vector< Scalar >::const_iterator it) override
 
- Public Member Functions inherited from Opm::WellInterface< TypeTag >
 WellInterface (const Well &well, const ParallelWellInfo< Scalar > &pw_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const std::vector< PerforationData< Scalar >> &perf_data)
 Constructor.
 
virtual ~WellInterface ()=default
 Virtual destructor.
 
void assembleWellEq (const Simulator &simulator, const double dt, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
void assembleWellEqWithoutIteration (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, const double dt, WellStateType &well_state, const bool solving_with_zero_rate)
 
void prepareWellBeforeAssembling (const Simulator &simulator, const double dt, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
std::optional< Scalar > computeBhpAtThpLimitProdWithAlqUsingIPR (const Simulator &simulator, const WellStateType &well_state, Scalar bhp, const SummaryState &summary_state, const Scalar alq_value)
 
bool wellUnderZeroRateTarget (const GroupStateHelperType &groupStateHelper) const
 
bool stoppedOrZeroRateTarget (const GroupStateHelperType &groupStateHelper) const
 
bool updateWellStateWithTHPTargetProd (const Simulator &simulator, WellStateType &well_state, const GroupStateHelperType &groupStateHelper) const
 
bool wellUnderZeroGroupRateTarget (const GroupStateHelperType &groupStateHelper, const std::optional< bool > group_control=std::nullopt) const
 
bool updateWellControl (const Simulator &simulator, const IndividualOrGroup iog, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
bool updateWellControlAndStatusLocalIteration (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const Scalar WQTotal, WellStateType &well_state, const bool fixed_control, const bool fixed_status, const bool solving_with_zero_rate)
 
void addCellRates (std::map< int, RateVector > &cellRates_) const
 
Scalar volumetricSurfaceRateForConnection (int cellIdx, int phaseIdx) const
 
void wellTesting (const Simulator &simulator, const double simulation_time, const GroupStateHelperType &groupStateHelper, WellStateType &well_state, WellTestState &welltest_state, GLiftEclWells &ecl_well_map, std::map< std::string, double > &open_times)
 
void checkWellOperability (const Simulator &simulator, const WellStateType &well_state, const GroupStateHelperType &groupStateHelper)
 
void gliftBeginTimeStepWellTestUpdateALQ (const Simulator &simulator, WellStateType &well_state, const GroupState< Scalar > &group_state, GLiftEclWells &ecl_well_map, DeferredLogger &deferred_logger)
 
void updateWellOperability (const Simulator &simulator, const WellStateType &well_state, const GroupStateHelperType &groupStateHelper)
 
bool updateWellOperabilityFromWellEq (const Simulator &simulator, const GroupStateHelperType &groupStateHelper)
 
void initializeProducerWellState (const Simulator &simulator, WellStateType &well_state, DeferredLogger &deferred_logger) const
 Modify the well_state's rates if there is only one nonzero rate. More...
 
void solveWellEquation (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
const std::vector< RateVector > & connectionRates () const
 
void updateConnectionDFactor (const Simulator &simulator, SingleWellStateType &ws) const
 
void updateConnectionTransmissibilityFactor (const Simulator &simulator, SingleWellStateType &ws) const
 
virtual bool iterateWellEqWithSwitching (const Simulator &simulator, const double dt, const WellInjectionControls &inj_controls, const WellProductionControls &prod_controls, const GroupStateHelperType &groupStateHelper, WellStateType &well_state, const bool fixed_control, const bool fixed_status, const bool solving_with_zero_rate)=0
 
- Public Member Functions inherited from Opm::WellInterfaceIndices< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
Scalar scalingFactor (const int phaseIdx) const
 
Eval restrictEval (const EvalWell &in) const
 
- Public Member Functions inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
const RateConverterTyperateConverter () const
 
- Public Member Functions inherited from Opm::WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
 WellInterfaceGeneric (const Well &well, const ParallelWellInfo< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &parallel_well_info, const int time_step, const ModelParameters &param, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const PhaseUsageInfo< GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &phase_usage, const std::vector< PerforationData< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar >> &perf_data)
 
const std::vector< PerforationData< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > > & perforationData () const
 Get the perforations of the well.
 
const std::string & name () const
 Well name.
 
bool isInjector () const
 True if the well is an injector.
 
bool isProducer () const
 True if the well is a producer.
 
const std::vector< int > & cells () const
 Well cells.
 
int indexOfWell () const
 Index of well in the wells struct and wellState.
 
void adaptRatesForVFP (std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &rates) const
 
const Well & wellEcl () const
 
Well & wellEcl ()
 
const PhaseUsageInfo< GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > & phaseUsage () const
 
bool underPredictionMode () const
 Returns true if the well is currently in prediction mode (i.e. not history mode).
 
bool isOperableAndSolvable () const
 
bool useVfpExplicit () const
 
bool thpLimitViolatedButNotSwitched () const
 
void initCompletions ()
 
void closeCompletions (const WellTestState &wellTestState)
 
void setVFPProperties (const VFPProperties< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > *vfp_properties_arg)
 
void setPrevSurfaceRates (WellStateType &well_state, const WellStateType &prev_well_state) const
 
void setGuideRate (const GuideRate *guide_rate_arg)
 
void setWellEfficiencyFactor (const GetPropType< TypeTag, Properties::FluidSystem > ::Scalar efficiency_factor)
 
void setRepRadiusPerfLength ()
 
void setWsolvent (const GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wsolvent)
 
void setDynamicThpLimit (const GetPropType< TypeTag, Properties::FluidSystem > ::Scalar thp_limit)
 
void setDynamicThpLimit (const std::optional< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > thp_limit)
 
std::optional< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > getDynamicThpLimit () const
 
void updatePerforatedCell (std::vector< bool > &is_cell_perforated)
 
bool wellHasTHPConstraints (const SummaryState &summaryState) const
 Returns true if the well has one or more THP limits/constraints.
 
void stopWell ()
 
void openWell ()
 
Well::Status wellStatus ()
 
bool wellIsStopped () const
 
int currentStep () const
 
int pvtRegionIdx () const
 
const GuideRate * guideRate () const
 
int numConservationQuantities () const
 
int numPhases () const
 
int numLocalPerfs () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar refDepth () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar gravity () const
 
const VFPProperties< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > * vfpProperties () const
 
const ParallelWellInfo< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > & parallelWellInfo () const
 
const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > & perfDepth () const
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > & perfDepth ()
 
const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > & wellIndex () const
 
const std::map< int, std::vector< int > > & getCompletions () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar getTHPConstraint (const SummaryState &summaryState) const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar getALQ (const WellStateType &well_state) const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wsolvent () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar rsRvInj () const
 
void initInjMult (const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &max_inj_mult)
 
void updateInjMult (std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &inj_multipliers, DeferredLogger &deferred_logger) const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar getInjMult (const int local_perf_index, const GetPropType< TypeTag, Properties::FluidSystem > ::Scalar bhp, const GetPropType< TypeTag, Properties::FluidSystem > ::Scalar perf_pres, DeferredLogger &dlogger) const
 
bool isVFPActive (DeferredLogger &deferred_logger) const
 
void reportWellSwitching (const SingleWellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &ws, DeferredLogger &deferred_logger) const
 
bool changedToOpenThisStep () const
 
void updateWellTestState (const SingleWellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &ws, const double &simulationTime, const bool &writeMessageToOPMLog, const bool zero_group_target, WellTestState &wellTestState, DeferredLogger &deferred_logger) const
 
bool isPressureControlled (const WellStateType &well_state) const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wellEfficiencyFactor () const
 
void updateFilterCakeMultipliers (const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &inj_fc_multiplier)
 Update filter cake multipliers.
 
void resetWellOperability ()
 
virtual int setPrimaryVars (typename std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar >::const_iterator)
 
void addPerforations (const std::vector< RuntimePerforation > &perfs)
 
- Public Member Functions inherited from Opm::MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
const EquationslinSys () const
 Returns a const reference to equation system.
 
- Public Member Functions inherited from Opm::MultisegmentWellGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
const WellSegments & segmentSet () const
 
int segmentNumberToIndex (const int segment_number) const
 
int numberOfSegments () const
 number of segments for this well
 

Static Public Attributes

static constexpr bool has_solvent
 
static constexpr bool has_polymer
 
- Static Public Attributes inherited from Opm::WellInterface< TypeTag >
static constexpr bool has_solvent = getPropValue<TypeTag, Properties::EnableSolvent>()
 
static constexpr bool has_zFraction = getPropValue<TypeTag, Properties::EnableExtbo>()
 
static constexpr bool has_polymer = getPropValue<TypeTag, Properties::EnablePolymer>()
 
static constexpr EnergyModules energyModuleType = getPropValue<TypeTag, Properties::EnergyModuleType>()
 
static constexpr bool has_energy = energyModuleType == EnergyModules::FullyImplicitThermal
 
static constexpr bool has_polymermw = getPropValue<TypeTag, Properties::EnablePolymerMW>()
 
static constexpr bool has_foam = getPropValue<TypeTag, Properties::EnableFoam>()
 
static constexpr bool has_brine = getPropValue<TypeTag, Properties::EnableBrine>()
 
static constexpr bool has_watVapor = getPropValue<TypeTag, Properties::EnableVapwat>()
 
static constexpr bool has_disgas_in_water = getPropValue<TypeTag, Properties::EnableDisgasInWater>()
 
static constexpr bool has_saltPrecip = getPropValue<TypeTag, Properties::EnableSaltPrecipitation>()
 
static constexpr bool has_bioeffects = getPropValue<TypeTag, Properties::EnableBioeffects>()
 
static constexpr bool has_micp = Indices::enableMICP
 
- Static Public Attributes inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
static constexpr int Water
 
static constexpr int Oil
 
static constexpr int Gas
 

Protected Member Functions

void updateWellState (const Simulator &simulator, const BVectorWell &dwells, const GroupStateHelperType &groupStateHelper, WellStateType &well_state, const Scalar relaxation_factor=1.0)
 
void computeInitialSegmentFluids (const Simulator &simulator, DeferredLogger &deferred_logger)
 
void computePerfCellPressDiffs (const Simulator &simulator)
 
template<class Value >
void computePerfRate (const IntensiveQuantities &int_quants, const std::vector< Value > &mob_perfcells, const std::vector< Value > &Tw, const int seg, const int perf, const Value &segment_pressure, const bool &allow_cf, std::vector< Value > &cq_s, Value &perf_press, PerforationRates< Scalar > &perf_rates, DeferredLogger &deferred_logger) const
 
template<class Value >
void computePerfRate (const Value &pressure_cell, const Value &rs, const Value &rv, const std::vector< Value > &b_perfcells, const std::vector< Value > &mob_perfcells, const std::vector< Value > &Tw, const int perf, const Value &segment_pressure, const Value &segment_density, const bool &allow_cf, const std::vector< Value > &cmix_s, std::vector< Value > &cq_s, Value &perf_press, PerforationRates< Scalar > &perf_rates, DeferredLogger &deferred_logger) const
 
void computeSegmentFluidProperties (const Simulator &simulator, DeferredLogger &deferred_logger)
 
template<class Value >
void getTransMult (Value &trans_mult, const Simulator &simulator, const int cell_indx) const
 
template<class Value >
void getMobility (const Simulator &simulator, const int local_perf_index, std::vector< Value > &mob, DeferredLogger &deferred_logger) const
 
void computeWellRatesAtBhpLimit (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, std::vector< Scalar > &well_flux) const
 
void computeWellRatesWithBhp (const Simulator &simulator, const Scalar &bhp, std::vector< Scalar > &well_flux, DeferredLogger &deferred_logger) const override
 
void computeWellRatesWithBhpIterations (const Simulator &simulator, const Scalar &bhp, const GroupStateHelperType &groupStateHelper, std::vector< Scalar > &well_flux) const override
 
std::vector< Scalar > computeWellPotentialWithTHP (const WellStateType &well_state, const Simulator &simulator, const GroupStateHelperType &groupStateHelper) const
 
bool computeWellPotentialsImplicit (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, std::vector< Scalar > &well_potentials) const
 
Scalar getRefDensity () const override
 
bool iterateWellEqWithControl (const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const GroupStateHelperType &groupStateHelper, WellStateType &well_state) override
 
bool iterateWellEqWithSwitching (const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const GroupStateHelperType &groupStateHelper, WellStateType &well_state, const bool fixed_control, const bool fixed_status, const bool solving_with_zero_rate) override
 
void assembleWellEqWithoutIteration (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, WellStateType &well_state, const bool solving_with_zero_rate) override
 
void updateWaterThroughput (const double dt, WellStateType &well_state) const override
 
EvalWell getSegmentSurfaceVolume (const Simulator &simulator, const int seg_idx, DeferredLogger &deferred_logger) const
 
bool openCrossFlowAvoidSingularity (const Simulator &simulator) const
 
bool allDrawDownWrongDirection (const Simulator &simulator) const
 
std::optional< Scalar > computeBhpAtThpLimitProd (const WellStateType &well_state, const Simulator &ebos_simulator, const GroupStateHelperType &groupStateHelper, const SummaryState &summary_state) const
 
std::optional< Scalar > computeBhpAtThpLimitInj (const Simulator &ebos_simulator, const GroupStateHelperType &groupStateHelper, const SummaryState &summary_state) const
 
Scalar maxPerfPress (const Simulator &simulator) const override
 
void checkOperabilityUnderBHPLimit (const WellStateType &well_state, const Simulator &ebos_simulator, DeferredLogger &deferred_logger) override
 
void checkOperabilityUnderTHPLimit (const Simulator &ebos_simulator, const WellStateType &well_state, const GroupStateHelperType &groupStateHelper) override
 
void updateIPR (const Simulator &ebos_simulator, DeferredLogger &deferred_logger) const override
 
FSInfo getFirstPerforationFluidStateInfo (const Simulator &simulator) const
 
- Protected Member Functions inherited from Opm::WellInterface< TypeTag >
Scalar wpolymer () const
 
Scalar wfoam () const
 
Scalar wsalt () const
 
Scalar wmicrobes () const
 
Scalar woxygen () const
 
Scalar wurea () const
 
std::vector< Scalar > initialWellRateFractions (const Simulator &ebosSimulator, const WellStateType &well_state) const
 
virtual void assembleWellEqWithoutIteration (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, const double dt, const WellInjectionControls &inj_controls, const WellProductionControls &prod_controls, WellStateType &well_state, const bool solving_with_zero_rate)=0
 
virtual bool iterateWellEqWithControl (const Simulator &simulator, const double dt, const WellInjectionControls &inj_controls, const WellProductionControls &prod_controls, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)=0
 
bool iterateWellEquations (const Simulator &simulator, const double dt, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
bool solveWellWithOperabilityCheck (const Simulator &simulator, const double dt, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
std::optional< Scalar > estimateOperableBhp (const Simulator &ebos_simulator, const double dt, const GroupStateHelperType &groupStateHelper, const SummaryState &summary_state, WellStateType &well_state)
 
bool solveWellWithBhp (const Simulator &simulator, const double dt, const Scalar bhp, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
bool solveWellWithZeroRate (const Simulator &simulator, const double dt, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
bool solveWellForTesting (const Simulator &simulator, const GroupStateHelperType &groupStateHelper, WellStateType &well_state)
 
template<class GasLiftSingleWell >
std::unique_ptr< GasLiftSingleWellinitializeGliftWellTest_ (const Simulator &simulator, WellStateType &well_state, const GroupState< Scalar > &group_state, GLiftEclWells &ecl_well_map, DeferredLogger &deferred_logger)
 
Eval getPerfCellPressure (const FluidState &fs) const
 
template<class Value , class Callback >
void getTransMult (Value &trans_mult, const Simulator &simulator, const int cell_idx, Callback &extendEval) const
 
template<class Value >
void getTw (std::vector< Value > &wi, const int perf, const IntensiveQuantities &intQuants, const Value &trans_mult, const SingleWellStateType &ws) const
 
template<class Value , class Callback >
void getMobility (const Simulator &simulator, const int local_perf_index, std::vector< Value > &mob, Callback &extendEval, [[maybe_unused]] DeferredLogger &deferred_logger) const
 
void computeConnLevelProdInd (const FluidState &fs, const std::function< Scalar(const Scalar)> &connPICalc, const std::vector< Scalar > &mobility, Scalar *connPI) const
 
void computeConnLevelInjInd (const FluidState &fs, const Phase preferred_phase, const std::function< Scalar(const Scalar)> &connIICalc, const std::vector< Scalar > &mobility, Scalar *connII, DeferredLogger &deferred_logger) const
 
Scalar computeConnectionDFactor (const int perf, const IntensiveQuantities &intQuants, const SingleWellStateType &ws) const
 
- Protected Member Functions inherited from Opm::WellInterfaceIndices< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
 WellInterfaceIndices (const Well &well, const ParallelWellInfo< Scalar > &parallel_well_info, const int time_step, const ModelParameters &param, const typename WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >::RateConverterType &rate_converter, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const std::vector< PerforationData< Scalar >> &perf_data)
 
- Protected Member Functions inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
 WellInterfaceFluidSystem (const Well &well, const ParallelWellInfo< Scalar > &parallel_well_info, const int time_step, const ModelParameters &param, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_conservation_quantities, const int num_phases, const int index_of_well, const std::vector< PerforationData< Scalar >> &perf_data)
 
void calculateReservoirRates (const bool use_well_bhp_temperature, SingleWellState< Scalar, IndexTraits > &ws) const
 
bool checkIndividualConstraints (SingleWellState< Scalar, IndexTraits > &ws, const SummaryState &summaryState, DeferredLogger &deferred_logger, const std::optional< Well::InjectionControls > &inj_controls=std::nullopt, const std::optional< Well::ProductionControls > &prod_controls=std::nullopt) const
 
bool checkGroupConstraints (const GroupStateHelperType &groupStateHelper, const Schedule &schedule, const SummaryState &summaryState, const bool check_guide_rate, WellStateType &well_state) const
 
bool checkConstraints (const GroupStateHelperType &groupStateHelper, const Schedule &schedule, const SummaryState &summaryState, WellStateType &well_state) const
 
std::optional< Scalar > getGroupInjectionTargetRate (const Group &group, const GroupStateHelperType &groupStateHelper, const InjectorType &injectorType, Scalar efficiencyFactor) const
 
Scalar getGroupProductionTargetRate (const Group &group, const GroupStateHelperType &groupStateHelper, Scalar efficiencyFactor) const
 
bool zeroGroupRateTarget (const GroupStateHelperType &groupStateHelper) const
 
- Protected Member Functions inherited from Opm::WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
bool getAllowCrossFlow () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wmicrobes_ () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wfoam_ () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar woxygen_ () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wpolymer_ () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wsalt_ () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wurea_ () const
 
int polymerTable_ () const
 
int polymerInjTable_ () const
 
int polymerWaterTable_ () const
 
bool wellUnderZeroRateTargetIndividual (const SummaryState &summary_state, const WellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &well_state) const
 
bool wellUnderGroupControl (const SingleWellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &ws) const
 
std::pair< bool, bool > computeWellPotentials (std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &well_potentials, const WellStateType &well_state)
 
void checkNegativeWellPotentials (std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &well_potentials, const bool checkOperability, DeferredLogger &deferred_logger)
 
void onlyKeepBHPandTHPcontrols (const SummaryState &summary_state, WellStateType &well_state, Well::InjectionControls &inj_controls, Well::ProductionControls &prod_controls) const
 
void resetDampening ()
 
- Protected Member Functions inherited from Opm::MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
 MultisegmentWellEval (WellInterfaceIndices< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > > &baseif, const ParallelWellInfo< Scalar > &parallel_well_info)
 
void initMatrixAndVectors (const ParallelWellInfo< Scalar > &parallel_well_info)
 
void assembleDefaultPressureEq (const int seg, WellState< Scalar, IndexTraits > &well_state, const bool use_average_density)
 
void assembleICDPressureEq (const int seg, const UnitSystem &unit_system, WellState< Scalar, IndexTraits > &well_state, const SummaryState &summary_state, const bool use_average_density, DeferredLogger &deferred_logger)
 
void assembleAccelerationAndHydroPressureLosses (const int seg, WellState< Scalar, IndexTraits > &well_state, const bool use_average_density)
 
void assemblePressureEq (const int seg, const UnitSystem &unit_system, WellState< Scalar, IndexTraits > &well_state, const SummaryState &summary_state, const bool use_average_density, DeferredLogger &deferred_logger)
 
ConvergenceReport getWellConvergence (const WellState< Scalar, IndexTraits > &well_state, const std::vector< Scalar > &B_avg, DeferredLogger &deferred_logger, const Scalar max_residual_allowed, const Scalar tolerance_wells, const Scalar relaxed_inner_tolerance_flow_ms_well, const Scalar tolerance_pressure_ms_wells, const Scalar relaxed_inner_tolerance_pressure_ms_well, const bool relax_tolerance, const bool well_is_stopped) const
 check whether the well equations get converged for this well
 
std::pair< bool, std::vector< Scalar > > getFiniteWellResiduals (const std::vector< Scalar > &B_avg, DeferredLogger &deferred_logger) const
 
Scalar getControlTolerance (const WellState< Scalar, IndexTraits > &well_state, const Scalar tolerance_wells, const Scalar tolerance_pressure_ms_wells, DeferredLogger &deferred_logger) const
 
Scalar getResidualMeasureValue (const WellState< Scalar, IndexTraits > &well_state, const std::vector< Scalar > &residuals, const Scalar tolerance_wells, const Scalar tolerance_pressure_ms_wells, DeferredLogger &deferred_logger) const
 
void assembleAccelerationPressureLoss (const int seg, WellState< Scalar, IndexTraits > &well_state)
 
EvalWell extendEval (const Eval &in) const
 
- Protected Member Functions inherited from Opm::MultisegmentWellGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
 MultisegmentWellGeneric (WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &baseif)
 
void scaleSegmentRatesWithWellRates (const std::vector< std::vector< int >> &segment_inlets, const std::vector< std::vector< int >> &segment_perforations, WellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &well_state) const
 
void scaleSegmentPressuresWithBhp (WellState< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > &well_state) const
 
WellSegmentCompPressureDrop compPressureDrop () const
 
bool update_relaxation_factor (const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &measure_history, GetPropType< TypeTag, Properties::FluidSystem > ::Scalar &relaxation_factor, bool &regularize, DeferredLogger &deferred_logger) const
 Detect oscillation or stagnation based on the residual measure history.
 
bool repeatedStagnation (const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &measure_history, bool &regularize, DeferredLogger &deferred_logger) const
 
bool accelerationalPressureLossConsidered () const
 
bool frictionalPressureLossConsidered () const
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar getSegmentDp (const int seg, const GetPropType< TypeTag, Properties::FluidSystem > ::Scalar density, const std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > &seg_dp) const
 

Protected Attributes

bool regularize_
 
std::vector< std::vector< Scalar > > segment_fluid_initial_
 
int debug_cost_counter_ = 0
 
- Protected Attributes inherited from Opm::WellInterface< TypeTag >
std::vector< RateVector > connectionRates_
 
std::vector< Scalar > B_avg_
 
bool changed_to_stopped_this_step_ = false
 
bool thp_update_iterations = false
 
int number_of_well_reopenings_ {0}
 
- Protected Attributes inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
const RateConverterTyperateConverter_
 
- Protected Attributes inherited from Opm::WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
OperabilityStatus operability_status_
 
Well well_ecl_
 
const ParallelWellInfo< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > & parallel_well_info_
 
const int current_step_
 
const ModelParametersparam_
 
const int pvtRegionIdx_
 
const int num_conservation_quantities_
 
int number_of_phases_
 
int index_of_well_
 
const PhaseUsageInfo< GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > & phase_usage_
 
const std::vector< PerforationData< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > > * perf_data_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > ipr_a_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > ipr_b_
 
std::vector< int > well_cells_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > well_index_
 
int number_of_local_perforations_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > perf_depth_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > perf_rep_radius_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > perf_length_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > bore_diameters_
 
std::map< int, std::vector< int > > completions_
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar ref_depth_
 
std::vector< int > saturation_table_number_
 
Well::Status wellStatus_
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar gravity_
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar wsolvent_
 
std::optional< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > dynamic_thp_limit_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > inj_multiplier_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > prev_inj_multiplier_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > inj_multiplier_previter_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > inj_multiplier_damp_factor_
 
std::vector< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar > inj_fc_multiplier_
 
GetPropType< TypeTag, Properties::FluidSystem > ::Scalar well_efficiency_factor_
 
const VFPProperties< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > * vfp_properties_
 
const GuideRate * guide_rate_
 
std::vector< std::string > well_control_log_
 
bool changed_to_open_this_step_
 
- Protected Attributes inherited from Opm::MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
const WellInterfaceIndices< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > > & baseif_
 
Equations linSys_
 The equation system.
 
PrimaryVariables primary_variables_
 The primary variables.
 
MSWSegments segments_
 Segment properties.
 
std::vector< Scalar > cell_perforation_depth_diffs_
 
std::vector< Scalar > cell_perforation_pressure_diffs_
 
- Protected Attributes inherited from Opm::MultisegmentWellGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType >
const WellInterfaceGeneric< GetPropType< TypeTag, Properties::FluidSystem > ::Scalar, GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType > & baseif_
 

Additional Inherited Members

- Protected Types inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
using RateConverterType = RateConverter::SurfaceToReservoirVoidage< GetPropType< TypeTag, Properties::FluidSystem >, std::vector< int > >
 
- Protected Types inherited from Opm::MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
using Scalar = typename GetPropType< TypeTag, Properties::FluidSystem > ::Scalar
 
using IndexTraits = typename GetPropType< TypeTag, Properties::FluidSystem > ::IndexTraitsType
 
using PrimaryVariables = MultisegmentWellPrimaryVariables< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
 
using Equations = MultisegmentWellEquations< Scalar, IndexTraits, numWellEq, GetPropType< TypeTag, Properties::Indices > ::numEq >
 
using MSWSegments = MultisegmentWellSegments< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
 
using BVector = typename Equations::BVector
 
using BVectorWell = typename Equations::BVectorWell
 
using EvalWell = typename PrimaryVariables::EvalWell
 
using Eval = DenseAd::Evaluation< Scalar, GetPropType< TypeTag, Properties::Indices > ::numDerivatives >
 
- Static Protected Attributes inherited from Opm::WellInterfaceFluidSystem< GetPropType< TypeTag, Properties::FluidSystem > >
static constexpr int INVALIDCOMPLETION
 
- Static Protected Attributes inherited from Opm::MultisegmentWellEval< GetPropType< TypeTag, Properties::FluidSystem >, GetPropType< TypeTag, Properties::Indices > >
static constexpr int numWellEq
 
static constexpr int SPres
 
static constexpr int WQTotal
 

Member Function Documentation

◆ computeCurrentWellRates()

template<typename TypeTag >
std::vector< typename MultisegmentWell< TypeTag >::Scalar > Opm::MultisegmentWell< TypeTag >::computeCurrentWellRates ( const Simulator &  simulator,
DeferredLogger deferred_logger 
) const
overridevirtual

Compute well rates based on current reservoir conditions and well variables.

Used in updateWellStateRates().

Implements Opm::WellInterface< TypeTag >.


The documentation for this class was generated from the following files: