diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml
index 6e154a1faaf..41556c3b7c7 100644
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml
+++ b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/spe11b_vti_source_base.xml
@@ -81,8 +81,10 @@
logLevel="0"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ tables/pvtgas_thermal.txt, tables/pvtliquid_thermal.txt }"
- flashModelParaFile="tables/co2flash_thermal.txt" />
+ pressureCoordinates="{1e5, 5.e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{283.15, 353.5}"
+ temperatureInterval="2.5" />
+ pressureCoordinates="{1e5, 5.e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{283.15, 353.5}"
+ temperatureInterval="2.5" />
diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt
deleted file mode 100755
index 3383d920865..00000000000
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtgas_thermal.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-DensityFun SpanWagnerCO2Density 1e5 5.e7 1e6 283.15 353.5 2.5
-ViscosityFun FenghourCO2Viscosity 1e5 5.e7 1e6 283.15 353.5 2.5
-EnthalpyFun CO2Enthalpy 1.e5 5.e7 1e6 283.15 353.5 2.5
diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt
deleted file mode 100644
index b912980f9db..00000000000
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/SPE11/b/tables/pvtliquid_thermal.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-DensityFun PhillipsBrineDensity 1e5 5.e7 1e6 283.15 353.15 2.5 0
-ViscosityFun PhillipsBrineViscosity 0
-EnthalpyFun BrineEnthalpy 1e5 5.e7 1e6 283.15 353.15 2.5 0
diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt
deleted file mode 100644
index d02e891352d..00000000000
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt
+++ /dev/null
@@ -1 +0,0 @@
-FlashModel CO2Solubility 6.6e6 4e7 1e6 302.0 312.0 5 1.901285269
diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt
deleted file mode 100644
index 57977514453..00000000000
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-DensityFun SpanWagnerCO2Density 6.6e6 4e7 1e6 302.0 312.0 5
-ViscosityFun FenghourCO2Viscosity 6.6e6 4e7 1e6 302.0 312.0 5
diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt
deleted file mode 100644
index 6f6cea73c28..00000000000
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-DensityFun PhillipsBrineDensity 6.6e6 4e7 1e6 302.0 312.0 5 1.901285269
-ViscosityFun PhillipsBrineViscosity 1.901285269
diff --git a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base.xml b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base.xml
index cbcb33f0360..8b01872f611 100644
--- a/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base.xml
+++ b/inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/thermalLeakyWell_base.xml
@@ -102,8 +102,11 @@
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt"/>
+ pressureCoordinates="{6.6e6, 4e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{302.0, 312.0}"
+ temperatureInterval="5"
+ salinity="1.901285269" />
+ pressureCoordinates="{6.6e6, 4e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{302.0, 312.0}"
+ temperatureInterval="5"
+ salinity="1.901285269" />
+ pressureCoordinates="{1e6, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{1e6, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{1e6, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{1e6, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1.0" />
+ pressureCoordinates="{1e6, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1.0" />
+ pressureCoordinates="{5e5, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{5e5, 1.5e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{1.0e5, 6e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{283.15, 393.5}"
+ temperatureInterval="5"
+ salinity="1.901285269"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
+ pressureCoordinates="{1.0e5, 6e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{283.15, 393.5}"
+ temperatureInterval="5"
+ salinity="1.901285269"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
diff --git a/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml b/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml
index c731abcf696..095bff497a4 100644
--- a/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml
+++ b/inputFiles/compositionalMultiphaseWell/benchmarks/Class09Pb3/class09_pb3_hystRelperm_direct_base.xml
@@ -72,8 +72,13 @@
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ tables/pvtgas.txt, tables/pvtliquid_ez.txt }"
- flashModelParaFile="tables/co2flash.txt"/>
+ pressureCoordinates="{1.0e5, 6e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{283.15, 393.5}"
+ temperatureInterval="5"
+ salinity="1.901285269"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
+ pressureCoordinates="{1.0e5, 6e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{283.15, 393.5}"
+ temperatureInterval="5"
+ salinity="1.901285269"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
+ pressureCoordinates="{1.0e5, 7.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{285.15, 395.15}"
+ temperatureInterval="5" />
+ pressureCoordinates="{1.0e5, 7.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{285.15, 395.15}"
+ temperatureInterval="5" />
+ pressureCoordinates="{1.0e5, 7.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{285.15, 395.15}"
+ temperatureInterval="5"
+ salinity="0" />
+ pressureCoordinates="{1.0e5, 7.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{285.15, 395.15}"
+ temperatureInterval="5" />
+ pressureCoordinates="{1.0e5, 7.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{285.15, 395.15}"
+ temperatureInterval="5" />
+ pressureCoordinates="{1.0e5, 7.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{285.15, 395.15}"
+ temperatureInterval="5" />
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 460}"
+ temperatureInterval="10"
+ salinity="1.0" />
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 460}"
+ temperatureInterval="10"
+ salinity="1.0" />
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 460}"
+ temperatureInterval="10"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0.0, 0.0, 0.0}" />
+ solubilityModel="SpycherPruess"
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 460}"
+ temperatureInterval="10"
+ salinity="1.0" />
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 460}"
+ temperatureInterval="10"
+ salinity="1.0" />
diff --git a/inputFiles/constitutiveDriver/testPVT_CO2BrineTables.xml b/inputFiles/constitutiveDriver/testPVT_CO2BrineTables.xml
index 9cb487f12c3..74d5b99066a 100644
--- a/inputFiles/constitutiveDriver/testPVT_CO2BrineTables.xml
+++ b/inputFiles/constitutiveDriver/testPVT_CO2BrineTables.xml
@@ -54,14 +54,24 @@
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ testPVT_data/carbonDioxidePVT.txt, testPVT_data/brinePVT.txt }"
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 460}"
+ temperatureInterval="10"
+ salinity="1.0"
+ solubilityModel="Tables"
solubilityTableNames="{ co2Solubility }" />
diff --git a/inputFiles/constitutiveDriver/testPVT_Compositional.xml b/inputFiles/constitutiveDriver/testPVT_Compositional.xml
deleted file mode 100644
index d5d65514d5a..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_Compositional.xml
+++ /dev/null
@@ -1,184 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/inputFiles/constitutiveDriver/testPVT_CompositionalPhillipsBrine.xml b/inputFiles/constitutiveDriver/testPVT_CompositionalPhillipsBrine.xml
deleted file mode 100644
index ea20f1af5b2..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_CompositionalPhillipsBrine.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/inputFiles/constitutiveDriver/testPVT_data/brinePVT.txt b/inputFiles/constitutiveDriver/testPVT_data/brinePVT.txt
deleted file mode 100644
index 7894909ba43..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/brinePVT.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-DensityFun PhillipsBrineDensity 1e6 5e7 1e6 340 360 10 1.0
-ViscosityFun PhillipsBrineViscosity 1.0
diff --git a/inputFiles/constitutiveDriver/testPVT_data/brinePVTEzrokhi.txt b/inputFiles/constitutiveDriver/testPVT_data/brinePVTEzrokhi.txt
deleted file mode 100755
index 01dc19cc64f..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/brinePVTEzrokhi.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-DensityFun EzrokhiBrineDensity 0.1033 -2.2991e-5 -2.3658e-6
-ViscosityFun EzrokhiBrineViscosity 0 0 0
diff --git a/inputFiles/constitutiveDriver/testPVT_data/brinePVT_thermal.txt b/inputFiles/constitutiveDriver/testPVT_data/brinePVT_thermal.txt
deleted file mode 100644
index 20d27884f68..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/brinePVT_thermal.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-DensityFun PhillipsBrineDensity 1e6 5e7 1e6 340 360 10 1.0
-ViscosityFun PhillipsBrineViscosity 1.0
-EnthalpyFun BrineEnthalpy 1e6 5e7 1e6 340 360 10 1.0
diff --git a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxideFlash.txt b/inputFiles/constitutiveDriver/testPVT_data/carbonDioxideFlash.txt
deleted file mode 100644
index 40c0cc8c35a..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxideFlash.txt
+++ /dev/null
@@ -1 +0,0 @@
-FlashModel CO2Solubility 1e6 5e7 1e6 340 350 10 0
diff --git a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxidePVT.txt b/inputFiles/constitutiveDriver/testPVT_data/carbonDioxidePVT.txt
deleted file mode 100644
index f9661292bea..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxidePVT.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-DensityFun SpanWagnerCO2Density 1e6 5e7 1e6 340 360 10
-ViscosityFun FenghourCO2Viscosity 1e6 5e7 1e6 340 460 10
diff --git a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxidePVT_thermal.txt b/inputFiles/constitutiveDriver/testPVT_data/carbonDioxidePVT_thermal.txt
deleted file mode 100644
index 01cfd693883..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxidePVT_thermal.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-DensityFun SpanWagnerCO2Density 1e6 5e7 1e6 340 360 10
-ViscosityFun FenghourCO2Viscosity 1e6 5e7 1e6 340 460 10
-EnthalpyFun CO2Enthalpy 1e6 5e7 1e6 340 460 10
diff --git a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxideSpycherPruessFlash.txt b/inputFiles/constitutiveDriver/testPVT_data/carbonDioxideSpycherPruessFlash.txt
deleted file mode 100644
index 98f2cb18927..00000000000
--- a/inputFiles/constitutiveDriver/testPVT_data/carbonDioxideSpycherPruessFlash.txt
+++ /dev/null
@@ -1 +0,0 @@
-FlashModel CO2Solubility 0.99e6 5.01e7 4.911e6 339 351 1 0 1.0e-10 SpycherPruess
diff --git a/inputFiles/constitutiveDriver/testPVT_docExample.xml b/inputFiles/constitutiveDriver/testPVT_docExample.xml
index 6534f6b9eb9..6da70540fb2 100644
--- a/inputFiles/constitutiveDriver/testPVT_docExample.xml
+++ b/inputFiles/constitutiveDriver/testPVT_docExample.xml
@@ -9,8 +9,11 @@
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ testPVT_data/carbonDioxidePVT.txt, testPVT_data/brinePVT.txt }"
- flashModelParaFile="testPVT_data/carbonDioxideFlash.txt"/>
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="1e6"
+ temperatureCoordinates="{340, 350}"
+ temperatureInterval="10"
+ salinity="0.0" />
diff --git a/inputFiles/poromechanics/PoroElastic_hybridHexPrism_co2_base.xml b/inputFiles/poromechanics/PoroElastic_hybridHexPrism_co2_base.xml
index 86462b23ca7..591f8676393 100644
--- a/inputFiles/poromechanics/PoroElastic_hybridHexPrism_co2_base.xml
+++ b/inputFiles/poromechanics/PoroElastic_hybridHexPrism_co2_base.xml
@@ -90,8 +90,11 @@
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvt_tables/pvtgas.txt, pvt_tables/pvtliquid.txt }"
- flashModelParaFile="pvt_tables/co2flash.txt"/>
+ pressureCoordinates="{1e5, 5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{288, 368}"
+ temperatureInterval="10"
+ salinity="2.5" />
+ pressureCoordinates="{1e5, 5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{288, 368}"
+ temperatureInterval="10"
+ salinity="2.5" />
+ pressureCoordinates="{1e5, 5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{288, 368}"
+ temperatureInterval="10"
+ salinity="2.5" />
+ pressureCoordinates="{1.0e5, 1.0e8}"
+ pressureInterval="1.0e5"
+ temperatureCoordinates="{288.15, 369.15}"
+ temperatureInterval="2.0" />
+ pressureCoordinates="{1e6, 10e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{1e6, 10e7}"
+ pressureInterval="5e4"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
+ pressureCoordinates="{1.0e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{299.15, 369.15}"
+ temperatureInterval="10.0" />
+ pressureCoordinates="{1e5, 5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{288, 368}"
+ temperatureInterval="10"
+ salinity="2.5" />
+ pressureCoordinates="{1e6, 5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{367.15, 369.15}"
+ temperatureInterval="1" />
``, ```` nodes in the input.
+The models are represented in the input by the ```` and ```` nodes for the isothermal model and ```` and ```` nodes for their thermal counterparts.
The following attributes are supported:
@@ -300,6 +421,50 @@ co2,CO2 CO2 component
water,liquid Water component
============= ===============
+The salinity is specified in moles per kg of brine using the ``salinity`` attribute.
+
+The solubility model is selected using the ``solubilityModel`` attribute. If the solubility is set to ``Tables`` then user defined tables should be provided using the ``solubilityTableNames`` attribute. If a single table is provided, this will be treated as the CO2 solubility table while water vaporization will be zero. It 2 tables are provided, then the second table will be treated as the water vaporization table. Both values must give the names of ```` xml elements which define lookup tables for functions of pressure and temperature.
+
+These models utilize pre-computed lookup tables for fluid properties. These tables are constructed over defined two-dimensional grids of pressure and temperature. The user must specify the discretization of these grids using specific XML attributes.
+
+The grid definitions rely on the following XML attributes:
+
+* ``pressureCoordinates``: A list of pressure coordinate boundaries or explicit values.
+* ``pressureInterval``: (Optional) The step size for uniform pressure discretization.
+* ``temperatureCoordinates``: A list of temperature coordinate boundaries or explicit values.
+* ``temperatureInterval``: (Optional) The step size for uniform temperature discretization.
+
+The sequence of evaluation points for either pressure or temperature is generated based on the combination of the ``*Coordinates`` array and the corresponding ``*Interval`` value.
+
+Let :math:`C = \{c_1, c_2, \dots, c_n\}` be the sequence of values provided in the ``*Coordinates`` attribute, and :math:`\Delta` be the value provided in the ``*Interval`` attribute.
+
+There are two distinct methods for specifying the grid points:
+
+If an interval :math:`\Delta` is specified and is strictly positive (:math:`\Delta > 0`), the grid is generated as a linearly spaced sequence.
+
+* Only the first value (:math:`c_1`) and the last value (:math:`c_n`) of the ``*Coordinates`` array are utilized as the lower and upper bounds.
+* Any intermediate values provided in the array are **ignored**.
+* The generated sequence of points :math:`x_i` is defined as:
+
+ .. math::
+
+ x_i = c_1 + i \cdot \Delta \quad \text{for } i = 0, 1, \dots, k
+
+ where :math:`k` is the maximum integer such that :math:`x_k \le c_n`.
+
+If the ``*Interval`` attribute is omitted, set to zero, or is negative (:math:`\Delta \le 0`), the grid points are taken exactly as provided in the coordinates array.
+
+* The generated grid points exactly map to the provided array: :math:`X = C = \{c_1, c_2, \dots, c_n\}`.
+
+The same table discretization is used for all the properties.
+
+When utilizing the ``CO2BrineEzrokhiFluid`` model or the ``CO2BrineEzrokhiThermalFluid`` mode, the following additional attributes are required to calculate the density and viscosity corrections using the Ezrokhi correlation:
+
+* ``ezrokhiDensityCoefficients``: A three-element array :math:`\{A_1, A_2, A_3\}` defining the empirical coefficients used in the Ezrokhi equation of state to correct brine density.
+* ``ezrokhiViscosityCoefficients``: A three-element array :math:`\{B_1, B_2, B_3\}` defining the empirical coefficients used to correct brine viscosity. These are optional and if not specified, zero values are used.
+
+The default water compressibility can be changed using the ``waterCompressibility`` attribute.
+
Example
=======
@@ -307,12 +472,13 @@ Example
+ name="fluid"
+ phaseNames="{ gas, water }"
+ componentNames="{ co2, water }"
+ componentMolarWeight="{ 44e-3, 18e-3 }"
+ pressureCoordinates="{1.000e+05, 2.512e+05, 6.310e+05, 1.585e+06, 3.981e+06, 1.000e+07}"
+ temperatureCoordinates="{283.15, 305.15, 327.15, 349.15, 371.15, 393.15}"
+ salinity="3.0" />
@@ -320,17 +486,18 @@ Example
+ name="fluid"
+ phaseNames="{ gas, water }"
+ componentNames="{ co2, water }"
+ componentMolarWeight="{ 44e-3, 18e-3 }"
+ pressureCoordinates="{1.0e5, 6e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{283.15, 393.5}"
+ temperatureInterval="5"
+ salinity="1.901285269"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
-
-In the XML code listed above, "co2flash.txt" parameterizes the CO2 solubility table constructed in Step 1.
-The file "pvtgas.txt" parameterizes the CO2 phase density and viscosity tables constructed in Step 2,
-the file "pvtliquid.txt" parameterizes the brine density and viscosity tables according to Phillips or Ezrokhi correlation, depending on chosen fluid model.
References
==========
@@ -363,7 +530,22 @@ References
Coefficients `__,
2003
-
- Engineering ToolBox, `Water - Dynamic (Absolute) and Kinematic Viscosity
`__,
2004
+
+- N. Spycher, K. Pruess and J. Ennis-King, `CO2-H2O mixtures in the geological sequestration of CO2. I.
+ Assessment and calculation of mutual solubilities from 12 to 100°C and up to 600 bar
+ `__,
+ Geochimica et Cosmochimica Acta,
+ vol. 67, pp. 3015-3031, 2003.
+
+- N. Spycher and K. Pruess, `CO2-H2O mixtures in the geological sequestration of CO2. II.
+ Partitioning in chloride brines at 12-100°C and up to 600 bar
+ `__,
+ Geochimica et Cosmochimica Acta,
+ vol. 69, pp. 3309-3320, 2005.
+
+- E. E. Michaelides, `Thermodynamic properties of geothermal fluids.
+ `__,
+ Transactions - Geothermal Resources Council, vol. 5, pp. 361-364, 1981.
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp
index 323abfdd386..de9e9db7f13 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.cpp
@@ -40,34 +40,34 @@ template< typename PHASE1, typename PHASE2, typename FLASH > class
TwoPhaseCatalogNames {};
template<> class
- TwoPhaseCatalogNames< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::NoOpPVTFunction >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >,
- PVTProps::CO2Solubility >
+ TwoPhaseCatalogNames< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, NoOpPVTFunction >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >,
+ CO2Solubility >
{
public:
static string name() { return "CO2BrinePhillipsFluid"; }
};
template<> class
- TwoPhaseCatalogNames< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::BrineEnthalpy >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >,
- PVTProps::CO2Solubility >
+ TwoPhaseCatalogNames< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, BrineEnthalpy >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >,
+ CO2Solubility >
{
public:
static string name() { return "CO2BrinePhillipsThermalFluid"; }
};
template<> class
- TwoPhaseCatalogNames< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::NoOpPVTFunction >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >,
- PVTProps::CO2Solubility >
+ TwoPhaseCatalogNames< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, NoOpPVTFunction >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >,
+ CO2Solubility >
{
public:
static string name() { return "CO2BrineEzrokhiFluid"; }
};
template<> class
- TwoPhaseCatalogNames< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::BrineEnthalpy >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >,
- PVTProps::CO2Solubility >
+ TwoPhaseCatalogNames< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, BrineEnthalpy >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >,
+ CO2Solubility >
{
public:
static string name() { return "CO2BrineEzrokhiThermalFluid"; }
@@ -87,21 +87,6 @@ CO2BrineFluid< PHASE1, PHASE2, FLASH >::
CO2BrineFluid( string const & name, Group * const parent ):
MultiFluidBase( name, parent )
{
- registerWrapper( viewKeyStruct::phasePVTParaFilesString(), &m_phasePVTParaFiles ).
- setInputFlag( InputFlags::REQUIRED ).
- setRestartFlags( RestartFlags::NO_WRITE ).
- setDescription( "Names of the files defining the parameters of the viscosity and density models" );
-
- registerWrapper( viewKeyStruct::flashModelParaFileString(), &m_flashModelParaFile ).
- setInputFlag( InputFlags::OPTIONAL ).
- setRestartFlags( RestartFlags::NO_WRITE ).
- setDescription( "Name of the file defining the parameters of the flash model" );
-
- registerWrapper( viewKeyStruct::solubilityTablesString(), &m_solubilityTables ).
- setInputFlag( InputFlags::OPTIONAL ).
- setRestartFlags( RestartFlags::NO_WRITE ).
- setDescription( "Names of solubility tables for each phase" );
-
registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ).
setInputFlag( InputFlags::OPTIONAL ).
setRestartFlags( RestartFlags::NO_WRITE ).
@@ -115,8 +100,13 @@ CO2BrineFluid( string const & name, Group * const parent ):
setDescription( "Check phase presence when computing density and viscosity" ).
setApplyDefaultValue( 0 );
+ // Attach the fluid properties
+ bool constexpr EZROKHI_DENSITY = std::is_same_v< typename PHASE1::Density, EzrokhiBrineDensity >;
+ bool constexpr EZROKHI_VISCOSITY = std::is_same_v< typename PHASE1::Viscosity, EzrokhiBrineViscosity >;
+ m_brineFluidParameters.registerOnFluid< true, EZROKHI_DENSITY, EZROKHI_VISCOSITY >( this );
+
// if this is a thermal model, we need to make sure that the arrays will be properly displayed and saved to restart
- if( isThermal() )
+ if constexpr ( isThermalType() )
{
getField< fields::multifluid::phaseEnthalpy >().
setPlotLevel( PlotLevel::LEVEL_0 ).
@@ -168,10 +158,10 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const
m_phase1->density.checkTablesParameters( pressure, temperatureInCelsius );
m_phase1->viscosity.checkTablesParameters( pressure, temperatureInCelsius );
m_phase1->enthalpy.checkTablesParameters( pressure, temperatureInCelsius );
- } catch( SimulationError const & ex )
+ }
+ catch( SimulationError const & ex )
{
- string const errorMsg = GEOS_FMT( "Table input error for {} phase (in table from \"{}\").\n",
- m_phaseNames[m_p1Index], m_phasePVTParaFiles[m_p1Index] );
+ string const errorMsg = GEOS_FMT( "Table input error for {} phase.", m_phaseNames[m_p1Index] );
ErrorLogger::global().modifyCurrentExceptionMessage()
.addToMsg( errorMsg )
.addContextInfo( getDataContext().getContextInfo().setPriority( 2 ) );
@@ -183,10 +173,10 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const
m_phase2->density.checkTablesParameters( pressure, temperatureInCelsius );
m_phase2->viscosity.checkTablesParameters( pressure, temperatureInCelsius );
m_phase2->enthalpy.checkTablesParameters( pressure, temperatureInCelsius );
- } catch( SimulationError const & ex )
+ }
+ catch( SimulationError const & ex )
{
- string const errorMsg = GEOS_FMT( "Table input error for {} phase (in table from \"{}\").\n",
- m_phaseNames[m_p2Index], m_phasePVTParaFiles[m_p2Index] );
+ string const errorMsg = GEOS_FMT( "Table input error for {} phase.", m_phaseNames[m_p2Index] );
ErrorLogger::global().modifyCurrentExceptionMessage()
.addToMsg( errorMsg )
.addContextInfo( getDataContext().getContextInfo().setPriority( 2 ) );
@@ -196,10 +186,10 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const
try
{
m_flash->checkTablesParameters( pressure, temperatureInCelsius );
- } catch( SimulationError const & ex )
+ }
+ catch( SimulationError const & ex )
{
- string const errorMsg = GEOS_FMT( "Table input error for flash phase (in table from \"{}\").\n",
- m_flashModelParaFile );
+ string const errorMsg = "Table input error for flash parameters";
ErrorLogger::global().modifyCurrentExceptionMessage()
.addToMsg( errorMsg )
.addContextInfo( getDataContext().getContextInfo().setPriority( 2 ) );
@@ -207,16 +197,17 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::checkTablesParameters( real64 const
}
}
-
template< typename PHASE1, typename PHASE2, typename FLASH >
void CO2BrineFluid< PHASE1, PHASE2, FLASH >::initializePreSubGroups()
{
#if defined(GEOS_DEVICE_COMPILE)
- GEOS_THROW_IF( this->getCatalogName() == CO2BrineEzrokhiThermalFluid::catalogName(),
- GEOS_FMT( "The `{}` model is disabled for now. Please use the other thermal CO2-brine model instead: `{}`",
- CO2BrineEzrokhiThermalFluid::catalogName(),
- CO2BrinePhillipsThermalFluid::catalogName() ),
- InputError, getDataContext() );
+ if constexpr (std::is_same_v< CO2BrineFluid< PHASE1, PHASE2, FLASH >, CO2BrineEzrokhiThermalFluid >)
+ {
+ GEOS_THROW( GEOS_FMT( "The `{}` model is disabled for now. Please use the other thermal CO2-brine model instead: `{}`",
+ CO2BrineEzrokhiThermalFluid::catalogName(),
+ CO2BrinePhillipsThermalFluid::catalogName() ),
+ InputError, getDataContext() );
+ }
#endif
}
@@ -231,21 +222,6 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::postInputInitialization()
GEOS_THROW_IF_NE_MSG( numFluidComponents(), 2,
"invalid number of components",
InputError, getDataContext() );
- GEOS_THROW_IF_NE_MSG( m_phasePVTParaFiles.size(), 2,
- "invalid number of values",
- InputError, getDataContext() );
-
- // Make sure one (and only one) of m_flashModelParaFile or m_solubilityTables is provided
- bool const hasParamFile = !m_flashModelParaFile.empty();
- bool const hasTables = !m_solubilityTables.empty();
- GEOS_THROW_IF( hasParamFile == hasTables,
- GEOS_FMT( "One and only one of {} or {} should be specified",
- viewKeyStruct::flashModelParaFileString(),
- viewKeyStruct::solubilityTablesString() ),
- InputError,
- getWrapperDataContext( viewKeyStruct::flashModelParaFileString()),
- getWrapperDataContext( viewKeyStruct::solubilityTablesString()),
- getDataContext() );
// NOTE: for now, the names of the phases are still hardcoded here
// Later, we could read them from the XML file and we would then have a general class here
@@ -255,100 +231,18 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::postInputInitialization()
string const expectedGasPhaseNames[] = { "CO2", "co2", "gas", "Gas" };
m_p2Index = PVTFunctionHelpers::findName( m_phaseNames, expectedGasPhaseNames, viewKeyStruct::phaseNamesString() );
+
+ // Validate the brine fluid properties
+ bool constexpr EZROKHI_DENSITY = std::is_same_v< typename PHASE1::Density, EzrokhiBrineDensity >;
+ bool constexpr EZROKHI_VISCOSITY = std::is_same_v< typename PHASE1::Viscosity, EzrokhiBrineViscosity >;
+ m_brineFluidParameters.postInputInitialization< true, EZROKHI_DENSITY, EZROKHI_VISCOSITY >( this );
+
createPVTModels();
}
template< typename PHASE1, typename PHASE2, typename FLASH >
void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels()
{
- // TODO: get rid of these external files and move into XML, this is too error prone
- // For now, to support the legacy input, we read all the input parameters at once in the arrays below, and then we create the models
- stdVector< string_array > phase1InputParams;
- phase1InputParams.resize( 3 );
- stdVector< string_array > phase2InputParams;
- phase2InputParams.resize( 3 );
-
- // 1) Create the viscosity, density, enthalpy models
- for( string const & filename : m_phasePVTParaFiles )
- {
- std::ifstream is( filename );
- string str;
- while( std::getline( is, str ) )
- {
- string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str );
-
- if( !strs.empty() )
- {
- GEOS_THROW_IF( strs.size() < 2,
- GEOS_FMT( "missing PVT model in line '{}'", str ),
- InputError, getDataContext() );
-
- if( strs[0] == "DensityFun" )
- {
- if( strs[1] == PHASE1::Density::catalogName() )
- {
- phase1InputParams[PHASE1::InputParamOrder::DENSITY] = strs;
- }
- else if( strs[1] == PHASE2::Density::catalogName() )
- {
- phase2InputParams[PHASE2::InputParamOrder::DENSITY] = strs;
- }
- }
- else if( strs[0] == "ViscosityFun" )
- {
- if( strs[1] == PHASE1::Viscosity::catalogName() )
- {
- phase1InputParams[PHASE1::InputParamOrder::VISCOSITY] = strs;
- }
- else if( strs[1] == PHASE2::Viscosity::catalogName() )
- {
- phase2InputParams[PHASE2::InputParamOrder::VISCOSITY] = strs;
- }
- }
- else if( strs[0] == "EnthalpyFun" )
- {
- if( strs[1] == PHASE1::Enthalpy::catalogName() )
- {
- phase1InputParams[PHASE1::InputParamOrder::ENTHALPY] = strs;
- }
- else if( strs[1] == PHASE2::Enthalpy::catalogName() )
- {
- phase2InputParams[PHASE2::InputParamOrder::ENTHALPY] = strs;
- }
- }
- else
- {
- GEOS_THROW( GEOS_FMT( "invalid PVT function type '{}'", strs[0] ), InputError, getDataContext() );
- }
- }
- }
- is.close();
- }
-
- // at this point, we have read the file and we check the consistency of non-thermal models
- GEOS_THROW_IF( phase1InputParams[PHASE1::InputParamOrder::DENSITY].empty(),
- GEOS_FMT( "PVT model {} not found in input files", PHASE1::Density::catalogName() ),
- InputError, getDataContext() );
- GEOS_THROW_IF( phase2InputParams[PHASE2::InputParamOrder::DENSITY].empty(),
- GEOS_FMT( "PVT model {} not found in input files", PHASE2::Density::catalogName() ),
- InputError, getDataContext() );
- GEOS_THROW_IF( phase1InputParams[PHASE1::InputParamOrder::VISCOSITY].empty(),
- GEOS_FMT( "PVT model {} not found in input files", PHASE1::Viscosity::catalogName() ),
- InputError, getDataContext() );
- GEOS_THROW_IF( phase2InputParams[PHASE2::InputParamOrder::VISCOSITY].empty(),
- GEOS_FMT( "PVT model {} not found in input files", PHASE2::Viscosity::catalogName() ),
- InputError, getDataContext() );
-
- // we also detect any inconsistency arising in the enthalpy models
- GEOS_THROW_IF( phase1InputParams[PHASE1::InputParamOrder::ENTHALPY].empty() &&
- ( PHASE1::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() ),
- GEOS_FMT( "PVT model {} not found in input files", PHASE1::Enthalpy::catalogName() ),
- InputError, getDataContext() );
- GEOS_THROW_IF( phase2InputParams[PHASE2::InputParamOrder::ENTHALPY].empty() &&
- ( PHASE2::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() ),
- GEOS_FMT( "PVT model {} not found in input files", PHASE2::Enthalpy::catalogName() ),
- InputError, getDataContext() );
-
// then, we are ready to instantiate the phase models
bool const isClone = this->isClone();
TableFunction::OutputOptions const outputOpts = {
@@ -356,90 +250,25 @@ void CO2BrineFluid< PHASE1, PHASE2, FLASH >::createPVTModels()
!isClone && isLogLevelActive< logInfo::TableLogOutput >( this->getLogLevel()) // writeInLog
};
+ // 1) Create phase PVT models
m_phase1 = std::make_unique< PHASE1 >( getName() + "_phaseModel1",
- phase1InputParams,
+ m_brineFluidParameters,
m_componentNames,
m_componentMolarWeight,
outputOpts );
m_phase2 = std::make_unique< PHASE2 >( getName() + "_phaseModel2",
- phase2InputParams,
+ m_brineFluidParameters,
m_componentNames,
m_componentMolarWeight,
outputOpts );
-
// 2) Create the flash model
- if( !m_flashModelParaFile.empty())
- {
- std::ifstream is( m_flashModelParaFile );
- string str;
- while( std::getline( is, str ) )
- {
- string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str );
-
- if( !strs.empty() )
- {
- GEOS_THROW_IF( strs.size() < 2,
- GEOS_FMT( "missing flash model in line '{}'", str ),
- InputError, getDataContext() );
-
- if( strs[0] == "FlashModel" )
- {
- if( strs[1] == FLASH::catalogName() )
- {
- m_flash = std::make_unique< FLASH >( getName() + '_' + FLASH::catalogName(),
- strs,
- m_phaseNames,
- m_componentNames,
- m_componentMolarWeight,
- outputOpts );
- }
- }
- else
- {
- GEOS_THROW( GEOS_FMT( "invalid flash model type '{}'", strs[0] ), InputError, getDataContext() );
- }
- }
- }
- is.close();
- }
- else
- {
- // The user must provide 1 or 2 tables.
- GEOS_THROW_IF( m_solubilityTables.size() != 1 && m_solubilityTables.size() != 2,
- GEOS_FMT( "The number of table names in {} must be 1 or 2", viewKeyStruct::solubilityTablesString() ),
- InputError, getDataContext() );
-
- // If 1 table is provided, it is the CO2 solubility table and water vapourisation is zero
- // If 2 tables are provided, they are the CO2 solubility and water vapourisation tables depending
- // on how phaseNames is arranged
- string const solubilityModel = EnumStrings< CO2Solubility::SolubilityModel >::toString( CO2Solubility::SolubilityModel::Tables );
- string_array strs;
- strs.emplace_back( "FlashModel" );
- strs.emplace_back( solubilityModel ); // Marker to indicate that tables are provided
- strs.emplace_back( "" ); // 2 empty strings for the 2 phase tables gas first, then water
- strs.emplace_back( "" );
- if( m_solubilityTables.size() == 2 )
- {
- strs[2] = m_solubilityTables[m_p2Index];
- strs[3] = m_solubilityTables[m_p1Index];
- }
- else
- {
- strs[2] = m_solubilityTables[0];
- }
-
- m_flash = std::make_unique< FLASH >( getName() + '_' + FLASH::catalogName(),
- strs,
- m_phaseNames,
- m_componentNames,
- m_componentMolarWeight,
- outputOpts );
- }
-
- GEOS_THROW_IF( m_flash == nullptr,
- GEOS_FMT( " flash model {} not found in input files", FLASH::catalogName() ),
- InputError, getDataContext() );
+ m_flash = std::make_unique< FLASH >( getName() + '_' + FLASH::catalogName(),
+ m_brineFluidParameters,
+ m_phaseNames,
+ m_componentNames,
+ m_componentMolarWeight,
+ outputOpts );
}
template< typename PHASE1, typename PHASE2, typename FLASH >
@@ -504,19 +333,19 @@ CO2BrineFluid< PHASE1, PHASE2, FLASH >::KernelWrapper::
{}
// explicit instantiation of the model template; unfortunately we can't use the aliases for this
-template class CO2BrineFluid< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::NoOpPVTFunction >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >,
- PVTProps::CO2Solubility >;
-template class CO2BrineFluid< PhaseModel< PVTProps::PhillipsBrineDensity, PVTProps::PhillipsBrineViscosity, PVTProps::BrineEnthalpy >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >,
- PVTProps::CO2Solubility >;
-
-template class CO2BrineFluid< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::NoOpPVTFunction >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::NoOpPVTFunction >,
- PVTProps::CO2Solubility >;
-template class CO2BrineFluid< PhaseModel< PVTProps::EzrokhiBrineDensity, PVTProps::EzrokhiBrineViscosity, PVTProps::BrineEnthalpy >,
- PhaseModel< PVTProps::SpanWagnerCO2Density, PVTProps::FenghourCO2Viscosity, PVTProps::CO2Enthalpy >,
- PVTProps::CO2Solubility >;
+template class CO2BrineFluid< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, NoOpPVTFunction >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >,
+ CO2Solubility >;
+template class CO2BrineFluid< PhaseModel< PhillipsBrineDensity, PhillipsBrineViscosity, BrineEnthalpy >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >,
+ CO2Solubility >;
+
+template class CO2BrineFluid< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, NoOpPVTFunction >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, NoOpPVTFunction >,
+ CO2Solubility >;
+template class CO2BrineFluid< PhaseModel< EzrokhiBrineDensity, EzrokhiBrineViscosity, BrineEnthalpy >,
+ PhaseModel< SpanWagnerCO2Density, FenghourCO2Viscosity, CO2Enthalpy >,
+ CO2Solubility >;
REGISTER_CATALOG_ENTRY( ConstitutiveBase, CO2BrinePhillipsFluid, string const &, Group * const )
REGISTER_CATALOG_ENTRY( ConstitutiveBase, CO2BrinePhillipsThermalFluid, string const &, Group * const )
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp
index 1b89321acd7..16e48d533de 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/CO2BrineFluid.hpp
@@ -172,9 +172,6 @@ class CO2BrineFluid : public MultiFluidBase
struct viewKeyStruct : MultiFluidBase::viewKeyStruct
{
- static constexpr char const * flashModelParaFileString() { return "flashModelParaFile"; }
- static constexpr char const * solubilityTablesString() { return "solubilityTableNames"; }
- static constexpr char const * phasePVTParaFilesString() { return "phasePVTParaFiles"; }
static constexpr char const * writeCSVFlagString() { return "writeCSV"; }
static constexpr char const * checkPhasePresenceString() { return "checkPhasePresence"; }
};
@@ -192,14 +189,8 @@ class CO2BrineFluid : public MultiFluidBase
*/
void createPVTModels();
- /// Names of the files defining the viscosity and density models
- path_array m_phasePVTParaFiles;
-
- /// Name of the file defining the flash model
- Path m_flashModelParaFile;
-
- /// Names of solubility tables for each phase
- string_array m_solubilityTables;
+ /// All brine model properties
+ PVTProps::BrineFluidParameters m_brineFluidParameters{};
/// Index of the liquid phase
integer m_p1Index;
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp
index fe5b481e72c..ad8d4731fc7 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp
@@ -21,6 +21,7 @@
#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_PHASEMODEL_HPP_
#include "functions/TableFunction.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp"
namespace geos
{
@@ -59,22 +60,22 @@ struct PhaseModel
* @param[in] pvtOutputOpts A structure containing generated table output options
*/
PhaseModel( string const & phaseModelName,
- stdVector< string_array > const & inputParams,
+ PVTProps::BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts )
: density( phaseModelName + "_" + Density::catalogName(),
- inputParams[InputParamOrder::DENSITY],
+ brineFluidParameters,
componentNames,
componentMolarWeight,
pvtOutputOpts ),
viscosity( phaseModelName + "_" + Viscosity::catalogName(),
- inputParams[InputParamOrder::VISCOSITY],
+ brineFluidParameters,
componentNames,
componentMolarWeight,
pvtOutputOpts ),
enthalpy( phaseModelName + "_" + Enthalpy::catalogName(),
- inputParams[InputParamOrder::ENTHALPY],
+ brineFluidParameters,
componentNames,
componentMolarWeight,
pvtOutputOpts )
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp
index 41008529fe3..297c89e6e61 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.cpp
@@ -86,7 +86,7 @@ void calculateBrineEnthalpy( PTTableCoordinates const & tableCoords,
}
}
-TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams,
+TableFunction const * makeCO2EnthalpyTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters,
string const & functionName,
FunctionManager & functionManager )
{
@@ -104,21 +104,9 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams,
{
// initialize the (p,T) coordinates
PTTableCoordinates tableCoords;
- PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
- real64 tolerance = 1e-10;
-
- try
- {
- if( inputParams.size() >= 10 )
- {
- tolerance = stod( inputParams[9] );
- }
- }
- catch( const std::invalid_argument & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const tolerance = brineFluidParameters.m_tolerance;
array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() );
array1d< real64 > enthalpies( tableCoords.nPressures() * tableCoords.nTemperatures() );
@@ -135,7 +123,7 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams,
}
}
-TableFunction const * makeBrineEnthalpyTable( string_array const & inputParams,
+TableFunction const * makeBrineEnthalpyTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters,
string const & functionName,
FunctionManager & functionManager )
{
@@ -153,22 +141,10 @@ TableFunction const * makeBrineEnthalpyTable( string_array const & inputParams,
{
// initialize the (p,T) coordinates
PTTableCoordinates tableCoords;
- PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
// initialize salinity
- GEOS_THROW_IF_LT_MSG( inputParams.size(), 9,
- GEOS_FMT( "{}: insufficient number of model parameters", functionName ),
- InputError );
- real64 salinity;
-
- try
- {
- salinity = stod( inputParams[8] );
- }
- catch( std::invalid_argument const & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const salinity = brineFluidParameters.m_salinity;
array1d< real64 > enthalpies( tableCoords.nTemperatures() );
array1d< array1d< real64 > > temperatures;
@@ -189,7 +165,7 @@ TableFunction const * makeBrineEnthalpyTable( string_array const & inputParams,
} // namespace
BrineEnthalpy::BrineEnthalpy( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -203,8 +179,8 @@ BrineEnthalpy::BrineEnthalpy( string const & name,
string const expectedWaterComponentNames[] = { "Water", "water" };
m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" );
- m_CO2EnthalpyTable = makeCO2EnthalpyTable( inputParams, m_functionName, FunctionManager::getInstance() );
- m_brineEnthalpyTable = makeBrineEnthalpyTable( inputParams, m_functionName, FunctionManager::getInstance() );
+ m_CO2EnthalpyTable = makeCO2EnthalpyTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() );
+ m_brineEnthalpyTable = makeBrineEnthalpyTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() );
m_CO2EnthalpyTable->outputTableData( pvtOutputOpts );
m_brineEnthalpyTable->outputTableData( pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp
index 788a7f3ef0d..a71874d2561 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp
@@ -89,7 +89,7 @@ class BrineEnthalpy : public PVTFunctionBase
public:
BrineEnthalpy( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp
new file mode 100644
index 00000000000..1d16eb42baf
--- /dev/null
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.cpp
@@ -0,0 +1,308 @@
+/*
+ * ------------------------------------------------------------------------------------------------------------
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
+ * Copyright (c) 2018-2024 TotalEnergies
+ * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
+ * Copyright (c) 2023-2024 Chevron
+ * Copyright (c) 2019- GEOS/GEOSX Contributors
+ * All rights reserved
+ *
+ * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
+ * ------------------------------------------------------------------------------------------------------------
+ */
+
+/**
+ * @file BrineFluidParameters.cpp
+ */
+
+#include "BrineFluidParameters.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp"
+#include "constitutive/fluid/multifluid/MultiFluidConstants.hpp"
+#include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
+
+#include "dataRepository/InputFlags.hpp"
+#include "dataRepository/RestartFlags.hpp"
+#include "common/logger/Logger.hpp"
+
+namespace geos
+{
+
+using namespace dataRepository;
+
+namespace constitutive
+{
+namespace PVTProps
+{
+
+template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY >
+void BrineFluidParameters::registerOnFluid( MultiFluidBase * fluid )
+{
+ if constexpr (FLASH)
+ {
+ fluid->registerWrapper( viewKeyStruct::solubilityModelString(), &m_solubilityModel ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "The solubility model for calculating phase equilibrium. "
+ "Available options are: " + EnumStrings< SolubilityModel >::concat( "\n* " ) ).
+ setDefaultValue( m_solubilityModel );
+
+ fluid->registerWrapper( viewKeyStruct::solubilityTablesString(), &m_solubilityTables ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "Names of solubility tables for each phase" );
+ }
+
+ fluid->registerWrapper( viewKeyStruct::pressureCoordinatesString(), &m_pressureCoordinates ).
+ setInputFlag( InputFlags::REQUIRED ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "List of pressure values for interpolation of function values." );
+
+ fluid->registerWrapper( viewKeyStruct::pressureIntervalString(), &m_pressureInterval ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( GEOS_FMT( "Step size used to evenly discretize the range pressure range given by "
+ "{0} into a set of evenly spaced values. If a positive is givem, it defines the "
+ "spacing between generated points across the full range from the first to the "
+ "last input value. If zero or a negative number is given then the points in {0} "
+ " are left as is.", viewKeyStruct::pressureIntervalString() )).
+ setDefaultValue( m_pressureInterval );
+
+ fluid->registerWrapper( viewKeyStruct::temperatureCoordinatesString(), &m_temperatureCoordinates ).
+ setInputFlag( InputFlags::REQUIRED ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "List of temperature values for interpolation of function values." );
+
+ fluid->registerWrapper( viewKeyStruct::temperatureIntervalString(), &m_temperatureInterval ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( GEOS_FMT( "Step size used to evenly discretize the range temperature range given by "
+ "{0} into a set of evenly spaced values. If a positive is givem, it defines the "
+ "spacing between generated points across the full range from the first to the "
+ "last input value. If zero or a negative number is given then the points in {0} "
+ " are left as is.", viewKeyStruct::temperatureIntervalString() )).
+ setDefaultValue( m_temperatureInterval );
+
+ fluid->registerWrapper( viewKeyStruct::waterCompressibilityString(), &m_waterCompressibility ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "The compressibility of pure water" ).
+ setDefaultValue( m_waterCompressibility );
+
+ fluid->registerWrapper( viewKeyStruct::salinityString(), &m_salinity ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "The salinity of brine" ).
+ setDefaultValue( m_salinity );
+
+ fluid->registerWrapper( viewKeyStruct::toleranceString(), &m_tolerance ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "Tolerance to used for fluid property calculation" ).
+ setDefaultValue( m_tolerance );
+
+ // Check if we have the Ezrokhi model
+ if constexpr ( EZROKHI_DENSITY )
+ {
+ fluid->registerWrapper( viewKeyStruct::ezrokhiDensityCoefficientsString(), &m_ezrokhiDensityCoefficients ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "Ezrokhi correlation coefficients for brine density." );
+ }
+
+ if constexpr ( EZROKHI_VISCOSITY )
+ {
+ fluid->registerWrapper( viewKeyStruct::ezrokhiViscosityCoefficientsString(), &m_ezrokhiViscosityCoefficients ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "Ezrokhi correlation coefficients for brine viscosity." );
+ }
+}
+
+template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY >
+void BrineFluidParameters::postInputInitialization( MultiFluidBase * fluid )
+{
+ string const fullName = fluid->getFullName();
+
+ if constexpr (FLASH)
+ {
+ // Check if we need solubility tables
+ bool const hasNoTables = m_solubilityTables.empty();
+ bool const needsTables = m_solubilityModel == SolubilityModel::Tables;
+ GEOS_THROW_IF( needsTables && hasNoTables,
+ GEOS_FMT( "{}: If the solubility model is set to {} then the {} field should be provided.",
+ fullName,
+ m_solubilityModel,
+ viewKeyStruct::solubilityTablesString() ),
+ InputError );
+
+ if( needsTables )
+ {
+ // The user must provide 1 or 2 tables.
+ GEOS_THROW_IF( m_solubilityTables.size() != 1 && m_solubilityTables.size() != 2,
+ GEOS_FMT( "{}: The number of table names in {} must be 1 or 2", fullName, viewKeyStruct::solubilityTablesString() ),
+ InputError );
+ }
+ }
+
+ // Water compressibility must be positive
+ GEOS_THROW_IF_LT_MSG( m_waterCompressibility, MultiFluidConstants::epsilon,
+ GEOS_FMT( "{}: invalid water compressibility {}. "
+ "Value must be positive", fullName, viewKeyStruct::waterCompressibilityString() ),
+ InputError );
+
+ // Salinity must not be negative
+ GEOS_THROW_IF_LT_MSG( m_salinity, 0.0,
+ GEOS_FMT( "{}: invalid salinity {}. "
+ "Value must not be negative", fullName, viewKeyStruct::salinityString() ),
+ InputError );
+
+ // Flash tolerance must be positive
+ GEOS_THROW_IF_LT_MSG( m_tolerance, MultiFluidConstants::epsilon,
+ GEOS_FMT( "{}: invalid flash tolerance {}. "
+ "Value must be positive", fullName, viewKeyStruct::toleranceString() ),
+ InputError );
+
+ // Coordinates values must be at least 2
+ GEOS_THROW_IF_LT_MSG( m_pressureCoordinates.size(), 2,
+ GEOS_FMT( "{}: invalid number of pressure coordinates provided in {}. "
+ "At least 2 values must be provided", fullName, viewKeyStruct::pressureCoordinatesString() ),
+ InputError );
+
+ // Values must be strictly increasing
+ GEOS_THROW_IF( !isStrictlyIncreasing( m_pressureCoordinates.toSliceConst()),
+ GEOS_FMT( "{}: invalid values of pressure coordinates provided in {}. "
+ "Values must be strictly increasing.", fullName, viewKeyStruct::pressureCoordinatesString() ),
+ InputError );
+
+ // Coordinates values must be at least 2
+ GEOS_THROW_IF_LT_MSG( m_temperatureCoordinates.size(), 2,
+ GEOS_FMT( "{}: invalid number of temperature coordinates provided in {}. "
+ "At least 2 values must be provided", fullName, viewKeyStruct::temperatureCoordinatesString() ),
+ InputError );
+
+ // Values must be strictly increasing
+ GEOS_THROW_IF( !isStrictlyIncreasing( m_temperatureCoordinates.toSliceConst()),
+ GEOS_FMT( "{}: invalid values of temperature coordinates provided in {}. "
+ "Values must be strictly increasing.", fullName, viewKeyStruct::temperatureCoordinatesString() ),
+ InputError );
+
+ real64 const minTemp = m_temperatureCoordinates[0];
+ real64 const maxTemp = m_temperatureCoordinates[m_temperatureCoordinates.size()-1];
+ real64 const minTempInK = units::convertCToK( minimumTemperature );
+ real64 const maxTempInK = units::convertCToK( maximumTemperature );
+ GEOS_THROW_IF_LT_MSG( minTemp, minTempInK,
+ GEOS_FMT( "{}: Minimum temperature must be at least {}K ({} in C). "
+ "The lowest value provided in {} is {}K", fullName,
+ minTempInK, minimumTemperature,
+ viewKeyStruct::temperatureCoordinatesString(), minTemp ),
+ InputError );
+ GEOS_THROW_IF_GT_MSG( maxTemp, maxTempInK,
+ GEOS_FMT( "{}: Maximum temperature must be at most {}K ({} in C). "
+ "The highest value provided in {} is {}K", fullName,
+ maxTempInK, minimumTemperature,
+ viewKeyStruct::temperatureCoordinatesString(), maxTemp ),
+ InputError );
+
+ if constexpr ( EZROKHI_DENSITY )
+ {
+ if( m_ezrokhiDensityCoefficients.empty())
+ {
+ for( integer ic = 0; ic < 3; ic++ )
+ {
+ m_ezrokhiDensityCoefficients.emplace_back( 0.0 );
+ }
+ }
+ GEOS_THROW_IF_NE_MSG( m_ezrokhiDensityCoefficients.size(), 3,
+ GEOS_FMT( "{}: invalid number of Ezrokhi density coefficients provided in {}. "
+ "Exactly 3 values must be provided.", fullName, viewKeyStruct::ezrokhiDensityCoefficientsString() ),
+ InputError );
+ }
+
+ if constexpr ( EZROKHI_VISCOSITY )
+ {
+ if( m_ezrokhiViscosityCoefficients.empty())
+ {
+ for( integer ic = 0; ic < 3; ic++ )
+ {
+ m_ezrokhiViscosityCoefficients.emplace_back( 0.0 );
+ }
+ }
+ GEOS_THROW_IF_NE_MSG( m_ezrokhiViscosityCoefficients.size(), 3,
+ GEOS_FMT( "{}: invalid number of Ezrokhi viscosity coefficients provided in {}. "
+ "Exactly 3 values must be provided.", fullName, viewKeyStruct::ezrokhiViscosityCoefficientsString() ),
+ InputError );
+ }
+}
+
+void BrineFluidParameters::initializePropertyTable( BrineFluidParameters const & fluidParameters,
+ PTTableCoordinates & tableCoords )
+{
+ real64 const dP = fluidParameters.m_pressureInterval;
+ if( MultiFluidConstants::epsilon < dP )
+ {
+ integer const n = fluidParameters.m_pressureCoordinates.size();
+ real64 const startPressure = fluidParameters.m_pressureCoordinates[0];
+ real64 const endPressure = fluidParameters.m_pressureCoordinates[n-1];
+ for( real64 pressure = startPressure; pressure <= endPressure; pressure += dP )
+ {
+ tableCoords.appendPressure( pressure );
+ }
+ }
+ else
+ {
+ for( real64 const pressure : fluidParameters.m_pressureCoordinates )
+ {
+ tableCoords.appendPressure( pressure );
+ }
+ }
+
+ real64 const dT = fluidParameters.m_temperatureInterval;
+ if( MultiFluidConstants::epsilon < dT )
+ {
+ integer const n = fluidParameters.m_temperatureCoordinates.size();
+ real64 const startTemperature = fluidParameters.m_temperatureCoordinates[0];
+ real64 const endTemperature = fluidParameters.m_temperatureCoordinates[n-1];
+ for( real64 temperature = startTemperature; temperature <= endTemperature; temperature += dT )
+ {
+ tableCoords.appendTemperature( units::convertKToC( temperature ) );
+ }
+ }
+ else
+ {
+ for( real64 const temperature : fluidParameters.m_temperatureCoordinates )
+ {
+ tableCoords.appendTemperature( units::convertKToC( temperature ) );
+ }
+ }
+}
+
+bool BrineFluidParameters::isStrictlyIncreasing( arraySlice1d< real64 const > const & array )
+{
+ localIndex const size = array.size();
+ GEOS_ASSERT( 1 < size );
+ real64 constexpr epsilon = MultiFluidConstants::epsilon;
+ for( localIndex i = 1; i < size; ++i )
+ {
+ if( array[i] - array[i-1] < epsilon )
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+// Explicitly instantiate
+template void BrineFluidParameters::registerOnFluid< false, false, false >( MultiFluidBase * );
+template void BrineFluidParameters::registerOnFluid< true, false, false >( MultiFluidBase * );
+template void BrineFluidParameters::registerOnFluid< true, true, true >( MultiFluidBase * );
+template void BrineFluidParameters::postInputInitialization< false, false, false >( MultiFluidBase * );
+template void BrineFluidParameters::postInputInitialization< true, false, false >( MultiFluidBase * );
+template void BrineFluidParameters::postInputInitialization< true, true, true >( MultiFluidBase * );
+
+} // end namespace PVTProps
+
+} // end namespace constitutive
+
+} // end namespace geos
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp
new file mode 100644
index 00000000000..4b6084b65a7
--- /dev/null
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp
@@ -0,0 +1,142 @@
+/*
+ * ------------------------------------------------------------------------------------------------------------
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
+ * Copyright (c) 2018-2024 TotalEnergies
+ * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
+ * Copyright (c) 2023-2024 Chevron
+ * Copyright (c) 2019- GEOS/GEOSX Contributors
+ * All rights reserved
+ *
+ * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
+ * ------------------------------------------------------------------------------------------------------------
+ */
+
+/**
+ * @file BrineFluidParameters.hpp
+ */
+
+#ifndef GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_BRINEFLUIDPARAMETERS_HPP_
+#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_BRINEFLUIDPARAMETERS_HPP_
+
+#include "common/DataTypes.hpp"
+#include "common/format/EnumStrings.hpp"
+
+namespace geos
+{
+namespace constitutive
+{
+class MultiFluidBase;
+
+namespace PVTProps
+{
+
+class PTTableCoordinates;
+
+/// A structure to contain the properties required to create a brine fluid model
+struct BrineFluidParameters
+{
+ // Temperature limits for the correlation used (in C)
+ static real64 constexpr minimumTemperature = 10.0;
+ static real64 constexpr maximumTemperature = 200.0;
+
+ // Solubility models
+ enum class SolubilityModel : integer
+ {
+ DuanSun,
+ SpycherPruess,
+ Tables
+ };
+
+ /// Solubility model
+ SolubilityModel m_solubilityModel{SolubilityModel::DuanSun};
+
+ /// Pressure discretisation points
+ array1d< real64 > m_pressureCoordinates;
+
+ /// Interval for pressure discretisation
+ real64 m_pressureInterval{0.0};
+
+ /// Temperature discretisation points
+ array1d< real64 > m_temperatureCoordinates;
+
+ /// Interval for temperature discretisation
+ real64 m_temperatureInterval{0.0};
+
+ /// Names of solubility tables for each phase
+ string_array m_solubilityTables;
+
+ /// Water compressibility
+ real64 m_waterCompressibility{4.5e-10};
+
+ /// Flash tolerance used to solve any EOS states
+ real64 m_tolerance{1.0e-9};
+
+ /// Salinity
+ real64 m_salinity{0.0};
+
+ /// The Ezrokhi density Coefficients if required
+ array1d< real64 > m_ezrokhiDensityCoefficients;
+
+ /// The Ezrokhi viscosity Coefficients if required
+ array1d< real64 > m_ezrokhiViscosityCoefficients;
+
+ struct viewKeyStruct
+ {
+ static constexpr char const * solubilityModelString() { return "solubilityModel"; }
+ static constexpr char const * pressureCoordinatesString() { return "pressureCoordinates"; }
+ static constexpr char const * pressureIntervalString() { return "pressureInterval"; }
+ static constexpr char const * temperatureCoordinatesString() { return "temperatureCoordinates"; }
+ static constexpr char const * temperatureIntervalString() { return "temperatureInterval"; }
+ static constexpr char const * salinityString() { return "salinity"; }
+ static constexpr char const * waterCompressibilityString() { return "waterCompressibility"; }
+ static constexpr char const * solubilityTablesString() { return "solubilityTableNames"; }
+ static constexpr char const * toleranceString() { return "tolerance"; }
+ static constexpr char const * ezrokhiDensityCoefficientsString() { return "ezrokhiDensityCoefficients"; }
+ static constexpr char const * ezrokhiViscosityCoefficientsString() { return "ezrokhiViscosityCoefficients"; }
+ };
+
+ /**
+ * @brief Attaches the fluid properties to a fluid Group
+ * @param[in/out] fluid The fluid object
+ */
+ template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY >
+ void registerOnFluid( MultiFluidBase * fluid );
+
+ /**
+ * @brief Validates the user input for the fluid properties
+ * @param[in] fluid The fluid object
+ */
+ template< bool FLASH, bool EZROKHI_DENSITY, bool EZROKHI_VISCOSITY >
+ void postInputInitialization( MultiFluidBase * fluid );
+
+ /**
+ * @brief Populate the coordinate table with pressure and temperature
+ * @param[in] fluidProperties the user provided properties
+ * @param[out] tableCoords the (p,T) coordinates of the table
+ * @note This will output temperatures in C
+ */
+ static void initializePropertyTable( BrineFluidParameters const & fluidParameters,
+ PTTableCoordinates & tableCoords );
+
+ /**
+ * @brief Check if an array has strictly increasing values
+ * @param[in] array The array to be checked
+ * @return @c true if the array has values that are strictly increasing
+ */
+ static bool isStrictlyIncreasing( arraySlice1d< real64 const > const & array );
+};
+
+ENUM_STRINGS( BrineFluidParameters::SolubilityModel,
+ "DuanSun",
+ "SpycherPruess",
+ "Tables" );
+
+} // end namespace PVTProps
+
+} // end namespace constitutive
+
+} // end namespace geos
+
+#endif //GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_BRINEFLUIDPARAMETERS_HPP_
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp
index dfd94c81d8b..e609578e852 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.cpp
@@ -200,7 +200,7 @@ real64 helmholtzCO2Enthalpy( real64 const & T,
-TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams,
+TableFunction const * makeCO2EnthalpyTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters,
string const & functionName,
FunctionManager & functionManager )
{
@@ -218,21 +218,9 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams,
{
// initialize the (p,T) coordinates
PTTableCoordinates tableCoords;
- PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
- real64 tolerance = 1e-10;
-
- try
- {
- if( inputParams.size() >= 10 )
- {
- tolerance = stod( inputParams[9] );
- }
- }
- catch( const std::invalid_argument & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const tolerance = brineFluidParameters.m_tolerance;
array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() );
array1d< real64 > enthalpies( tableCoords.nPressures() * tableCoords.nTemperatures() );
@@ -254,7 +242,7 @@ TableFunction const * makeCO2EnthalpyTable( string_array const & inputParams,
} // namespace
CO2Enthalpy::CO2Enthalpy( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -265,7 +253,7 @@ CO2Enthalpy::CO2Enthalpy( string const & name,
string const expectedCO2ComponentNames[] = { "CO2", "co2" };
m_CO2Index = PVTFunctionHelpers::findName( componentNames, expectedCO2ComponentNames, "componentNames" );
- m_CO2EnthalpyTable = makeCO2EnthalpyTable( inputParams, m_functionName, FunctionManager::getInstance() );
+ m_CO2EnthalpyTable = makeCO2EnthalpyTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() );
m_CO2EnthalpyTable->outputTableData( pvtOutputOpts );
}
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp
index e9071dc6428..453d1e26571 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Enthalpy.hpp
@@ -77,7 +77,7 @@ class CO2Enthalpy : public PVTFunctionBase
public:
CO2Enthalpy( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp
index 8df746180f5..d2cc5d802a0 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.cpp
@@ -57,13 +57,15 @@ TableFunction const * makeTable( string const & tableName,
std::pair< TableFunction const *, TableFunction const * >
makeSolubilityTables( string const & functionName,
- string_array const & inputParams,
- constitutive::PVTProps::CO2Solubility::SolubilityModel const & solubilityModel )
+ constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters )
{
FunctionManager & functionManager = FunctionManager::getInstance();
constitutive::PVTProps::PTTableCoordinates tableCoords;
+
+ auto const & solubilityModel = brineFluidParameters.m_solubilityModel;
+
// Check solubility model for explicit table input
- if( solubilityModel == constitutive::PVTProps::CO2Solubility::SolubilityModel::Tables )
+ if( solubilityModel == constitutive::PVTProps::BrineFluidParameters::SolubilityModel::Tables )
{
// The default table is a table with all zeros unless the name is explicitly provided
// The pressure and temperature values below will be used only to create the zero table so they
@@ -72,12 +74,13 @@ makeSolubilityTables( string const & functionName,
.appendTemperature( 0.0 ).appendTemperature( 800.0 );
TableFunction const * tables[2] = { nullptr, nullptr };
+ auto const & solubilityTables = brineFluidParameters.m_solubilityTables;
for( integer tableIndex : { 0, 1 } )
{
array1d< real64 > values( 4 );
values.zero();
- string inputTableName = inputParams[2 + tableIndex];
+ string inputTableName = tableIndex < static_cast< integer >(solubilityTables.size()) ? solubilityTables[tableIndex] : "";
if( inputTableName.empty() )
{
inputTableName = GEOS_FMT( "{}_zeroDissolution_table", constitutive::PVTProps::CO2Solubility::catalogName() );
@@ -106,27 +109,10 @@ makeSolubilityTables( string const & functionName,
}
// Initialize the (p,T) coordinates
- constitutive::PVTProps::PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
- // Initialize salinity and tolerance
- GEOS_THROW_IF_LT_MSG( inputParams.size(), 9,
- GEOS_FMT( "{}: insufficient number of model parameters", functionName ),
- InputError );
-
- real64 tolerance = 1e-9;
- real64 salinity = 0.0;
- try
- {
- salinity = stod( inputParams[8] );
- if( inputParams.size() >= 10 )
- {
- tolerance = stod( inputParams[9] );
- }
- }
- catch( const std::invalid_argument & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const tolerance = brineFluidParameters.m_tolerance;
+ real64 const salinity = brineFluidParameters.m_salinity;
integer const nPressures = tableCoords.nPressures();
integer const nTemperatures = tableCoords.nTemperatures();
@@ -134,7 +120,7 @@ makeSolubilityTables( string const & functionName,
array1d< real64 > co2Solubility( nPressures * nTemperatures );
array1d< real64 > h2oSolubility( nPressures * nTemperatures );
- if( solubilityModel == constitutive::PVTProps::CO2Solubility::SolubilityModel::DuanSun )
+ if( solubilityModel == constitutive::PVTProps::BrineFluidParameters::SolubilityModel::DuanSun )
{
constitutive::PVTProps::CO2SolubilityDuanSun::populateSolubilityTables(
functionName,
@@ -144,7 +130,7 @@ makeSolubilityTables( string const & functionName,
co2Solubility,
h2oSolubility );
}
- else if( solubilityModel == constitutive::PVTProps::CO2Solubility::SolubilityModel::SpycherPruess )
+ else if( solubilityModel == constitutive::PVTProps::BrineFluidParameters::SolubilityModel::SpycherPruess )
{
constitutive::PVTProps::CO2SolubilitySpycherPruess::populateSolubilityTables(
functionName,
@@ -223,7 +209,7 @@ namespace PVTProps
{
CO2Solubility::CO2Solubility( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & phaseNames,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
@@ -251,17 +237,7 @@ CO2Solubility::CO2Solubility( string const & name,
string const expectedWaterPhaseNames[] = { "Water", "water", "Liquid", "liquid" };
m_phaseLiquidIndex = PVTFunctionHelpers::findName( phaseNames, expectedWaterPhaseNames, "phaseNames" );
- SolubilityModel solubilityModel = SolubilityModel::DuanSun; // Default solubility model
- if( inputParams[1] == EnumStrings< SolubilityModel >::toString( SolubilityModel::Tables ) )
- {
- solubilityModel = SolubilityModel::Tables;
- }
- else if( 11 <= inputParams.size() )
- {
- solubilityModel = EnumStrings< SolubilityModel >::fromString( inputParams[10] );
- }
-
- std::tie( m_CO2SolubilityTable, m_WaterVapourisationTable ) = makeSolubilityTables( m_modelName, inputParams, solubilityModel );
+ std::tie( m_CO2SolubilityTable, m_WaterVapourisationTable ) = makeSolubilityTables( m_modelName, brineFluidParameters );
m_CO2SolubilityTable->outputTableData( pvtOutputOpts );
m_WaterVapourisationTable->outputTableData( pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp
index b0809f3f3de..11fe0955dcc 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/CO2Solubility.hpp
@@ -22,6 +22,7 @@
#include "FlashModelBase.hpp"
#include "constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionHelpers.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp"
#include "constitutive/fluid/multifluid/Layouts.hpp"
#include "constitutive/fluid/multifluid/MultiFluidUtils.hpp"
#include "fileIO/Outputs/OutputBase.hpp"
@@ -103,17 +104,9 @@ class CO2SolubilityUpdate final : public FlashModelBaseUpdate
class CO2Solubility : public FlashModelBase
{
-public:
- enum class SolubilityModel : integer
- {
- DuanSun,
- SpycherPruess,
- Tables
- };
-
public:
CO2Solubility( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & phaseNames,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
@@ -347,11 +340,6 @@ CO2SolubilityUpdate::compute( real64 const & pressure,
}
}
-ENUM_STRINGS( CO2Solubility::SolubilityModel,
- "DuanSun",
- "SpycherPruess",
- "Tables" );
-
} // end namespace PVTProps
} // end namespace constitutive
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp
index 6f2b3caf5b8..c7067552fff 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.cpp
@@ -35,13 +35,14 @@ namespace PVTProps
{
EzrokhiBrineDensity::EzrokhiBrineDensity( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
PVTFunctionBase( name,
componentNames,
- componentMolarWeight )
+ componentMolarWeight ),
+ m_waterCompressibility( brineFluidParameters.m_waterCompressibility )
{
string const expectedCO2ComponentNames[] = { "CO2", "co2" };
m_CO2Index = PVTFunctionHelpers::findName( componentNames, expectedCO2ComponentNames, "componentNames" );
@@ -49,7 +50,7 @@ EzrokhiBrineDensity::EzrokhiBrineDensity( string const & name,
string const expectedWaterComponentNames[] = { "Water", "water" };
m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" );
- makeCoefficients( inputPara );
+ makeCoefficients( brineFluidParameters.m_ezrokhiDensityCoefficients );
m_waterSatDensityTable = PureWaterProperties::makeSaturationDensityTable( m_functionName, FunctionManager::getInstance() );
m_waterSatPressureTable = PureWaterProperties::makeSaturationPressureTable( m_functionName, FunctionManager::getInstance() );
@@ -57,27 +58,13 @@ EzrokhiBrineDensity::EzrokhiBrineDensity( string const & name,
m_waterSatDensityTable->outputTableData( pvtOutputOpts );
}
-void EzrokhiBrineDensity::makeCoefficients( string_array const & inputPara )
+void EzrokhiBrineDensity::makeCoefficients( arrayView1d< real64 const > const & coefficients )
{
// compute brine density following Ezrokhi`s method
// Reference : Zaytsev, I.D. and Aseyev, G.G. Properties of Aqueous Solutions of Electrolytes, Boca Raton, Florida, USA CRC Press (1993).
-
- m_waterCompressibility = 4.5e-10; // Pa-1
- GEOS_THROW_IF_LT_MSG( inputPara.size(), 5,
- GEOS_FMT( "{}: insufficient number of model parameters", m_functionName ),
- InputError );
-
- try
- {
- // assume CO2 is the only non-water component in the brine
- m_coef0 = stod( inputPara[2] );
- m_coef1 = stod( inputPara[3] );
- m_coef2 = stod( inputPara[4] );
- }
- catch( std::invalid_argument const & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value '{}'", m_functionName, e.what() ), InputError );
- }
+ m_coef0 = coefficients[0];
+ m_coef1 = coefficients[1];
+ m_coef2 = coefficients[2];
}
void EzrokhiBrineDensity::checkTablesParameters( real64 const GEOS_UNUSED_PARAM( pressure ),
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp
index a11815623a4..23b3e76119f 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineDensity.hpp
@@ -106,7 +106,7 @@ class EzrokhiBrineDensity : public PVTFunctionBase
public:
EzrokhiBrineDensity( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
@@ -136,7 +136,7 @@ class EzrokhiBrineDensity : public PVTFunctionBase
private:
- void makeCoefficients( string_array const & inputPara );
+ void makeCoefficients( arrayView1d< real64 const > const & coefficients );
/// Table with water saturated density tabulated as a function (T)
TableFunction const * m_waterSatDensityTable = nullptr;
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp
index 605ede35515..8ae469f0055 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.cpp
@@ -35,7 +35,7 @@ namespace PVTProps
{
EzrokhiBrineViscosity::EzrokhiBrineViscosity( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -49,31 +49,19 @@ EzrokhiBrineViscosity::EzrokhiBrineViscosity( string const & name,
string const expectedWaterComponentNames[] = { "Water", "water" };
m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" );
- makeCoefficients( inputPara );
+ makeCoefficients( brineFluidParameters.m_ezrokhiViscosityCoefficients );
m_waterViscosityTable = PureWaterProperties::makeSaturationViscosityTable( m_functionName, FunctionManager::getInstance() );
m_waterViscosityTable->outputTableData( pvtOutputOpts );
}
-void EzrokhiBrineViscosity::makeCoefficients( string_array const & inputPara )
+void EzrokhiBrineViscosity::makeCoefficients( arrayView1d< real64 const > const & coefficients )
{
// compute brine viscosity following Ezrokhi`s method
// Reference : Zaytsev, I.D. and Aseyev, G.G. Properties of Aqueous Solutions of Electrolytes, Boca Raton, Florida, USA CRC Press (1993).
- GEOS_THROW_IF_LT_MSG( inputPara.size(), 5,
- GEOS_FMT( "{}: insufficient number of model parameters", m_functionName ),
- InputError );
-
- try
- {
- // assume CO2 is the only non-water component in the brine
- m_coef0 = stod( inputPara[2] );
- m_coef1 = stod( inputPara[3] );
- m_coef2 = stod( inputPara[4] );
- }
- catch( std::invalid_argument const & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value '{}'", m_functionName, e.what() ), InputError );
- }
+ m_coef0 = coefficients[0];
+ m_coef1 = coefficients[1];
+ m_coef2 = coefficients[2];
}
void EzrokhiBrineViscosity::checkTablesParameters( real64 const GEOS_UNUSED_PARAM( pressure ),
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp
index 0c65c125a7b..e1d891474e3 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/EzrokhiBrineViscosity.hpp
@@ -95,7 +95,7 @@ class EzrokhiBrineViscosity : public PVTFunctionBase
public:
EzrokhiBrineViscosity( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
@@ -125,7 +125,7 @@ class EzrokhiBrineViscosity : public PVTFunctionBase
private:
- void makeCoefficients( string_array const & inputPara );
+ void makeCoefficients( arrayView1d< real64 const > const & coefficients );
/// Table with water viscosity tabulated as a function (T)
TableFunction const * m_waterViscosityTable = nullptr;
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp
index da161b99874..516a09fa47e 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.cpp
@@ -88,7 +88,7 @@ void calculateCO2Viscosity( PTTableCoordinates const & tableCoords,
}
}
-TableFunction const * makeViscosityTable( string_array const & inputParams,
+TableFunction const * makeViscosityTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters,
string const & functionName,
FunctionManager & functionManager )
{
@@ -105,20 +105,9 @@ TableFunction const * makeViscosityTable( string_array const & inputParams,
else
{
PTTableCoordinates tableCoords;
- PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
- real64 tolerance = 1e-10;
- try
- {
- if( inputParams.size() >= 9 )
- {
- tolerance = stod( inputParams[8] );
- }
- }
- catch( const std::invalid_argument & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const tolerance = brineFluidParameters.m_tolerance;
localIndex const nP = tableCoords.nPressures();
localIndex const nT = tableCoords.nTemperatures();
@@ -139,7 +128,7 @@ TableFunction const * makeViscosityTable( string_array const & inputParams,
} // namespace
FenghourCO2Viscosity::FenghourCO2Viscosity( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts )
@@ -147,7 +136,7 @@ FenghourCO2Viscosity::FenghourCO2Viscosity( string const & name,
componentNames,
componentMolarWeight )
{
- m_CO2ViscosityTable = makeViscosityTable( inputParams, m_functionName, FunctionManager::getInstance() );
+ m_CO2ViscosityTable = makeViscosityTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() );
m_CO2ViscosityTable->outputTableData( pvtOutputOpts );
}
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp
index da959eff77a..1326019c33e 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/FenghourCO2Viscosity.hpp
@@ -73,7 +73,7 @@ class FenghourCO2Viscosity : public PVTFunctionBase
public:
FenghourCO2Viscosity( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp
index e3aca977273..b96d7791512 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp
@@ -68,7 +68,7 @@ class NoOpPVTFunction : public PVTFunctionBase
public:
NoOpPVTFunction( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts )
@@ -76,7 +76,7 @@ class NoOpPVTFunction : public PVTFunctionBase
componentNames,
componentMolarWeight )
{
- GEOS_UNUSED_VAR( inputPara, pvtOutputOpts );
+ GEOS_UNUSED_VAR( brineFluidParameters, pvtOutputOpts );
}
static string catalogName() { return "NoOpPVTFunction"; }
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp
index f1ce6247bd4..60554073e65 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PVTFunctionBase.hpp
@@ -21,6 +21,7 @@
#define GEOS_CONSTITUTIVE_FLUID_MULTIFLUID_CO2BRINE_FUNCTIONS_PVTFUNCTIONBASE_HPP_
#include "dataRepository/ObjectCatalog.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/BrineFluidParameters.hpp"
namespace geos
{
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp
index 02b7f42dd0a..da8b4c868e9 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.cpp
@@ -110,7 +110,7 @@ void calculatePureWaterDensity( PTTableCoordinates const & tableCoords,
}
}
-TableFunction const * makeDensityTable( string_array const & inputParams,
+TableFunction const * makeDensityTable( BrineFluidParameters const & brineFluidParameters,
string const & functionName,
FunctionManager & functionManager )
{
@@ -126,24 +126,12 @@ TableFunction const * makeDensityTable( string_array const & inputParams,
}
else
{
- GEOS_THROW_IF_LT_MSG( inputParams.size(), 9,
- GEOS_FMT( "{}: insufficient number of model parameters", functionName ),
- InputError );
-
// initialize the (p,T) coordinates
PTTableCoordinates tableCoords;
- PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
// initialize salinity
- real64 salinity;
- try
- {
- salinity = stod( inputParams[8] );
- }
- catch( std::invalid_argument const & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const salinity = brineFluidParameters.m_salinity;
array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() );
if( !isZero( salinity ) )
@@ -174,7 +162,7 @@ TableFunction const * makeDensityTable( string_array const & inputParams,
} // namespace
PhillipsBrineDensity::PhillipsBrineDensity( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -188,7 +176,7 @@ PhillipsBrineDensity::PhillipsBrineDensity( string const & name,
string const expectedWaterComponentNames[] = { "Water", "water" };
m_waterIndex = PVTFunctionHelpers::findName( componentNames, expectedWaterComponentNames, "componentNames" );
- m_brineDensityTable = makeDensityTable( inputParams, m_functionName, FunctionManager::getInstance() );
+ m_brineDensityTable = makeDensityTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() );
m_brineDensityTable->outputTableData( pvtOutputOpts );
}
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp
index 67b740e3381..d94e60a30d0 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineDensity.hpp
@@ -83,7 +83,7 @@ class PhillipsBrineDensity : public PVTFunctionBase
public:
PhillipsBrineDensity( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp
index 6ab93100f47..28c13ab8270 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.cpp
@@ -34,7 +34,7 @@ namespace PVTProps
{
PhillipsBrineViscosity::PhillipsBrineViscosity( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -43,27 +43,13 @@ PhillipsBrineViscosity::PhillipsBrineViscosity( string const & name,
componentMolarWeight )
{
m_waterViscosityTable = PureWaterProperties::makeSaturationViscosityTable( m_functionName, FunctionManager::getInstance() );
- makeCoefficients( inputPara );
+ makeCoefficients( brineFluidParameters.m_salinity );
m_waterViscosityTable->outputTableData( pvtOutputOpts );
}
-void PhillipsBrineViscosity::makeCoefficients( string_array const & inputPara )
+void PhillipsBrineViscosity::makeCoefficients( real64 const salinity )
{
- GEOS_THROW_IF_LT_MSG( inputPara.size(), 3,
- GEOS_FMT( "{}: insufficient number of model parameters", m_functionName ),
- InputError );
-
- real64 m;
- try
- {
- m = stod( inputPara[2] );
- }
- catch( std::invalid_argument const & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value '{}'", m_functionName, e.what() ), InputError );
- }
-
// these coefficients come from Phillips et al. (1981), equation (1), pages 5-6
constexpr real64 a = 0.0816;
constexpr real64 b = 0.0122;
@@ -73,6 +59,7 @@ void PhillipsBrineViscosity::makeCoefficients( string_array const & inputPara )
// precompute the model coefficients
// (excluding water viscosity, which will multiply them in the compute function)
+ real64 const & m = salinity;
m_coef0 = (1.0 + a * m + b * m * m + c * m * m * m);
m_coef1 = d * (1.0 - exp( k * m ));
}
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp
index 678d781046e..5e5a67303e0 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp
@@ -81,7 +81,7 @@ class PhillipsBrineViscosity : public PVTFunctionBase
public:
PhillipsBrineViscosity( string const & name,
- string_array const & inputPara,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
@@ -111,7 +111,7 @@ class PhillipsBrineViscosity : public PVTFunctionBase
private:
- void makeCoefficients( string_array const & inputPara );
+ void makeCoefficients( real64 const salinity );
/// Table with water viscosity tabulated as a function (T)
TableFunction const * m_waterViscosityTable = nullptr;
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp
index 554118fe552..92b928f9286 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.cpp
@@ -208,7 +208,7 @@ real64 spanWagnerCO2DensityFunction( string const & name,
}
-TableFunction const * makeDensityTable( string_array const & inputParams,
+TableFunction const * makeDensityTable( constitutive::PVTProps::BrineFluidParameters const & brineFluidParameters,
string const & functionName,
FunctionManager & functionManager )
{
@@ -225,20 +225,9 @@ TableFunction const * makeDensityTable( string_array const & inputParams,
else
{
PTTableCoordinates tableCoords;
- PVTFunctionHelpers::initializePropertyTable( inputParams, tableCoords );
+ constitutive::PVTProps::BrineFluidParameters::initializePropertyTable( brineFluidParameters, tableCoords );
- real64 tolerance = 1e-10;
- try
- {
- if( inputParams.size() >= 9 )
- {
- tolerance = stod( inputParams[8] );
- }
- }
- catch( const std::invalid_argument & e )
- {
- GEOS_THROW( GEOS_FMT( "{}: invalid model parameter value: {}", functionName, e.what() ), InputError );
- }
+ real64 const tolerance = brineFluidParameters.m_tolerance;
array1d< real64 > densities( tableCoords.nPressures() * tableCoords.nTemperatures() );
SpanWagnerCO2Density::calculateCO2Density( functionName, tolerance, tableCoords, densities );
@@ -276,7 +265,7 @@ void SpanWagnerCO2Density::calculateCO2Density( string const & functionName,
}
SpanWagnerCO2Density::SpanWagnerCO2Density( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -287,7 +276,7 @@ SpanWagnerCO2Density::SpanWagnerCO2Density( string const & name,
string const expectedCO2ComponentNames[] = { "CO2", "co2" };
m_CO2Index = PVTFunctionHelpers::findName( componentNames, expectedCO2ComponentNames, "componentNames" );
- m_CO2DensityTable = makeDensityTable( inputParams, m_functionName, FunctionManager::getInstance() );
+ m_CO2DensityTable = makeDensityTable( brineFluidParameters, m_functionName, FunctionManager::getInstance() );
m_CO2DensityTable->outputTableData( pvtOutputOpts );
}
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp
index 002c1384aa0..8209048183b 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/SpanWagnerCO2Density.hpp
@@ -78,7 +78,7 @@ class SpanWagnerCO2Density : public PVTFunctionBase
public:
SpanWagnerCO2Density( string const &,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp
index 5d8827423db..d27c64337ed 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.cpp
@@ -34,7 +34,7 @@ namespace PVTProps
WaterDensity::WaterDensity( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts ):
@@ -42,7 +42,7 @@ WaterDensity::WaterDensity( string const & name,
componentNames,
componentMolarWeight )
{
- GEOS_UNUSED_VAR( inputParams );
+ GEOS_UNUSED_VAR( brineFluidParameters );
m_waterDensityTable = PureWaterProperties::makeSaturationDensityTable( m_functionName, FunctionManager::getInstance() );
m_waterDensityTable->outputTableData( pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp
index 3e65cad07d0..1e21d029cc1 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp
@@ -73,7 +73,7 @@ class WaterDensity : public PVTFunctionBase
public:
WaterDensity( string const & name,
- string_array const & inputParams,
+ BrineFluidParameters const & brineFluidParameters,
string_array const & componentNames,
array1d< real64 > const & componentMolarWeight,
TableFunction::OutputOptions const pvtOutputOpts );
diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp
index 055d48079e6..8fb5945a3d2 100644
--- a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp
+++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.cpp
@@ -66,12 +66,7 @@ ReactiveBrineFluid< PHASE > ::
ReactiveBrineFluid( string const & name, Group * const parent ):
ReactiveMultiFluid( name, parent )
{
- registerWrapper( viewKeyStruct::phasePVTParaFilesString(), &m_phasePVTParaFiles ).
- setInputFlag( InputFlags::REQUIRED ).
- setRestartFlags( RestartFlags::NO_WRITE ).
- setDescription( "Names of the files defining the parameters of the viscosity and density models" );
-
- this->registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ).
+ registerWrapper( viewKeyStruct::writeCSVFlagString(), &m_writeCSV ).
setApplyDefaultValue( 0 ).
setInputFlag( InputFlags::OPTIONAL ).
setRestartFlags( RestartFlags::NO_WRITE ).
@@ -79,6 +74,12 @@ ReactiveBrineFluid( string const & name, Group * const parent ):
"If the table is requested to be output in the log, and it is too large,"
"a CSV file will be generated even if `writeCSV` is set to 0." );
+ registerWrapper( viewKeyStruct::salinityString(), &m_salinity ).
+ setInputFlag( InputFlags::OPTIONAL ).
+ setRestartFlags( RestartFlags::NO_WRITE ).
+ setDescription( "The salinity of brine" ).
+ setDefaultValue( m_salinity );
+
// if this is a thermal model, we need to make sure that the arrays will be properly displayed and saved to restart
if( isThermal() )
{
@@ -95,12 +96,11 @@ ReactiveBrineFluid( string const & name, Group * const parent ):
}
template< typename PHASE >
-bool ReactiveBrineFluid< PHASE > ::isThermal() const
+bool ReactiveBrineFluid< PHASE >::isThermal() const
{
- return ( PHASE::Enthalpy::catalogName() != PVTProps::NoOpPVTFunction::catalogName() );
+ return isThermalType();
}
-
template< typename PHASE >
std::unique_ptr< ConstitutiveBase >
ReactiveBrineFluid< PHASE > ::
@@ -130,17 +130,20 @@ void ReactiveBrineFluid< PHASE > ::postInputInitialization()
ReactiveMultiFluid::postInputInitialization();
GEOS_THROW_IF_NE_MSG( numFluidPhases(), 1,
- "invalid number of phases",
- InputError, getDataContext() );
- GEOS_THROW_IF_NE_MSG( m_phasePVTParaFiles.size(), 1,
- "invalid number of values in attribute ",
- InputError, getDataContext() );
+ GEOS_FMT( "{}: invalid number of phases", getFullName() ),
+ InputError );
+
+ // Salinity must not be negative
+ GEOS_THROW_IF_LT_MSG( m_salinity, 0.0,
+ GEOS_FMT( "{}: invalid salinity {}. "
+ "Value must not be negative", getFullName(), viewKeyStruct::salinityString() ),
+ InputError );
createPVTModels();
}
template< typename PHASE >
-void ReactiveBrineFluid< PHASE > ::createPVTModels()
+void ReactiveBrineFluid< PHASE >::createPVTModels()
{
// TODO: get rid of these external files and move into XML, this is too error prone
// For now, to support the legacy input, we read all the input parameters at once in the arrays below, and then we create the models
@@ -211,8 +214,14 @@ void ReactiveBrineFluid< PHASE > ::createPVTModels()
!isClone && isLogLevelActive< logInfo::TableLogOutput >( this->getLogLevel()) // writeInLog
};
+ BrineFluidParameters parameters;
+ parameters.m_salinity = m_salinity;
+
// then, we are ready to instantiate the phase models
- m_phase = std::make_unique< PHASE >( getName() + "_phaseModel1", phase1InputParams, m_componentNames, m_componentMolarWeight,
+ m_phase = std::make_unique< PHASE >( getName() + "_phaseModel1",
+ parameters,
+ m_componentNames,
+ m_componentMolarWeight,
pvtOutputOpts );
}
diff --git a/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp
new file mode 100644
index 00000000000..7457d032641
--- /dev/null
+++ b/src/coreComponents/constitutive/fluid/multifluid/reactive/ReactiveBrineFluid.hpp
@@ -0,0 +1,316 @@
+/*
+ * ------------------------------------------------------------------------------------------------------------
+ * SPDX-License-Identifier: LGPL-2.1-only
+ *
+ * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
+ * Copyright (c) 2018-2024 TotalEnergies
+ * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
+ * Copyright (c) 2023-2024 Chevron
+ * Copyright (c) 2019- GEOS/GEOSX Contributors
+ * All rights reserved
+ *
+ * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
+ * ------------------------------------------------------------------------------------------------------------
+ */
+
+/**
+ * @file ReactiveBrineFluid.hpp
+ */
+
+#ifndef GEOS_CONSTITUTIVE_FLUID_REACTIVEBRINEFLUID_HPP_
+#define GEOS_CONSTITUTIVE_FLUID_REACTIVEBRINEFLUID_HPP_
+
+#include "common/format/EnumStrings.hpp"
+#include "constitutive/fluid/multifluid/reactive/ReactiveMultiFluid.hpp"
+#include "constitutive/fluid/multifluid/MultiFluidUtils.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/PhaseModel.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/BrineEnthalpy.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/NoOpPVTFunction.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/WaterDensity.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/PhillipsBrineViscosity.hpp"
+#include "constitutive/fluid/multifluid/CO2Brine/functions/PureWaterProperties.hpp"
+#include "common/Units.hpp"
+
+
+
+#include
+
+namespace geos
+{
+
+namespace constitutive
+{
+
+template< typename PHASE >
+class ReactiveBrineFluid : public ReactiveMultiFluid
+{
+public:
+
+ using exec_policy = parallelDevicePolicy<>;
+
+ ReactiveBrineFluid( string const & name,
+ Group * const parent );
+
+ virtual std::unique_ptr< ConstitutiveBase >
+ deliverClone( string const & name,
+ Group * const parent ) const override;
+
+ static string catalogName();
+
+ static constexpr bool isThermalType()
+ {
+ return !( std::is_same_v< typename PHASE::Enthalpy, PVTProps::NoOpPVTFunction > );
+ }
+
+ virtual string getCatalogName() const override { return catalogName(); }
+
+ virtual bool isThermal() const override final;
+
+ /**
+ * @copydoc MultiFluidBase::checkTablesParameters( real64 pressure, real64 temperature )
+ */
+ void checkTablesParameters( real64 pressure, real64 temperature ) const override final;
+
+ /**
+ * @brief Kernel wrapper class for ReactiveBrineFluid.
+ */
+ class KernelWrapper final : public ReactiveMultiFluid::KernelWrapper
+ {
+public:
+ GEOS_HOST_DEVICE
+ virtual void compute( real64 const pressure,
+ real64 const temperature,
+ arraySlice1d< real64 const, compflow::USD_COMP - 1 > const & composition,
+ PhaseProp::SliceType const phaseFraction,
+ PhaseProp::SliceType const phaseDensity,
+ PhaseProp::SliceType const phaseMassDensity,
+ PhaseProp::SliceType const phaseViscosity,
+ PhaseProp::SliceType const phaseEnthalpy,
+ PhaseProp::SliceType const phaseInternalEnergy,
+ PhaseComp::SliceType const phaseCompFraction,
+ FluidProp::SliceType const totalDensity ) const override;
+
+ GEOS_HOST_DEVICE
+ virtual void update( localIndex const k,
+ localIndex const q,
+ real64 const pressure,
+ real64 const temperature,
+ arraySlice1d< real64 const, compflow::USD_COMP - 1 > const & composition ) const override;
+
+ virtual void updateChemistry( localIndex const k,
+ localIndex const q,
+ real64 const pressure,
+ real64 const temperature,
+ arraySlice1d< real64 const, compflow::USD_COMP - 1 > const & composition ) const override;
+
+private:
+
+ friend class ReactiveBrineFluid;
+
+ KernelWrapper( PHASE const & phase,
+ arrayView1d< real64 const > componentMolarWeight,
+ bool const useMass,
+ bool const isThermal,
+ PhaseProp::ViewType phaseFraction,
+ PhaseProp::ViewType phaseDensity,
+ PhaseProp::ViewType phaseMassDensity,
+ PhaseProp::ViewType phaseViscosity,
+ PhaseProp::ViewType phaseEnthalpy,
+ PhaseProp::ViewType phaseInternalEnergy,
+ PhaseComp::ViewType phaseCompFraction,
+ FluidProp::ViewType totalDensity,
+ integer const numPrimarySpecies,
+ chemicalReactions::EquilibriumReactions const & equilibriumReactions,
+ chemicalReactions::KineticReactions const & kineticReactions,
+ arrayView2d< real64, compflow::USD_COMP > const & primarySpeciesConcentration,
+ arrayView2d< real64, compflow::USD_COMP > const & secondarySpeciesConcentration,
+ arrayView2d< real64, compflow::USD_COMP > const & primarySpeciesTotalConcentration,
+ arrayView2d< real64, compflow::USD_COMP > const & kineticReactionRates );
+
+
+ /// Flag to specify whether the model is thermal or not
+ bool m_isThermal;
+
+ /// Brine constitutive kernel wrappers
+ typename PHASE::KernelWrapper m_phase;
+
+ };
+
+ virtual integer getWaterPhaseIndex() const override final;
+
+ /**
+ * @brief Names of the submodels for input
+ */
+ enum class SubModelInputNames : integer
+ {
+ DENSITY, ///< the keyword for the density model
+ VISCOSITY, ///< the keyword for the viscosity model
+ ENTHALPY ///< the keyword for the enthalpy model
+ };
+
+ /**
+ * @brief Create an update kernel wrapper.
+ * @return the wrapper
+ */
+ KernelWrapper createKernelWrapper();
+
+ struct viewKeyStruct : ReactiveMultiFluid::viewKeyStruct
+ {
+ static constexpr char const * writeCSVFlagString() { return "writeCSV"; }
+ static constexpr char const * salinityString() { return "salinity"; }
+ };
+
+protected:
+
+ virtual void postInputInitialization() override;
+
+private:
+
+ /**
+ * @brief Create a PVT Model and output them
+ */
+ void createPVTModels();
+
+ /// Salinity
+ real64 m_salinity{0.0};
+
+ /// Output csv file containing informations about PVT
+ integer m_writeCSV;
+
+ /// Brine constitutive models
+ std::unique_ptr< PHASE > m_phase;
+
+};
+
+// these aliases are useful in constitutive dispatch
+using ReactiveBrine =
+ ReactiveBrineFluid< PhaseModel< PVTProps::WaterDensity, PVTProps::PhillipsBrineViscosity, PVTProps::NoOpPVTFunction > >;
+using ReactiveBrineThermal =
+ ReactiveBrineFluid< PhaseModel< PVTProps::WaterDensity, PVTProps::PhillipsBrineViscosity, PVTProps::BrineEnthalpy > >;
+
+template< typename PHASE >
+GEOS_HOST_DEVICE
+inline void
+ReactiveBrineFluid< PHASE >::KernelWrapper::
+ compute( real64 const pressure,
+ real64 const temperature,
+ arraySlice1d< real64 const, compflow::USD_COMP - 1 > const & composition,
+ PhaseProp::SliceType const phaseFraction,
+ PhaseProp::SliceType const phaseDensity,
+ PhaseProp::SliceType const phaseMassDensity,
+ PhaseProp::SliceType const phaseViscosity,
+ PhaseProp::SliceType const phaseEnthalpy,
+ PhaseProp::SliceType const phaseInternalEnergy,
+ PhaseComp::SliceType const phaseCompFraction,
+ FluidProp::SliceType const totalDensity ) const
+{
+ integer constexpr numComp = chemicalReactions::ReactionsBase::maxNumPrimarySpecies;
+
+ // 1. We perform a sort of single phase flash
+ stackArray1d< real64, numComp > compMoleFrac( composition.size() );
+
+ phaseFraction.value[0] = 1.0; // it's a single phase system
+ for( integer ic = 0; ic < composition.size(); ++ic )
+ {
+ compMoleFrac[ic] = composition[ic];
+ phaseCompFraction.value[0][ic] = composition[ic];
+ }
+
+ real64 const temperatureInCelsius = units::convertKToC( temperature );
+
+ // 2. Compute phase densities and phase viscosities
+ m_phase.density.compute( pressure,
+ temperatureInCelsius,
+ phaseCompFraction.value[0].toSliceConst(), phaseCompFraction.derivs[0].toSliceConst(),
+ phaseDensity.value[0], phaseDensity.derivs[0],
+ m_useMass );
+
+ m_phase.viscosity.compute( pressure,
+ temperatureInCelsius,
+ phaseCompFraction.value[0].toSliceConst(), phaseCompFraction.derivs[0].toSliceConst(),
+ phaseViscosity.value[0], phaseViscosity.derivs[0],
+ m_useMass );
+
+
+ // for now, we have to compute the phase mass density here
+ m_phase.density.compute( pressure,
+ temperatureInCelsius,
+ phaseCompFraction.value[0].toSliceConst(), phaseCompFraction.derivs[0].toSliceConst(),
+ phaseMassDensity.value[0], phaseMassDensity.derivs[0],
+ true );
+
+ // 3. Compute enthalpy and internal energy
+ if( m_isThermal )
+ {
+ m_phase.enthalpy.compute( pressure,
+ temperatureInCelsius,
+ phaseCompFraction.value[0].toSliceConst(), phaseCompFraction.derivs[0].toSliceConst(),
+ phaseEnthalpy.value[0], phaseEnthalpy.derivs[0],
+ m_useMass );
+
+ computeInternalEnergy( pressure,
+ phaseFraction,
+ phaseMassDensity,
+ phaseEnthalpy,
+ phaseInternalEnergy );
+ }
+
+ // 6. Compute total fluid mass/molar density and derivatives
+ computeTotalDensity( phaseFraction,
+ phaseDensity,
+ totalDensity );
+}
+
+template< typename PHASE >
+GEOS_HOST_DEVICE inline void
+ReactiveBrineFluid< PHASE >::KernelWrapper::
+ update( localIndex const k,
+ localIndex const q,
+ real64 const pressure,
+ real64 const temperature,
+ arraySlice1d< geos::real64 const, compflow::USD_COMP - 1 > const & composition ) const
+{
+ compute( pressure,
+ temperature,
+ composition,
+ m_phaseFraction( k, q ),
+ m_phaseDensity( k, q ),
+ m_phaseMassDensity( k, q ),
+ m_phaseViscosity( k, q ),
+ m_phaseEnthalpy( k, q ),
+ m_phaseInternalEnergy( k, q ),
+ m_phaseCompFraction( k, q ),
+ m_totalDensity( k, q ) );
+}
+
+template< typename PHASE >
+inline void
+ReactiveBrineFluid< PHASE >::KernelWrapper::
+ updateChemistry( localIndex const k,
+ localIndex const q,
+ real64 const pressure,
+ real64 const temperature,
+ arraySlice1d< geos::real64 const, compflow::USD_COMP - 1 > const & composition ) const
+
+{
+ real64 const totalMolecularWeight = PVTProps::PureWaterProperties::MOLECULAR_WEIGHT;
+
+ convertMoleFractionToMolarity( m_totalDensity( k, q ).value,
+ totalMolecularWeight,
+ composition,
+ m_primarySpeciesTotalConcentration[k] );
+
+ computeChemistry( pressure,
+ temperature,
+ m_primarySpeciesTotalConcentration[k],
+ m_primarySpeciesConcentration[k],
+ m_secondarySpeciesConcentration[k],
+ m_kineticReactionRates[k] );
+}
+
+
+} // namespace constitutive
+
+} // namespace geos
+
+#endif //GEOS_CONSTITUTIVE_FLUID_REACTIVEBRINEFLUID_HPP_
diff --git a/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp b/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp
index 72cfec6501c..99d94e50565 100644
--- a/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp
+++ b/src/coreComponents/constitutive/unitTests/FluidModelTest_impl.hpp
@@ -115,7 +115,7 @@ testValuesAgainstPreviousImplementation( FluidModel * fluid,
"\n{} failed.\n"
"Pressure: {}, Temperature: {} Composition: {}.\n"
"Calculated: {}.\n"
- "Expacted: {}\n"
+ "Expected: {}\n"
"Difference: {}",
name,
pressure, temperature, toString( compositionView[0].toSliceConst() ),
diff --git a/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp b/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp
index 30242769d45..0cbe8e7708b 100644
--- a/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp
+++ b/src/coreComponents/constitutive/unitTests/testCO2BrinePVTModels.cpp
@@ -31,25 +31,60 @@ using namespace geos::stringutilities;
using namespace geos::constitutive::PVTProps;
using namespace geos::constitutive::multifluid;
-/// Input tables written into temporary files during testing
-
-static const char * pvtLiquidPhillipsTableContent = "DensityFun PhillipsBrineDensity 1e6 1.5e7 5e4 367.15 369.15 1 0.2\n"
- "ViscosityFun PhillipsBrineViscosity 0.1";
-
-// Used also for gas phase
-static const char * pvtLiquidEnthalpyTableContent = "EnthalpyFun BrineEnthalpy 1e6 1.5e7 5e4 367.15 369.15 1 0.2";
+template< typename MODEL >
+struct Parameters
+{
+ static void populate( BrineFluidParameters & parameters )
+ {
+ parameters.m_pressureCoordinates.emplace_back( 1.0e6 );
+ parameters.m_pressureCoordinates.emplace_back( 1.5e7 );
+ parameters.m_pressureInterval = 5.0e4;
+ parameters.m_temperatureCoordinates.emplace_back( 367.15 );
+ parameters.m_temperatureCoordinates.emplace_back( 369.15 );
+ parameters.m_temperatureInterval = 1.0;
+ parameters.m_salinity = 0.2;
+ parameters.m_ezrokhiDensityCoefficients.emplace_back( 2.01e-6 );
+ parameters.m_ezrokhiDensityCoefficients.emplace_back( -6.34e-7 );
+ parameters.m_ezrokhiDensityCoefficients.emplace_back( 1e-4 );
+ parameters.m_ezrokhiViscosityCoefficients.emplace_back( 2.42e-7 );
+ parameters.m_ezrokhiViscosityCoefficients.emplace_back( 0.0 );
+ parameters.m_ezrokhiViscosityCoefficients.emplace_back( 1e-4 );
+ }
+};
-// the last are set relatively high (1e-4) to increase derivative value and check it properly
-// This string has some more various whitespace values in it to test if everything goes well anyway.
-static const char * pvtLiquidEzrokhiTableContent = "\tDensityFun EzrokhiBrineDensity 2.01e-6 -6.34e-7 1e-4\n\r"
- "\tViscosityFun EzrokhiBrineViscosity 2.42e-7 0 1e-4\n\r\n\r";
+template<>
+struct Parameters< PhillipsBrineViscosity >
+{
+ static void populate( BrineFluidParameters & parameters )
+ {
+ Parameters< NoOpPVTFunction >::populate( parameters );
+ parameters.m_salinity = 0.1;
+ }
+};
-static const char * pvtGasTableContent = "DensityFun SpanWagnerCO2Density 1e5 7.5e7 5e4 285.15 369.15 4.0\n" // we want to test the full
- // (pres, temp) range here
- "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1.0";
+template<>
+struct Parameters< SpanWagnerCO2Density >
+{
+ static void populate( BrineFluidParameters & parameters )
+ {
+ Parameters< NoOpPVTFunction >::populate( parameters );
+ parameters.m_pressureCoordinates[0] = 1.0e5;
+ parameters.m_pressureCoordinates[1] = 7.5e7;
+ parameters.m_temperatureCoordinates[0] = 285.15;
+ parameters.m_temperatureCoordinates[1] = 369.15;
+ parameters.m_temperatureInterval = 4.0;
+ }
+};
-static const char * co2FlashTableContent = "FlashModel CO2Solubility 1e5 7.5e7 5e4 285.15 369.15 4.0 0.15"; // we want to test the full
- // (pres, temp) range here
+template<>
+struct Parameters< CO2Solubility >
+{
+ static void populate( BrineFluidParameters & parameters )
+ {
+ Parameters< SpanWagnerCO2Density >::populate( parameters );
+ parameters.m_salinity = 0.15;
+ }
+};
template< typename PVT_WRAPPER >
void testValuesAgainstPreviousImplementation( PVT_WRAPPER const & pvtFunctionWrapper,
@@ -313,129 +348,100 @@ void testNumericalDerivatives( FLASH_WRAPPER const & flashModelWrapper,
}
}
}
-
-}
-
-void writeTableToFile( string const & filename, char const * str )
-{
- std::ofstream os( filename );
- ASSERT_TRUE( os.is_open() );
- os << str;
- os.close();
-}
-
-void removeFile( string const & filename )
-{
- int const ret = std::remove( filename.c_str() );
- ASSERT_TRUE( ret == 0 );
}
template< typename MODEL >
-std::unique_ptr< MODEL > makePVTFunction( string const & filename,
- string const & key )
+std::unique_ptr< MODEL > makePVTFunction()
{
// define component names and molar weight
string_array componentNames;
componentNames.resize( 2 );
- componentNames[0] = "co2"; componentNames[1] = "water";
+ componentNames[0] = "co2";
+ componentNames[1] = "water";
array1d< real64 > componentMolarWeight;
componentMolarWeight.resize( 2 );
- componentMolarWeight[0] = 44e-3; componentMolarWeight[1] = 18e-3;
-
- // read parameters from file
- std::ifstream is( filename );
- std::unique_ptr< MODEL > pvtFunction = nullptr;
- string str;
- while( std::getline( is, str ) )
- {
- string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str );
-
- TableFunction::OutputOptions const pvtOutputOpts = {
- true,// writeCSV
- true, // writeInLog
- };
-
- if( strs.size()>1 && strs[0] == key )
- {
- pvtFunction = std::make_unique< MODEL >( strs[1],
- strs,
- componentNames,
- componentMolarWeight,
- pvtOutputOpts );
- }
- }
- GEOS_ERROR_IF( pvtFunction == nullptr,
- GEOS_FMT( "Could not find {} in {}", key, filename ) );
-
- return pvtFunction;
+ componentMolarWeight[0] = 44e-3;
+ componentMolarWeight[1] = 18e-3;
+
+ TableFunction::OutputOptions const outputOpts = {
+ true, // writeCSV
+ true, // writeInLog
+ };
+
+ // Create parameters
+ BrineFluidParameters parameters;
+ Parameters< MODEL >::populate( parameters );
+
+ return std::make_unique< MODEL >( MODEL::catalogName(),
+ parameters,
+ componentNames,
+ componentMolarWeight,
+ outputOpts );
}
-template< typename MODEL >
-std::unique_ptr< MODEL > makeFlashModel( string const & filename,
- string const & key )
+template<>
+std::unique_ptr< CO2Solubility > makePVTFunction< CO2Solubility >()
{
// define phase names
string_array phaseNames;
phaseNames.resize( 2 );
- phaseNames[0] = "gas"; phaseNames[1] = "liquid";
+ phaseNames[0] = "gas";
+ phaseNames[1] = "liquid";
// define component names and molar weight
string_array componentNames;
componentNames.resize( 2 );
- componentNames[0] = "co2"; componentNames[1] = "water";
+ componentNames[0] = "co2";
+ componentNames[1] = "water";
array1d< real64 > componentMolarWeight;
componentMolarWeight.resize( 2 );
- componentMolarWeight[0] = 44e-3; componentMolarWeight[1] = 18e-3;
-
- // read parameters from file
- std::ifstream is( filename );
- std::unique_ptr< MODEL > flashModel;
- string str;
- while( std::getline( is, str ) )
- {
- string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( str );
- TableFunction::OutputOptions const flashOutputOpts = {
- true, // writeCSV
- true, // writeInLog
- };
- if( strs.size()>1 && strs[0] == key )
- {
- flashModel = std::make_unique< MODEL >( strs[1],
- strs,
- phaseNames,
- componentNames,
- componentMolarWeight,
- flashOutputOpts );
- }
- }
- GEOS_ERROR_IF( flashModel == nullptr,
- GEOS_FMT( "Could not find {} in {}", key, filename ) );
-
- return flashModel;
+ componentMolarWeight[0] = 44e-3;
+ componentMolarWeight[1] = 18e-3;
+
+ TableFunction::OutputOptions const outputOpts = {
+ true, // writeCSV
+ true, // writeInLog
+ };
+
+ // Create parameters
+ BrineFluidParameters parameters;
+ Parameters< CO2Solubility >::populate( parameters );
+
+ return std::make_unique< CO2Solubility >( CO2Solubility::catalogName(),
+ parameters,
+ phaseNames,
+ componentNames,
+ componentMolarWeight,
+ outputOpts );
}
-class PhillipsBrineViscosityTest : public ::testing::Test
+template< typename MODEL >
+class CO2BrineModelTestFixture : public ::testing::Test
{
public:
- PhillipsBrineViscosityTest()
+ CO2BrineModelTestFixture()
{
- writeTableToFile( filename, pvtLiquidPhillipsTableContent );
- pvtFunction = makePVTFunction< PhillipsBrineViscosity >( filename, key );
+ pvtFunction = makePVTFunction< MODEL >();
}
- ~PhillipsBrineViscosityTest() override
- {
- removeFile( filename );
- }
+ ~CO2BrineModelTestFixture() override = default;
protected:
- string const key = "ViscosityFun";
- string const filename = "pvtliquid.txt";
- std::unique_ptr< PhillipsBrineViscosity > pvtFunction;
+ std::unique_ptr< MODEL > pvtFunction{};
};
+using PhillipsBrineViscosityTest = CO2BrineModelTestFixture< PhillipsBrineViscosity >;
+using EzrokhiBrineViscosityTest = CO2BrineModelTestFixture< EzrokhiBrineViscosity >;
+using FenghourCO2ViscosityTest = CO2BrineModelTestFixture< FenghourCO2Viscosity >;
+using PhillipsBrineDensityTest = CO2BrineModelTestFixture< PhillipsBrineDensity >;
+using EzrokhiBrineDensityTest = CO2BrineModelTestFixture< EzrokhiBrineDensity >;
+using SpanWagnerCO2DensityTest = CO2BrineModelTestFixture< SpanWagnerCO2Density >;
+using CO2SolubilityTest = CO2BrineModelTestFixture< CO2Solubility >;
+using BrineEnthalpyTest = CO2BrineModelTestFixture< BrineEnthalpy >;
+using CO2EnthalpyTest = CO2BrineModelTestFixture< CO2Enthalpy >;
+
TEST_F( PhillipsBrineViscosityTest, brineViscosityValuesAndDeriv )
{
real64 const P[3] = { 5e6, 7.5e6, 1.2e7 };
@@ -475,26 +481,6 @@ TEST_F( PhillipsBrineViscosityTest, brineViscosityValuesAndDeriv )
}
}
-class EzrokhiBrineViscosityTest : public ::testing::Test
-{
-public:
- EzrokhiBrineViscosityTest()
- {
- writeTableToFile( filename, pvtLiquidEzrokhiTableContent );
- pvtFunction = makePVTFunction< EzrokhiBrineViscosity >( filename, key );
- }
-
- ~EzrokhiBrineViscosityTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "ViscosityFun";
- string const filename = "pvtliquid.txt";
- std::unique_ptr< EzrokhiBrineViscosity > pvtFunction;
-};
-
TEST_F( EzrokhiBrineViscosityTest, brineViscosityValuesAndDeriv )
{
real64 const P[3] = { 5e6, 7.5e6, 1.2e7 };
@@ -522,26 +508,6 @@ TEST_F( EzrokhiBrineViscosityTest, brineViscosityValuesAndDeriv )
}
}
-class FenghourCO2ViscosityTest : public ::testing::Test
-{
-public:
- FenghourCO2ViscosityTest()
- {
- writeTableToFile( filename, pvtGasTableContent );
- pvtFunction = makePVTFunction< FenghourCO2Viscosity >( filename, key );
- }
-
- ~FenghourCO2ViscosityTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "ViscosityFun";
- string const filename = "pvtgas.txt";
- std::unique_ptr< FenghourCO2Viscosity > pvtFunction;
-};
-
TEST_F( FenghourCO2ViscosityTest, fenghourCO2ViscosityValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
@@ -581,26 +547,6 @@ TEST_F( FenghourCO2ViscosityTest, fenghourCO2ViscosityValuesAndDeriv )
}
}
-class PhillipsBrineDensityTest : public ::testing::Test
-{
-public:
- PhillipsBrineDensityTest()
- {
- writeTableToFile( filename, pvtLiquidPhillipsTableContent );
- pvtFunction = makePVTFunction< PhillipsBrineDensity >( filename, key );
- }
-
- ~PhillipsBrineDensityTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "DensityFun";
- string const filename = "pvtliquid.txt";
- std::unique_ptr< PhillipsBrineDensity > pvtFunction;
-};
-
TEST_F( PhillipsBrineDensityTest, brineCO2DensityMassValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
@@ -668,26 +614,6 @@ TEST_F( PhillipsBrineDensityTest, brineCO2DensityMolarValuesAndDeriv )
}
}
-class EzrokhiBrineDensityTest : public ::testing::Test
-{
-public:
- EzrokhiBrineDensityTest()
- {
- writeTableToFile( filename, pvtLiquidEzrokhiTableContent );
- pvtFunction = makePVTFunction< EzrokhiBrineDensity >( filename, key );
- }
-
- ~EzrokhiBrineDensityTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "DensityFun";
- string const filename = "pvtliquid.txt";
- std::unique_ptr< EzrokhiBrineDensity > pvtFunction;
-};
-
TEST_F( EzrokhiBrineDensityTest, brineCO2DensityMassValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
@@ -746,26 +672,6 @@ TEST_F( EzrokhiBrineDensityTest, brineCO2DensityMolarValuesAndDeriv )
}
}
-class SpanWagnerCO2DensityTest : public ::testing::Test
-{
-public:
- SpanWagnerCO2DensityTest()
- {
- writeTableToFile( filename, pvtGasTableContent );
- pvtFunction = makePVTFunction< SpanWagnerCO2Density >( filename, key );
- }
-
- ~SpanWagnerCO2DensityTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "DensityFun";
- string const filename = "pvtgas.txt";
- std::unique_ptr< SpanWagnerCO2Density > pvtFunction;
-};
-
TEST_F( SpanWagnerCO2DensityTest, spanWagnerCO2DensityMassValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
@@ -845,26 +751,6 @@ TEST_F( SpanWagnerCO2DensityTest, spanWagnerCO2DensityMolarValuesAndDeriv )
}
}
-class CO2SolubilityTest : public ::testing::Test
-{
-public:
- CO2SolubilityTest()
- {
- writeTableToFile( filename, co2FlashTableContent );
- flashModel = makeFlashModel< CO2Solubility >( filename, key );
- }
-
- ~CO2SolubilityTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "FlashModel";
- string const filename = "co2flash.txt";
- std::unique_ptr< CO2Solubility > flashModel;
-};
-
TEST_F( CO2SolubilityTest, co2SolubilityValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
@@ -890,7 +776,7 @@ TEST_F( CO2SolubilityTest, co2SolubilityValuesAndDeriv )
0.008322701666, 0.008287995083, 0.008259683449, 0.01143341315, 0.0113929227, 0.01135993384,
0.01597786252, 0.01594169644, 0.015912288 };
- CO2Solubility::KernelWrapper flashModelWrapper = flashModel->createKernelWrapper();
+ CO2Solubility::KernelWrapper flashModelWrapper = pvtFunction->createKernelWrapper();
integer counter = 0;
for( integer iComp = 0; iComp < 3; ++iComp )
@@ -911,26 +797,6 @@ TEST_F( CO2SolubilityTest, co2SolubilityValuesAndDeriv )
}
}
-class BrineEnthalpyTest : public ::testing::Test
-{
-public:
- BrineEnthalpyTest()
- {
- writeTableToFile( filename, pvtLiquidEnthalpyTableContent );
- pvtFunction = makePVTFunction< BrineEnthalpy >( filename, key );
- }
-
- ~BrineEnthalpyTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "EnthalpyFun";
- string const filename = "pvtliquid.txt";
- std::unique_ptr< BrineEnthalpy > pvtFunction;
-};
-
TEST_F( BrineEnthalpyTest, BrineEnthalpyMassValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
@@ -1005,28 +871,6 @@ TEST_F( BrineEnthalpyTest, BrineEnthalpyMolarValuesAndDeriv )
}
}
-class CO2EnthalpyTest : public ::testing::Test
-{
-public:
- CO2EnthalpyTest()
- {
- // gas enthalpy model repeats liquid parameters (except m), use them here
- writeTableToFile( filename, pvtLiquidEnthalpyTableContent );
- pvtFunction = makePVTFunction< CO2Enthalpy >( filename, key );
-
- }
-
- ~CO2EnthalpyTest() override
- {
- removeFile( filename );
- }
-
-protected:
- string const key = "EnthalpyFun";
- string const filename = "pvtgas.txt";
- std::unique_ptr< CO2Enthalpy > pvtFunction;
-};
-
TEST_F( CO2EnthalpyTest, CO2EnthalpyMassValuesAndDeriv )
{
// when checking numerical derivatives, do not fall on the coordinate points of the tables!!
diff --git a/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp b/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp
index 06feb1c6877..81c6cd88dd7 100644
--- a/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp
+++ b/src/coreComponents/constitutive/unitTests/testCO2SpycherPruessModels.cpp
@@ -50,18 +50,17 @@ class CO2SolubilitySpycherPruessTestFixture : public ::testing::TestWithParam< T
static real64 constexpr relTol = 1.0e-5;
static real64 constexpr absTol = 1.0e-7;
static real64 constexpr pertubation = 1.0e-6;
- static constexpr char const * flashContent = "FlashModel CO2Solubility 1.0e5 1.0e7 9.9e5 283.15 383.15 10.0 0.15 1.0e-8 SpycherPruess";
public:
CO2SolubilitySpycherPruessTestFixture() = default;
~CO2SolubilitySpycherPruessTestFixture() override = default;
protected:
- static std::unique_ptr< CO2Solubility > makeFlashModel( string const & fileContent );
+ static std::unique_ptr< CO2Solubility > makeFlashModel();
};
std::unique_ptr< CO2Solubility >
-CO2SolubilitySpycherPruessTestFixture::makeFlashModel( string const & fileContent )
+CO2SolubilitySpycherPruessTestFixture::makeFlashModel()
{
// Define phase names
string_array phaseNames;
@@ -80,16 +79,25 @@ CO2SolubilitySpycherPruessTestFixture::makeFlashModel( string const & fileConten
componentMolarWeight[0] = 44.0e-3;
componentMolarWeight[1] = 18.0e-3;
- // Read file parameters
- string_array const strs = stringutilities::tokenizeBySpaces< stdVector >( fileContent );
+ // Fluid model parameters
+ BrineFluidParameters parameters;
+ parameters.m_solubilityModel = BrineFluidParameters::SolubilityModel::SpycherPruess;
+ parameters.m_pressureCoordinates.emplace_back( 1.0e5 );
+ parameters.m_pressureCoordinates.emplace_back( 1.0e7 );
+ parameters.m_pressureInterval = 9.9e5;
+ parameters.m_temperatureCoordinates.emplace_back( 283.15 );
+ parameters.m_temperatureCoordinates.emplace_back( 383.15 );
+ parameters.m_temperatureInterval = 10.0;
+ parameters.m_salinity = 0.15;
+ parameters.m_tolerance = 1.0e-8;
TableFunction::OutputOptions const flashOutputOpts = {
false, // writeCSV
false, // writeInLog
};
- return std::make_unique< CO2Solubility >( strs[1],
- strs,
+ return std::make_unique< CO2Solubility >( "FlashModel",
+ parameters,
phaseNames,
componentNames,
componentMolarWeight,
@@ -98,7 +106,7 @@ CO2SolubilitySpycherPruessTestFixture::makeFlashModel( string const & fileConten
TEST_P( CO2SolubilitySpycherPruessTestFixture, testExpectedValues )
{
- auto flashModel = makeFlashModel( CO2SolubilitySpycherPruessTestFixture::flashContent );
+ auto flashModel = makeFlashModel();
auto [pressure, temperature, z_co2, expected_V, expected_x_co2, expected_y_wat] = GetParam();
@@ -137,7 +145,7 @@ TEST_P( CO2SolubilitySpycherPruessTestFixture, testNumericalDerivatives )
{
using Deriv = multifluid::DerivativeOffset;
- auto flashModel = makeFlashModel( CO2SolubilitySpycherPruessTestFixture::flashContent );
+ auto flashModel = makeFlashModel();
auto [pressure, temperature, z_co2, expected_V, expected_x_co2, expected_y_wat] = GetParam();
GEOS_UNUSED_VAR( expected_V, expected_x_co2, expected_y_wat );
diff --git a/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp b/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp
index d908f61445f..283bbd6251b 100644
--- a/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp
+++ b/src/coreComponents/constitutive/unitTests/testMultiFluidCO2Brine.cpp
@@ -22,6 +22,7 @@
#include "common/initializeEnvironment.hpp"
using namespace geos::constitutive;
+using namespace geos::constitutive::PVTProps;
namespace geos
{
@@ -34,6 +35,23 @@ enum class FlashType : int {DuanSun, SpycherPruess};
ENUM_STRINGS( BrineModelType, "Phillips", "Ezrokhi" );
ENUM_STRINGS( FlashType, "DuanSun", "SpycherPruess" );
+static void populateFluidParameters( BrineFluidParameters & parameters )
+{
+ parameters.m_pressureCoordinates.emplace_back( 1.0e6 );
+ parameters.m_pressureCoordinates.emplace_back( 1.5e7 );
+ parameters.m_pressureInterval = 5.0e4;
+ parameters.m_temperatureCoordinates.emplace_back( 367.15 );
+ parameters.m_temperatureCoordinates.emplace_back( 369.15 );
+ parameters.m_temperatureInterval = 1.0;
+ parameters.m_salinity = 0.2;
+ parameters.m_ezrokhiDensityCoefficients.emplace_back( 2.01e-6 );
+ parameters.m_ezrokhiDensityCoefficients.emplace_back( -6.34e-7 );
+ parameters.m_ezrokhiDensityCoefficients.emplace_back( 1e-4 );
+ parameters.m_ezrokhiViscosityCoefficients.emplace_back( 2.42e-7 );
+ parameters.m_ezrokhiViscosityCoefficients.emplace_back( 0.0 );
+ parameters.m_ezrokhiViscosityCoefficients.emplace_back( 1e-4 );
+}
+
template< BrineModelType BRINE, bool THERMAL >
struct FluidType {};
@@ -41,41 +59,21 @@ template<>
struct FluidType< BrineModelType::Phillips, false >
{
using type = CO2BrinePhillipsFluid;
- static constexpr const char * brineContent = "DensityFun PhillipsBrineDensity 1e6 1.5e7 5e4 367.15 369.15 1 0.2\n"
- "ViscosityFun PhillipsBrineViscosity 0.1";
- static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1";
};
template<>
struct FluidType< BrineModelType::Phillips, true >
{
using type = CO2BrinePhillipsThermalFluid;
- static constexpr const char * brineContent = "DensityFun PhillipsBrineDensity 1e6 1.5e7 5e4 367.15 369.15 1 0.2\n"
- "ViscosityFun PhillipsBrineViscosity 0.1\n"
- "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0";
- static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1\n"
- "EnthalpyFun CO2Enthalpy 1e6 1.5e7 5e4 367.15 369.15 1";
};
template<>
struct FluidType< BrineModelType::Ezrokhi, false >
{
using type = CO2BrineEzrokhiFluid;
- static constexpr const char * brineContent = "DensityFun EzrokhiBrineDensity 2.01e-6 -6.34e-7 1e-4\n"
- "ViscosityFun EzrokhiBrineViscosity 2.42e-7 0 1e-4";
- static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1";
};
template<>
struct FluidType< BrineModelType::Ezrokhi, true >
{
using type = CO2BrineEzrokhiThermalFluid;
- static constexpr const char * brineContent = "DensityFun EzrokhiBrineDensity 2.01e-6 -6.34e-7 1e-4\n"
- "ViscosityFun EzrokhiBrineViscosity 2.42e-7 0 1e-4\n"
- "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0";
- static constexpr const char * gasContent = "DensityFun SpanWagnerCO2Density 1e6 1.5e7 5e4 367.15 369.15 1\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 1.5e7 5e4 367.15 369.15 1\n"
- "EnthalpyFun CO2Enthalpy 1e6 1.5e7 5e4 367.15 369.15 1";
};
template< FlashType FLASH >
@@ -84,12 +82,18 @@ struct FlashModel {};
template<>
struct FlashModel< FlashType::DuanSun >
{
- static constexpr const char * flashContent = "FlashModel CO2Solubility 1e6 1.5e7 5e4 367.15 369.15 1 0.15";
+ static void populate( BrineFluidParameters & GEOS_UNUSED_PARAM( parameters ) )
+ {}
};
+
template<>
struct FlashModel< FlashType::SpycherPruess >
{
- static constexpr const char * flashContent = "FlashModel CO2Solubility 1e6 1.5e7 5e4 367.15 369.15 1 0.15 1.0e-10 SpycherPruess";
+ static void populate( BrineFluidParameters & parameters )
+ {
+ parameters.m_solubilityModel = BrineFluidParameters::SolubilityModel::SpycherPruess;
+ parameters.m_tolerance = 1.0e-10;
+ }
};
template< BrineModelType BRINE, FlashType FLASH, bool THERMAL >
@@ -105,21 +109,12 @@ class MultiFluidCO2BrineTestFixture : public FluidModelTest< typename FluidType<
public:
MultiFluidCO2BrineTestFixture()
{
- Base::writeTableToFile( pvtGasFileName, FluidType< BRINE, THERMAL >::gasContent );
- Base::writeTableToFile( pvtLiquidFileName, FluidType< BRINE, THERMAL >::brineContent );
- Base::writeTableToFile( pvtFlashFileName, FlashModel< FLASH >::flashContent );
-
Base::createFluid( getFluidName(), []( CO2BrineFluid & fluid ){
fillPhysicalProperties( fluid );
} );
}
- ~MultiFluidCO2BrineTestFixture() override
- {
- Base::removeFile( pvtGasFileName );
- Base::removeFile( pvtLiquidFileName );
- Base::removeFile( pvtFlashFileName );
- }
+ ~MultiFluidCO2BrineTestFixture() override = default;
// Test numerical derivatives at selected data points
void testNumericalDerivatives( bool const useMass )
@@ -155,9 +150,6 @@ class MultiFluidCO2BrineTestFixture : public FluidModelTest< typename FluidType<
private:
static void fillPhysicalProperties( CO2BrineFluid & fluid );
- static constexpr const char * pvtGasFileName = "pvtgas.txt";
- static constexpr const char * pvtLiquidFileName = "pvtliquid.txt";
- static constexpr const char * pvtFlashFileName = "co2flash.txt";
};
template< BrineModelType BRINE, FlashType FLASH, bool THERMAL >
@@ -186,12 +178,30 @@ void MultiFluidCO2BrineTestFixture< BRINE, FLASH, THERMAL >::fillPhysicalPropert
auto & molarWeight = group.getReference< array1d< real64 > >( MultiFluidBase::viewKeyStruct::componentMolarWeightString() );
Base::fill( molarWeight, Feed< 2 >{44e-3, 18e-3} );
- auto & phasePVTParaFileNames = group.getReference< path_array >( CO2BrineFluid::viewKeyStruct::phasePVTParaFilesString() );
- phasePVTParaFileNames.emplace_back( Path( pvtGasFileName ) );
- phasePVTParaFileNames.emplace_back( Path( pvtLiquidFileName ) );
+ BrineFluidParameters parameters;
+ populateFluidParameters( parameters );
+ FlashModel< FLASH >::populate( parameters );
- auto & flashModelParaFileName = group.getReference< Path >( CO2BrineFluid::viewKeyStruct::flashModelParaFileString() );
- flashModelParaFileName = pvtFlashFileName;
+ using Keys = BrineFluidParameters::viewKeyStruct;
+ auto setValue = [&]( string const key, auto const value )
+ {
+ using T = typename std::remove_const< decltype(value) >::type;
+ group.getReference< T >( key ) = value;
+ };
+ setValue( Keys::solubilityModelString(), parameters.m_solubilityModel );
+ setValue( Keys::pressureCoordinatesString(), parameters.m_pressureCoordinates );
+ setValue( Keys::pressureIntervalString(), parameters.m_pressureInterval );
+ setValue( Keys::temperatureCoordinatesString(), parameters.m_temperatureCoordinates );
+ setValue( Keys::temperatureIntervalString(), parameters.m_temperatureInterval );
+ setValue( Keys::salinityString(), parameters.m_salinity );
+ setValue( Keys::toleranceString(), parameters.m_tolerance );
+ setValue( Keys::waterCompressibilityString(), parameters.m_waterCompressibility );
+ setValue( Keys::solubilityTablesString(), parameters.m_solubilityTables );
+ if constexpr (BRINE == BrineModelType::Ezrokhi)
+ {
+ setValue( Keys::ezrokhiDensityCoefficientsString(), parameters.m_ezrokhiDensityCoefficients );
+ setValue( Keys::ezrokhiViscosityCoefficientsString(), parameters.m_ezrokhiViscosityCoefficients );
+ }
}
using CO2BrinePhillipsTest = MultiFluidCO2BrineTestFixture< BrineModelType::Phillips,
@@ -298,97 +308,87 @@ TEST_P( CO2BrinePhillipsSpycherPruessTest, testFluidValues )
/* UNCRUSTIFY-OFF */
-#define D( ... ) CO2BrinePhillipsTest::ParamType{ __VA_ARGS__ }
INSTANTIATE_TEST_SUITE_P(
FluidValueTest, CO2BrinePhillipsTest,
- ::testing::Values(
+ ::testing::ValuesIn({
//| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density
- D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.32967e+04}, {8.25738e+01, 9.70853e+02}, {1.90427e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.88317e+03}),
- D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.32812e+04}, {8.24487e+01, 9.70542e+02}, {1.90569e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87456e+03}),
- D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.32478e+04}, {8.21833e+01, 9.69875e+02}, {1.90872e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.85630e+03}),
- D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.32486e+04}, {1.34361e+02, 9.74235e+02}, {2.00622e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18273e+03}),
- D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.32333e+04}, {1.34097e+02, 9.73923e+02}, {2.00722e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.16610e+03}),
- D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.32005e+04}, {1.33538e+02, 9.73254e+02}, {2.00938e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.13094e+03}),
- D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.32330e+04}, {2.54147e+02, 9.79494e+02}, {2.39022e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57730e+04}),
- D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.32179e+04}, {2.53338e+02, 9.79185e+02}, {2.38854e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57318e+04}),
- D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.31853e+04}, {2.51643e+02, 9.78520e+02}, {2.38514e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56452e+04})
- )
+ {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.33005e+04}, {8.25738e+01, 9.70812e+02}, {1.90427e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.88220e+03}},
+ {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.32850e+04}, {8.24487e+01, 9.70502e+02}, {1.90569e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87360e+03}},
+ {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.32516e+04}, {8.21833e+01, 9.69835e+02}, {1.90872e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.85534e+03}},
+ {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.32538e+04}, {1.34361e+02, 9.74179e+02}, {2.00622e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18078e+03}},
+ {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.32386e+04}, {1.34097e+02, 9.73867e+02}, {2.00722e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.16417e+03}},
+ {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.32057e+04}, {1.33538e+02, 9.73198e+02}, {2.00938e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.12901e+03}},
+ {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.32402e+04}, {2.54147e+02, 9.79416e+02}, {2.39022e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57692e+04}},
+ {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.32251e+04}, {2.53338e+02, 9.79107e+02}, {2.38854e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.57280e+04}},
+ {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.31925e+04}, {2.51643e+02, 9.78443e+02}, {2.38514e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56415e+04}},
+ })
);
-#undef D
-#define D( ... ) CO2BrineEzrokhiTest::ParamType{ __VA_ARGS__ }
INSTANTIATE_TEST_SUITE_P(
FluidValueTest, CO2BrineEzrokhiTest,
- ::testing::Values(
+ ::testing::ValuesIn({
//| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density
- D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.51674e+04}, {8.25738e+01, 1.00493e+03}, {1.90427e-05, 3.12148e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.89876e+03}),
- D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.51663e+04}, {8.24487e+01, 1.00488e+03}, {1.90569e-05, 3.11023e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.89023e+03}),
- D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.51642e+04}, {8.21833e+01, 1.00478e+03}, {1.90872e-05, 3.08611e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87213e+03}),
- D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.58209e+04}, {1.34361e+02, 1.02130e+03}, {2.00622e-05, 3.16876e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.23469e+03}),
- D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.58254e+04}, {1.34097e+02, 1.02135e+03}, {2.00722e-05, 3.15764e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.21829e+03}),
- D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.58353e+04}, {1.33538e+02, 1.02146e+03}, {2.00938e-05, 3.13381e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18360e+03}),
- D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.67057e+04}, {2.54147e+02, 1.04339e+03}, {2.39022e-05, 3.23075e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59791e+04}),
- D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.67188e+04}, {2.53338e+02, 1.04360e+03}, {2.38854e-05, 3.21991e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59385e+04}),
- D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.67472e+04}, {2.51643e+02, 1.04405e+03}, {2.38514e-05, 3.19665e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.58533e+04})
- )
+ {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.51522e+04}, {8.25738e+01, 1.00454e+03}, {1.90427e-05, 3.12027e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.89763e+03}},
+ {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.51511e+04}, {8.24487e+01, 1.00449e+03}, {1.90569e-05, 3.10902e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.88910e+03}},
+ {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.51487e+04}, {8.21833e+01, 1.00439e+03}, {1.90872e-05, 3.08490e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.87101e+03}},
+ {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.57997e+04}, {1.34361e+02, 1.02075e+03}, {2.00622e-05, 3.16706e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.23220e+03}},
+ {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.58041e+04}, {1.34097e+02, 1.02080e+03}, {2.00722e-05, 3.15594e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.21580e+03}},
+ {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.58136e+04}, {1.33538e+02, 1.02090e+03}, {2.00938e-05, 3.13210e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.18112e+03}},
+ {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.66765e+04}, {2.54147e+02, 1.04263e+03}, {2.39022e-05, 3.22839e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59731e+04}},
+ {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.66893e+04}, {2.53338e+02, 1.04283e+03}, {2.38854e-05, 3.21754e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.59325e+04}},
+ {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.67171e+04}, {2.51643e+02, 1.04328e+03}, {2.38514e-05, 3.19427e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.58474e+04}},
+ })
);
-#undef D
-#define D( ... ) CO2BrinePhillipsThermalTest::ParamType{ __VA_ARGS__ }
INSTANTIATE_TEST_SUITE_P(
FluidValueTest, CO2BrinePhillipsThermalTest,
- ::testing::Values(
+ ::testing::ValuesIn({
//| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density
- D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.32967e+04}, {8.25738e+01, 9.70853e+02}, {1.90427e-05, 3.03214e-04}, {1.21447e+07, 2.18796e+07}, {1.20841e+07, 2.18744e+07}, 5.88317e+03}),
- D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.32812e+04}, {8.24487e+01, 9.70542e+02}, {1.90569e-05, 3.02064e-04}, {1.21537e+07, 2.19628e+07}, {1.20931e+07, 2.19576e+07}, 5.87456e+03}),
- D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.32478e+04}, {8.21833e+01, 9.69875e+02}, {1.90872e-05, 2.99598e-04}, {1.21731e+07, 2.21410e+07}, {1.21123e+07, 2.21359e+07}, 5.85630e+03}),
- D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.32486e+04}, {1.34361e+02, 9.74235e+02}, {2.00622e-05, 3.03214e-04}, {1.17163e+07, 2.18445e+07}, {1.16605e+07, 2.18368e+07}, 9.18273e+03}),
- D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.32333e+04}, {1.34097e+02, 9.73923e+02}, {2.00722e-05, 3.02064e-04}, {1.17269e+07, 2.19275e+07}, {1.16709e+07, 2.19198e+07}, 9.16610e+03}),
- D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.32005e+04}, {1.33538e+02, 9.73254e+02}, {2.00938e-05, 2.99598e-04}, {1.17494e+07, 2.21054e+07}, {1.16932e+07, 2.20977e+07}, 9.13094e+03}),
- D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.32330e+04}, {2.54147e+02, 9.79494e+02}, {2.39022e-05, 3.03214e-04}, {1.08306e+07, 2.17898e+07}, {1.07833e+07, 2.17775e+07}, 1.57730e+04}),
- D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.32179e+04}, {2.53338e+02, 9.79185e+02}, {2.38854e-05, 3.02064e-04}, {1.08453e+07, 2.18726e+07}, {1.07979e+07, 2.18603e+07}, 1.57318e+04}),
- D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.31853e+04}, {2.51643e+02, 9.78520e+02}, {2.38514e-05, 2.99598e-04}, {1.08767e+07, 2.20500e+07}, {1.08290e+07, 2.20378e+07}, 1.56452e+04})
- )
+ {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.33005e+04}, {8.25738e+01, 9.70812e+02}, {1.90427e-05, 3.06891e-04}, {1.21447e+07, 2.15290e+07}, {1.20841e+07, 2.15238e+07}, 5.88220e+03}},
+ {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.32850e+04}, {8.24487e+01, 9.70502e+02}, {1.90569e-05, 3.05730e-04}, {1.21537e+07, 2.16115e+07}, {1.20931e+07, 2.16064e+07}, 5.87360e+03}},
+ {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.32516e+04}, {8.21833e+01, 9.69835e+02}, {1.90872e-05, 3.03243e-04}, {1.21731e+07, 2.17883e+07}, {1.21123e+07, 2.17832e+07}, 5.85534e+03}},
+ {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.32538e+04}, {1.34361e+02, 9.74179e+02}, {2.00622e-05, 3.06891e-04}, {1.17163e+07, 2.14953e+07}, {1.16605e+07, 2.14876e+07}, 9.18078e+03}},
+ {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.32386e+04}, {1.34097e+02, 9.73867e+02}, {2.00722e-05, 3.05730e-04}, {1.17269e+07, 2.15777e+07}, {1.16709e+07, 2.15700e+07}, 9.16417e+03}},
+ {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.32057e+04}, {1.33538e+02, 9.73198e+02}, {2.00938e-05, 3.03243e-04}, {1.17494e+07, 2.17542e+07}, {1.16932e+07, 2.17465e+07}, 9.12901e+03}},
+ {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.32402e+04}, {2.54147e+02, 9.79416e+02}, {2.39022e-05, 3.06891e-04}, {1.08306e+07, 2.14426e+07}, {1.07833e+07, 2.14304e+07}, 1.57692e+04}},
+ {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.32251e+04}, {2.53338e+02, 9.79107e+02}, {2.38854e-05, 3.05730e-04}, {1.08453e+07, 2.15248e+07}, {1.07979e+07, 2.15125e+07}, 1.57280e+04}},
+ {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.31925e+04}, {2.51643e+02, 9.78443e+02}, {2.38514e-05, 3.03243e-04}, {1.08767e+07, 2.17008e+07}, {1.08290e+07, 2.16885e+07}, 1.56415e+04}},
+ })
);
-#undef D
#if !defined(GEOS_DEVICE_COMPILE)
-#define D( ... ) CO2BrineEzrokhiThermalTest::ParamType{ __VA_ARGS__ }
INSTANTIATE_TEST_SUITE_P(
FluidValueTest, CO2BrineEzrokhiThermalTest,
- ::testing::Values(
+ ::testing::ValuesIn({
//| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density |
- D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94136e-01, 7.05864e-01}, {1.87668e+03, 5.51674e+04}, {8.25738e+01, 1.00493e+03}, {1.90427e-05, 3.12148e-04}, {1.21447e+07, 2.18796e+07}, {1.20841e+07, 2.18746e+07}, 5.89876e+03}),
- D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94150e-01, 7.05850e-01}, {1.87383e+03, 5.51663e+04}, {8.24487e+01, 1.00488e+03}, {1.90569e-05, 3.11023e-04}, {1.21537e+07, 2.19628e+07}, {1.20931e+07, 2.19578e+07}, 5.89023e+03}),
- D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94181e-01, 7.05819e-01}, {1.86780e+03, 5.51642e+04}, {8.21833e+01, 1.00478e+03}, {1.90872e-05, 3.08611e-04}, {1.21731e+07, 2.21410e+07}, {1.21123e+07, 2.21361e+07}, 5.87213e+03}),
- D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.91939e-01, 7.08061e-01}, {3.05367e+03, 5.58209e+04}, {1.34361e+02, 1.02130e+03}, {2.00622e-05, 3.16876e-04}, {1.17163e+07, 2.18445e+07}, {1.16605e+07, 2.18372e+07}, 9.23469e+03}),
- D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.91956e-01, 7.08044e-01}, {3.04766e+03, 5.58254e+04}, {1.34097e+02, 1.02135e+03}, {2.00722e-05, 3.15764e-04}, {1.17269e+07, 2.19275e+07}, {1.16709e+07, 2.19202e+07}, 9.21829e+03}),
- D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.91992e-01, 7.08008e-01}, {3.03496e+03, 5.58353e+04}, {1.33538e+02, 1.02146e+03}, {2.00938e-05, 3.13381e-04}, {1.17494e+07, 2.21054e+07}, {1.16932e+07, 2.20981e+07}, 9.18360e+03}),
- D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89059e-01, 7.10941e-01}, {5.77607e+03, 5.67057e+04}, {2.54147e+02, 1.04339e+03}, {2.39022e-05, 3.23075e-04}, {1.08306e+07, 2.17898e+07}, {1.07833e+07, 2.17783e+07}, 1.59791e+04}),
- D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89075e-01, 7.10925e-01}, {5.75768e+03, 5.67188e+04}, {2.53338e+02, 1.04360e+03}, {2.38854e-05, 3.21991e-04}, {1.08453e+07, 2.18726e+07}, {1.07979e+07, 2.18611e+07}, 1.59385e+04}),
- D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89109e-01, 7.10891e-01}, {5.71917e+03, 5.67472e+04}, {2.51643e+02, 1.04405e+03}, {2.38514e-05, 3.19665e-04}, {1.08767e+07, 2.20500e+07}, {1.08290e+07, 2.20385e+07}, 1.58533e+04})
- )
+ {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.94192e-01, 7.05808e-01}, {1.87668e+03, 5.51522e+04}, {8.25738e+01, 1.00454e+03}, {1.90427e-05, 3.12027e-04}, {1.21447e+07, 2.15290e+07}, {1.20841e+07, 2.15240e+07}, 5.89763e+03}},
+ {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.94206e-01, 7.05794e-01}, {1.87383e+03, 5.51511e+04}, {8.24487e+01, 1.00449e+03}, {1.90569e-05, 3.10902e-04}, {1.21537e+07, 2.16115e+07}, {1.20931e+07, 2.16065e+07}, 5.88910e+03}},
+ {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.94236e-01, 7.05764e-01}, {1.86780e+03, 5.51487e+04}, {8.21833e+01, 1.00439e+03}, {1.90872e-05, 3.08490e-04}, {1.21731e+07, 2.17883e+07}, {1.21123e+07, 2.17834e+07}, 5.87101e+03}},
+ {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.92018e-01, 7.07982e-01}, {3.05367e+03, 5.57997e+04}, {1.34361e+02, 1.02075e+03}, {2.00622e-05, 3.16706e-04}, {1.17163e+07, 2.14953e+07}, {1.16605e+07, 2.14880e+07}, 9.23220e+03}},
+ {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.92035e-01, 7.07965e-01}, {3.04766e+03, 5.58041e+04}, {1.34097e+02, 1.02080e+03}, {2.00722e-05, 3.15594e-04}, {1.17269e+07, 2.15777e+07}, {1.16709e+07, 2.15704e+07}, 9.21580e+03}},
+ {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.92070e-01, 7.07930e-01}, {3.03496e+03, 5.58136e+04}, {1.33538e+02, 1.02090e+03}, {2.00938e-05, 3.13210e-04}, {1.17494e+07, 2.17542e+07}, {1.16932e+07, 2.17468e+07}, 9.18112e+03}},
+ {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.89169e-01, 7.10831e-01}, {5.77607e+03, 5.66765e+04}, {2.54147e+02, 1.04263e+03}, {2.39022e-05, 3.22839e-04}, {1.08306e+07, 2.14426e+07}, {1.07833e+07, 2.14311e+07}, 1.59731e+04}},
+ {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.89185e-01, 7.10815e-01}, {5.75768e+03, 5.66893e+04}, {2.53338e+02, 1.04283e+03}, {2.38854e-05, 3.21754e-04}, {1.08453e+07, 2.15248e+07}, {1.07979e+07, 2.15133e+07}, 1.59325e+04}},
+ {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.89218e-01, 7.10782e-01}, {5.71917e+03, 5.67171e+04}, {2.51643e+02, 1.04328e+03}, {2.38514e-05, 3.19427e-04}, {1.08767e+07, 2.17008e+07}, {1.08290e+07, 2.16893e+07}, 1.58474e+04}},
+ })
);
-#undef D
#endif
-#define D( ... ) CO2BrinePhillipsSpycherPruessTest::ParamType{ __VA_ARGS__ }
INSTANTIATE_TEST_SUITE_P(
FluidValueTest, CO2BrinePhillipsSpycherPruessTest,
- ::testing::Values(
+ ::testing::ValuesIn({
//| pressure | temp | composition | phase fraction | phase density | phase mass density | phase viscosity | phase enthalpy | phase internal energy | density |
- D({5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{3.00488e-01, 6.99512e-01}, {1.87668e+03, 5.32842e+04}, {8.25738e+01, 9.70985e+02}, {1.90427e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.77217e+03}),
- D({5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{3.00580e-01, 6.99420e-01}, {1.87383e+03, 5.32686e+04}, {8.24487e+01, 9.70677e+02}, {1.90569e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.76239e+03}),
- D({5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{3.00781e-01, 6.99219e-01}, {1.86780e+03, 5.32348e+04}, {8.21833e+01, 9.70013e+02}, {1.90872e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.74154e+03}),
- D({7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.96731e-01, 7.03269e-01}, {3.05367e+03, 5.32295e+04}, {1.34361e+02, 9.74440e+02}, {2.00622e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.05928e+03}),
- D({7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.96804e-01, 7.03196e-01}, {3.04766e+03, 5.32141e+04}, {1.34097e+02, 9.74130e+02}, {2.00722e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.04143e+03}),
- D({7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.96962e-01, 7.03038e-01}, {3.03496e+03, 5.31808e+04}, {1.33538e+02, 9.73465e+02}, {2.00938e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.00358e+03}),
- D({1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.93050e-01, 7.06950e-01}, {5.77607e+03, 5.32048e+04}, {2.54147e+02, 9.79798e+02}, {2.39022e-05, 3.03214e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56195e+04}),
- D({1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.93105e-01, 7.06895e-01}, {5.75768e+03, 5.31894e+04}, {2.53338e+02, 9.79492e+02}, {2.38854e-05, 3.02064e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.55771e+04}),
- D({1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.93225e-01, 7.06775e-01}, {5.71917e+03, 5.31561e+04}, {2.51643e+02, 9.78834e+02}, {2.38514e-05, 2.99598e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.54878e+04})
- )
+ {{5.00100e+06, 3.67650e+02, {0.300, 0.700}}, {{3.00488e-01, 6.99512e-01}, {1.87668e+03, 5.32842e+04}, {8.25738e+01, 9.70985e+02}, {1.90427e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.77217e+03}},
+ {{5.00100e+06, 3.68000e+02, {0.300, 0.700}}, {{3.00580e-01, 6.99420e-01}, {1.87383e+03, 5.32686e+04}, {8.24487e+01, 9.70677e+02}, {1.90569e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.76239e+03}},
+ {{5.00100e+06, 3.68750e+02, {0.300, 0.700}}, {{3.00781e-01, 6.99219e-01}, {1.86780e+03, 5.32348e+04}, {8.21833e+01, 9.70013e+02}, {1.90872e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 5.74154e+03}},
+ {{7.50100e+06, 3.67650e+02, {0.300, 0.700}}, {{2.96731e-01, 7.03269e-01}, {3.05367e+03, 5.32295e+04}, {1.34361e+02, 9.74440e+02}, {2.00622e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.05928e+03}},
+ {{7.50100e+06, 3.68000e+02, {0.300, 0.700}}, {{2.96804e-01, 7.03196e-01}, {3.04766e+03, 5.32141e+04}, {1.34097e+02, 9.74130e+02}, {2.00722e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.04143e+03}},
+ {{7.50100e+06, 3.68750e+02, {0.300, 0.700}}, {{2.96962e-01, 7.03038e-01}, {3.03496e+03, 5.31808e+04}, {1.33538e+02, 9.73465e+02}, {2.00938e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 9.00358e+03}},
+ {{1.20100e+07, 3.67650e+02, {0.300, 0.700}}, {{2.93050e-01, 7.06950e-01}, {5.77607e+03, 5.32048e+04}, {2.54147e+02, 9.79798e+02}, {2.39022e-05, 3.06891e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.56195e+04}},
+ {{1.20100e+07, 3.68000e+02, {0.300, 0.700}}, {{2.93105e-01, 7.06895e-01}, {5.75768e+03, 5.31894e+04}, {2.53338e+02, 9.79492e+02}, {2.38854e-05, 3.05730e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.55771e+04}},
+ {{1.20100e+07, 3.68750e+02, {0.300, 0.700}}, {{2.93225e-01, 7.06775e-01}, {5.71917e+03, 5.31561e+04}, {2.51643e+02, 9.78834e+02}, {2.38514e-05, 3.03243e-04}, {0.00000e+00, 0.00000e+00}, {0.00000e+00, 0.00000e+00}, 1.54878e+04}},
+ })
);
-#undef D
/* UNCRUSTIFY-ON */
diff --git a/src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.xml b/src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.xml
index d37ed605c49..dba47b3b159 100644
--- a/src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.xml
+++ b/src/coreComponents/integrationTests/constitutiveTests/testReactiveFluid.xml
@@ -39,8 +39,7 @@
name="reactiveFluid"
phaseNames="{ water }"
componentNames="{ H+, HCO3-, Ca+2, SO4-2, Cl-, Mg+2, Na+1 }"
- componentMolarWeight="{ 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3}"
- phasePVTParaFiles="{ testPVT_data/reactiveBrinePVT.txt }"/>
+ componentMolarWeight="{ 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3, 18e-3}" />
diff --git a/src/coreComponents/integrationTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp b/src/coreComponents/integrationTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp
index 64f947bf80d..4b6144c94e9 100644
--- a/src/coreComponents/integrationTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp
+++ b/src/coreComponents/integrationTests/fluidFlowTests/testThermalCompMultiphaseFlow.cpp
@@ -34,16 +34,6 @@ CommandLineOptions g_commandLineOptions;
// Sphinx start after input XML
-char const * pvtLiquid = "DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 295.15 370.15 25 0\n"
- "ViscosityFun PhillipsBrineViscosity 0\n"
- "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 295.15 370.15 25 0\n";
-
-char const * pvtGas = "DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 295.15 370.15 25\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 295.15 370.15 25\n"
- "EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 295.15 370.15 25\n";
-
-char const * co2flash = "FlashModel CO2Solubility 1e6 7.5e7 5e5 295.15 370.15 25 0";
-
char const * xmlInput =
R"xml(
@@ -119,8 +109,10 @@ char const * xmlInput =
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt" />
+ pressureCoordinates="{1e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{295.15, 370.15}"
+ temperatureInterval="25" />
( g_commandLineOptions ) )
- {
- writeTableToFile( pvtLiquidFilename, pvtLiquid );
- writeTableToFile( pvtGasFilename, pvtGas );
- writeTableToFile( co2flashFilename, co2flash );
- }
+ {}
- ~ThermalCompositionalMultiphaseFlowTest() override
- {
- removeFile( pvtLiquidFilename );
- removeFile( pvtGasFilename );
- removeFile( co2flashFilename );
- }
+ ~ThermalCompositionalMultiphaseFlowTest() override = default;
protected:
@@ -313,10 +282,6 @@ class ThermalCompositionalMultiphaseFlowTest : public ::testing::Test
GeosxState state;
CompositionalMultiphaseFVM * solver;
-
- string const pvtLiquidFilename = "pvtliquid.txt";
- string const pvtGasFilename = "pvtgas.txt";
- string const co2flashFilename = "co2flash.txt";
};
real64 constexpr ThermalCompositionalMultiphaseFlowTest::time;
diff --git a/src/coreComponents/integrationTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp b/src/coreComponents/integrationTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp
index bbb29ff0972..fb8a901f2fb 100644
--- a/src/coreComponents/integrationTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp
+++ b/src/coreComponents/integrationTests/tableFunctionsFileTests/testTableFunctionsOutput.cpp
@@ -23,30 +23,8 @@
#include
#include
-
using namespace geos;
-void writeTableToFile( string const & filename, char const * str )
-{
- std::ofstream os( filename );
- ASSERT_TRUE( os.is_open() );
- os << str;
- os.close();
-}
-
-void removeFile( string const & filename )
-{
- int const ret = std::remove( filename.c_str() );
- ASSERT_TRUE( ret == 0 );
-}
-char const * co2flash = "FlashModel CO2Solubility 1e6 7.5e7 5e5 299.15 369.15 10 0";
-char const * pvtLiquid = "DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 299.15 369.15 10 0\n"
- "ViscosityFun PhillipsBrineViscosity 0\n"
- "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0\n";
-
-char const * pvtGas = "DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 299.15 369.15 10\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 299.15 369.15 10\n"
- "EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 299.15 369.15 10\n";
char const * xmlInput =
R"xml(
@@ -201,8 +179,10 @@ char const * xmlInput =
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt"/>
+ pressureCoordinates="{1e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{299.15, 369.15}"
+ temperatureInterval="10" />
( g_commandLineOptions ) );
ProblemManager & problem = state.getProblemManager();
@@ -300,20 +281,18 @@ TEST( testTableFunctionsOutput, testOutputFiles )
EXPECT_TRUE( std::filesystem::exists( f2 ));
EXPECT_TRUE( std::filesystem::exists( f3 ));
EXPECT_TRUE( std::filesystem::exists( f4 ));
- EXPECT_FALSE( std::filesystem::exists( f5 ));
-
- std::filesystem::remove( "fluid_phaseModel1_PhillipsBrineDensity_table.csv" );
- std::filesystem::remove( "fluid_phaseModel2_SpanWagnerCO2Density_table.csv" );
- std::filesystem::remove( "fluid_phaseModel2_FenghourCO2Viscosity_table.csv" );
- std::filesystem::remove( "fluid_CO2Solubility_co2Dissolution_table.csv" );
- std::filesystem::remove( "fluid_phaseModel1_PhillipsBrineViscosity_table.csv" );
+ EXPECT_TRUE( std::filesystem::exists( f5 ));
+ EXPECT_FALSE( std::filesystem::exists( f6 ));
+
+ std::filesystem::remove( f1 );
+ std::filesystem::remove( f2 );
+ std::filesystem::remove( f3 );
+ std::filesystem::remove( f4 );
+ std::filesystem::remove( f5 );
}
int main( int argc, char * * argv )
{
- writeTableToFile( "co2flash.txt", co2flash );
- writeTableToFile( "pvtliquid.txt", pvtLiquid );
- writeTableToFile( "pvtgas.txt", pvtGas );
::testing::InitGoogleTest( &argc, argv );
g_commandLineOptions = *geos::basicSetup( argc, argv );
diff --git a/src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp b/src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp
index da7d3606fb2..8da3d40be71 100644
--- a/src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp
+++ b/src/coreComponents/integrationTests/wellsTests/testIsothermalReservoirCompositionalMultiphaseMSWells.cpp
@@ -36,27 +36,7 @@ using namespace geos::constitutive;
using namespace geos::testing;
CommandLineOptions g_commandLineOptions;
-void writeTableToFile( string const & filename, char const * str )
-{
- std::ofstream os( filename );
- ASSERT_TRUE( os.is_open() );
- os << str;
- os.close();
-}
-void removeFile( string const & filename )
-{
- int const ret = std::remove( filename.c_str() );
- ASSERT_TRUE( ret == 0 );
-}
-char const * co2flash = "FlashModel CO2Solubility 1e6 7.5e7 5e5 299.15 369.15 10 0";
-char const * pvtLiquid = "DensityFun PhillipsBrineDensity 1e6 7.5e7 5e5 299.15 369.15 10 0\n"
- "ViscosityFun PhillipsBrineViscosity 0\n"
- "EnthalpyFun BrineEnthalpy 1e6 7.5e7 5e5 299.15 369.15 10 0\n";
-
-char const * pvtGas = "DensityFun SpanWagnerCO2Density 1e6 7.5e7 5e5 299.15 369.15 10\n"
- "ViscosityFun FenghourCO2Viscosity 1e6 7.5e7 5e5 299.15 369.15 10\n"
- "EnthalpyFun CO2Enthalpy 1e6 7.5e7 5e5 299.15 369.15 10\n";
char const * xmlInput =
R"xml(
@@ -214,8 +194,10 @@ char const * xmlInput =
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt"/>
+ pressureCoordinates="{1e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{299.15, 369.15}"
+ temperatureInterval="10" />
+ pressureCoordinates="{1e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{299.15, 369.15}"
+ temperatureInterval="10" />
@@ -212,9 +191,10 @@ char const * xmlInput =
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt">
-
+ pressureCoordinates="{1e5, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{283.15, 414.15}"
+ temperatureInterval="10.0" />
@@ -213,9 +190,10 @@ char const * xmlInput =
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt">
-
+ pressureCoordinates="{1e5, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{283.15, 414.15}"
+ temperatureInterval="10.0" />
+ pressureCoordinates="{1e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{299.15, 369.15}"
+ temperatureInterval="10" />
+ pressureCoordinates="{1e6, 7.5e7}"
+ pressureInterval="5e5"
+ temperatureCoordinates="{299.15, 369.15}"
+ temperatureInterval="10" />
+ pressureCoordinates="{1.5e7, 2.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{370.15, 400.15}"
+ temperatureInterval="2.0"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
( g_commandLineOptions ) );
ProblemManager & problem = state.getProblemManager();
@@ -929,8 +932,12 @@ TestSet getTestSet()
phaseNames="{ gas, water }"
componentNames="{ co2, water }"
componentMolarWeight="{ 44e-3, 18e-3 }"
- phasePVTParaFiles="{ pvtgas.txt, pvtliquid.txt }"
- flashModelParaFile="co2flash.txt" />
+ pressureCoordinates="{1.5e7, 2.5e7}"
+ pressureInterval="1e5"
+ temperatureCoordinates="{370.15, 400.15}"
+ temperatureInterval="2.0"
+ ezrokhiDensityCoefficients="{0.1033, -2.2991e-5, -2.3658e-6}"
+ ezrokhiViscosityCoefficients="{0, 0, 0}" />
( g_commandLineOptions ) );
ProblemManager & problem = state.getProblemManager();
diff --git a/src/coreComponents/schema/schema.xsd b/src/coreComponents/schema/schema.xsd
index 4805f560fa5..bcb982d9fa2 100644
--- a/src/coreComponents/schema/schema.xsd
+++ b/src/coreComponents/schema/schema.xsd
@@ -6996,8 +6996,10 @@ The expected format is "{ waterMax, oilMax }", in that order-->
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -7025,8 +7048,10 @@ if the table is requested to be output in the log, and it is too large, a CSV fi
-
-
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -7054,8 +7095,6 @@ if the table is requested to be output in the log, and it is too large, a CSV fi
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -7083,8 +7138,6 @@ if the table is requested to be output in the log, and it is too large, a CSV fi
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/docs/sphinx/advancedExamples/validationStudies/carbonStorage/thermalLeakyWell/Example.rst b/src/docs/sphinx/advancedExamples/validationStudies/carbonStorage/thermalLeakyWell/Example.rst
index 0136106763b..bdfc5faaf28 100644
--- a/src/docs/sphinx/advancedExamples/validationStudies/carbonStorage/thermalLeakyWell/Example.rst
+++ b/src/docs/sphinx/advancedExamples/validationStudies/carbonStorage/thermalLeakyWell/Example.rst
@@ -144,14 +144,12 @@ for density and viscosity, respectively.
The density and viscosity values are internally tabulated by GEOS at the beginning of the simulation by solving
the Helmholtz energy equation for each pair :math:`(p,T)`.
-The tables size and spacing are specified in the file `pvtgas.txt`.
-Here, for both quantities, the values are tabulated between 6.6e6 Pa and 4e7 Pa, with a pressure spacing of 1e6 Pa,
+The tables size and spacing are specified by the parameters in the fluid xml element.
+Here, for all quantities, the values are tabulated between 6.6e6 Pa and 4e7 Pa, with a uniform pressure spacing of 1e6 Pa,
and between 302 K and 312 K, with a temperature increment of 5 K.
These values have been chosen using the initial condition and an upper bound on the expected pressure increase
during the simulation.
-.. literalinclude:: ../../../../../../../inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtgas.txt
-
.. note::
If pressure or temperature go outside the values specified in this parameter file, constant extrapolation is used to obtain the density and viscosity values. Note that for now, no warning is issued by GEOS when this happens. We plan to add a warning message to document this behavior in the near future.
@@ -161,13 +159,9 @@ Brine density and viscosity
These properties depend on pressure, temperature, composition, and salinity via the models proposed by
Phillips et al. (1981). The brine density is modified to account for the presence of dissolved CO2 using
the method proposed by Garcia (2001).
-The values of (pure) brine density are also tabulated at a function of pressure and temperature, and we
-use the same range as for the CO2 properties to construct this table:
-
-.. literalinclude:: ../../../../../../../inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/pvtliquid.txt
+The values of (pure) brine density are also tabulated at a function of pressure and temperature at the same pressure and temperature points as the CO2.
-Importantly, the last value on each line in the file `pvtliquid.txt` defines the salinity in the domain.
-In our model, salinity is constant in space and in time (i.e., unlike water and CO2, it is not tracked as
+In this model, salinity is constant in space and in time (i.e., unlike water and CO2, it is not tracked as
a component in GEOS).
In our model, salinity is specified as a molal concentration in mole of NaCl per kg of solvent (brine).
The value used here (1000 x 10 / ( 58.44 x ( 100 - 10 ) ) = 1.901285269 moles/kg) is
@@ -178,10 +172,8 @@ CO2 solubility in brine
As explained in :ref:`CO2-EOS`, we use the highly nonlinear model proposed by Duan and Sun (2004)
to compute the CO2 solubility as a function of pressure, temperature, composition, and salinity.
-In `co2flash.txt`, we use the same parameters as above to construct the pressure-temperature tables
+The pressure and temperature points defined in the xml entry, as above, are used to construct the pressure-temperature tables
of precomputed CO2 solubility in brine.
-
-.. literalinclude:: ../../../../../../../inputFiles/compositionalMultiphaseFlow/benchmarks/thermalLeakyWell/co2flash.txt
------------------------------------------------------------------
Initial and boundary conditions
diff --git a/src/docs/sphinx/basicExamples/co2Injection/Example.rst b/src/docs/sphinx/basicExamples/co2Injection/Example.rst
index a1e177c3ede..8669be34cc3 100644
--- a/src/docs/sphinx/basicExamples/co2Injection/Example.rst
+++ b/src/docs/sphinx/basicExamples/co2Injection/Example.rst
@@ -165,30 +165,15 @@ Under the **Constitutive** tag, four items can be found:
The PVT data specified by **CO2BrinePhillipsFluid** is set to model the behavior of the CO :sub:`2`-brine system as a function of pressure, temperature, and salinity.
We currently rely on a two-phase, two-component (CO :sub:`2` and H :sub:`2` O) model in which salinity is a constant parameter in space and in time.
The model is described in detail in :ref:`CO2-EOS`.
-The model definition requires three text files:
+The fluid property models (including CO :sub:`2` solubility, density, and viscosity) and their tabular bounds are defined directly via XML attributes:
-In *co2flash.txt*, we define the CO :sub:`2` solubility model used to compute the amount of CO :sub:`2` dissolved in the brine phase as a function of pressure (in Pascal), temperature (in Kelvin), and salinity (in units of molality):
-
-.. literalinclude:: ../../../../../inputFiles/compositionalMultiphaseWell/co2flash.txt
-
-The first keyword is an identifier for the model type (here, a flash model). It is followed by the model name. Then, the lower, upper, and step increment values for pressure and temperature ranges are specified.
-The trailing 0 defines a zero-salinity in the model.
-Note that the water component is not allowed to evaporate into the CO :sub:`2` -rich phase.
-
-
-The *pvtgas.txt* and *pvtliquid.txt* files define the models used to compute the density and viscosity of the two phases, as follows:
-
-.. literalinclude:: ../../../../../inputFiles/compositionalMultiphaseWell/pvtgas.txt
-
-.. literalinclude:: ../../../../../inputFiles/compositionalMultiphaseWell/pvtliquid.txt
-
-In these files, the first keyword of each line is an identifier for the model type (either a density or a viscosity model).
-It is followed by the model name.
-Then, the lower, upper, and step increment values for pressure and temperature ranges are specified.
-The trailing 0 for ``PhillipsBrineDensity`` and ``PhillipsBrineViscosity`` entry is the salinity of the brine, set to zero.
+The lower and upper bounds for the internal fluid property tables are defined by the ``pressureCoordinates`` (in Pascal) and ``temperatureCoordinates`` (in Kelvin) attributes.
+The step increments used to construct these tables are provided by the ``pressureInterval`` and ``temperatureInterval`` attributes.
+Note that in this model formulation, the water component is not allowed to evaporate into the CO :sub:`2`-rich phase.
+The salinity in this case is explicitly set to 0.
.. note::
- It is the responsibility of the user to make sure that the pressure and temperature values encountered in the simulation (in the reservoir and in the well) are within the bounds specified in the PVT files. GEOS will not throw an error if a value outside these bounds is encountered, but the (nonlinear) behavior of the simulation and the quality of the results will likely be negatively impacted.
+ It is the responsibility of the user to make sure that the pressure and temperature values encountered in the simulation (in the reservoir and in the well) are within the bounds specified by the coordinate attributes in the XML. GEOS will not throw an error if a value outside these bounds is encountered, but the (nonlinear) behavior of the simulation and the quality of the results will likely be negatively impacted.
.. _FieldSpecifications_tag_co2_field_case: