My Project
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 <vector>
35
36namespace Opm {
37
38#if HAVE_ECL_INPUT
39class EclipseState;
40class Schedule;
41#endif
42
47template <class Scalar>
49{
50 using SamplingPoints = std::vector<std::pair<Scalar, Scalar>>;
51
52public:
54
55#if HAVE_ECL_INPUT
61 void initFromState(const EclipseState& eclState, const Schedule&);
62#endif
63
64 void setNumRegions(size_t numRegions);
65
69 void setReferenceDensities(unsigned regionIdx,
70 Scalar /*rhoRefOil*/,
71 Scalar rhoRefGas,
72 Scalar /*rhoRefWater*/)
73 {
74 gasReferenceDensity_[regionIdx] = rhoRefGas;
75 }
76
80 void setMolarMasses(unsigned /*regionIdx*/,
81 Scalar /*MOil*/,
82 Scalar /*MGas*/,
83 Scalar /*MWater*/)
84 { }
85
91 void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction& mug)
92 { gasMu_[regionIdx] = mug; }
93
99 void setGasFormationVolumeFactor(unsigned regionIdx,
100 const SamplingPoints& samplePoints);
101
105 void initEnd();
106
110 unsigned numRegions() const
111 { return gasReferenceDensity_.size(); }
112
116 template <class Evaluation>
117 Evaluation internalEnergy(unsigned,
118 const Evaluation&,
119 const Evaluation&,
120 const Evaluation&,
121 const Evaluation&) const
122 {
123 throw std::runtime_error("Requested the enthalpy of gas but the thermal option is not enabled");
124 }
125
129 template <class Evaluation>
130 Evaluation viscosity(unsigned regionIdx,
131 const Evaluation& temperature,
132 const Evaluation& pressure,
133 const Evaluation& /*Rv*/,
134 const Evaluation& /*Rvw*/) 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& invBg = inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true);
146 const Evaluation& invMugBg = inverseGasBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
147
148 return invBg/invMugBg;
149 }
150
154 template <class Evaluation>
155 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
156 const Evaluation& temperature,
157 const Evaluation& pressure,
158 const Evaluation& /*Rv*/,
159 const Evaluation& /*Rvw*/) const
160 { return saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure); }
161
165 template <class Evaluation>
166 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
167 const Evaluation& /*temperature*/,
168 const Evaluation& pressure) const
169 { return inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
170
177 template <class Evaluation>
178 Evaluation saturationPressure(unsigned /*regionIdx*/,
179 const Evaluation& /*temperature*/,
180 const Evaluation& /*Rv*/) const
181 { return 0.0; /* this is dry gas! */ }
182
186 template <class Evaluation>
187 Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
188 const Evaluation& /*temperature*/,
189 const Evaluation& /*pressure*/) const
190 { return 0.0; /* this is non-humid gas! */ }
191
195 template <class Evaluation = Scalar>
196 Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
197 const Evaluation& /*temperature*/,
198 const Evaluation& /*pressure*/,
199 const Evaluation& /*saltConcentration*/) const
200 { return 0.0; }
201
202
206 template <class Evaluation>
207 Evaluation saturatedOilVaporizationFactor(unsigned /*regionIdx*/,
208 const Evaluation& /*temperature*/,
209 const Evaluation& /*pressure*/,
210 const Evaluation& /*oilSaturation*/,
211 const Evaluation& /*maxOilSaturation*/) const
212 { return 0.0; /* this is dry gas! */ }
213
217 template <class Evaluation>
218 Evaluation saturatedOilVaporizationFactor(unsigned /*regionIdx*/,
219 const Evaluation& /*temperature*/,
220 const Evaluation& /*pressure*/) const
221 { return 0.0; /* this is dry gas! */ }
222
223 template <class Evaluation>
224 Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
225 const Evaluation& /*pressure*/,
226 unsigned /*compIdx*/) const
227 {
228 throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
229 }
230
231 Scalar gasReferenceDensity(unsigned regionIdx) const
232 { return gasReferenceDensity_[regionIdx]; }
233
234 const std::vector<TabulatedOneDFunction>& inverseGasB() const
235 { return inverseGasB_; }
236
237 const std::vector<TabulatedOneDFunction>& gasMu() const
238 { return gasMu_; }
239
240 const std::vector<TabulatedOneDFunction>& inverseGasBMu() const
241 { return inverseGasBMu_; }
242
243private:
244 std::vector<Scalar> gasReferenceDensity_;
245 std::vector<TabulatedOneDFunction> inverseGasB_;
246 std::vector<TabulatedOneDFunction> gasMu_;
247 std::vector<TabulatedOneDFunction> inverseGasBMu_;
248};
249
250} // namespace Opm
251
252#endif
This class represents the Pressure-Volume-Temperature relations of the gas phase without vaporized oi...
Definition: DryGasPvt.hpp:49
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:141
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:178
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:117
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: DryGasPvt.hpp:110
void setGasFormationVolumeFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the formation volume factor of dry gas.
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:155
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:196
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition: DryGasPvt.hpp:218
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:130
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:166
void initEnd()
Finish initializing the oil phase PVT properties.
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition: DryGasPvt.hpp:187
void setMolarMasses(unsigned, Scalar, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: DryGasPvt.hpp:80
void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction &mug)
Initialize the viscosity of the gas phase.
Definition: DryGasPvt.hpp:91
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: DryGasPvt.hpp:69
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:207
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