My Project
StandardWellConnections.hpp
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2016 - 2017 IRIS 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_STANDARDWELL_CONNECTIONS_HEADER_INCLUDED
24#define OPM_STANDARDWELL_CONNECTIONS_HEADER_INCLUDED
25
26#include <functional>
27#include <vector>
28
29namespace Opm
30{
31
32class DeferredLogger;
33template<class FluidSystem, class Indices, class Scalar> class WellInterfaceIndices;
34class WellState;
35
36template<class FluidSystem, class Indices, class Scalar>
38{
39public:
41
42 void computePropertiesForPressures(const WellState& well_state,
43 const std::function<Scalar(int,int)>& getTemperature,
44 const std::function<Scalar(int)>& getSaltConcentration,
45 const std::function<int(int)>& pvtRegionIdx,
46 const std::function<Scalar(int)>& solventInverseFormationVolumeFactor,
47 const std::function<Scalar(int)>& solventRefDensity,
48 std::vector<Scalar>& b_perf,
49 std::vector<Scalar>& rsmax_perf,
50 std::vector<Scalar>& rvmax_perf,
51 std::vector<Scalar>& rvwmax_perf,
52 std::vector<Scalar>& rswmax_perf,
53 std::vector<Scalar>& surf_dens_perf) const;
54
56 void computeProperties(const WellState& well_state,
57 const std::function<Scalar(int,int)>& invB,
58 const std::function<Scalar(int,int)>& mobility,
59 const std::function<Scalar(int)>& solventInverseFormationVolumeFactor,
60 const std::function<Scalar(int)>& solventMobility,
61 const std::vector<Scalar>& b_perf,
62 const std::vector<Scalar>& rsmax_perf,
63 const std::vector<Scalar>& rvmax_perf,
64 const std::vector<Scalar>& rvwmax_perf,
65 const std::vector<Scalar>& rswmax_perf,
66 const std::vector<Scalar>& surf_dens_perf,
67 DeferredLogger& deferred_logger);
68
70 Scalar rho() const
71 {
72 return this->perf_densities_.empty() ? 0.0 : perf_densities_[0];
73 }
74
76 Scalar pressure_diff(const unsigned perf) const
77 { return perf_pressure_diffs_[perf]; }
78
79private:
80 void computePressureDelta();
81
82 // TODO: not total sure whether it is a good idea to put this function here
83 // the major reason to put here is to avoid the usage of Wells struct
84 void computeDensities(const std::vector<Scalar>& perfComponentRates,
85 const std::vector<Scalar>& b_perf,
86 const std::vector<Scalar>& rsmax_perf,
87 const std::vector<Scalar>& rvmax_perf,
88 const std::vector<Scalar>& rvwmax_perf,
89 const std::vector<Scalar>& rswmax_perf,
90 const std::vector<Scalar>& surf_dens_perf,
91 DeferredLogger& deferred_logger);
92
94
95 std::vector<Scalar> perf_densities_;
96 std::vector<Scalar> perf_pressure_diffs_;
97};
98
99}
100
101#endif // OPM_STANDARDWELL_CONNECTIONS_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: StandardWellConnections.hpp:38
Scalar rho() const
Returns density for first perforation.
Definition: StandardWellConnections.hpp:70
Scalar pressure_diff(const unsigned perf) const
Returns pressure drop for a given perforation.
Definition: StandardWellConnections.hpp:76
void computeProperties(const WellState &well_state, const std::function< Scalar(int, int)> &invB, const std::function< Scalar(int, int)> &mobility, const std::function< Scalar(int)> &solventInverseFormationVolumeFactor, const std::function< Scalar(int)> &solventMobility, const std::vector< Scalar > &b_perf, const std::vector< Scalar > &rsmax_perf, const std::vector< Scalar > &rvmax_perf, const std::vector< Scalar > &rvwmax_perf, const std::vector< Scalar > &rswmax_perf, const std::vector< Scalar > &surf_dens_perf, DeferredLogger &deferred_logger)
Compute connection properties (densities, pressure drop, ...)
Definition: StandardWellConnections.cpp:477
Definition: WellInterfaceIndices.hpp:33
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: WellState.hpp:60
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27