23#ifndef OPM_STANDARDWELL_GENERIC_HEADER_INCLUDED
24#define OPM_STANDARDWELL_GENERIC_HEADER_INCLUDED
26#include <dune/common/dynmatrix.hh>
27#include <dune/common/dynvector.hh>
28#include <dune/istl/bcrsmatrix.hh>
29#include <dune/istl/bvector.hh>
31#include <opm/simulators/wells/WellHelpers.hpp>
40class ConvergenceReport;
42class ParallelWellInfo;
45class WellInterfaceGeneric;
57 using VectorBlockWellType = Dune::DynamicVector<Scalar>;
58 using BVectorWell = Dune::BlockVector<VectorBlockWellType>;
61 using DiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>;
62 using DiagMatWell = Dune::BCRSMatrix<DiagMatrixBlockWellType>;
65 using OffDiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>;
66 using OffDiagMatWell = Dune::BCRSMatrix<OffDiagMatrixBlockWellType>;
77 static double relaxationFactorRate(
const std::vector<double>& primary_variables,
78 const BVectorWell& dwells);
81 static double relaxationFactorFraction(
const double old_value,
84 double calculateThpFromBhp(
const WellState& well_state,
85 const std::vector<double>& rates,
90 void checkConvergenceControlEq(
const WellState& well_state,
93 const double max_residual_allowed)
const;
95 void checkConvergencePolyMW(
const std::vector<double>& res,
97 const double maxResidualAllowed)
const;
99 void computeConnectionPressureDelta();
101 std::optional<double> computeBhpAtThpLimitInj(
const std::function<std::vector<double>(
const double)>& frates,
102 const SummaryState& summary_state,
104 std::optional<double> computeBhpAtThpLimitProdWithAlq(
const std::function<std::vector<double>(
const double)>& frates,
105 const SummaryState& summary_state,
108 double alq_value)
const;
114 BVectorWell resWell_;
117 std::vector<double> perf_densities_;
119 std::vector<double> perf_pressure_diffs_;
122 OffDiagMatWell duneB_;
123 OffDiagMatWell duneC_;
125 DiagMatWell invDuneD_;
132 mutable BVectorWell Bx_;
133 mutable BVectorWell invDrw_;
135 double getRho()
const {
return perf_densities_[0]; }
Represents the convergence status of the whole simulator, to make it possible to query and store the ...
Definition: ConvergenceReport.hpp:36
Definition: DeferredLogger.hpp:57
Definition: StandardWellGeneric.hpp:50
void getNumBlocks(unsigned int &_nnzs) const
get the number of blocks of the C and B matrices, used to allocate memory in a WellContributions obje...
Definition: StandardWellGeneric.cpp:524
Definition: WellInterfaceGeneric.hpp:51
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: WellState.hpp:56
A wrapper around the B matrix for distributed wells.
Definition: WellHelpers.hpp:49
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27