My Project
Opm::MultisegmentWellEval< FluidSystem, Indices, Scalar > Class Template Reference
Inheritance diagram for Opm::MultisegmentWellEval< FluidSystem, Indices, Scalar >:
Opm::MultisegmentWellGeneric< Scalar >

Public Member Functions

void addWellContribution (WellContributions &wellContribs) const
 add the contribution (C, D, B matrices) of this Well to the WellContributions object
 

Protected Types

using VectorBlockWellType = Dune::FieldVector< Scalar, numWellEq >
 
using BVectorWell = Dune::BlockVector< VectorBlockWellType >
 
using VectorBlockType = Dune::FieldVector< Scalar, Indices::numEq >
 
using BVector = Dune::BlockVector< VectorBlockType >
 
using DiagMatrixBlockWellType = Dune::FieldMatrix< Scalar, numWellEq, numWellEq >
 
using DiagMatWell = Dune::BCRSMatrix< DiagMatrixBlockWellType >
 
using OffDiagMatrixBlockWellType = Dune::FieldMatrix< Scalar, numWellEq, Indices::numEq >
 
using OffDiagMatWell = Dune::BCRSMatrix< OffDiagMatrixBlockWellType >
 
using EvalWell = DenseAd::Evaluation< double, Indices::numEq+numWellEq >
 
using Eval = DenseAd::Evaluation< Scalar, Indices::numEq >
 

Protected Member Functions

 MultisegmentWellEval (WellInterfaceIndices< FluidSystem, Indices, Scalar > &baseif)
 
void initMatrixAndVectors (const int num_cells) const
 
void initPrimaryVariablesEvaluation () const
 
void assembleControlEq (const WellState &well_state, const GroupState &group_state, const Schedule &schedule, const SummaryState &summaryState, const Well::InjectionControls &inj_controls, const Well::ProductionControls &prod_controls, const double rho, DeferredLogger &deferred_logger)
 
void assembleDefaultPressureEq (const int seg, WellState &well_state) const
 
void assembleICDPressureEq (const int seg, const UnitSystem &unit_system, WellState &well_state, DeferredLogger &deferred_logger) const
 
void assemblePressureEq (const int seg, const UnitSystem &unit_system, WellState &well_state, DeferredLogger &deferred_logger) const
 
void checkConvergenceControlEq (const WellState &well_state, ConvergenceReport &report, const double tolerance_pressure_ms_wells, const double tolerance_wells, const double max_residual_allowed, DeferredLogger &deferred_logger) const
 
ConvergenceReport getWellConvergence (const WellState &well_state, const std::vector< double > &B_avg, DeferredLogger &deferred_logger, const double max_residual_allowed, const double tolerance_wells, const double relaxed_inner_tolerance_flow_ms_well, const double tolerance_pressure_ms_wells, const double relaxed_inner_tolerance_pressure_ms_well, const bool relax_tolerance) const
 check whether the well equations get converged for this well
 
void processFractions (const int seg) const
 
void recoverSolutionWell (const BVector &x, BVectorWell &xw) const
 
void updatePrimaryVariables (const WellState &well_state) const
 
void updateUpwindingSegments ()
 
void updatePrimaryVariablesNewton (const BVectorWell &dwells, const double relaxation_factor, const double DFLimit, const double max_pressure_change) const
 
void computeSegmentFluidProperties (const EvalWell &temperature, const EvalWell &saltConcentration, int pvt_region_index, DeferredLogger &deferred_logger)
 
EvalWell getBhp () const
 
EvalWell getFrictionPressureLoss (const int seg) const
 
EvalWell getHydroPressureLoss (const int seg) const
 
EvalWell getQs (const int comp_idx) const
 
EvalWell getSegmentWQTotal (const int seg) const
 
EvalWell getSegmentPressure (const int seg) const
 
EvalWell getSegmentRate (const int seg, const int comp_idx) const
 
EvalWell getSegmentRateUpwinding (const int seg, const size_t comp_idx) const
 
EvalWell getSegmentSurfaceVolume (const EvalWell &temperature, const EvalWell &saltConcentration, const int pvt_region_index, const int seg_idx) const
 
EvalWell getWQTotal () const
 
std::pair< bool, std::vector< Scalar > > getFiniteWellResiduals (const std::vector< Scalar > &B_avg, DeferredLogger &deferred_logger) const
 
double getControlTolerance (const WellState &well_state, const double tolerance_wells, const double tolerance_pressure_ms_wells, DeferredLogger &deferred_logger) const
 
double getResidualMeasureValue (const WellState &well_state, const std::vector< double > &residuals, const double tolerance_wells, const double tolerance_pressure_ms_wells, DeferredLogger &deferred_logger) const
 
void handleAccelerationPressureLoss (const int seg, WellState &well_state) const
 
EvalWell pressureDropAutoICD (const int seg, const UnitSystem &unit_system) const
 
EvalWell pressureDropSpiralICD (const int seg) const
 
EvalWell pressureDropValve (const int seg) const
 
void updateThp (WellState &well_state, const double rho, DeferredLogger &deferred_logger) const
 
void updateWellStateFromPrimaryVariables (WellState &well_state, const double rho, DeferredLogger &deferred_logger) const
 
EvalWell volumeFraction (const int seg, const unsigned compIdx) const
 
EvalWell volumeFractionScaled (const int seg, const int comp_idx) const
 
EvalWell surfaceVolumeFraction (const int seg, const int comp_idx) const
 
EvalWell extendEval (const Eval &in) const
 
- Protected Member Functions inherited from Opm::MultisegmentWellGeneric< Scalar >
 MultisegmentWellGeneric (WellInterfaceGeneric &baseif)
 
void scaleSegmentRatesWithWellRates (WellState &well_state) const
 
void scaleSegmentPressuresWithBhp (WellState &well_state) const
 
const WellSegments & segmentSet () const
 
WellSegments::CompPressureDrop compPressureDrop () const
 
int segmentNumberToIndex (const int segment_number) const
 
int numberOfSegments () const
 number of segments for this well
 
double calculateThpFromBhp (const std::vector< double > &rates, const double bhp, const double rho, DeferredLogger &deferred_logger) const
 
std::optional< double > computeBhpAtThpLimitInj (const std::function< std::vector< double >(const double)> &frates, const SummaryState &summary_state, const double rho, DeferredLogger &deferred_logger) const
 
std::optional< double > computeBhpAtThpLimitProdWithAlq (const std::function< std::vector< double >(const double)> &frates, const SummaryState &summary_state, const double maxPerfPress, const double rho, DeferredLogger &deferred_logger, double alq_value) const
 
std::optional< double > bhpMax (const std::function< double(const double)> &fflo, const double bhp_limit, const double maxPerfPress, const double vfp_flo_front, DeferredLogger &deferred_logger) const
 
bool bruteForceBracket (const std::function< double(const double)> &eq, const std::array< double, 2 > &range, double &low, double &high, DeferredLogger &deferred_logger) const
 
bool bisectBracket (const std::function< double(const double)> &eq, const std::array< double, 2 > &range, double &low, double &high, std::optional< double > &approximate_solution, DeferredLogger &deferred_logger) const
 
void detectOscillations (const std::vector< double > &measure_history, const int it, bool &oscillate, bool &stagnate) const
 Detect oscillation or stagnation based on the residual measure history.
 
bool accelerationalPressureLossConsidered () const
 
bool frictionalPressureLossConsidered () const
 

Protected Attributes

const WellInterfaceIndices< FluidSystem, Indices, Scalar > & baseif_
 
OffDiagMatWell duneB_
 
OffDiagMatWell duneC_
 
DiagMatWell duneD_
 
std::shared_ptr< Dune::UMFPack< DiagMatWell > > duneDSolver_
 solver for diagonal matrix More...
 
BVectorWell resWell_
 
std::vector< std::array< double, numWellEq > > primary_variables_
 
std::vector< std::array< EvalWell, numWellEq > > primary_variables_evaluation_
 
std::vector< int > upwinding_segments_
 
std::vector< EvalWell > segment_densities_
 
std::vector< EvalWell > segment_mass_rates_
 
std::vector< EvalWell > segment_viscosities_
 
std::vector< std::vector< EvalWell > > segment_phase_densities_
 
std::vector< std::vector< EvalWell > > segment_phase_fractions_
 
std::vector< std::vector< EvalWell > > segment_phase_viscosities_
 
std::vector< double > cell_perforation_depth_diffs_
 
std::vector< double > cell_perforation_pressure_diffs_
 
- Protected Attributes inherited from Opm::MultisegmentWellGeneric< Scalar >
const WellInterfaceGenericbaseif_
 
std::vector< std::vector< int > > segment_perforations_
 
std::vector< std::vector< int > > segment_inlets_
 
std::vector< double > segment_depth_diffs_
 
std::vector< double > perforation_segment_depth_diffs_
 

Static Protected Attributes

static constexpr bool has_water = (Indices::waterSaturationIdx >= 0)
 
static constexpr bool has_gas = (Indices::compositionSwitchIdx >= 0)
 
static constexpr bool has_oil = (Indices::numPhases - has_gas - has_water) > 0
 
static constexpr bool has_wfrac_variable = has_water && Indices::numPhases > 1
 
static constexpr bool has_gfrac_variable = has_gas && has_oil
 
static constexpr int WQTotal = 0
 
static constexpr int WFrac = has_wfrac_variable ? 1 : -1000
 
static constexpr int GFrac = has_gfrac_variable ? has_wfrac_variable + 1 : -1000
 
static constexpr int SPres = has_wfrac_variable + has_gfrac_variable + 1
 
static constexpr int numWellEq = Indices::numPhases + 1
 

Member Data Documentation

◆ duneDSolver_

template<typename FluidSystem , typename Indices , typename Scalar >
std::shared_ptr<Dune::UMFPack<DiagMatWell> > Opm::MultisegmentWellEval< FluidSystem, Indices, Scalar >::duneDSolver_
mutableprotected

solver for diagonal matrix

This is a shared_ptr as MultisegmentWell is copied in computeWellPotentials...


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