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 <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
66 void setVapPars(const Scalar, const Scalar)
67 {
68 }
69
73 void setReferenceDensities(unsigned regionIdx,
74 Scalar /*rhoRefOil*/,
75 Scalar rhoRefGas,
76 Scalar /*rhoRefWater*/)
77 {
78 gasReferenceDensity_[regionIdx] = rhoRefGas;
79 }
80
84 void setMolarMasses(unsigned /*regionIdx*/,
85 Scalar /*MOil*/,
86 Scalar /*MGas*/,
87 Scalar /*MWater*/)
88 { }
89
95 void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction& mug)
96 { gasMu_[regionIdx] = mug; }
97
103 void setGasFormationVolumeFactor(unsigned regionIdx,
104 const SamplingPoints& samplePoints);
105
109 void initEnd();
110
114 unsigned numRegions() const
115 { return gasReferenceDensity_.size(); }
116
120 template <class Evaluation>
121 Evaluation internalEnergy(unsigned,
122 const Evaluation&,
123 const Evaluation&,
124 const Evaluation&,
125 const Evaluation&) const
126 {
127 throw std::runtime_error("Requested the enthalpy of gas but the thermal option is not enabled");
128 }
129
133 template <class Evaluation>
134 Evaluation viscosity(unsigned regionIdx,
135 const Evaluation& temperature,
136 const Evaluation& pressure,
137 const Evaluation& /*Rv*/,
138 const Evaluation& /*Rvw*/) const
139 { return saturatedViscosity(regionIdx, temperature, pressure); }
140
144 template <class Evaluation>
145 Evaluation saturatedViscosity(unsigned regionIdx,
146 const Evaluation& /*temperature*/,
147 const Evaluation& pressure) const
148 {
149 const Evaluation& invBg = inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true);
150 const Evaluation& invMugBg = inverseGasBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
151
152 return invBg/invMugBg;
153 }
154
158 template <class Evaluation>
159 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
160 const Evaluation& temperature,
161 const Evaluation& pressure,
162 const Evaluation& /*Rv*/,
163 const Evaluation& /*Rvw*/) const
164 { return saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure); }
165
169 template <class Evaluation>
170 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
171 const Evaluation& /*temperature*/,
172 const Evaluation& pressure) const
173 { return inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
174
181 template <class Evaluation>
182 Evaluation saturationPressure(unsigned /*regionIdx*/,
183 const Evaluation& /*temperature*/,
184 const Evaluation& /*Rv*/) const
185 { return 0.0; /* this is dry gas! */ }
186
190 template <class Evaluation>
191 Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
192 const Evaluation& /*temperature*/,
193 const Evaluation& /*pressure*/) const
194 { return 0.0; /* this is non-humid gas! */ }
195
199 template <class Evaluation = Scalar>
200 Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
201 const Evaluation& /*temperature*/,
202 const Evaluation& /*pressure*/,
203 const Evaluation& /*saltConcentration*/) const
204 { return 0.0; }
205
206
210 template <class Evaluation>
211 Evaluation saturatedOilVaporizationFactor(unsigned /*regionIdx*/,
212 const Evaluation& /*temperature*/,
213 const Evaluation& /*pressure*/,
214 const Evaluation& /*oilSaturation*/,
215 const Evaluation& /*maxOilSaturation*/) const
216 { return 0.0; /* this is dry gas! */ }
217
221 template <class Evaluation>
222 Evaluation saturatedOilVaporizationFactor(unsigned /*regionIdx*/,
223 const Evaluation& /*temperature*/,
224 const Evaluation& /*pressure*/) const
225 { return 0.0; /* this is dry gas! */ }
226
227 template <class Evaluation>
228 Evaluation diffusionCoefficient(const Evaluation& /*temperature*/,
229 const Evaluation& /*pressure*/,
230 unsigned /*compIdx*/) const
231 {
232 throw std::runtime_error("Not implemented: The PVT model does not provide a diffusionCoefficient()");
233 }
234
235 Scalar gasReferenceDensity(unsigned regionIdx) const
236 { return gasReferenceDensity_[regionIdx]; }
237
238 const std::vector<TabulatedOneDFunction>& inverseGasB() const
239 { return inverseGasB_; }
240
241 const std::vector<TabulatedOneDFunction>& gasMu() const
242 { return gasMu_; }
243
244 const std::vector<TabulatedOneDFunction>& inverseGasBMu() const
245 { return inverseGasBMu_; }
246
247private:
248 std::vector<Scalar> gasReferenceDensity_;
249 std::vector<TabulatedOneDFunction> inverseGasB_;
250 std::vector<TabulatedOneDFunction> gasMu_;
251 std::vector<TabulatedOneDFunction> inverseGasBMu_;
252};
253
254} // namespace Opm
255
256#endif
A central place for various physical constants occuring in some equations.
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: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:145
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:182
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:121
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition DryGasPvt.hpp:114
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:159
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:200
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition DryGasPvt.hpp:222
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:134
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:170
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:191
void setMolarMasses(unsigned, Scalar, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DryGasPvt.hpp:84
void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction &mug)
Initialize the viscosity of the gas phase.
Definition DryGasPvt.hpp:95
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DryGasPvt.hpp:73
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:211
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