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#include <cstddef>
47#include <vector>
48
49namespace Opm {
50
51class EclipseState;
52class Schedule;
53class Co2StoreConfig;
54class EzrokhiTable;
55
60template <class Scalar>
62{
63 static constexpr bool extrapolate = true;
64 //typedef H2O<Scalar> H2O_IAPWS;
65 //typedef Brine<Scalar, H2O_IAPWS> Brine_IAPWS;
66 //typedef TabulatedComponent<Scalar, H2O_IAPWS> H2O_Tabulated;
67 //typedef TabulatedComponent<Scalar, Brine_IAPWS> Brine_Tabulated;
68
69 //typedef H2O_Tabulated H2O;
70 //typedef Brine_Tabulated Brine;
71
72
73public:
76 using CO2 = ::Opm::CO2<Scalar>;
77
80
81 explicit BrineCo2Pvt() = default;
82
83 explicit BrineCo2Pvt(const std::vector<Scalar>& salinity,
84 int activityModel = 3,
85 int thermalMixingModelSalt = 1,
86 int thermalMixingModelLiquid = 2,
87 Scalar T_ref = 288.71, //(273.15 + 15.56)
88 Scalar P_ref = 101325);
89
90#if HAVE_ECL_INPUT
95 void initFromState(const EclipseState& eclState, const Schedule&);
96#endif
97
98 void setNumRegions(std::size_t numRegions);
99
100 void setVapPars(const Scalar, const Scalar)
101 {
102 }
103
107 void setReferenceDensities(unsigned regionIdx,
108 Scalar rhoRefBrine,
109 Scalar rhoRefCO2,
110 Scalar /*rhoRefWater*/);
111
115 void initEnd()
116 {
117 }
118
125 void setEnableDissolvedGas(bool yesno)
126 { enableDissolution_ = yesno; }
127
135 { enableSaltConcentration_ = yesno; }
136
140 void setActivityModelSalt(int activityModel);
141
145 void setThermalMixingModel(int thermalMixingModelSalt, int thermalMixingModelLiquid);
146
147 void setEzrokhiDenCoeff(const std::vector<EzrokhiTable>& denaqa);
148
149 void setEzrokhiViscCoeff(const std::vector<EzrokhiTable>& viscaqa);
150
154 unsigned numRegions() const
155 { return brineReferenceDensity_.size(); }
156
157 Scalar hVap(unsigned ) const{
158 return 0;
159 }
160
164 template <class Evaluation>
165 Evaluation internalEnergy(unsigned regionIdx,
166 const Evaluation& temperature,
167 const Evaluation& pressure,
168 const Evaluation& Rs,
169 const Evaluation& saltConcentration) const
170 {
171 OPM_TIMEFUNCTION_LOCAL();
172 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltConcentration);
173 const Evaluation xlCO2 = convertRsToXoG_(Rs,regionIdx);
174 return (liquidEnthalpyBrineCO2_(temperature,
175 pressure,
176 salinity,
177 xlCO2)
178 - pressure / density(regionIdx, temperature, pressure, Rs, salinity ));
179 }
183 template <class Evaluation>
184 Evaluation internalEnergy(unsigned regionIdx,
185 const Evaluation& temperature,
186 const Evaluation& pressure,
187 const Evaluation& Rs) const
188 {
189 OPM_TIMEFUNCTION_LOCAL();
190 const Evaluation xlCO2 = convertRsToXoG_(Rs,regionIdx);
191 return (liquidEnthalpyBrineCO2_(temperature,
192 pressure,
193 Evaluation(salinity_[regionIdx]),
194 xlCO2)
195 - pressure / density(regionIdx, temperature, pressure, Rs, Evaluation(salinity_[regionIdx])));
196 }
197
201 template <class Evaluation>
202 Evaluation viscosity(unsigned regionIdx,
203 const Evaluation& temperature,
204 const Evaluation& pressure,
205 const Evaluation& /*Rs*/) const
206 {
207 //TODO: The viscosity does not yet depend on the composition
208 return saturatedViscosity(regionIdx, temperature, pressure);
209 }
210
214 template <class Evaluation>
215 Evaluation saturatedViscosity(unsigned regionIdx,
216 const Evaluation& temperature,
217 const Evaluation& pressure,
218 const Evaluation& saltConcentration) const
219 {
220 OPM_TIMEFUNCTION_LOCAL();
221 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature, pressure, saltConcentration);
222 if (enableEzrokhiViscosity_) {
223 const Evaluation& mu_pure = H2O::liquidViscosity(temperature, pressure, extrapolate);
224 const Evaluation& nacl_exponent = ezrokhiExponent_(temperature, ezrokhiViscNaClCoeff_);
225 return mu_pure * pow(10.0, nacl_exponent * salinity);
226 }
227 else {
228 return Brine::liquidViscosity(temperature, pressure, salinity);
229 }
230 }
231
235 template <class Evaluation>
236 Evaluation viscosity(unsigned regionIdx,
237 const Evaluation& temperature,
238 const Evaluation& pressure,
239 const Evaluation& /*Rsw*/,
240 const Evaluation& saltConcentration) const
241 {
242 OPM_TIMEFUNCTION_LOCAL();
243 //TODO: The viscosity does not yet depend on the composition
244 return saturatedViscosity(regionIdx, temperature, pressure, saltConcentration);
245 }
246
250 template <class Evaluation>
251 Evaluation saturatedViscosity(unsigned regionIdx,
252 const Evaluation& temperature,
253 const Evaluation& pressure) const
254 {
255 OPM_TIMEFUNCTION_LOCAL();
256 if (enableEzrokhiViscosity_) {
257 const Evaluation& mu_pure = H2O::liquidViscosity(temperature, pressure, extrapolate);
258 const Evaluation& nacl_exponent = ezrokhiExponent_(temperature, ezrokhiViscNaClCoeff_);
259 return mu_pure * pow(10.0, nacl_exponent * Evaluation(salinity_[regionIdx]));
260 }
261 else {
262 return Brine::liquidViscosity(temperature, pressure, Evaluation(salinity_[regionIdx]));
263 }
264
265 }
266
267
271 template <class Evaluation>
272 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
273 const Evaluation& temperature,
274 const Evaluation& pressure,
275 const Evaluation& saltconcentration) const
276 {
277 OPM_TIMEFUNCTION_LOCAL();
278 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature,
279 pressure, saltconcentration);
280 Evaluation rs_sat = rsSat(regionIdx, temperature, pressure, salinity);
281 return (1.0 - convertRsToXoG_(rs_sat,regionIdx)) * density(regionIdx, temperature,
282 pressure, rs_sat, salinity)
283 / brineReferenceDensity_[regionIdx];
284 }
288 template <class Evaluation>
289 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
290 const Evaluation& temperature,
291 const Evaluation& pressure,
292 const Evaluation& Rs,
293 const Evaluation& saltConcentration) const
294 {
295 OPM_TIMEFUNCTION_LOCAL();
296 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature,
297 pressure, saltConcentration);
298 return (1.0 - convertRsToXoG_(Rs,regionIdx)) * density(regionIdx, temperature,
299 pressure, Rs, salinity)
300 / brineReferenceDensity_[regionIdx];
301 }
305 template <class Evaluation>
306 Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
307 const Evaluation& temperature,
308 const Evaluation& pressure,
309 const Evaluation& Rs) const
310 {
311 return (1.0 - convertRsToXoG_(Rs,regionIdx)) * density(regionIdx, temperature, pressure,
312 Rs, Evaluation(salinity_[regionIdx]))
313 / brineReferenceDensity_[regionIdx];
314 }
315
319 template <class Evaluation>
320 Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
321 const Evaluation& temperature,
322 const Evaluation& pressure) const
323 {
324 OPM_TIMEFUNCTION_LOCAL();
325 Evaluation rs_sat = rsSat(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
326 return (1.0 - convertRsToXoG_(rs_sat,regionIdx)) * density(regionIdx, temperature, pressure,
327 rs_sat, Evaluation(salinity_[regionIdx]))
328 / brineReferenceDensity_[regionIdx];
329 }
330
337 template <class Evaluation>
338 Evaluation saturationPressure(unsigned /*regionIdx*/,
339 const Evaluation& /*temperature*/,
340 const Evaluation& /*Rs*/) const
341 {
342 throw std::runtime_error("Requested the saturation pressure for the brine-co2 pvt module. "
343 "Not yet implemented.");
344 }
345
352 template <class Evaluation>
353 Evaluation saturationPressure(unsigned /*regionIdx*/,
354 const Evaluation& /*temperature*/,
355 const Evaluation& /*Rs*/,
356 const Evaluation& /*saltConcentration*/) const
357 {
358 throw std::runtime_error("Requested the saturation pressure for the brine-co2 pvt module. "
359 "Not yet implemented.");
360 }
361
365 template <class Evaluation>
366 Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
367 const Evaluation& temperature,
368 const Evaluation& pressure,
369 const Evaluation& /*oilSaturation*/,
370 const Evaluation& /*maxOilSaturation*/) const
371 {
372 //TODO support VAPPARS
373 return rsSat(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
374 }
375
379 template <class Evaluation>
380 Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
381 const Evaluation& temperature,
382 const Evaluation& pressure,
383 const Evaluation& saltConcentration) const
384 {
385 const Evaluation salinity = salinityFromConcentration(regionIdx, temperature,
386 pressure, saltConcentration);
387 return rsSat(regionIdx, temperature, pressure, salinity);
388 }
389
393 template <class Evaluation>
394 Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
395 const Evaluation& temperature,
396 const Evaluation& pressure) const
397 {
398 return rsSat(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
399 }
400
401 Scalar oilReferenceDensity(unsigned regionIdx) const
402 { return brineReferenceDensity_[regionIdx]; }
403
404 Scalar waterReferenceDensity(unsigned regionIdx) const
405 { return brineReferenceDensity_[regionIdx]; }
406
407 Scalar gasReferenceDensity(unsigned regionIdx) const
408 { return co2ReferenceDensity_[regionIdx]; }
409
410 Scalar salinity(unsigned regionIdx) const
411 { return salinity_[regionIdx]; }
412
413 template <class Evaluation>
414 Evaluation diffusionCoefficient(const Evaluation& temperature,
415 const Evaluation& pressure,
416 unsigned /*compIdx*/) const
417 {
418 OPM_TIMEFUNCTION_LOCAL();
419 // Diffusion coefficient of CO2 in pure water according to
420 // (McLachlan and Danckwerts, 1972)
421 const Evaluation log_D_H20 = -4.1764 + 712.52 / temperature
422 -2.5907e5 / (temperature * temperature);
423
424 // Diffusion coefficient of CO2 in the brine phase modified following
425 // (Ratcliff and Holdcroft,1963 and Al-Rawajfeh, 2004)
426
427 // Water viscosity
428 const Evaluation& mu_H20 = H2O::liquidViscosity(temperature, pressure, extrapolate);
429 Evaluation mu_Brine;
430 if (enableEzrokhiViscosity_) {
431 const Evaluation& nacl_exponent = ezrokhiExponent_(temperature,
432 ezrokhiViscNaClCoeff_);
433 mu_Brine = mu_H20 * pow(10.0, nacl_exponent * Evaluation(salinity_[0]));
434 }
435 else {
436 // Brine viscosity
437 mu_Brine = Brine::liquidViscosity(temperature, pressure, Evaluation(salinity_[0]));
438 }
439 const Evaluation log_D_Brine = log_D_H20 - 0.87*log10(mu_Brine / mu_H20);
440
441 return pow(Evaluation(10), log_D_Brine) * 1e-4; // convert from cm2/s to m2/s
442 }
443
444 template <class Evaluation>
445 Evaluation density(unsigned regionIdx,
446 const Evaluation& temperature,
447 const Evaluation& pressure,
448 const Evaluation& Rs,
449 const Evaluation& salinity) const
450 {
451 OPM_TIMEFUNCTION_LOCAL();
452 Evaluation xlCO2 = convertXoGToxoG_(convertRsToXoG_(Rs,regionIdx), salinity);
453 Evaluation result = liquidDensity_(temperature,
454 pressure,
455 xlCO2,
456 salinity);
457
458 Valgrind::CheckDefined(result);
459 return result;
460 }
461
462 template <class Evaluation>
463 Evaluation rsSat(unsigned regionIdx,
464 const Evaluation& temperature,
465 const Evaluation& pressure,
466 const Evaluation& salinity) const
467 {
468 OPM_TIMEFUNCTION_LOCAL();
469 if (!enableDissolution_) {
470 return 0.0;
471 }
472
473 // calulate the equilibrium composition for the given
474 // temperature and pressure.
475 Evaluation xgH2O;
476 Evaluation xlCO2;
478 pressure,
479 salinity,
480 /*knownPhaseIdx=*/-1,
481 xlCO2,
482 xgH2O,
483 activityModel_,
484 extrapolate);
485
486 // normalize the phase compositions
487 xlCO2 = max(0.0, min(1.0, xlCO2));
488
489 return convertXoGToRs(convertxoGToXoG(xlCO2, salinity), regionIdx);
490 }
491
492private:
493 template <class LhsEval>
494 LhsEval ezrokhiExponent_(const LhsEval& temperature,
495 const std::vector<Scalar>& ezrokhiCoeff) const
496 {
497 const LhsEval& tempC = temperature - 273.15;
498 return ezrokhiCoeff[0] + tempC * (ezrokhiCoeff[1] + ezrokhiCoeff[2] * tempC);
499 }
500
501 template <class LhsEval>
502 LhsEval liquidDensity_(const LhsEval& T,
503 const LhsEval& pl,
504 const LhsEval& xlCO2,
505 const LhsEval& salinity) const
506 {
507 OPM_TIMEFUNCTION_LOCAL();
508 Valgrind::CheckDefined(T);
509 Valgrind::CheckDefined(pl);
510 Valgrind::CheckDefined(xlCO2);
511
512 if (!extrapolate && T < 273.15) {
513 const std::string msg =
514 "Liquid density for Brine and CO2 is only "
515 "defined above 273.15K (is " +
516 std::to_string(getValue(T)) + "K)";
517 throw NumericalProblem(msg);
518 }
519 if (!extrapolate && pl >= 2.5e8) {
520 const std::string msg =
521 "Liquid density for Brine and CO2 is only "
522 "defined below 250MPa (is " +
523 std::to_string(getValue(pl)) + "Pa)";
524 throw NumericalProblem(msg);
525 }
526
527 const LhsEval& rho_pure = H2O::liquidDensity(T, pl, extrapolate);
528 if (enableEzrokhiDensity_) {
529 const LhsEval& nacl_exponent = ezrokhiExponent_(T, ezrokhiDenNaClCoeff_);
530 const LhsEval& co2_exponent = ezrokhiExponent_(T, ezrokhiDenCo2Coeff_);
531 const LhsEval& XCO2 = convertxoGToXoG(xlCO2, salinity);
532 return rho_pure * pow(10.0, nacl_exponent * salinity + co2_exponent * XCO2);
533 }
534 else {
535 const LhsEval& rho_brine = Brine::liquidDensity(T, pl, salinity, extrapolate);
536 const LhsEval& rho_lCO2 = liquidDensityWaterCO2_(T, pl, xlCO2);
537 const LhsEval& contribCO2 = rho_lCO2 - rho_pure;
538 return rho_brine + contribCO2;
539 }
540 }
541
542 template <class LhsEval>
543 LhsEval liquidDensityWaterCO2_(const LhsEval& temperature,
544 const LhsEval& pl,
545 const LhsEval& xlCO2) const
546 {
547 OPM_TIMEFUNCTION_LOCAL();
548 Scalar M_CO2 = CO2::molarMass();
549 Scalar M_H2O = H2O::molarMass();
550
551 const LhsEval& tempC = temperature - 273.15; /* tempC : temperature in °C */
552 const LhsEval& rho_pure = H2O::liquidDensity(temperature, pl, extrapolate);
553 // calculate the mole fraction of CO2 in the liquid. note that xlH2O is available
554 // as a function parameter, but in the case of a pure gas phase the value of M_T
555 // for the virtual liquid phase can become very large
556 const LhsEval xlH2O = 1.0 - xlCO2;
557 const LhsEval& M_T = M_H2O * xlH2O + M_CO2 * xlCO2;
558 const LhsEval& V_phi =
559 (37.51 +
560 tempC*(-9.585e-2 +
561 tempC*(8.74e-4 -
562 tempC*5.044e-7))) / 1.0e6;
563 return 1 / (xlCO2 * V_phi/M_T + M_H2O * xlH2O / (rho_pure * M_T));
564 }
565
570 template <class LhsEval>
571 LhsEval convertRsToXoG_(const LhsEval& Rs, unsigned regionIdx) const
572 {
573 OPM_TIMEFUNCTION_LOCAL();
574 Scalar rho_oRef = brineReferenceDensity_[regionIdx];
575 Scalar rho_gRef = co2ReferenceDensity_[regionIdx];
576
577 const LhsEval& rho_oG = Rs*rho_gRef;
578 return rho_oG/(rho_oRef + rho_oG);
579 }
580
584 template <class LhsEval>
585 LhsEval convertXoGToxoG_(const LhsEval& XoG, const LhsEval& salinity) const
586 {
587 OPM_TIMEFUNCTION_LOCAL();
588 Scalar M_CO2 = CO2::molarMass();
589 LhsEval M_Brine = Brine::molarMass(salinity);
590 return XoG*M_Brine / (M_CO2*(1 - XoG) + XoG*M_Brine);
591 }
592
596 template <class LhsEval>
597 LhsEval convertxoGToXoG(const LhsEval& xoG, const LhsEval& salinity) const
598 {
599 OPM_TIMEBLOCK_LOCAL(convertxoGToXoG);
600 Scalar M_CO2 = CO2::molarMass();
601 LhsEval M_Brine = Brine::molarMass(salinity);
602
603 return xoG*M_CO2 / (xoG*(M_CO2 - M_Brine) + M_Brine);
604 }
605
610 template <class LhsEval>
611 LhsEval convertXoGToRs(const LhsEval& XoG, unsigned regionIdx) const
612 {
613 Scalar rho_oRef = brineReferenceDensity_[regionIdx];
614 Scalar rho_gRef = co2ReferenceDensity_[regionIdx];
615
616 return XoG/(1.0 - XoG)*(rho_oRef/rho_gRef);
617 }
618
619 template <class LhsEval>
620 LhsEval liquidEnthalpyBrineCO2_(const LhsEval& T,
621 const LhsEval& p,
622 const LhsEval& salinity,
623 const LhsEval& X_CO2_w) const
624 {
625 if (liquidMixType_ == Co2StoreConfig::LiquidMixingType::NONE
626 && saltMixType_ == Co2StoreConfig::SaltMixingType::NONE)
627 {
628 return H2O::liquidEnthalpy(T, p);
629 }
630
631 LhsEval hw = H2O::liquidEnthalpy(T, p) /1E3; /* kJ/kg */
632 LhsEval h_ls1 = hw;
633 // Use mixing model for salt by MICHAELIDES
634 if (saltMixType_ == Co2StoreConfig::SaltMixingType::MICHAELIDES) {
635
636 /* X_CO2_w : mass fraction of CO2 in brine */
637
638 /* same function as enthalpy_brine, only extended by CO2 content */
639
640 /*Numerical coefficents from PALLISER*/
641 static constexpr Scalar f[] = {
642 2.63500E-1, 7.48368E-6, 1.44611E-6, -3.80860E-10
643 };
644
645 /*Numerical coefficents from MICHAELIDES for the enthalpy of brine*/
646 static constexpr Scalar a[4][3] = {
647 { 9633.6, -4080.0, +286.49 },
648 { +166.58, +68.577, -4.6856 },
649 { -0.90963, -0.36524, +0.249667E-1 },
650 { +0.17965E-2, +0.71924E-3, -0.4900E-4 }
651 };
652
653 LhsEval theta, h_NaCl;
654 LhsEval d_h, delta_h;
655
656 theta = T - 273.15;
657
658 // Regularization
659 Scalar scalarTheta = scalarValue(theta);
660 Scalar S_lSAT = f[0] + scalarTheta*(f[1] + scalarTheta*(f[2] + scalarTheta*f[3]));
661
662 LhsEval S = salinity;
663 if (S > S_lSAT)
664 S = S_lSAT;
665
666 /*DAUBERT and DANNER*/
667 /*U=*/h_NaCl = (3.6710E4*T + 0.5*(6.2770E1)*T*T - ((6.6670E-2)/3)*T*T*T
668 +((2.8000E-5)/4)*(T*T*T*T))/(58.44E3)- 2.045698e+02; /* kJ/kg */
669
670 LhsEval m = 1E3 / 58.44 * S / (1 - S);
671 d_h = 0;
672
673 for (int i = 0; i <=3; ++i) {
674 for (int j = 0; j <= 2; ++j) {
675 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
690 LhsEval delta_hCO2, hg;
691 /* heat of dissolution for CO2 according to Fig. 6 in Duan and Sun 2003. (kJ/kg)
692 In the relevant temperature ranges CO2 dissolution is
693 exothermal */
694 if (liquidMixType_ == Co2StoreConfig::LiquidMixingType::DUANSUN) {
695 delta_hCO2 = (-57.4375 + T * 0.1325) * 1000/44;
696 }
697 else {
698 delta_hCO2 = 0.0;
699 }
700
701 /* enthalpy contribution of CO2 (kJ/kg) */
702 hg = CO2::gasEnthalpy(T, p, extrapolate)/1E3 + delta_hCO2;
703
704 /* Enthalpy of brine with dissolved CO2 */
705 return (h_ls1 - X_CO2_w*hw + hg*X_CO2_w)*1E3; /*J/kg*/
706 }
707
708 template <class LhsEval>
709 const LhsEval salinityFromConcentration(unsigned regionIdx,
710 const LhsEval&T,
711 const LhsEval& P,
712 const LhsEval& saltConcentration) const
713 {
714 if (enableSaltConcentration_) {
715 return saltConcentration/H2O::liquidDensity(T, P, true);
716 }
717
718 return salinity(regionIdx);
719 }
720
721 std::vector<Scalar> brineReferenceDensity_{};
722 std::vector<Scalar> co2ReferenceDensity_{};
723 std::vector<Scalar> salinity_{};
724 std::vector<Scalar> ezrokhiDenNaClCoeff_{};
725 std::vector<Scalar> ezrokhiDenCo2Coeff_{};
726 std::vector<Scalar> ezrokhiViscNaClCoeff_{};
727 bool enableEzrokhiDensity_ = false;
728 bool enableEzrokhiViscosity_ = false;
729 bool enableDissolution_ = true;
730 bool enableSaltConcentration_ = false;
731 int activityModel_{};
732 Co2StoreConfig::LiquidMixingType liquidMixType_{};
733 Co2StoreConfig::SaltMixingType saltMixType_{};
734
735};
736
737} // namespace Opm
738
739#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:62
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:184
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:236
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:289
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:165
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:366
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:380
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:251
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:306
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition BrineCo2Pvt.hpp:154
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:272
void setActivityModelSalt(int activityModel)
Set activity coefficient model for salt in solubility model.
Definition BrineCo2Pvt.cpp:172
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:338
void initEnd()
Finish initializing the oil phase PVT properties.
Definition BrineCo2Pvt.hpp:115
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:320
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:353
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:215
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefBrine, Scalar rhoRefCO2, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition BrineCo2Pvt.cpp:161
void setEnableSaltConcentration(bool yesno)
Specify whether the PVT model should consider salt concentration from the fluidstate or a fixed salin...
Definition BrineCo2Pvt.hpp:134
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:202
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:394
void setThermalMixingModel(int thermalMixingModelSalt, int thermalMixingModelLiquid)
Set thermal mixing model for co2 in brine.
Definition BrineCo2Pvt.cpp:184
void setEnableDissolvedGas(bool yesno)
Specify whether the PVT model should consider that the CO2 component can dissolve in the brine phase.
Definition BrineCo2Pvt.hpp:125
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 Scalar molarMass()
The molar mass in of the component.
Definition Component.hpp:93
Definition EclipseState.hpp:63
Definition Schedule.hpp:89
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