ReservoirPropertyCapillary.hpp
Go to the documentation of this file.
1//===========================================================================
2//
3// File: ReservoirPropertyCapillary.hpp
4//
5// Created: Fri Jul 3 12:28:48 2009
6//
7// Author(s): Atgeirr F Rasmussen <atgeirr@sintef.no>
8// Bård Skaflestad <bard.skaflestad@sintef.no>
9//
10// $Date$
11//
12// $Revision$
13//
14//===========================================================================
15
16/*
17 Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
18 Copyright 2009, 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_RESERVOIRPROPERTYCAPILLARY_HEADER
37#define OPENRS_RESERVOIRPROPERTYCAPILLARY_HEADER
38
41#include <array>
42
43namespace Opm
44{
45
48 {
49 double mob;
50 void setToAverage(const ScalarMobility& m1, const ScalarMobility& m2)
51 {
52 mob = 0.5*(m1.mob + m2.mob);
53 }
54 void setToSum(const ScalarMobility& m1, const ScalarMobility& m2)
55 {
56 mob = m1.mob + m2.mob;
57 }
59 {
60 mob = 1.0/m.mob;
61 }
62 template <class Vec>
63 Vec multiply(const Vec& v)
64 {
65 Vec ret(v);
66 ret *= mob;
67 return ret;
68 }
70 {
71 mob *= other.mob;
72 return *this;
73 }
74 };
75
78 template <int dim>
79 class ReservoirPropertyCapillary : public ReservoirPropertyCommon<dim, ReservoirPropertyCapillary<dim>, RockJfunc>
80 {
81 public:
84
89 double mobilityFirstPhase(int cell_index, double saturation) const;
90
95 double mobilitySecondPhase(int cell_index, double saturation) const;
96
102 void phaseMobility(int phase_index, int cell_index, double saturation, double& phase_mob) const;
103
108 double totalMobility(int cell_index, double saturation) const;
109
114 double fractionalFlow(int cell_index, double saturation) const;
115
122 template<class Vector>
123 void phaseMobilities(int cell_index, double saturation, Vector& mobility) const;
124
125 template<class Vector>
126 void phaseMobilitiesDeriv(int c, double s, Vector& dmob) const;
127
129 void computeCflFactors();
130 private:
132 // Methods
133 double relPermFirstPhase(int cell_index, double saturation) const;
134 double relPermSecondPhase(int cell_index, double saturation) const;
135 double relPermFirstPhaseDeriv(int cell_index, double saturation) const;
136 double relPermSecondPhaseDeriv(int cell_index, double saturation) const;
137 void cflFracFlows(int rock, double s, double& ff_first, double& ff_gravity) const;
138 std::array<double, 3> computeSingleRockCflFactors(int rock, double min_perm, double max_poro) const;
139 };
140
141
142} // namespace Opm
143
145
146#endif // OPENRS_RESERVOIRPROPERTYCAPILLARY_HEADER
A property class for incompressible two-phase flow.
Definition: ReservoirPropertyCapillary.hpp:80
void computeCflFactors()
Computes cfl factors. Called from ReservoirPropertyCommon::init().
Definition: ReservoirPropertyCapillary_impl.hpp:254
void phaseMobilities(int cell_index, double saturation, Vector &mobility) const
Mobilities for both phases.
Definition: ReservoirPropertyCapillary_impl.hpp:93
double mobilitySecondPhase(int cell_index, double saturation) const
Mobility of second (oil) phase.
Definition: ReservoirPropertyCapillary_impl.hpp:52
void phaseMobilitiesDeriv(int c, double s, Vector &dmob) const
Definition: ReservoirPropertyCapillary_impl.hpp:104
void phaseMobility(int phase_index, int cell_index, double saturation, double &phase_mob) const
Phase mobility.
Definition: ReservoirPropertyCapillary_impl.hpp:59
ScalarMobility Mobility
The (scalar) mobility type.
Definition: ReservoirPropertyCapillary.hpp:83
double mobilityFirstPhase(int cell_index, double saturation) const
Mobility of first (water) phase.
Definition: ReservoirPropertyCapillary_impl.hpp:45
double totalMobility(int cell_index, double saturation) const
Total mobility.
Definition: ReservoirPropertyCapillary_impl.hpp:74
double fractionalFlow(int cell_index, double saturation) const
Fractional flow (of the first phase).
Definition: ReservoirPropertyCapillary_impl.hpp:83
A property class for incompressible two-phase flow.
Definition: ReservoirPropertyCommon.hpp:59
Definition: RockJfunc.hpp:53
Definition: BlackoilFluid.hpp:32
A wrapper for a scalar.
Definition: ReservoirPropertyCapillary.hpp:48
void setToAverage(const ScalarMobility &m1, const ScalarMobility &m2)
Definition: ReservoirPropertyCapillary.hpp:50
void setToSum(const ScalarMobility &m1, const ScalarMobility &m2)
Definition: ReservoirPropertyCapillary.hpp:54
void setToInverse(const ScalarMobility &m)
Definition: ReservoirPropertyCapillary.hpp:58
ScalarMobility & operator*=(const ScalarMobility &other)
Definition: ReservoirPropertyCapillary.hpp:69
double mob
Definition: ReservoirPropertyCapillary.hpp:49
Vec multiply(const Vec &v)
Definition: ReservoirPropertyCapillary.hpp:63