LCOV - code coverage report
Current view: top level - include/materials - PorousFlowFluidStateBrineCO2.h (source / functions) Hit Total Coverage
Test: porous_flow Test Coverage Lines: 1 1 100.0 %
Date: 2017-11-20 14:50:56 Functions: 1 2 50.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /****************************************************************/
       2             : /* MOOSE - Multiphysics Object Oriented Simulation Environment  */
       3             : /*                                                              */
       4             : /*          All contents are licensed under LGPL V2.1           */
       5             : /*             See LICENSE for full restrictions                */
       6             : /****************************************************************/
       7             : 
       8             : #ifndef POROUSFLOWFLUIDSTATEBRINECO2_H
       9             : #define POROUSFLOWFLUIDSTATEBRINECO2_H
      10             : 
      11             : #include "PorousFlowFluidStateFlashBase.h"
      12             : 
      13             : class BrineFluidProperties;
      14             : class SinglePhaseFluidPropertiesPT;
      15             : class PorousFlowFluidStateBrineCO2;
      16             : 
      17             : template <>
      18             : InputParameters validParams<PorousFlowFluidStateBrineCO2>();
      19             : 
      20             : /**
      21             :  * Fluid state class for brine and CO2. Includes mutual solubility of CO2 and
      22             :  * brine using model of Spycher, Pruess and Ennis-King, CO2-H2O mixtures in the
      23             :  * geological sequestration of CO2. I. Assessment and calculation of mutual
      24             :  * solubilities from 12 to 100C and up to 600 bar, Geochimica et Cosmochimica Acta,
      25             :  * 67, 3015-3031 (2003), and
      26             :  * Spycher and Pruess, CO2-H2O mixtures in the geological sequestration of CO2. II.
      27             :  * Partitioning in chloride brine at 12-100C and up to 600 bar, Geochimica et
      28             :  * Cosmochimica Acta, 69, 3309-3320 (2005)
      29             :  */
      30           6 : class PorousFlowFluidStateBrineCO2 : public PorousFlowFluidStateFlashBase
      31             : {
      32             : public:
      33             :   PorousFlowFluidStateBrineCO2(const InputParameters & parameters);
      34             : 
      35             : protected:
      36             :   virtual void thermophysicalProperties() override;
      37             :   /**
      38             :    * Mass fractions of CO2 and brine calculated using mutual solubilities given
      39             :    * by Spycher, Pruess and Ennis-King, CO2-H2O mixtures in the geological
      40             :    * sequestration of CO2. I. Assessment and calculation of mutual solubilities
      41             :    * from 12 to 100C and up to 600 bar, Geochimica et Cosmochimica Acta, 67, 3015-3031 (2003),
      42             :    * and Spycher and Pruess, CO2-H2O mixtures in the geological sequestration of CO2. II.
      43             :    * Partitioning in chloride brine at 12-100C and up to 600 bar, Geochimica et
      44             :    * Cosmochimica Acta, 69, 3309-3320 (2005)
      45             :    *
      46             :    * @param pressure phase pressure (Pa)
      47             :    * @param temperature phase temperature (C)
      48             :    * @param xnacl NaCl mass fraction (kg/kg)
      49             :    * @param[out] xco2l mass fraction of CO2 in liquid (kg/kg)
      50             :    * @param[out] dxco2l_dp derivative of mass fraction of CO2 in liquid wrt pressure
      51             :    * @param[out] dxco2l_dT derivative of mass fraction of CO2 in liqiud wrt temperature
      52             :    * @param[out] xh2og mass fraction of H2O in gas (kg/kg)
      53             :    * @param[out] dh2ogl_dp derivative of mass fraction of H2O in gas wrt pressure
      54             :    * @param[out] dh2og_dT derivative of mass fraction of H2O in gas wrt temperature
      55             :    */
      56             :   void massFractions(Real pressure,
      57             :                      Real temperature,
      58             :                      Real xnacl,
      59             :                      Real & xco2l,
      60             :                      Real & dxco2l_dp,
      61             :                      Real & dxco2l_dT,
      62             :                      Real & xh2og,
      63             :                      Real & dxh2og_dp,
      64             :                      Real & dxh2og_dT) const;
      65             : 
      66             :   /**
      67             :    * Fugacity coefficient for CO2. Eq. (B7) from Spycher, Pruess and
      68             :    * Ennis-King, CO2-H2O mixtures in the geological sequestration of CO2. I.
      69             :    * Assessment and calculation of mutual solubilities from 12 to 100C and
      70             :    * up to 600 bar, Geochimica et Cosmochimica Acta, 67, 3015-3031 (2003)
      71             :    *
      72             :    * @param pressure gas pressure (Pa)
      73             :    * @param temperature temperature (K)
      74             :    * @param[out] fco2 fugacity coefficient for CO2
      75             :    * @param[out] dfco2_dp derivative of fugacity coefficient wrt pressure
      76             :    * @param[out] dfco2_dT derivative of fugacity coefficient wrt temperature
      77             :    */
      78             :   void fugacityCoefficientCO2(
      79             :       Real pressure, Real temperature, Real & fco2, Real & dfco2_dp, Real & dfco2_dT) const;
      80             : 
      81             :   /**
      82             :    * Fugacity coefficient for H2O. Eq. (B7) from Spycher, Pruess and
      83             :    * Ennis-King, CO2-H2O mixtures in the geological sequestration of CO2. I.
      84             :    * Assessment and calculation of mutual solubilities from 12 to 100C and
      85             :    * up to 600 bar, Geochimica et Cosmochimica Acta, 67, 3015-3031 (2003)
      86             :    *
      87             :    * @param pressure gas pressure (Pa)
      88             :    * @param temperature temperature (K)
      89             :    * @param[out] fh2o fugacity coefficient for H2O
      90             :    * @param[out] dfh2o_dp derivative of fugacity coefficient wrt pressure
      91             :    * @param[out] dfh2o_dT derivative of fugacity coefficient wrt temperature
      92             :    */
      93             :   void fugacityCoefficientH2O(
      94             :       Real pressure, Real temperature, Real & fh2o, Real & dfh2o_dp, Real & dfh2o_dT) const;
      95             : 
      96             :   /**
      97             :    * Activity coefficient for CO2 in brine. From Duan and Sun, An improved model calculating
      98             :    * CO2 solubility in pure water and aqueous NaCl solutions from 257 to 533 K and from 0 to
      99             :    * 2000 bar, Chem. Geol., 193, 257-271 (2003)
     100             :    *
     101             :    * @param pressure phase pressure (Pa)
     102             :    * @param temperature phase temperature (K)
     103             :    * @param xnacl salt mass fraction (kg/kg)
     104             :    * @param[out] gamma activity coefficient for CO2 in brine (output)
     105             :    * @param[out] dgamma_dp derivative of activity coefficient wrt pressure
     106             :    * @param[out] dgamma_dT derivative of activity coefficient wrt temperature
     107             :    */
     108             :   void activityCoefficient(Real pressure,
     109             :                            Real temperature,
     110             :                            Real xnacl,
     111             :                            Real & gamma,
     112             :                            Real & dgamma_dp,
     113             :                            Real & dgamma_dT) const;
     114             : 
     115             :   /**
     116             :    * Equilibrium constant for H2O from Spycher, Pruess and
     117             :    * Ennis-King, CO2-H2O mixtures in the geological sequestration of CO2. I.
     118             :    * Assessment and calculation of mutual solubilities from 12 to 100C and
     119             :    * up to 600 bar, Geochimica et Cosmochimica Acta, 67, 3015-3031 (2003).
     120             :    * Note: correlation uses temperature in Celcius
     121             :    *
     122             :    * @param temperature temperature (C)
     123             :    * @param[out] kh2o equilibrium constant for H2O
     124             :    * @param[out] dkh2o_dT derivative of equilibrium constant wrt temperature
     125             :    */
     126             :   void equilibriumConstantH2O(Real temperature, Real & kh2o, Real & dkh2o_dT) const;
     127             : 
     128             :   /**
     129             :    * Equilibrium constant for CO2 from Spycher, Pruess and
     130             :    * Ennis-King, CO2-H2O mixtures in the geological sequestration of CO2. I.
     131             :    * Assessment and calculation of mutual solubilities from 12 to 100C and
     132             :    * up to 600 bar, Geochimica et Cosmochimica Acta, 67, 3015-3031 (2003).
     133             :    * Note: correlation uses temperature in Celcius
     134             :    *
     135             :    * @param temperature temperature (C)
     136             :    * @param[out] kco2 equilibrium constant for CO2
     137             :    * @param[out] dkco2_dT derivative of equilibrium constant wrt temperature
     138             :    */
     139             :   void equilibriumConstantCO2(Real temperature, Real & kco2, Real & dkco2_dT) const;
     140             : 
     141             :   /**
     142             :    * Partial density of dissolved CO2
     143             :    * From Garcia, Density of aqueous solutions of CO2, LBNL-49023 (2001)
     144             :    *
     145             :    * @param temperature fluid temperature (K)
     146             :    * @param[out] partial molar density (kg/m^3)
     147             :    * @param[out] derivative of partial molar density wrt temperature
     148             :    */
     149             :   void
     150             :   partialDensityCO2(Real temperature, Real & partial_density, Real & dpartial_density_dT) const;
     151             : 
     152             :   /// Salt mass fraction (kg/kg)
     153             :   const VariableValue & _xnacl;
     154             :   /// Fluid properties UserObject for brine
     155             :   const BrineFluidProperties & _brine_fp;
     156             :   /// Fluid properties UserObject for CO2
     157             :   const SinglePhaseFluidPropertiesPT & _co2_fp;
     158             :   /// Fluid properties UserObject for H20
     159             :   const SinglePhaseFluidPropertiesPT & _water_fp;
     160             :   /// Molar mass of water (kg/mol)
     161             :   const Real _Mh2o;
     162             :   /// Inverse of molar mass of H2O (mol/kg)
     163             :   const Real _invMh2o;
     164             :   /// Molar mass of CO2 (kg/mol)
     165             :   const Real _Mco2;
     166             :   /// Molar mass of NaCL
     167             :   const Real _Mnacl;
     168             :   /// Molar gas constant in bar cm^3 /(K mol)
     169             :   const Real _Rbar;
     170             : };
     171             : 
     172             : #endif // POROUSFLOWFLUIDSTATEBRINECO2_H

Generated by: LCOV version 1.11