27 #ifndef OPM_CO2_GAS_PVT_HPP
28 #define OPM_CO2_GAS_PVT_HPP
36 #include <opm/material/components/co2tables.inc>
39 #include <opm/input/eclipse/EclipseState/EclipseState.hpp>
40 #include <opm/input/eclipse/Schedule/Schedule.hpp>
41 #include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
51 template <
class Scalar>
56 static constexpr
bool extrapolate =
true;
63 Co2GasPvt(
const std::vector<Scalar>& gasReferenceDensity)
64 : gasReferenceDensity_(gasReferenceDensity)
69 Scalar T_ref = 288.71,
70 Scalar P_ref = 101325)
81 void initFromState(
const EclipseState& eclState,
const Schedule&)
83 if( !eclState.getTableManager().getDensityTable().empty()) {
84 std::cerr <<
"WARNING: CO2STOR is enabled but DENSITY is in the deck. \n" <<
85 "The surface density is computed based on CO2-BRINE PVT at standard conditions (STCOND) and DENSITY is ignored " << std::endl;
88 if( eclState.getTableManager().hasTables(
"PVDG") || !eclState.getTableManager().getPvtgTables().empty()) {
89 std::cerr <<
"WARNING: CO2STOR is enabled but PVDG or PVTG is in the deck. \n" <<
90 "CO2 PVT properties are computed based on the Span-Wagner pvt model and PVDG/PVTG input is ignored. " << std::endl;
97 Scalar T_ref = eclState.getTableManager().stCond().temperature;
98 Scalar P_ref = eclState.getTableManager().stCond().pressure;
99 gasReferenceDensity_[regionIdx] =
CO2::gasDensity(T_ref, P_ref, extrapolate);
118 gasReferenceDensity_[regionIdx] = rhoRefGas;
133 {
return gasReferenceDensity_.size(); }
138 template <
class Evaluation>
140 const Evaluation& temperature,
141 const Evaluation& pressure,
142 const Evaluation&)
const
150 template <
class Evaluation>
152 const Evaluation& temperature,
153 const Evaluation& pressure,
155 const Evaluation& )
const
161 template <
class Evaluation>
163 const Evaluation& temperature,
164 const Evaluation& pressure)
const
172 template <
class Evaluation>
174 const Evaluation& temperature,
175 const Evaluation& pressure,
177 const Evaluation& )
const
183 template <
class Evaluation>
185 const Evaluation& temperature,
186 const Evaluation& pressure)
const
188 return CO2::gasDensity(temperature, pressure, extrapolate)/gasReferenceDensity_[regionIdx];
197 template <
class Evaluation>
200 const Evaluation& )
const
206 template <
class Evaluation>
209 const Evaluation& )
const
215 template <
class Evaluation>
220 const Evaluation& )
const
226 template <
class Evaluation>
229 const Evaluation& )
const
232 template <
class Evaluation>
233 Evaluation diffusionCoefficient(
const Evaluation& temperature,
234 const Evaluation& pressure,
240 const Scalar gasReferenceDensity(
unsigned regionIdx)
const
241 {
return gasReferenceDensity_[regionIdx]; }
243 bool operator==(
const Co2GasPvt<Scalar>& data)
const
245 return gasReferenceDensity_ == data.gasReferenceDensity_;
249 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.
Binary coefficients for brine and CO2.
Definition: Brine_CO2.hpp:42
static Evaluation gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Binary diffusion coefficent [m^2/s] of water in the CO2 phase.
Definition: Brine_CO2.hpp:56
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:53
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:184
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: Co2GasPvt.hpp:173
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:162
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: Co2GasPvt.hpp:113
void initEnd()
Finish initializing the oil phase PVT properties.
Definition: Co2GasPvt.hpp:124
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:198
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:139
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: Co2GasPvt.hpp:132
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition: Co2GasPvt.hpp:207
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: Co2GasPvt.hpp:151
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:216
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition: Co2GasPvt.hpp:227
A simple version of pure water with density from Hu et al.
Definition: SimpleHuDuanH2O.hpp:70