My Project
Loading...
Searching...
No Matches
DryGasPvt.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_DRY_GAS_PVT_HPP
28#define OPM_DRY_GAS_PVT_HPP
29
31
33
34#include <cstddef>
35#include <vector>
36
37namespace Opm {
38
39#if HAVE_ECL_INPUT
40class EclipseState;
41class Schedule;
42#endif
43
48template <class Scalar>
50{
51 using SamplingPoints = std::vector<std::pair<Scalar, Scalar>>;
52
53public:
55
56#if HAVE_ECL_INPUT
62 void initFromState(const EclipseState& eclState, const Schedule&);
63#endif
64
65 void setNumRegions(std::size_t numRegions);
66
67 void setVapPars(const Scalar, const Scalar)
68 {
69 }
70
74 void setReferenceDensities(unsigned regionIdx,
75 Scalar /*rhoRefOil*/,
76 Scalar rhoRefGas,
77 Scalar /*rhoRefWater*/)
78 {
79 gasReferenceDensity_[regionIdx] = rhoRefGas;
80 }
81
85 void setMolarMasses(unsigned /*regionIdx*/,
86 Scalar /*MOil*/,
87 Scalar /*MGas*/,
88 Scalar /*MWater*/)
89 { }
90
96 void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction& mug)
97 { gasMu_[regionIdx] = mug; }
98
104 void setGasFormationVolumeFactor(unsigned regionIdx,
105 const SamplingPoints& samplePoints);
106
110 void initEnd();
111
115 unsigned numRegions() const
116 { return gasReferenceDensity_.size(); }
117
121 template <class Evaluation>
122 Evaluation internalEnergy(unsigned,
123 const Evaluation&,
124 const Evaluation&,
125 const Evaluation&,
126 const Evaluation&) const
127 {
128 throw std::runtime_error("Requested the enthalpy of gas but the thermal "
129 "option is not enabled");
130 }
131
132 Scalar hVap(unsigned) const
133 {
134 throw std::runtime_error("Requested the hvap of oil but the thermal "
135 "option is not enabled");
136 }
140 template <class Evaluation>
141 Evaluation viscosity(unsigned regionIdx,
142 const Evaluation& temperature,
143 const Evaluation& pressure,
144 const Evaluation& /*Rv*/,
145 const Evaluation& /*Rvw*/) const
146 { return saturatedViscosity(regionIdx, temperature, pressure); }
147
151 template <class Evaluation>
152 Evaluation saturatedViscosity(unsigned regionIdx,
153 const Evaluation& /*temperature*/,
154 const Evaluation& pressure) const
155 {
156 const Evaluation& invBg = inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true);
157 const Evaluation& invMugBg = inverseGasBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
158
159 return invBg / invMugBg;
160 }
161
165 template <class Evaluation>
166 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
167 const Evaluation& temperature,
168 const Evaluation& pressure,
169 const Evaluation& /*Rv*/,
170 const Evaluation& /*Rvw*/) const
171 { return saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure); }
172
176 template <class Evaluation>
177 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
178 const Evaluation& /*temperature*/,
179 const Evaluation& pressure) const
180 { return inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
181
189 template <class Evaluation>
190 Evaluation saturationPressure(unsigned /*regionIdx*/,
191 const Evaluation& /*temperature*/,
192 const Evaluation& /*Rv*/) const
193 { return 0.0; /* this is dry gas! */ }
194
198 template <class Evaluation>
199 Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
200 const Evaluation& /*temperature*/,
201 const Evaluation& /*pressure*/) const
202 { return 0.0; /* this is non-humid gas! */ }
203
207 template <class Evaluation = Scalar>
208 Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
209 const Evaluation& /*temperature*/,
210 const Evaluation& /*pressure*/,
211 const Evaluation& /*saltConcentration*/) const
212 { return 0.0; }
213
217 template <class Evaluation>
218 Evaluation saturatedOilVaporizationFactor(unsigned /*regionIdx*/,
219 const Evaluation& /*temperature*/,
220 const Evaluation& /*pressure*/,
221 const Evaluation& /*oilSaturation*/,
222 const Evaluation& /*maxOilSaturation*/) const
223 { return 0.0; /* this is dry gas! */ }
224
228 template <class Evaluation>
229 Evaluation saturatedOilVaporizationFactor(unsigned /*regionIdx*/,
230 const Evaluation& /*temperature*/,
231 const Evaluation& /*pressure*/) const
232 { return 0.0; /* this is dry gas! */ }
233
234 template <class Evaluation>
235 Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
236 const Evaluation& /*pressure*/,
237 unsigned /*compIdx*/) const
238 {
239 throw std::runtime_error("Not implemented: The PVT model does not provide "
240 "a diffusionCoefficient()");
241 }
242
243 Scalar gasReferenceDensity(unsigned regionIdx) const
244 { return gasReferenceDensity_[regionIdx]; }
245
246 const std::vector<TabulatedOneDFunction>& inverseGasB() const
247 { return inverseGasB_; }
248
249 const std::vector<TabulatedOneDFunction>& gasMu() const
250 { return gasMu_; }
251
252 const std::vector<TabulatedOneDFunction>& inverseGasBMu() const
253 { return inverseGasBMu_; }
254
255private:
256 std::vector<Scalar> gasReferenceDensity_{};
257 std::vector<TabulatedOneDFunction> inverseGasB_{};
258 std::vector<TabulatedOneDFunction> gasMu_{};
259 std::vector<TabulatedOneDFunction> inverseGasBMu_{};
260};
261
262} // namespace Opm
263
264#endif
Implements a linearly interpolated scalar function that depends on one variable.
This class represents the Pressure-Volume-Temperature relations of the gas phase without vaporized oi...
Definition DryGasPvt.hpp:50
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas at given pressure.
Definition DryGasPvt.hpp:152
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the gas phase [Pa] depending on its mass fraction of the oil compo...
Definition DryGasPvt.hpp:190
Evaluation internalEnergy(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of gas given a set of parameters.
Definition DryGasPvt.hpp:122
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition DryGasPvt.hpp:115
void setGasFormationVolumeFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the formation volume factor of dry gas.
Definition DryGasPvt.cpp:103
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition DryGasPvt.hpp:166
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of water saturated gas.
Definition DryGasPvt.hpp:208
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition DryGasPvt.hpp:229
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition DryGasPvt.hpp:141
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil saturated gas at given pressure.
Definition DryGasPvt.hpp:177
void initEnd()
Finish initializing the oil phase PVT properties.
Definition DryGasPvt.cpp:117
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition DryGasPvt.hpp:199
void setMolarMasses(unsigned, Scalar, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DryGasPvt.hpp:85
void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction &mug)
Initialize the viscosity of the gas phase.
Definition DryGasPvt.hpp:96
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DryGasPvt.hpp:74
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition DryGasPvt.hpp:218
Definition EclipseState.hpp:63
Definition Schedule.hpp:101
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