opm-simulators
Loading...
Searching...
No Matches
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 <cstdint>
30
31namespace Opm {
32
33template<class Scalar> class ParallelWellInfo;
34struct WellProductionControls;
35struct WellInjectionControls;
36enum class WellProducerCMode : std::uint16_t;
37enum class WellInjectorCMode : std::uint16_t;
38
39namespace wellhelpers {
40
51template<typename Scalar>
52class ParallelStandardWellB
53{
54public:
55 using Block = Dune::DynamicMatrix<Scalar>;
56 using Matrix = Dune::BCRSMatrix<Block>;
57
58 ParallelStandardWellB(const Matrix& B,
59 const ParallelWellInfo<Scalar>& parallel_well_info);
60
62 template<class X, class Y>
63 void mv (const X& x, Y& y) const;
64
66 template<class X, class Y>
67 void mmv (const X& x, Y& y) const;
68
69private:
70 const Matrix& B_;
71 const ParallelWellInfo<Scalar>& parallel_well_info_;
72};
73
74template<class Scalar>
75Scalar computeHydrostaticCorrection(const Scalar well_ref_depth,
76 const Scalar vfp_ref_depth,
77 const Scalar rho,
78 const Scalar gravity);
79
81template<typename MatrixType, typename VectorType, typename Comm>
82void sumDistributedWellEntries(MatrixType& mat,
83 VectorType& vec,
84 const Comm& comm);
85
86
87// explicit transpose of a dense matrix due to compilation problems
88// used for calculating quasiimpes well weights
89template <class DenseMatrix>
90DenseMatrix transposeDenseDynMatrix(const DenseMatrix& M);
91
93bool rateControlWithZeroProdTarget(const WellProductionControls& controls,
94 WellProducerCMode mode);
95
97bool rateControlWithZeroInjTarget(const WellInjectionControls& controls,
98 WellInjectorCMode mode);
99
100} // namespace wellhelpers
101} // namespace Opm
102
103#endif
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:198
void mv(const X &x, Y &y) const
y = A x
Definition WellHelpers.cpp:52
void mmv(const X &x, Y &y) const
y = A x
Definition WellHelpers.cpp:109
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45