27#ifndef OPM_CONSTANT_COMPRESSIBILITY_BRINE_PVT_HPP
28#define OPM_CONSTANT_COMPRESSIBILITY_BRINE_PVT_HPP
38template <
class Scalar,
bool enableThermal,
bool enableBrine>
50template <
class Scalar>
66 void setVapPars(
const Scalar,
const Scalar)
77 { waterReferenceDensity_[regionIdx] = rhoRefWater; }
89 {
return waterReferenceDensity_.size(); }
94 template <
class Evaluation>
99 const Evaluation&)
const
101 throw std::runtime_error(
"Requested the enthalpy of water but the thermal option is not enabled");
104 Scalar hVap(
unsigned)
const
106 throw std::runtime_error(
"Requested the hvap of oil but the thermal option is not enabled");
112 template <
class Evaluation>
114 const Evaluation& temperature,
115 const Evaluation& pressure,
116 const Evaluation& Rsw,
117 const Evaluation& saltconcentration)
const
120 Scalar pRef = referencePressure_[regionIdx];
121 const Evaluation C = compressibilityTables_[regionIdx].eval(saltconcentration,
true);
122 const Evaluation Cv = viscosibilityTables_[regionIdx].eval(saltconcentration,
true);
123 const Evaluation BwRef = formationVolumeTables_[regionIdx].eval(saltconcentration,
true);
124 const Evaluation Y = (C-Cv)* (pressure - pRef);
125 Evaluation MuwRef = viscosityTables_[regionIdx].eval(saltconcentration,
true);
129 return MuwRef * BwRef * bw / (1 + Y * (1 + Y/2));
136 template <
class Evaluation>
138 const Evaluation& temperature,
139 const Evaluation& pressure,
140 const Evaluation& saltconcentration)
const
142 Scalar pRef = referencePressure_[regionIdx];
143 const Evaluation C = compressibilityTables_[regionIdx].eval(saltconcentration,
true);
144 const Evaluation Cv = viscosibilityTables_[regionIdx].eval(saltconcentration,
true);
145 const Evaluation BwRef = formationVolumeTables_[regionIdx].eval(saltconcentration,
true);
146 const Evaluation Y = (C-Cv)* (pressure - pRef);
147 Evaluation MuwRef = viscosityTables_[regionIdx].eval(saltconcentration,
true);
151 return MuwRef * BwRef * bw / (1 + Y * (1 + Y/2));
157 template <
class Evaluation>
159 const Evaluation& temperature,
160 const Evaluation& pressure,
161 const Evaluation& saltconcentration)
const
163 Evaluation Rsw = 0.0;
165 Rsw, saltconcentration);
170 template <
class Evaluation>
173 const Evaluation& pressure,
175 const Evaluation& saltconcentration)
const
177 Scalar pRef = referencePressure_[regionIdx];
179 const Evaluation BwRef = formationVolumeTables_[regionIdx].eval(saltconcentration,
true);
180 const Evaluation C = compressibilityTables_[regionIdx].eval(saltconcentration,
true);
181 const Evaluation X = C * (pressure - pRef);
183 return (1.0 + X * (1.0 + X / 2.0)) / BwRef;
190 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar>
191 std::pair<LhsEval, LhsEval>
194 const LhsEval& pressure = decay<LhsEval>(fluidState.pressure(FluidState::waterPhaseIdx));
195 const LhsEval& saltConcentration
196 = BlackOil::template getSaltConcentration_<FluidState, LhsEval>(fluidState, regionIdx);
197 const auto segIdx = this->formationVolumeTables_[regionIdx]
198 .findSegmentIndex(saltConcentration,
true);
201 const Scalar pRef = referencePressure_[regionIdx];
202 const LhsEval BwRef = formationVolumeTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
203 const LhsEval C = compressibilityTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
204 const LhsEval X = C * (pressure - pRef);
205 const LhsEval bw = (1.0 + X * (1.0 + X / 2.0)) / BwRef;
208 const LhsEval Cv = viscosibilityTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
209 const LhsEval Y = (C - Cv) * (pressure - pRef);
210 const LhsEval MuwRef = viscosityTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
211 const LhsEval muw = MuwRef * BwRef * bw / (1.0 + Y * (1.0 + Y / 2.0));
222 template <
class Evaluation>
226 const Evaluation& )
const
232 template <
class Evaluation>
236 const Evaluation& )
const
239 template <
class Evaluation>
240 Evaluation diffusionCoefficient(
const Evaluation& ,
244 throw std::runtime_error(
"Not implemented: The PVT model does not provide "
245 "a diffusionCoefficient()");
248 Scalar waterReferenceDensity(
unsigned regionIdx)
const
249 {
return waterReferenceDensity_[regionIdx]; }
251 const std::vector<Scalar>& referencePressure()
const
252 {
return referencePressure_; }
254 const std::vector<TabulatedFunction>& formationVolumeTables()
const
255 {
return formationVolumeTables_; }
257 const std::vector<TabulatedFunction>& compressibilityTables()
const
258 {
return compressibilityTables_; }
260 const std::vector<TabulatedFunction>& viscosityTables()
const
261 {
return viscosityTables_; }
263 const std::vector<TabulatedFunction>& viscosibilityTables()
const
264 {
return viscosibilityTables_; }
267 std::vector<Scalar> waterReferenceDensity_{};
268 std::vector<Scalar> referencePressure_{};
269 std::vector<TabulatedFunction> formationVolumeTables_{};
270 std::vector<TabulatedFunction> compressibilityTables_{};
271 std::vector<TabulatedFunction> viscosityTables_{};
272 std::vector<TabulatedFunction> viscosibilityTables_{};
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 ConstantCompressibilityBrinePvt.hpp:52
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &saltconcentration) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition ConstantCompressibilityBrinePvt.hpp:137
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rsw, const Evaluation &saltconcentration) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition ConstantCompressibilityBrinePvt.hpp:113
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition ConstantCompressibilityBrinePvt.hpp:88
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &, const Evaluation &saltconcentration) const
Returns the formation volume factor [-] of the fluid phase.
Definition ConstantCompressibilityBrinePvt.hpp:171
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar, Scalar rhoRefWater)
Set the water reference density [kg / m^3].
Definition ConstantCompressibilityBrinePvt.hpp:73
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the water phase [Pa] depending on its mass fraction of the gas com...
Definition ConstantCompressibilityBrinePvt.hpp:223
std::pair< LhsEval, LhsEval > inverseFormationVolumeFactorAndViscosity(const FluidState &fluidState, unsigned regionIdx)
Returns the formation volume factor [-] and viscosity [Pa s] of the fluid phase.
Definition ConstantCompressibilityBrinePvt.hpp:192
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the water phase.
Definition ConstantCompressibilityBrinePvt.hpp:233
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &saltconcentration) const
Returns the formation volume factor [-] of the fluid phase.
Definition ConstantCompressibilityBrinePvt.hpp:158
void initEnd()
Finish initializing the water phase PVT properties.
Definition ConstantCompressibilityBrinePvt.hpp:82
Evaluation internalEnergy(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of water given a set of parameters.
Definition ConstantCompressibilityBrinePvt.hpp:95
Definition EclipseState.hpp:62
Definition Schedule.hpp:101
Implements a linearly interpolated scalar function that depends on one variable.
Definition Tabulated1DFunction.hpp:51
This class represents the Pressure-Volume-Temperature relations of the water phase in the black-oil m...
Definition WaterPvtMultiplexer.hpp:90
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition Tabulated1DFunction.hpp:41