MSWellHelpers.hpp
Go to the documentation of this file.
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
28namespace Dune {
29template<class Matrix> class UMFPack;
30}
31
32namespace Opm {
33
34class DeferredLogger;
35class SICD;
36
37namespace mswellhelpers
38{
39
41 template <typename MatrixType, typename VectorType>
42 VectorType
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& w, const ValueType& mu);
75
76
77 template <typename ValueType, typename Scalar>
78 ValueType valveContrictionPressureLoss(const ValueType& mass_rate,
79 const ValueType& density,
80 const Scalar area_con, const Scalar cv);
81
82
83 template <typename ValueType, typename Scalar>
84 ValueType velocityHead(const Scalar area, const ValueType& mass_rate,
85 const ValueType& density);
86
87
88 // calculating the viscosity of oil-water emulsion at local conditons
89 template <typename ValueType, typename Scalar>
90 ValueType emulsionViscosity(const ValueType& water_fraction,
91 const ValueType& water_viscosity,
92 const ValueType& oil_fraction,
93 const ValueType& oil_viscosity,
94 const SICD& sicd);
95
96} // namespace mswellhelpers
97} // namespace Opm
98
99#endif
Definition: MSWellHelpers.hpp:29
Definition: DeferredLogger.hpp:57
Definition: fvbaseprimaryvariables.hh:141
ValueType velocityHead(const Scalar area, const ValueType &mass_rate, const ValueType &density)
ValueType valveContrictionPressureLoss(const ValueType &mass_rate, const ValueType &density, const Scalar area_con, const Scalar cv)
VectorType applyUMFPack(Dune::UMFPack< MatrixType > &linsolver, VectorType x)
Applies umfpack and checks for singularity.
ValueType frictionPressureLoss(const Scalar l, const Scalar diameter, const Scalar area, const Scalar roughness, const ValueType &density, const ValueType &w, const ValueType &mu)
Dune::Matrix< typename MatrixType::block_type > invertWithUMFPack(const int size, const int bsize, Dune::UMFPack< MatrixType > &linsolver)
Applies umfpack and checks for singularity.
ValueType emulsionViscosity(const ValueType &water_fraction, const ValueType &water_viscosity, const ValueType &oil_fraction, const ValueType &oil_viscosity, const SICD &sicd)
VectorType invDX(const MatrixType &D, VectorType x, DeferredLogger &deferred_logger)
Definition: blackoilboundaryratevector.hh:37