My Project
Loading...
Searching...
No Matches
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
58 void setVapPars(const Scalar, const Scalar)
59 {
60 }
61
65 void setReferenceDensities(unsigned regionIdx,
66 Scalar rhoRefOil,
67 Scalar /*rhoRefGas*/,
68 Scalar /*rhoRefWater*/)
69 {
70 oilReferenceDensity_[regionIdx] = rhoRefOil;
71 }
72
83 void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction& invBo)
84 { inverseOilB_[regionIdx] = invBo; }
85
91 void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction& muo)
92 { oilMu_[regionIdx] = muo; }
93
97 void initEnd();
98
102 unsigned numRegions() const
103 { return inverseOilBMu_.size(); }
104
108 template <class Evaluation>
109 Evaluation internalEnergy(unsigned,
110 const Evaluation&,
111 const Evaluation&,
112 const Evaluation&) const
113 {
114 throw std::runtime_error("Requested the enthalpy of oil but the thermal option is not enabled");
115 }
116
120 template <class Evaluation>
121 Evaluation viscosity(unsigned regionIdx,
122 const Evaluation& temperature,
123 const Evaluation& pressure,
124 const Evaluation& /*Rs*/) const
125 { return saturatedViscosity(regionIdx, temperature, pressure); }
126
130 template <class Evaluation>
131 Evaluation saturatedViscosity(unsigned regionIdx,
132 const Evaluation& /*temperature*/,
133 const Evaluation& pressure) const
134 {
135 const Evaluation& invBo = inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true);
136 const Evaluation& invMuoBo = inverseOilBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
137
138 return invBo/invMuoBo;
139 }
140
144 template <class Evaluation>
145 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
146 const Evaluation& /*temperature*/,
147 const Evaluation& pressure,
148 const Evaluation& /*Rs*/) const
149 { return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
150
156 template <class Evaluation>
157 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
158 const Evaluation& /*temperature*/,
159 const Evaluation& pressure) const
160 { return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
161
165 template <class Evaluation>
166 Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
167 const Evaluation& /*temperature*/,
168 const Evaluation& /*pressure*/) const
169 { return 0.0; /* this is dead oil! */ }
170
174 template <class Evaluation>
175 Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
176 const Evaluation& /*temperature*/,
177 const Evaluation& /*pressure*/,
178 const Evaluation& /*oilSaturation*/,
179 const Evaluation& /*maxOilSaturation*/) const
180 { return 0.0; /* this is dead oil! */ }
181
188 template <class Evaluation>
189 Evaluation saturationPressure(unsigned /*regionIdx*/,
190 const Evaluation& /*temperature*/,
191 const Evaluation& /*Rs*/) const
192 { return 0.0; /* this is dead oil, so there isn't any meaningful saturation pressure! */ }
193
194 template <class Evaluation>
195 Evaluation saturatedGasMassFraction(unsigned /*regionIdx*/,
196 const Evaluation& /*temperature*/,
197 const Evaluation& /*pressure*/) const
198 { return 0.0; /* this is dead oil! */ }
199
200 template <class Evaluation>
201 Evaluation saturatedGasMoleFraction(unsigned /*regionIdx*/,
202 const Evaluation& /*temperature*/,
203 const Evaluation& /*pressure*/) const
204 { return 0.0; /* this is dead oil! */ }
205
206 template <class Evaluation>
207 Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
208 const Evaluation& /*pressure*/,
209 unsigned /*compIdx*/) const
210 {
211 throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
212 }
213
214 Scalar oilReferenceDensity(unsigned regionIdx) const
215 { return oilReferenceDensity_[regionIdx]; }
216
217 const std::vector<TabulatedOneDFunction>& inverseOilB() const
218 { return inverseOilB_; }
219
220 const std::vector<TabulatedOneDFunction>& oilMu() const
221 { return oilMu_; }
222
223 const std::vector<TabulatedOneDFunction>& inverseOilBMu() const
224 { return inverseOilBMu_; }
225
226private:
227 std::vector<Scalar> oilReferenceDensity_;
228 std::vector<TabulatedOneDFunction> inverseOilB_;
229 std::vector<TabulatedOneDFunction> oilMu_;
230 std::vector<TabulatedOneDFunction> inverseOilBMu_;
231};
232
233} // namespace Opm
234
235#endif
Implements a linearly interpolated scalar function that depends on one variable.
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:91
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition DeadOilPvt.hpp:166
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition DeadOilPvt.hpp:83
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:121
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DeadOilPvt.hpp:65
void initEnd()
Finish initializing the oil phase PVT properties.
Definition DeadOilPvt.cpp:92
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:131
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:109
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of saturated oil.
Definition DeadOilPvt.hpp:157
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:189
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition DeadOilPvt.hpp:145
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition DeadOilPvt.hpp:102
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:175
Definition EclipseState.hpp:63
Definition Schedule.hpp:88
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