27#ifndef OPM_CONSTANT_COMPRESSIBILITY_BRINE_PVT_HPP
28#define OPM_CONSTANT_COMPRESSIBILITY_BRINE_PVT_HPP
38template <
class Scalar,
bool enableThermal,
bool enableBrine>
48template <
class Scalar>
62 void setVapPars(
const Scalar,
const Scalar)
73 { waterReferenceDensity_[regionIdx] = rhoRefWater; }
85 {
return waterReferenceDensity_.size(); }
90 template <
class Evaluation>
95 const Evaluation&)
const
97 throw std::runtime_error(
"Requested the enthalpy of water but the thermal option is not enabled");
100 Scalar hVap(
unsigned)
const
102 throw std::runtime_error(
"Requested the hvap of oil but the thermal option is not enabled");
108 template <
class Evaluation>
110 const Evaluation& temperature,
111 const Evaluation& pressure,
112 const Evaluation& Rsw,
113 const Evaluation& saltconcentration)
const
116 Scalar pRef = referencePressure_[regionIdx];
117 const Evaluation C = compressibilityTables_[regionIdx].eval(saltconcentration,
true);
118 const Evaluation Cv = viscosibilityTables_[regionIdx].eval(saltconcentration,
true);
119 const Evaluation BwRef = formationVolumeTables_[regionIdx].eval(saltconcentration,
true);
120 const Evaluation Y = (C-Cv)* (pressure - pRef);
121 Evaluation MuwRef = viscosityTables_[regionIdx].eval(saltconcentration,
true);
125 return MuwRef * BwRef * bw / (1 + Y * (1 + Y/2));
132 template <
class Evaluation>
134 const Evaluation& temperature,
135 const Evaluation& pressure,
136 const Evaluation& saltconcentration)
const
138 Scalar pRef = referencePressure_[regionIdx];
139 const Evaluation C = compressibilityTables_[regionIdx].eval(saltconcentration,
true);
140 const Evaluation Cv = viscosibilityTables_[regionIdx].eval(saltconcentration,
true);
141 const Evaluation BwRef = formationVolumeTables_[regionIdx].eval(saltconcentration,
true);
142 const Evaluation Y = (C-Cv)* (pressure - pRef);
143 Evaluation MuwRef = viscosityTables_[regionIdx].eval(saltconcentration,
true);
147 return MuwRef * BwRef * bw / (1 + Y * (1 + Y/2));
153 template <
class Evaluation>
155 const Evaluation& temperature,
156 const Evaluation& pressure,
157 const Evaluation& saltconcentration)
const
159 Evaluation Rsw = 0.0;
161 Rsw, saltconcentration);
166 template <
class Evaluation>
169 const Evaluation& pressure,
171 const Evaluation& saltconcentration)
const
173 Scalar pRef = referencePressure_[regionIdx];
175 const Evaluation BwRef = formationVolumeTables_[regionIdx].eval(saltconcentration,
true);
176 const Evaluation C = compressibilityTables_[regionIdx].eval(saltconcentration,
true);
177 const Evaluation X = C * (pressure - pRef);
179 return (1.0 + X * (1.0 + X / 2.0)) / BwRef;
186 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::ValueType>
187 std::pair<LhsEval, LhsEval>
190 const LhsEval& pressure = decay<LhsEval>(fluidState.pressure(FluidState::waterPhaseIdx));
191 const LhsEval& saltConcentration
192 = BlackOil::template getSaltConcentration_<FluidState, LhsEval>(fluidState, regionIdx);
193 const auto segIdx = this->formationVolumeTables_[regionIdx]
194 .findSegmentIndex(saltConcentration,
true);
197 const Scalar pRef = referencePressure_[regionIdx];
198 const LhsEval BwRef = formationVolumeTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
199 const LhsEval C = compressibilityTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
200 const LhsEval X = C * (pressure - pRef);
201 const LhsEval bw = (1.0 + X * (1.0 + X / 2.0)) / BwRef;
204 const LhsEval Cv = viscosibilityTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
205 const LhsEval Y = (C - Cv) * (pressure - pRef);
206 const LhsEval MuwRef = viscosityTables_[regionIdx].eval(saltConcentration,
SegmentIndex{segIdx});
207 const LhsEval muw = MuwRef * BwRef * bw / (1.0 + Y * (1.0 + Y / 2.0));
218 template <
class Evaluation>
222 const Evaluation& )
const
228 template <
class Evaluation>
232 const Evaluation& )
const
235 template <
class Evaluation>
236 Evaluation diffusionCoefficient(
const Evaluation& ,
241 throw std::runtime_error(
"Not implemented: The PVT model does not provide "
242 "a diffusionCoefficient()");
245 Scalar waterReferenceDensity(
unsigned regionIdx)
const
246 {
return waterReferenceDensity_[regionIdx]; }
248 const std::vector<Scalar>& referencePressure()
const
249 {
return referencePressure_; }
251 const std::vector<TabulatedFunction>& formationVolumeTables()
const
252 {
return formationVolumeTables_; }
254 const std::vector<TabulatedFunction>& compressibilityTables()
const
255 {
return compressibilityTables_; }
257 const std::vector<TabulatedFunction>& viscosityTables()
const
258 {
return viscosityTables_; }
260 const std::vector<TabulatedFunction>& viscosibilityTables()
const
261 {
return viscosibilityTables_; }
264 std::vector<Scalar> waterReferenceDensity_{};
265 std::vector<Scalar> referencePressure_{};
266 std::vector<TabulatedFunction> formationVolumeTables_{};
267 std::vector<TabulatedFunction> compressibilityTables_{};
268 std::vector<TabulatedFunction> viscosityTables_{};
269 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:50
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:133
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:109
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition ConstantCompressibilityBrinePvt.hpp:84
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:167
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar, Scalar rhoRefWater)
Set the water reference density [kg / m^3].
Definition ConstantCompressibilityBrinePvt.hpp:69
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:219
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:188
void initFromState(const EclipseState &eclState, const Schedule &)
Sets the pressure-dependent water viscosity and density using a table stemming from the Eclipse PVTWS...
Definition ConstantCompressibilityBrinePvt.cpp:38
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:229
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:154
void initEnd()
Finish initializing the water phase PVT properties.
Definition ConstantCompressibilityBrinePvt.hpp:78
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:91
Definition EclipseState.hpp:66
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:88
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition Tabulated1DFunction.hpp:41