My Project
Loading...
Searching...
No Matches
BrineCo2Pvt.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 2 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18
19 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
27#ifndef OPM_BRINE_CO2_PVT_HPP
28#define OPM_BRINE_CO2_PVT_HPP
29
31#include <opm/common/TimingMacros.hpp>
32#include <opm/common/ErrorMacros.hpp>
33
35
43
44#include <opm/input/eclipse/EclipseState/Co2StoreConfig.hpp>
45
46
47#include <vector>
48
49namespace Opm {
50
51class EclipseState;
52class Schedule;
53class Co2StoreConfig;
54
59template <class Scalar>
61{
62 static constexpr bool extrapolate = true;
63 //typedef H2O<Scalar> H2O_IAPWS;
64 //typedef Brine<Scalar, H2O_IAPWS> Brine_IAPWS;
65 //typedef TabulatedComponent<Scalar, H2O_IAPWS> H2O_Tabulated;
66 //typedef TabulatedComponent<Scalar, Brine_IAPWS> Brine_Tabulated;
67
68 //typedef H2O_Tabulated H2O;
69 //typedef Brine_Tabulated Brine;
70
71
72public:
75 using CO2 = ::Opm::CO2<Scalar>;
76
79
80 explicit BrineCo2Pvt() = default;
81
82 BrineCo2Pvt(const std::vector<Scalar>& salinity,
83 int activityModel = 3,
84 int thermalMixingModelSalt = 1,
85 int thermalMixingModelLiquid = 2,
86 Scalar T_ref = 288.71, //(273.15 + 15.56)
87 Scalar P_ref = 101325)
88 : salinity_(salinity)
89 {
90 // Throw an error if reference state is not (T, p) = (15.56 C, 1 atm) = (288.71 K, 1.01325e5 Pa)
91 if (T_ref != Scalar(288.71) || P_ref != Scalar(1.01325e5)) {
92 OPM_THROW(std::runtime_error,
93 "BrineCo2Pvt class can only be used with default reference state (T, P) = (288.71 K, 1.01325e5 Pa)!");
94 }
95 setActivityModelSalt(activityModel);
96 setThermalMixingModel(thermalMixingModelSalt, thermalMixingModelLiquid);
97 int num_regions = salinity_.size();
98 co2ReferenceDensity_.resize(num_regions);
99 brineReferenceDensity_.resize(num_regions);
100 for (int i = 0; i < num_regions; ++i) {
101 co2ReferenceDensity_[i] = CO2::gasDensity(T_ref, P_ref, true);
102 brineReferenceDensity_[i] = Brine::liquidDensity(T_ref, P_ref, salinity_[i], true);
103 }
104 }
105
106#if HAVE_ECL_INPUT
111 void initFromState(const EclipseState& eclState, const Schedule&);
112#endif
113
114 void setNumRegions(size_t numRegions)
115 {
116 brineReferenceDensity_.resize(numRegions);
117 co2ReferenceDensity_.resize(numRegions);
118 salinity_.resize(numRegions);
119 }
120
121 void setVapPars(const Scalar, const Scalar)
122 {
123 }
124
128 void setReferenceDensities(unsigned regionIdx,
129 Scalar rhoRefBrine,
130 Scalar rhoRefCO2,
131 Scalar /*rhoRefWater*/)
132 {
133 brineReferenceDensity_[regionIdx] = rhoRefBrine;
134 co2ReferenceDensity_[regionIdx] = rhoRefCO2;
135 }
136
137
141 void initEnd()
142 {
143
144 }
145
152 void setEnableDissolvedGas(bool yesno)
153 { enableDissolution_ = yesno; }
154
162 { enableSaltConcentration_ = yesno; }
163
167 void setActivityModelSalt(int activityModel)
168 {
169 // Only 1, 2 and 3 are allowed
170 if (activityModel > 3 || activityModel < 1) {
171 OPM_THROW(std::runtime_error, "The salt activity model options are 1, 2 or 3");
172 }
173 activityModel_ = activityModel;
174 }
175
179 void setThermalMixingModel(int thermalMixingModelSalt, int thermalMixingModelLiquid)
180 {
181 if (thermalMixingModelSalt == 0)
182 saltMixType_ = Co2StoreConfig::SaltMixingType::NONE;
183 else if (thermalMixingModelSalt == 1)
184 saltMixType_ = Co2StoreConfig::SaltMixingType::MICHAELIDES;
185 else
186 OPM_THROW(std::runtime_error, "The thermal mixing model option for salt are 0 or 1");
187
188 if (thermalMixingModelLiquid == 0)
189 liquidMixType_ = Co2StoreConfig::LiquidMixingType::NONE;
190 else if (thermalMixingModelLiquid == 1)
191 liquidMixType_ = Co2StoreConfig::LiquidMixingType::IDEAL;
192 else if (thermalMixingModelLiquid == 2)
193 liquidMixType_ = Co2StoreConfig::LiquidMixingType::DUANSUN;
194 else
195 OPM_THROW(std::runtime_error, "The thermal mixing model option for liquid are 0, 1 and 2");
196 }
197
201 unsigned numRegions() const
202 { return brineReferenceDensity_.size(); }
203
207 template <class Evaluation>
208 Evaluation internalEnergy(unsigned regionIdx,
209 const Evaluation& temperature,
210 const Evaluation& pressure,
211 const Evaluation& Rs,
212 const Evaluation& saltConcentration) const
213 {
214 OPM_TIMEFUNCTION_LOCAL();
215 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltConcentration);
216 const Evaluation xlCO2 = convertRsToXoG_(Rs,regionIdx);
217 return (liquidEnthalpyBrineCO2_(temperature,
218 pressure,
219 salinity,
220 xlCO2)
221 - pressure / density(regionIdx, temperature, pressure, Rs, salinity ));
222 }
226 template <class Evaluation>
227 Evaluation internalEnergy(unsigned regionIdx,
228 const Evaluation& temperature,
229 const Evaluation& pressure,
230 const Evaluation& Rs) const
231 {
232 OPM_TIMEFUNCTION_LOCAL();
233 const Evaluation xlCO2 = convertRsToXoG_(Rs,regionIdx);
234 return (liquidEnthalpyBrineCO2_(temperature,
235 pressure,
236 Evaluation(salinity_[regionIdx]),
237 xlCO2)
238 - pressure / density(regionIdx, temperature, pressure, Rs, Evaluation(salinity_[regionIdx])));
239 }
240
244 template <class Evaluation>
245 Evaluation viscosity(unsigned regionIdx,
246 const Evaluation& temperature,
247 const Evaluation& pressure,
248 const Evaluation& /*Rs*/) const
249 {
250 //TODO: The viscosity does not yet depend on the composition
251 return saturatedViscosity(regionIdx, temperature, pressure);
252 }
253
257 template <class Evaluation>
258 Evaluation saturatedViscosity(unsigned regionIdx,
259 const Evaluation& temperature,
260 const Evaluation& pressure,
261 const Evaluation& saltConcentration) const
262 {
263 OPM_TIMEFUNCTION_LOCAL();
264 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltConcentration);
265 return Brine::liquidViscosity(temperature, pressure, salinity);
266 }
267
271 template <class Evaluation>
272 Evaluation viscosity(unsigned regionIdx,
273 const Evaluation& temperature,
274 const Evaluation& pressure,
275 const Evaluation& /*Rsw*/,
276 const Evaluation& saltConcentration) const
277 {
278 OPM_TIMEFUNCTION_LOCAL();
279 //TODO: The viscosity does not yet depend on the composition
280 return saturatedViscosity(regionIdx, temperature, pressure, saltConcentration);
281 }
282
286 template <class Evaluation>
287 Evaluation saturatedViscosity(unsigned regionIdx,
288 const Evaluation& temperature,
289 const Evaluation& pressure) const
290 {
291 OPM_TIMEFUNCTION_LOCAL();
292 return Brine::liquidViscosity(temperature, pressure, Evaluation(salinity_[regionIdx]));
293 }
294
295
299 template <class Evaluation>
300 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
301 const Evaluation& temperature,
302 const Evaluation& pressure,
303 const Evaluation& saltconcentration) const
304 {
305 OPM_TIMEFUNCTION_LOCAL();
306 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltconcentration);
307 Evaluation rs_sat = rsSat(regionIdx, temperature, pressure, salinity);
308 return (1.0 - convertRsToXoG_(rs_sat,regionIdx)) * density(regionIdx, temperature, pressure, rs_sat, salinity)/brineReferenceDensity_[regionIdx];
309 }
313 template <class Evaluation>
314 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
315 const Evaluation& temperature,
316 const Evaluation& pressure,
317 const Evaluation& Rs,
318 const Evaluation& saltConcentration) const
319 {
320 OPM_TIMEFUNCTION_LOCAL();
321 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltConcentration);
322 return (1.0 - convertRsToXoG_(Rs,regionIdx)) * density(regionIdx, temperature, pressure, Rs, salinity)/brineReferenceDensity_[regionIdx];
323 }
327 template <class Evaluation>
328 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
329 const Evaluation& temperature,
330 const Evaluation& pressure,
331 const Evaluation& Rs) const
332 {
333 return (1.0 - convertRsToXoG_(Rs,regionIdx)) * density(regionIdx, temperature, pressure, Rs, Evaluation(salinity_[regionIdx]))/brineReferenceDensity_[regionIdx];
334 }
335
339 template <class Evaluation>
340 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
341 const Evaluation& temperature,
342 const Evaluation& pressure) const
343 {
344 OPM_TIMEFUNCTION_LOCAL();
345 Evaluation rs_sat = rsSat(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
346 return (1.0 - convertRsToXoG_(rs_sat,regionIdx)) * density(regionIdx, temperature, pressure, rs_sat, Evaluation(salinity_[regionIdx]))/brineReferenceDensity_[regionIdx];
347 }
348
355 template <class Evaluation>
356 Evaluation saturationPressure(unsigned /*regionIdx*/,
357 const Evaluation& /*temperature*/,
358 const Evaluation& /*Rs*/) const
359 {
360 throw std::runtime_error("Requested the saturation pressure for the brine-co2 pvt module. Not yet implemented.");
361 }
362
369 template <class Evaluation>
370 Evaluation saturationPressure(unsigned /*regionIdx*/,
371 const Evaluation& /*temperature*/,
372 const Evaluation& /*Rs*/,
373 const Evaluation& /*saltConcentration*/) const
374 {
375 throw std::runtime_error("Requested the saturation pressure for the brine-co2 pvt module. Not yet implemented.");
376 }
377
381 template <class Evaluation>
382 Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
383 const Evaluation& temperature,
384 const Evaluation& pressure,
385 const Evaluation& /*oilSaturation*/,
386 const Evaluation& /*maxOilSaturation*/) const
387 {
388 //TODO support VAPPARS
389 return rsSat(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
390 }
391
395 template <class Evaluation>
396 Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
397 const Evaluation& temperature,
398 const Evaluation& pressure,
399 const Evaluation& saltConcentration) const
400 {
401 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltConcentration);
402 return rsSat(regionIdx, temperature, pressure, salinity);
403 }
404
408 template <class Evaluation>
409 Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
410 const Evaluation& temperature,
411 const Evaluation& pressure) const
412 {
413 return rsSat(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
414 }
415
416 const Scalar oilReferenceDensity(unsigned regionIdx) const
417 { return brineReferenceDensity_[regionIdx]; }
418
419 const Scalar waterReferenceDensity(unsigned regionIdx) const
420 { return brineReferenceDensity_[regionIdx]; }
421
422 const Scalar gasReferenceDensity(unsigned regionIdx) const
423 { return co2ReferenceDensity_[regionIdx]; }
424
425 const Scalar salinity(unsigned regionIdx) const
426 { return salinity_[regionIdx]; }
427
428
429 template <class Evaluation>
430 Evaluation diffusionCoefficient(const Evaluation& temperature,
431 const Evaluation& pressure,
432 unsigned /*compIdx*/) const
433 {
434 OPM_TIMEFUNCTION_LOCAL();
435 //Diffusion coefficient of CO2 in pure water according to (McLachlan and Danckwerts, 1972)
436 const Evaluation log_D_H20 = -4.1764 + 712.52 / temperature - 2.5907e5 / (temperature*temperature);
437
438 //Diffusion coefficient of CO2 in the brine phase modified following (Ratcliff and Holdcroft,1963 and Al-Rawajfeh, 2004)
439 const Evaluation& mu_H20 = H2O::liquidViscosity(temperature, pressure, extrapolate); // Water viscosity
440 const Evaluation& mu_Brine = Brine::liquidViscosity(temperature, pressure, Evaluation(salinity_[0])); // Brine viscosity
441 const Evaluation log_D_Brine = log_D_H20 - 0.87*log10(mu_Brine / mu_H20);
442
443 return pow(Evaluation(10), log_D_Brine) * 1e-4; // convert from cm2/s to m2/s
444 }
445
446 template <class Evaluation>
447 Evaluation density(unsigned regionIdx,
448 const Evaluation& temperature,
449 const Evaluation& pressure,
450 const Evaluation& Rs,
451 const Evaluation& salinity) const
452 {
453 OPM_TIMEFUNCTION_LOCAL();
454 Evaluation xlCO2 = convertXoGToxoG_(convertRsToXoG_(Rs,regionIdx), salinity);
455 Evaluation result = liquidDensity_(temperature,
456 pressure,
457 xlCO2,
458 salinity);
459
460 Valgrind::CheckDefined(result);
461 return result;
462 }
463
464 template <class Evaluation>
465 Evaluation rsSat(unsigned regionIdx,
466 const Evaluation& temperature,
467 const Evaluation& pressure,
468 const Evaluation& salinity) const
469 {
470 OPM_TIMEFUNCTION_LOCAL();
471 if (!enableDissolution_)
472 return 0.0;
473
474 // calulate the equilibrium composition for the given
475 // temperature and pressure.
476 Evaluation xgH2O;
477 Evaluation xlCO2;
479 pressure,
480 salinity,
481 /*knownPhaseIdx=*/-1,
482 xlCO2,
483 xgH2O,
484 activityModel_,
485 extrapolate);
486
487 // normalize the phase compositions
488 xlCO2 = max(0.0, min(1.0, xlCO2));
489
490 return convertXoGToRs(convertxoGToXoG(xlCO2, salinity), regionIdx);
491 }
492
493private:
494 std::vector<Scalar> brineReferenceDensity_;
495 std::vector<Scalar> co2ReferenceDensity_;
496 std::vector<Scalar> salinity_;
497 bool enableDissolution_ = true;
498 bool enableSaltConcentration_ = false;
499 int activityModel_;
500 Co2StoreConfig::LiquidMixingType liquidMixType_;
501 Co2StoreConfig::SaltMixingType saltMixType_;
502
503 template <class LhsEval>
504 LhsEval liquidDensity_(const LhsEval& T,
505 const LhsEval& pl,
506 const LhsEval& xlCO2,
507 const LhsEval& salinity) const
508 {
509 OPM_TIMEFUNCTION_LOCAL();
510 Valgrind::CheckDefined(T);
511 Valgrind::CheckDefined(pl);
512 Valgrind::CheckDefined(xlCO2);
513
514 if(!extrapolate && T < 273.15) {
515 const std::string msg =
516 "Liquid density for Brine and CO2 is only "
517 "defined above 273.15K (is " +
518 std::to_string(getValue(T)) + "K)";
519 throw NumericalProblem(msg);
520 }
521 if(!extrapolate && pl >= 2.5e8) {
522 const std::string msg =
523 "Liquid density for Brine and CO2 is only "
524 "defined below 250MPa (is " +
525 std::to_string(getValue(pl)) + "Pa)";
526 throw NumericalProblem(msg);
527 }
528
529 const LhsEval& rho_brine = Brine::liquidDensity(T, pl, salinity, extrapolate);
530 const LhsEval& rho_pure = H2O::liquidDensity(T, pl, extrapolate);
531 const LhsEval& rho_lCO2 = liquidDensityWaterCO2_(T, pl, xlCO2);
532 const LhsEval& contribCO2 = rho_lCO2 - rho_pure;
533
534 return rho_brine + contribCO2;
535 }
536
537 template <class LhsEval>
538 LhsEval liquidDensityWaterCO2_(const LhsEval& temperature,
539 const LhsEval& pl,
540 const LhsEval& xlCO2) const
541 {
542 OPM_TIMEFUNCTION_LOCAL();
543 Scalar M_CO2 = CO2::molarMass();
544 Scalar M_H2O = H2O::molarMass();
545
546 const LhsEval& tempC = temperature - 273.15; /* tempC : temperature in °C */
547 const LhsEval& rho_pure = H2O::liquidDensity(temperature, pl, extrapolate);
548 // calculate the mole fraction of CO2 in the liquid. note that xlH2O is available
549 // as a function parameter, but in the case of a pure gas phase the value of M_T
550 // for the virtual liquid phase can become very large
551 const LhsEval xlH2O = 1.0 - xlCO2;
552 const LhsEval& M_T = M_H2O * xlH2O + M_CO2 * xlCO2;
553 const LhsEval& V_phi =
554 (37.51 +
555 tempC*(-9.585e-2 +
556 tempC*(8.74e-4 -
557 tempC*5.044e-7))) / 1.0e6;
558 return 1/ (xlCO2 * V_phi/M_T + M_H2O * xlH2O / (rho_pure * M_T));
559 }
560
565 template <class LhsEval>
566 LhsEval convertRsToXoG_(const LhsEval& Rs, unsigned regionIdx) const
567 {
568 OPM_TIMEFUNCTION_LOCAL();
569 Scalar rho_oRef = brineReferenceDensity_[regionIdx];
570 Scalar rho_gRef = co2ReferenceDensity_[regionIdx];
571
572 const LhsEval& rho_oG = Rs*rho_gRef;
573 return rho_oG/(rho_oRef + rho_oG);
574 }
575
576
580 template <class LhsEval>
581 LhsEval convertXoGToxoG_(const LhsEval& XoG, const LhsEval& salinity) const
582 {
583 OPM_TIMEFUNCTION_LOCAL();
584 Scalar M_CO2 = CO2::molarMass();
585 LhsEval M_Brine = Brine::molarMass(salinity);
586 return XoG*M_Brine / (M_CO2*(1 - XoG) + XoG*M_Brine);
587 }
588
589
593 template <class LhsEval>
594 LhsEval convertxoGToXoG(const LhsEval& xoG, const LhsEval& salinity) const
595 {
596 OPM_TIMEBLOCK_LOCAL(convertxoGToXoG);
597 Scalar M_CO2 = CO2::molarMass();
598 LhsEval M_Brine = Brine::molarMass(salinity);
599
600 return xoG*M_CO2 / (xoG*(M_CO2 - M_Brine) + M_Brine);
601 }
602
603
608 template <class LhsEval>
609 LhsEval convertXoGToRs(const LhsEval& XoG, unsigned regionIdx) const
610 {
611 Scalar rho_oRef = brineReferenceDensity_[regionIdx];
612 Scalar rho_gRef = co2ReferenceDensity_[regionIdx];
613
614 return XoG/(1.0 - XoG)*(rho_oRef/rho_gRef);
615 }
616
617 template <class LhsEval>
618 LhsEval liquidEnthalpyBrineCO2_(const LhsEval& T,
619 const LhsEval& p,
620 const LhsEval& salinity,
621 const LhsEval& X_CO2_w) const
622 {
623
624
625 if (liquidMixType_ == Co2StoreConfig::LiquidMixingType::NONE
626 && saltMixType_ == Co2StoreConfig::SaltMixingType::NONE)
627 return H2O::liquidEnthalpy(T, p);
628
629 LhsEval hw = H2O::liquidEnthalpy(T, p) /1E3; /* kJ/kg */
630 LhsEval h_ls1 = hw;
631 // Use mixing model for salt by MICHAELIDES
632 if (saltMixType_ == Co2StoreConfig::SaltMixingType::MICHAELIDES) {
633
634 /* X_CO2_w : mass fraction of CO2 in brine */
635
636 /* same function as enthalpy_brine, only extended by CO2 content */
637
638 /*Numerical coefficents from PALLISER*/
639 static constexpr Scalar f[] = {
640 2.63500E-1, 7.48368E-6, 1.44611E-6, -3.80860E-10
641 };
642
643 /*Numerical coefficents from MICHAELIDES for the enthalpy of brine*/
644 static constexpr Scalar a[4][3] = {
645 { 9633.6, -4080.0, +286.49 },
646 { +166.58, +68.577, -4.6856 },
647 { -0.90963, -0.36524, +0.249667E-1 },
648 { +0.17965E-2, +0.71924E-3, -0.4900E-4 }
649 };
650
651 LhsEval theta, h_NaCl;
652 LhsEval d_h, delta_h;
653
654 theta = T - 273.15;
655
656 // Regularization
657 Scalar scalarTheta = scalarValue(theta);
658 Scalar S_lSAT = f[0] + scalarTheta*(f[1] + scalarTheta*(f[2] + scalarTheta*f[3]));
659
660 LhsEval S = salinity;
661 if (S > S_lSAT)
662 S = S_lSAT;
663
664 /*DAUBERT and DANNER*/
665 /*U=*/h_NaCl = (3.6710E4*T + 0.5*(6.2770E1)*T*T - ((6.6670E-2)/3)*T*T*T
666 +((2.8000E-5)/4)*(T*T*T*T))/(58.44E3)- 2.045698e+02; /* kJ/kg */
667
668 LhsEval m = 1E3/58.44 * S/(1-S);
669 int i = 0;
670 int j = 0;
671 d_h = 0;
672
673 for (i = 0; i<=3; i++) {
674 for (j=0; j<=2; j++) {
675 d_h = d_h + a[i][j] * pow(theta, static_cast<Scalar>(i)) * pow(m, j);
676 }
677 }
678 /* heat of dissolution for halite according to Michaelides 1971 */
679 delta_h = (4.184/(1E3 + (58.44 * m)))*d_h;
680
681 /* Enthalpy of brine without CO2 */
682 h_ls1 =(1-S)*hw + S*h_NaCl + S*delta_h; /* kJ/kg */
683
684 // Use Enthalpy of brine without CO2
685 if (liquidMixType_ == Co2StoreConfig::LiquidMixingType::NONE)
686 return h_ls1*1E3;
687 }
688
689 LhsEval delta_hCO2, hg;
690 /* heat of dissolution for CO2 according to Fig. 6 in Duan and Sun 2003. (kJ/kg)
691 In the relevant temperature ranges CO2 dissolution is
692 exothermal */
693 if (liquidMixType_ == Co2StoreConfig::LiquidMixingType::DUANSUN)
694 delta_hCO2 = (-57.4375 + T * 0.1325) * 1000/44;
695 else
696 delta_hCO2 = 0.0;
697
698 /* enthalpy contribution of CO2 (kJ/kg) */
699 hg = CO2::gasEnthalpy(T, p, extrapolate)/1E3 + delta_hCO2;
700
701 /* Enthalpy of brine with dissolved CO2 */
702 return (h_ls1 - X_CO2_w*hw + hg*X_CO2_w)*1E3; /*J/kg*/
703 }
704
705 template <class LhsEval>
706 const LhsEval salinityFromConcentration(unsigned regionIdx, const LhsEval&T, const LhsEval& P, const LhsEval& saltConcentration) const
707 {
708 if (enableSaltConcentration_)
709 return saltConcentration/H2O::liquidDensity(T, P, true);
710
711 return salinity(regionIdx);
712 }
713};
714
715} // namespace Opm
716
717#endif
A class for the brine fluid properties.
Binary coefficients for brine and CO2.
A class for the CO2 fluid properties.
A central place for various physical constants occuring in some equations.
Provides the OPM specific exception classes.
Binary coefficients for water and CO2.
A simple version of pure water with density from Hu et al.
A generic class which tabulates all thermodynamic properties of a given component.
Implements a scalar function that depends on two variables and which is sampled on an uniform X-Y gri...
Binary coefficients for brine and CO2.
Definition Brine_CO2.hpp:45
static void calculateMoleFractions(const Evaluation &temperature, const Evaluation &pg, const Evaluation &salinity, const int knownPhaseIdx, Evaluation &xlCO2, Evaluation &ygH2O, const int &activityModel, bool extrapolate=false)
Returns the mol (!) fraction of CO2 in the liquid phase and the mol_ (!) fraction of H2O in the gas p...
Definition Brine_CO2.hpp:100
This class represents the Pressure-Volume-Temperature relations of the liquid phase for a CO2-Brine s...
Definition BrineCo2Pvt.hpp:61
Evaluation internalEnergy(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rs) const
Returns the specific enthalpy [J/kg] of gas given a set of parameters.
Definition BrineCo2Pvt.hpp:227
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &saltConcentration) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition BrineCo2Pvt.hpp:272
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rs, const Evaluation &saltConcentration) const
Returns the formation volume factor [-] of the fluid phase.
Definition BrineCo2Pvt.hpp:314
Evaluation internalEnergy(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rs, const Evaluation &saltConcentration) const
Returns the specific enthalpy [J/kg] of gas given a set of parameters.
Definition BrineCo2Pvt.hpp:208
Evaluation saturatedGasDissolutionFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the gas dissoluiton factor [m^3/m^3] of the liquid phase.
Definition BrineCo2Pvt.hpp:382
Evaluation saturatedGasDissolutionFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &saltConcentration) const
Returns the gas dissoluiton factor [m^3/m^3] of the liquid phase.
Definition BrineCo2Pvt.hpp:396
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas at given pressure.
Definition BrineCo2Pvt.hpp:287
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rs) const
Returns the formation volume factor [-] of the fluid phase.
Definition BrineCo2Pvt.hpp:328
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition BrineCo2Pvt.hpp:201
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &saltconcentration) const
Returns the formation volume factor [-] of the fluid phase.
Definition BrineCo2Pvt.hpp:300
void setActivityModelSalt(int activityModel)
Set activity coefficient model for salt in solubility model.
Definition BrineCo2Pvt.hpp:167
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the brine phase [Pa] depending on its mass fraction of the gas com...
Definition BrineCo2Pvt.hpp:356
void initEnd()
Finish initializing the oil phase PVT properties.
Definition BrineCo2Pvt.hpp:141
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the formation volume factor [-] of brine saturated with CO2 at a given pressure.
Definition BrineCo2Pvt.hpp:340
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the brine phase [Pa] depending on its mass fraction of the gas com...
Definition BrineCo2Pvt.hpp:370
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 BrineCo2Pvt.hpp:258
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefBrine, Scalar rhoRefCO2, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition BrineCo2Pvt.hpp:128
void setEnableSaltConcentration(bool yesno)
Specify whether the PVT model should consider salt concentration from the fluidstate or a fixed salin...
Definition BrineCo2Pvt.hpp:161
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 BrineCo2Pvt.hpp:245
Evaluation saturatedGasDissolutionFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns thegas dissoluiton factor [m^3/m^3] of the liquid phase.
Definition BrineCo2Pvt.hpp:409
void setThermalMixingModel(int thermalMixingModelSalt, int thermalMixingModelLiquid)
Set thermal mixing model for co2 in brine.
Definition BrineCo2Pvt.hpp:179
void setEnableDissolvedGas(bool yesno)
Specify whether the PVT model should consider that the CO2 component can dissolve in the brine phase.
Definition BrineCo2Pvt.hpp:152
A class for the brine fluid properties.
Definition BrineDynamic.hpp:48
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure, const Evaluation &salinity, bool extrapolate=false)
The density of the liquid component at a given pressure in and temperature in .
Definition BrineDynamic.hpp:263
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &, const Evaluation &salinity)
The dynamic viscosity of pure water.
Definition BrineDynamic.hpp:340
A class for the CO2 fluid properties.
Definition CO2.hpp:54
static Evaluation gasEnthalpy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific enthalpy of gaseous CO2 [J/kg].
Definition CO2.hpp:169
static Scalar molarMass()
The mass in [kg] of one mole of CO2.
Definition CO2.hpp:71
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:194
static Scalar molarMass()
The molar mass in of the component.
Definition Component.hpp:93
Definition EclipseState.hpp:63
Definition Schedule.hpp:88
A simple version of pure water with density from Hu et al.
Definition SimpleHuDuanH2O.hpp:65
static Evaluation liquidEnthalpy(const Evaluation &temperature, const Evaluation &)
Specific enthalpy of liquid water .
Definition SimpleHuDuanH2O.hpp:198
static Evaluation liquidViscosity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate)
The dynamic viscosity of pure water.
Definition SimpleHuDuanH2O.hpp:351
static Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate)
The density of pure water at a given pressure and temperature .
Definition SimpleHuDuanH2O.hpp:310
static Scalar molarMass()
The molar mass in of water.
Definition SimpleHuDuanH2O.hpp:99
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30