22 #ifndef OPM_MULTISEGMENTWELL_EQUATIONS_HEADER_INCLUDED 23 #define OPM_MULTISEGMENTWELL_EQUATIONS_HEADER_INCLUDED 25 #include <opm/simulators/utils/ParallelCommunication.hpp> 26 #include <opm/simulators/wells/ParallelWellInfo.hpp> 27 #include <opm/simulators/wells/MSWellHelpers.hpp> 28 #include <dune/common/fmatrix.hh> 29 #include <dune/common/fvector.hh> 30 #include <dune/istl/bcrsmatrix.hh> 31 #include <dune/istl/bvector.hh> 34 #include <type_traits> 37 template<
class M>
class UMFPack;
43 template<
class Scalar,
typename IndexTraits,
int numWellEq,
int numEq>
class MultisegmentWellEquationAccess;
45 #if COMPILE_GPU_BRIDGE 49 template<
typename Scalar,
typename IndexTraits>
class WellState;
51 template<
class Scalar,
typename IndexTraits,
int numWellEq,
int numEq>
60 using VectorBlockWellType = Dune::FieldVector<Scalar,numWellEq>;
61 using BVectorWell = Dune::BlockVector<VectorBlockWellType>;
63 using VectorBlockType = Dune::FieldVector<Scalar,numEq>;
64 using BVector = Dune::BlockVector<VectorBlockType>;
67 using DiagMatrixBlockWellType = Dune::FieldMatrix<Scalar,numWellEq,numWellEq>;
68 using DiagMatWell = Dune::BCRSMatrix<DiagMatrixBlockWellType>;
71 using OffDiagMatrixBlockWellType = Dune::FieldMatrix<Scalar,numWellEq,numEq>;
72 using OffDiagMatWell = Dune::BCRSMatrix<OffDiagMatrixBlockWellType>;
82 void init(
const int numPerfs,
83 const std::vector<int>& cells,
84 const std::vector<std::vector<int>>& segment_inlets,
85 const std::vector<std::vector<int>>& segment_perforations,
92 void apply(
const BVector& x, BVector& Ax)
const;
95 void apply(BVector& r)
const;
101 BVectorWell
solve()
const;
104 BVectorWell
solve(
const BVectorWell& rhs)
const;
110 #if COMPILE_GPU_BRIDGE 116 template<
class SparseMatrixAdapter>
117 void extract(SparseMatrixAdapter& jacobian)
const;
120 template<
class PressureMatrix>
122 const BVector& weights,
123 const int pressureVarIndex,
126 const int seg_pressure_var_ind,
141 OffDiagMatWell duneB_;
142 OffDiagMatWell duneC_;
150 using UMFPackSolver = std::conditional_t<std::is_same_v<Scalar,double>,
151 std::shared_ptr<Dune::UMFPack<DiagMatWell>>,
153 mutable UMFPackSolver duneDSolver_;
156 BVectorWell resWell_;
158 const MultisegmentWellGeneric<Scalar, IndexTraits>& well_;
161 std::vector<int> cells_;
164 mswellhelpers::ParallellMSWellB<OffDiagMatWell> parallelB_;
169 #endif // OPM_MULTISEGMENTWELLWELL_EQUATIONS_HEADER_INCLUDED void createSolver()
Compute the LU-decomposition of D matrix.
Definition: MultisegmentWellEquations.cpp:195
Definition: fvbaseprimaryvariables.hh:161
void init(const int numPerfs, const std::vector< int > &cells, const std::vector< std::vector< int >> &segment_inlets, const std::vector< std::vector< int >> &segment_perforations, const ParallelWellInfo< Scalar > ¶llel_well_info)
Setup sparsity pattern for the matrices.
Definition: MultisegmentWellEquations.cpp:62
Definition: MultisegmentWellAssemble.hpp:34
void extract(SparseMatrixAdapter &jacobian) const
Add the matrices of this well to the sparse matrix adapter.
Definition: MultisegmentWellEquations.cpp:333
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
BVectorWell solve() const
Apply inverted D matrix to residual and return result.
Definition: MultisegmentWellEquations.cpp:215
void recoverSolutionWell(const BVector &x, BVectorWell &xw) const
Recover well solution.
Definition: MultisegmentWellEquations.cpp:245
void extractCPRPressureMatrix(PressureMatrix &jacobian, const BVector &weights, const int pressureVarIndex, const bool, const WellInterfaceGeneric< Scalar, IndexTraits > &well, const int seg_pressure_var_ind, const WellState< Scalar, IndexTraits > &well_state) const
Extract CPR pressure matrix.
Definition: MultisegmentWellEquations.cpp:372
Class encapsulating some information about parallel wells.
Definition: MSWellHelpers.hpp:34
const BVectorWell & residual() const
Returns a const reference to the residual.
Definition: MultisegmentWellEquations.hpp:133
This class serves to eliminate the need to include the WellContributions into the matrix (with –matr...
Definition: GpuBridge.hpp:30
Class administering assembler access to equation system.
Definition: MultisegmentWellAssemble.cpp:45
Definition: MultisegmentWellEquations.hpp:44
void clear()
Set all coefficients to 0.
Definition: MultisegmentWellEquations.cpp:141
void apply(const BVector &x, BVector &Ax) const
Apply linear operator to vector.
Definition: MultisegmentWellEquations.cpp:154
Definition: BlackoilWellModelGeneric.hpp:75
void sumDistributed(Parallel::Communication comm)
Sum with off-process contribution.
Definition: MultisegmentWellEquations.cpp:457
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: TemperatureModel.hpp:61