25 #ifndef OPM_CONSTANT_COMPRESSIBILITY_WATER_PVT_HPP
26 #define OPM_CONSTANT_COMPRESSIBILITY_WATER_PVT_HPP
31 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
42 template <
class Scalar>
46 typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
54 void initFromDeck(DeckConstPtr deck, EclipseStateConstPtr )
56 DeckKeywordConstPtr pvtwKeyword = deck->getKeyword(
"PVTW");
57 DeckKeywordConstPtr densityKeyword = deck->getKeyword(
"DENSITY");
59 assert(pvtwKeyword->size() == densityKeyword->size());
61 size_t numRegions = pvtwKeyword->size();
64 for (
unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
65 auto pvtwRecord = pvtwKeyword->getRecord(regionIdx);
66 auto densityRecord = densityKeyword->getRecord(regionIdx);
68 waterReferenceDensity_[regionIdx] =
69 densityRecord->getItem(
"WATER")->getSIDouble(0);
71 waterReferencePressure_[regionIdx] =
72 pvtwRecord->getItem(
"P_REF")->getSIDouble(0);
73 waterReferenceFormationVolumeFactor_[regionIdx] =
74 pvtwRecord->getItem(
"WATER_VOL_FACTOR")->getSIDouble(0);
75 waterCompressibility_[regionIdx] =
76 pvtwRecord->getItem(
"WATER_COMPRESSIBILITY")->getSIDouble(0);
77 waterViscosity_[regionIdx] =
78 pvtwRecord->getItem(
"WATER_VISCOSITY")->getSIDouble(0);
79 waterViscosibility_[regionIdx] =
80 pvtwRecord->getItem(
"WATER_VISCOSIBILITY")->getSIDouble(0);
87 waterReferenceDensity_.resize(numRegions);
88 waterReferencePressure_.resize(numRegions);
89 waterReferenceFormationVolumeFactor_.resize(numRegions);
90 waterCompressibility_.resize(numRegions);
91 waterViscosity_.resize(numRegions);
92 waterViscosibility_.resize(numRegions);
94 for (
unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
108 { waterReferenceDensity_[regionIdx] = rhoRefWater; }
114 { waterReferencePressure_[regionIdx] = p; }
119 void setViscosity(
unsigned regionIdx, Scalar muw, Scalar waterViscosibility = 0.0)
121 waterViscosity_[regionIdx] = muw;
122 waterViscosibility_[regionIdx] = waterViscosibility;
129 { waterCompressibility_[regionIdx] = waterCompressibility; }
135 { waterReferenceFormationVolumeFactor_[regionIdx] = BwRef; }
141 { waterViscosibility_[regionIdx] = muComp; }
152 template <
class Evaluation>
154 const Evaluation& temperature,
155 const Evaluation& pressure)
const
160 Scalar BwMuwRef = waterViscosity_[regionIdx]*waterReferenceFormationVolumeFactor_[regionIdx];
163 Scalar pRef = waterReferencePressure_[regionIdx];
164 const Evaluation& Y =
165 (waterCompressibility_[regionIdx] - waterViscosibility_[regionIdx])
167 return BwMuwRef/((1 + Y*(1 + Y/2))*Bw);
173 template <
class Evaluation>
175 const Evaluation& temperature,
176 const Evaluation& pressure)
const
179 return waterReferenceDensity_[regionIdx]/Bw;
185 template <
class Evaluation>
188 const Evaluation& pressure)
const
191 Scalar pRef = waterReferencePressure_[regionIdx];
192 const Evaluation& X = waterCompressibility_[regionIdx]*(pressure - pRef);
194 Scalar BwRef = waterReferenceFormationVolumeFactor_[regionIdx];
197 return BwRef/(1 + X*(1 + X/2));
204 template <
class Evaluation>
207 const Evaluation& pressure)
const
213 const Scalar pvWater = 30e3;
215 return 1e10*pvWater / pressure;
222 template <
class Evaluation>
225 const Evaluation& pressure)
const
231 const Scalar pvWater = 30e3;
233 return 1.01e10*pvWater / pressure;
240 template <
class Evaluation>
243 const Evaluation& pressure)
const
249 const Scalar pvWater = 30e3;
251 return pvWater / pressure;
255 std::vector<Scalar> waterReferenceDensity_;
256 std::vector<Scalar> waterReferencePressure_;
257 std::vector<Scalar> waterReferenceFormationVolumeFactor_;
258 std::vector<Scalar> waterCompressibility_;
259 std::vector<Scalar> waterViscosity_;
260 std::vector<Scalar> waterViscosibility_;
Evaluation density(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the density [kg/m^3] of the fluid phase given a set of parameters.
Definition: ConstantCompressibilityWaterPvt.hpp:174
Definition: Air_Mesitylene.hpp:31
This class represents the Pressure-Volume-Temperature relations of the gas phase without vaporized oi...
Definition: ConstantCompressibilityWaterPvt.hpp:43
void setViscosibility(unsigned regionIdx, Scalar muComp)
Set the water "viscosibility" [1/ (Pa s)].
Definition: ConstantCompressibilityWaterPvt.hpp:140
void setViscosity(unsigned regionIdx, Scalar muw, Scalar waterViscosibility=0.0)
Set the viscosity and "viscosibility" of the water phase.
Definition: ConstantCompressibilityWaterPvt.hpp:119
Evaluation fugacityCoefficientGas(unsigned, const Evaluation &, const Evaluation &pressure) const
Returns the fugacity coefficient [Pa] of the gas component in the water phase given a set of paramete...
Definition: ConstantCompressibilityWaterPvt.hpp:223
void setCompressibility(unsigned regionIdx, Scalar waterCompressibility)
Set the compressibility of the water phase.
Definition: ConstantCompressibilityWaterPvt.hpp:128
Implements a linearly interpolated scalar function that depends on one variable.
void setReferenceFormationVolumeFactor(unsigned regionIdx, Scalar BwRef)
Set the water reference formation volume factor [-].
Definition: ConstantCompressibilityWaterPvt.hpp:134
void setNumRegions(size_t numRegions)
Definition: ConstantCompressibilityWaterPvt.hpp:85
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar, Scalar rhoRefWater)
Set the water reference density [kg / m^3].
Definition: ConstantCompressibilityWaterPvt.hpp:104
Evaluation fugacityCoefficientWater(unsigned, const Evaluation &, const Evaluation &pressure) const
Returns the fugacity coefficient [Pa] of the water component in the water phase given a set of parame...
Definition: ConstantCompressibilityWaterPvt.hpp:241
void setReferencePressure(unsigned regionIdx, Scalar p)
Set the water reference pressure [Pa].
Definition: ConstantCompressibilityWaterPvt.hpp:113
void initEnd()
Finish initializing the water phase PVT properties.
Definition: ConstantCompressibilityWaterPvt.hpp:146
Evaluation formationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of the fluid phase.
Definition: ConstantCompressibilityWaterPvt.hpp:186
Evaluation fugacityCoefficientOil(unsigned, const Evaluation &, const Evaluation &pressure) const
Returns the fugacity coefficient [Pa] of the oil component in the water phase given a set of paramete...
Definition: ConstantCompressibilityWaterPvt.hpp:205
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: ConstantCompressibilityWaterPvt.hpp:153
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:44