My Project
WellHelpers.hpp
1/*
2 Copyright 2016 SINTEF ICT, Applied Mathematics.
3 Copyright 2016 Statoil ASA.
4 Copyright 2020 OPM-OP AS.
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22
23#ifndef OPM_WELLHELPERS_HEADER_INCLUDED
24#define OPM_WELLHELPERS_HEADER_INCLUDED
25
26#include <dune/istl/bcrsmatrix.hh>
27#include <dune/common/dynmatrix.hh>
28
29#include <array>
30
31namespace Opm {
32
33class ParallelWellInfo;
34
35namespace wellhelpers {
36
47template<typename Scalar>
49{
50public:
51 using Block = Dune::DynamicMatrix<Scalar>;
52 using Matrix = Dune::BCRSMatrix<Block>;
53
54 ParallelStandardWellB(const Matrix& B, const ParallelWellInfo& parallel_well_info);
55
57 template<class X, class Y>
58 void mv (const X& x, Y& y) const;
59
61 template<class X, class Y>
62 void mmv (const X& x, Y& y) const;
63
64private:
65 const Matrix& B_;
66 const ParallelWellInfo& parallel_well_info_;
67};
68
69double computeHydrostaticCorrection(const double well_ref_depth,
70 const double vfp_ref_depth,
71 const double rho, const double gravity);
72
73
75template<typename Scalar, typename Comm>
76void sumDistributedWellEntries(Dune::DynamicMatrix<Scalar>& mat,
77 Dune::DynamicVector<Scalar>& vec,
78 const Comm& comm);
79
80
81// explicit transpose of a dense matrix due to compilation problems
82// used for calculating quasiimpes well weights
83template <class DenseMatrix>
84DenseMatrix transposeDenseDynMatrix(const DenseMatrix& M);
85
86} // namespace wellhelpers
87} // namespace Opm
88
89#endif
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:243
A wrapper around the B matrix for distributed wells.
Definition: WellHelpers.hpp:49
void mv(const X &x, Y &y) const
y = A x
Definition: WellHelpers.cpp:45
void mmv(const X &x, Y &y) const
y = A x
Definition: WellHelpers.cpp:102
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27