ReservoirPropertyFixedMobility.hpp
Go to the documentation of this file.
1//===========================================================================
2//
3// File: ReservoirPropertyFixedMobility.hpp
4//
5// Created: Thu Apr 15 14:50:22 2010
6//
7// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
8// Jostein R Natvig <jostein.r.natvig@sintef.no>
9//
10// $Date$
11//
12// $Revision$
13//
14//===========================================================================
15
16/*
17 Copyright 2010 SINTEF ICT, Applied Mathematics.
18 Copyright 2010 Statoil ASA.
19
20 This file is part of The Open Reservoir Simulator Project (OpenRS).
21
22 OpenRS is free software: you can redistribute it and/or modify
23 it under the terms of the GNU General Public License as published by
24 the Free Software Foundation, either version 3 of the License, or
25 (at your option) any later version.
26
27 OpenRS is distributed in the hope that it will be useful,
28 but WITHOUT ANY WARRANTY; without even the implied warranty of
29 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 GNU General Public License for more details.
31
32 You should have received a copy of the GNU General Public License
33 along with OpenRS. If not, see <http://www.gnu.org/licenses/>.
34*/
35
36#ifndef OPENRS_RESERVOIRPROPERTYFIXEDMOBILITY_HEADER
37#define OPENRS_RESERVOIRPROPERTYFIXEDMOBILITY_HEADER
38
39
40#include <vector>
41
42
43namespace Opm {
44
45 template <class Mobility>
47 public:
48 ReservoirPropertyFixedMobility(const std::vector<Mobility>& mobs)
49 : mobs_(mobs)
50 {
51 }
52
53 enum { NumberOfPhases = 2 };
54
55 template<class Vector>
56 void phaseMobilities(int cell_index, double /*saturation*/, Vector& mobility) const
57 {
58 mobility[0] = mobs_[cell_index].mob;
59 mobility[1] = 0.0;
60 }
61
62 template <class ActualMobType>
63 void phaseMobility(int phase, int cell_index, double /*saturation*/, ActualMobType& mobility) const
64 {
65 if (phase == 0)
66 mobility = mobs_[cell_index].mob;
67 else
68 zero(mobility);
69 }
70
71 template<class Vector>
72 void phaseDensities(int /*cell_index*/, Vector& rho) const
73 {
74 rho[0] = 1.0;
75 rho[1] = 0.0;
76 }
77 private:
78 const std::vector<Mobility>& mobs_;
79 };
80}
81
82
83#endif // OPENRS_RESERVOIRPROPERTYFIXEDMOBILITY_HEADER
Definition: ReservoirPropertyFixedMobility.hpp:46
void phaseMobilities(int cell_index, double, Vector &mobility) const
Definition: ReservoirPropertyFixedMobility.hpp:56
@ NumberOfPhases
Definition: ReservoirPropertyFixedMobility.hpp:53
ReservoirPropertyFixedMobility(const std::vector< Mobility > &mobs)
Definition: ReservoirPropertyFixedMobility.hpp:48
void phaseDensities(int, Vector &rho) const
Definition: ReservoirPropertyFixedMobility.hpp:72
void phaseMobility(int phase, int cell_index, double, ActualMobType &mobility) const
Definition: ReservoirPropertyFixedMobility.hpp:63
Definition: BlackoilFluid.hpp:32
void zero(Matrix &A)
Zero-fill a.
Definition: Matrix.hpp:603