27 #ifndef OPM_CO2_GAS_PVT_HPP
28 #define OPM_CO2_GAS_PVT_HPP
37 #include <opm/material/components/co2tables.inc>
40 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
41 #include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
42 #include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
52 template <
class Scalar>
55 typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
56 typedef ::Opm::CO2<Scalar, CO2Tables>
CO2;
58 static const bool extrapolate =
true;
67 Co2GasPvt(
const std::vector<Scalar>& gasReferenceDensity)
68 : gasReferenceDensity_(gasReferenceDensity)
75 void initFromState(
const EclipseState& eclState,
const Schedule&)
77 if( !eclState.getTableManager().getDensityTable().empty()) {
78 std::cerr <<
"WARNING: CO2STOR is enabled but DENSITY is in the deck. \n" <<
79 "The surface density is computed based on CO2-BRINE PVT at standard conditions (STCOND) and DENSITY is ignored " << std::endl;
82 if( eclState.getTableManager().hasTables(
"PVDG") || !eclState.getTableManager().getPvtgTables().empty()) {
83 std::cerr <<
"WARNING: CO2STOR is enabled but PVDG or PVTG is in the deck. \n" <<
84 "CO2 PVT properties are computed based on the Span-Wagner pvt model and PVDG/PVTG input is ignored. " << std::endl;
91 Scalar T_ref = eclState.getTableManager().stCond().temperature;
92 Scalar P_ref = eclState.getTableManager().stCond().pressure;
93 gasReferenceDensity_[regionIdx] =
CO2::gasDensity(T_ref, P_ref, extrapolate);
112 gasReferenceDensity_[regionIdx] = rhoRefGas;
127 {
return gasReferenceDensity_.size(); }
132 template <
class Evaluation>
134 const Evaluation& temperature,
135 const Evaluation& pressure,
136 const Evaluation&)
const
144 template <
class Evaluation>
146 const Evaluation& temperature,
147 const Evaluation& pressure,
148 const Evaluation& )
const
154 template <
class Evaluation>
156 const Evaluation& temperature,
157 const Evaluation& pressure)
const
165 template <
class Evaluation>
167 const Evaluation& temperature,
168 const Evaluation& pressure,
169 const Evaluation& )
const
175 template <
class Evaluation>
177 const Evaluation& temperature,
178 const Evaluation& pressure)
const
180 return CO2::gasDensity(temperature, pressure, extrapolate)/gasReferenceDensity_[regionIdx];
189 template <
class Evaluation>
192 const Evaluation& )
const
198 template <
class Evaluation>
203 const Evaluation& )
const
209 template <
class Evaluation>
212 const Evaluation& )
const
215 template <
class Evaluation>
216 Evaluation diffusionCoefficient(
const Evaluation& temperature,
217 const Evaluation& pressure,
223 const Scalar gasReferenceDensity(
unsigned regionIdx)
const
224 {
return gasReferenceDensity_[regionIdx]; }
226 bool operator==(
const Co2GasPvt<Scalar>& data)
const
228 return gasReferenceDensity_ == data.gasReferenceDensity_;
232 std::vector<Scalar> gasReferenceDensity_;
Binary coefficients for brine and CO2.
A class for the CO2 fluid properties.
A central place for various physical constants occuring in some equations.
A simple version of pure water with density from Hu et al.
Implements a linearly interpolated scalar function that depends on one variable.
Binary coefficients for brine and CO2.
Definition: Brine_CO2.hpp:41
static Evaluation gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure)
Binary diffusion coefficent [m^2/s] of water in the CO2 phase.
Definition: Brine_CO2.hpp:55
A class for the CO2 fluid properties.
Definition: CO2.hpp:53
static Evaluation gasViscosity(Evaluation temperature, const Evaluation &pressure, bool extrapolate=false)
The dynamic viscosity [Pa s] of CO2.
Definition: CO2.hpp:203
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific internal energy of CO2 [J/kg].
Definition: CO2.hpp:175
static Evaluation gasDensity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
The density of CO2 at a given pressure and temperature [kg/m^3].
Definition: CO2.hpp:189
This class represents the Pressure-Volume-Temperature relations of the gas phase for CO2.
Definition: Co2GasPvt.hpp:54
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil saturated gas at given pressure.
Definition: Co2GasPvt.hpp:176
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: Co2GasPvt.hpp:145
Evaluation saturatedViscosity(unsigned, const Evaluation &temperature, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas at given pressure.
Definition: Co2GasPvt.hpp:155
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: Co2GasPvt.hpp:107
void initEnd()
Finish initializing the oil phase PVT properties.
Definition: Co2GasPvt.hpp:118
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: Co2GasPvt.hpp:190
Evaluation internalEnergy(unsigned, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &) const
Returns the specific enthalpy [J/kg] of gas given a set of parameters.
Definition: Co2GasPvt.hpp:133
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition: Co2GasPvt.hpp:166
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: Co2GasPvt.hpp:126
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: Co2GasPvt.hpp:199
BinaryCoeff::Brine_CO2< Scalar, H2O, CO2 > BinaryCoeffBrineCO2
The binary coefficients for brine and CO2 used by this fluid system.
Definition: Co2GasPvt.hpp:64
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition: Co2GasPvt.hpp:210
A simple version of pure water with density from Hu et al.
Definition: SimpleHuDuanH2O.hpp:70
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:47