23#ifndef OPM_STANDARDWELL_EQUATIONS_HEADER_INCLUDED
24#define OPM_STANDARDWELL_EQUATIONS_HEADER_INCLUDED
26#include <opm/simulators/utils/ParallelCommunication.hpp>
27#include <opm/simulators/wells/WellHelpers.hpp>
28#include <opm/common/TimingMacros.hpp>
29#include <dune/common/dynmatrix.hh>
30#include <dune/common/dynvector.hh>
31#include <dune/istl/bcrsmatrix.hh>
32#include <dune/istl/bvector.hh>
37template<
class Scalar>
class ParallelWellInfo;
45template<
class Scalar,
int numEq>
54 using VectorBlockWellType = Dune::DynamicVector<Scalar>;
55 using BVectorWell = Dune::BlockVector<VectorBlockWellType>;
58 using DiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>;
59 using DiagMatWell = Dune::BCRSMatrix<DiagMatrixBlockWellType>;
62 using OffDiagMatrixBlockWellType = Dune::DynamicMatrix<Scalar>;
63 using OffDiagMatWell = Dune::BCRSMatrix<OffDiagMatrixBlockWellType>;
66 using BVector = Dune::BlockVector<Dune::FieldVector<Scalar,numEq>>;
74 void init(
const int numWellEq,
76 const std::vector<int>& cells);
82 void apply(
const BVector& x, BVector& Ax)
const;
85 void apply(BVector& r)
const;
88 void solve(BVectorWell& dx_well)
const;
91 void solve(
const BVectorWell& rhs_well, BVectorWell& x_well)
const;
100#if COMPILE_BDA_BRIDGE
102 void extract(
const int numStaticWellEq,
107 template<
class SparseMatrixAdapter>
108 void extract(SparseMatrixAdapter& jacobian)
const;
111 template<
class PressureMatrix>
113 const BVector& weights,
114 const int pressureVarIndex,
115 const bool use_well_weights,
117 const int bhp_var_index,
136 OffDiagMatWell duneB_;
137 OffDiagMatWell duneC_;
139 DiagMatWell invDuneD_;
146 BVectorWell resWell_;
149 mutable BVectorWell Bx_;
150 mutable BVectorWell invDrw_;
153 std::vector<int> cells_;
Class encapsulating some information about parallel wells.
Definition WGState.hpp:31
Class administering assembler access to equation system.
Definition StandardWellEquations.hpp:38
Definition StandardWellEquations.hpp:47
const BVectorWell & residual() const
Returns a const reference to the residual.
Definition StandardWellEquations.hpp:127
void extract(SparseMatrixAdapter &jacobian) const
Add the matrices of this well to the sparse matrix adapter.
Definition StandardWellEquations.cpp:254
void invert()
Invert D matrix.
Definition StandardWellEquations.cpp:158
void extractCPRPressureMatrix(PressureMatrix &jacobian, const BVector &weights, const int pressureVarIndex, const bool use_well_weights, const WellInterfaceGeneric< Scalar > &well, const int bhp_var_index, const WellState< Scalar > &well_state) const
Extract CPR pressure matrix.
Definition StandardWellEquations.cpp:291
void apply(const BVector &x, BVector &Ax) const
Apply linear operator to vector.
Definition StandardWellEquations.cpp:128
unsigned int getNumBlocks() const
Get the number of blocks of the C and B matrices.
Definition StandardWellEquations.cpp:283
void sumDistributed(Parallel::Communication comm)
Sum with off-process contribution.
Definition StandardWellEquations.cpp:404
void solve(BVectorWell &dx_well) const
Apply inverted D matrix to residual and store in vector.
Definition StandardWellEquations.cpp:173
void recoverSolutionWell(const BVector &x, BVectorWell &xw) const
Recover well solution.
Definition StandardWellEquations.cpp:186
void init(const int numWellEq, const int numPerfs, const std::vector< int > &cells)
Setup sparsity pattern for the matrices.
Definition StandardWellEquations.cpp:55
void clear()
Set all coefficients to 0.
Definition StandardWellEquations.cpp:119
This class serves to eliminate the need to include the WellContributions into the matrix (with –matri...
Definition StandardWellEval.hpp:41
Definition WellTest.hpp:37
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:62
A wrapper around the B matrix for distributed wells.
Definition WellHelpers.hpp:51
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37