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
32#include <cstddef>
33#include <vector>
34
35namespace Opm {
36
37#if HAVE_ECL_INPUT
38class EclipseState;
39class Schedule;
40#endif
41
46template <class Scalar>
48{
49public:
51
52#if HAVE_ECL_INPUT
56 void initFromState(const EclipseState& eclState, const Schedule&);
57#endif // HAVE_ECL_INPUT
58
59 void setNumRegions(std::size_t numRegions);
60
61 void setVapPars(const Scalar, const Scalar)
62 {
63 }
64
68 void setReferenceDensities(unsigned regionIdx,
69 Scalar rhoRefOil,
70 Scalar /*rhoRefGas*/,
71 Scalar /*rhoRefWater*/)
72 {
73 oilReferenceDensity_[regionIdx] = rhoRefOil;
74 }
75
86 void setInverseOilFormationVolumeFactor(unsigned regionIdx,
87 const TabulatedOneDFunction& invBo)
88 { inverseOilB_[regionIdx] = invBo; }
89
95 void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction& muo)
96 { oilMu_[regionIdx] = muo; }
97
101 void initEnd();
102
106 unsigned numRegions() const
107 { return inverseOilBMu_.size(); }
108
112 template <class Evaluation>
113 Evaluation internalEnergy(unsigned,
114 const Evaluation&,
115 const Evaluation&,
116 const Evaluation&) const
117 {
118 throw std::runtime_error("Requested the enthalpy of oil but the thermal "
119 "option is not enabled");
120 }
121
122 Scalar hVap(unsigned) const
123 {
124 throw std::runtime_error("Requested the hvap of oil but the thermal "
125 "option is not enabled");
126 }
130 template <class Evaluation>
131 Evaluation viscosity(unsigned regionIdx,
132 const Evaluation& temperature,
133 const Evaluation& pressure,
134 const Evaluation& /*Rs*/) const
135 { return saturatedViscosity(regionIdx, temperature, pressure); }
136
140 template <class Evaluation>
141 Evaluation saturatedViscosity(unsigned regionIdx,
142 const Evaluation& /*temperature*/,
143 const Evaluation& pressure) const
144 {
145 const Evaluation& invBo = inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true);
146 const Evaluation& invMuoBo = inverseOilBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
147
148 return invBo / invMuoBo;
149 }
150
154 template <class Evaluation>
155 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
156 const Evaluation& /*temperature*/,
157 const Evaluation& pressure,
158 const Evaluation& /*Rs*/) const
159 { return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
160
166 template <class Evaluation>
167 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
168 const Evaluation& /*temperature*/,
169 const Evaluation& pressure) const
170 { return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
171
175 template <class Evaluation>
176 Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
177 const Evaluation& /*temperature*/,
178 const Evaluation& /*pressure*/) const
179 { return 0.0; /* this is dead oil! */ }
180
184 template <class Evaluation>
185 Evaluation saturatedGasDissolutionFactor(unsigned /*regionIdx*/,
186 const Evaluation& /*temperature*/,
187 const Evaluation& /*pressure*/,
188 const Evaluation& /*oilSaturation*/,
189 const Evaluation& /*maxOilSaturation*/) const
190 { return 0.0; /* this is dead oil! */ }
191
198 template <class Evaluation>
199 Evaluation saturationPressure(unsigned /*regionIdx*/,
200 const Evaluation& /*temperature*/,
201 const Evaluation& /*Rs*/) const
202 { return 0.0; /* this is dead oil, so there isn't any meaningful saturation pressure! */ }
203
204 template <class Evaluation>
205 Evaluation saturatedGasMassFraction(unsigned /*regionIdx*/,
206 const Evaluation& /*temperature*/,
207 const Evaluation& /*pressure*/) const
208 { return 0.0; /* this is dead oil! */ }
209
210 template <class Evaluation>
211 Evaluation saturatedGasMoleFraction(unsigned /*regionIdx*/,
212 const Evaluation& /*temperature*/,
213 const Evaluation& /*pressure*/) const
214 { return 0.0; /* this is dead oil! */ }
215
216 template <class Evaluation>
217 Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
218 const Evaluation& /*pressure*/,
219 unsigned /*compIdx*/) const
220 {
221 throw std::runtime_error("Not implemented: The PVT model does not provide "
222 "a diffusionCoefficient()");
223 }
224
225 Scalar oilReferenceDensity(unsigned regionIdx) const
226 { return oilReferenceDensity_[regionIdx]; }
227
228 const std::vector<TabulatedOneDFunction>& inverseOilB() const
229 { return inverseOilB_; }
230
231 const std::vector<TabulatedOneDFunction>& oilMu() const
232 { return oilMu_; }
233
234 const std::vector<TabulatedOneDFunction>& inverseOilBMu() const
235 { return inverseOilBMu_; }
236
237private:
238 std::vector<Scalar> oilReferenceDensity_{};
239 std::vector<TabulatedOneDFunction> inverseOilB_{};
240 std::vector<TabulatedOneDFunction> oilMu_{};
241 std::vector<TabulatedOneDFunction> inverseOilBMu_{};
242};
243
244} // namespace Opm
245
246#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:48
void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction &muo)
Initialize the viscosity of the oil phase.
Definition DeadOilPvt.hpp:95
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition DeadOilPvt.hpp:176
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition DeadOilPvt.hpp:86
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:131
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DeadOilPvt.hpp:68
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:141
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:113
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of saturated oil.
Definition DeadOilPvt.hpp:167
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:199
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition DeadOilPvt.hpp:155
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition DeadOilPvt.hpp:106
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:185
Definition EclipseState.hpp:63
Definition Schedule.hpp:89
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