My Project
DeadOilPvt.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
27#ifndef OPM_DEAD_OIL_PVT_HPP
28#define OPM_DEAD_OIL_PVT_HPP
29
31
32namespace Opm {
33
34#if HAVE_ECL_INPUT
35class EclipseState;
36class Schedule;
37#endif
38
43template <class Scalar>
45{
46public:
48
49#if HAVE_ECL_INPUT
53 void initFromState(const EclipseState& eclState, const Schedule&);
54#endif // HAVE_ECL_INPUT
55
56 void setNumRegions(size_t numRegions);
57
61 void setReferenceDensities(unsigned regionIdx,
62 Scalar rhoRefOil,
63 Scalar /*rhoRefGas*/,
64 Scalar /*rhoRefWater*/)
65 {
66 oilReferenceDensity_[regionIdx] = rhoRefOil;
67 }
68
79 void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction& invBo)
80 { inverseOilB_[regionIdx] = invBo; }
81
87 void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction& muo)
88 { oilMu_[regionIdx] = muo; }
89
93 void initEnd();
94
98 unsigned numRegions() const
99 { return inverseOilBMu_.size(); }
100
104 template <class Evaluation>
105 Evaluation internalEnergy(unsigned,
106 const Evaluation&,
107 const Evaluation&,
108 const Evaluation&) const
109 {
110 throw std::runtime_error("Requested the enthalpy of oil but the thermal option is not enabled");
111 }
112
116 template <class Evaluation>
117 Evaluation viscosity(unsigned regionIdx,
118 const Evaluation& temperature,
119 const Evaluation& pressure,
120 const Evaluation& /*Rs*/) const
121 { return saturatedViscosity(regionIdx, temperature, pressure); }
122
126 template <class Evaluation>
127 Evaluation saturatedViscosity(unsigned regionIdx,
128 const Evaluation& /*temperature*/,
129 const Evaluation& pressure) const
130 {
131 const Evaluation& invBo = inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true);
132 const Evaluation& invMuoBo = inverseOilBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
133
134 return invBo/invMuoBo;
135 }
136
140 template <class Evaluation>
141 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
142 const Evaluation& /*temperature*/,
143 const Evaluation& pressure,
144 const Evaluation& /*Rs*/) const
145 { return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
146
152 template <class Evaluation>
153 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
154 const Evaluation& /*temperature*/,
155 const Evaluation& pressure) const
156 { return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
157
161 template <class Evaluation>
162 Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
163 const Evaluation& /*temperature*/,
164 const Evaluation& /*pressure*/) const
165 { return 0.0; /* this is dead oil! */ }
166
170 template <class Evaluation>
171 Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
172 const Evaluation& /*temperature*/,
173 const Evaluation& /*pressure*/,
174 const Evaluation& /*oilSaturation*/,
175 const Evaluation& /*maxOilSaturation*/) const
176 { return 0.0; /* this is dead oil! */ }
177
184 template <class Evaluation>
185 Evaluation saturationPressure(unsigned /*regionIdx*/,
186 const Evaluation& /*temperature*/,
187 const Evaluation& /*Rs*/) const
188 { return 0.0; /* this is dead oil, so there isn't any meaningful saturation pressure! */ }
189
190 template <class Evaluation>
191 Evaluation saturatedGasMassFraction(unsigned /*regionIdx*/,
192 const Evaluation& /*temperature*/,
193 const Evaluation& /*pressure*/) const
194 { return 0.0; /* this is dead oil! */ }
195
196 template <class Evaluation>
197 Evaluation saturatedGasMoleFraction(unsigned /*regionIdx*/,
198 const Evaluation& /*temperature*/,
199 const Evaluation& /*pressure*/) const
200 { return 0.0; /* this is dead oil! */ }
201
202 template <class Evaluation>
203 Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
204 const Evaluation& /*pressure*/,
205 unsigned /*compIdx*/) const
206 {
207 throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
208 }
209
210 Scalar oilReferenceDensity(unsigned regionIdx) const
211 { return oilReferenceDensity_[regionIdx]; }
212
213 const std::vector<TabulatedOneDFunction>& inverseOilB() const
214 { return inverseOilB_; }
215
216 const std::vector<TabulatedOneDFunction>& oilMu() const
217 { return oilMu_; }
218
219 const std::vector<TabulatedOneDFunction>& inverseOilBMu() const
220 { return inverseOilBMu_; }
221
222private:
223 std::vector<Scalar> oilReferenceDensity_;
224 std::vector<TabulatedOneDFunction> inverseOilB_;
225 std::vector<TabulatedOneDFunction> oilMu_;
226 std::vector<TabulatedOneDFunction> inverseOilBMu_;
227};
228
229} // namespace Opm
230
231#endif
This class represents the Pressure-Volume-Temperature relations of the oil phase without dissolved ga...
Definition: DeadOilPvt.hpp:45
void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction &muo)
Initialize the viscosity of the oil phase.
Definition: DeadOilPvt.hpp:87
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition: DeadOilPvt.hpp:162
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition: DeadOilPvt.hpp:79
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: DeadOilPvt.hpp:117
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: DeadOilPvt.hpp:61
void initEnd()
Finish initializing the oil phase PVT properties.
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of gas saturated oil given a pressure.
Definition: DeadOilPvt.hpp:127
Evaluation internalEnergy(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of oil given a set of parameters.
Definition: DeadOilPvt.hpp:105
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of saturated oil.
Definition: DeadOilPvt.hpp:153
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the oil phase [Pa] depending on its mass fraction of the gas compo...
Definition: DeadOilPvt.hpp:185
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition: DeadOilPvt.hpp:141
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: DeadOilPvt.hpp:98
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition: DeadOilPvt.hpp:171
Definition: EclipseState.hpp:55
Definition: Schedule.hpp:130
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:51
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30