My Project
Loading...
Searching...
No Matches
MSWellHelpers.hpp
1
/*
2
Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3
Copyright 2017 Statoil ASA.
4
Copyright 2020 Equinor ASA.
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_MSWELLHELPERS_HEADER_INCLUDED
24
#define OPM_MSWELLHELPERS_HEADER_INCLUDED
25
26
#include <dune/istl/matrix.hh>
27
28
namespace
Dune {
29
template
<
class
Matrix>
class
UMFPack
;
30
}
31
32
namespace
Opm
{
33
34
class
DeferredLogger;
35
class
SICD
;
36
37
namespace
mswellhelpers
38
{
39
41
template
<
typename
MatrixType,
typename
VectorType>
42
VectorType
43
applyUMFPack(
Dune::UMFPack<MatrixType>
&
linsolver
,
44
VectorType x);
45
46
47
49
template
<
typename
VectorType,
typename
MatrixType>
50
Dune::Matrix<typename MatrixType::block_type>
51
invertWithUMFPack(
const
int
size,
52
const
int
bsize
,
53
Dune::UMFPack<MatrixType>
&
linsolver
);
54
55
56
57
// obtain y = D^-1 * x with a BICSSTAB iterative solver
58
template
<
typename
MatrixType,
typename
VectorType>
59
VectorType
60
invDX(
const
MatrixType& D, VectorType x, DeferredLogger&
deferred_logger
);
61
62
// calculating the friction pressure loss
63
// l is the segment length
64
// area is the segment cross area
65
// diameter is the segment inner diameter
66
// w is mass flow rate through the segment
67
// density is density
68
// roughness is the absolute roughness
69
// mu is the average phase viscosity
70
template
<
typename
ValueType,
typename
Scalar>
71
ValueType
frictionPressureLoss(
const
Scalar
l
,
const
Scalar
diameter
,
72
const
Scalar area,
const
Scalar
roughness
,
73
const
ValueType
& density,
74
const
ValueType
&