Introduction

This package contains a Scilab/Octave/Matlab implementation of the
thermodynamic model of Duan and Mao1 to compute methane solubility in salted
water. It relies on various other models (references 2-5) which are also
(partially) implemented. The most interesting functions defined are probably:

  • function solubility = ch4_solubility (temperature, pressure, nacl_mole_fraction)
    Computes the CH4 solubility at given T, P and NaCl content.
    Input:
    - temperature, in Kelvin, valid range [273.15, 573.15],
    - pressure, in bar, valid range [1, 2000],
    - nacl_mole_fraction, no unit, valid range [0.0, 0.0888778] (i.e. less than 6 mol/Kg of solvent).
    Output:
    - solubility, in mol/Kg of solvent.
  • function molar_volume = ch4_molar_volume (temperature, pressure)
    Computes the molar volume of CH4 at given T, P.
    Input:
    - temperature, in Kelvin, valid range [273.15, 1273.15],
    - pressure, in bar, valid range [0, 8000],
    Output:
    - molar_volume, in litre/mol.
  • function fugacity_coefficient = ch4_fugacity_coefficient (temperature, pressure)
    Computes the fugacity coefficient of CH4 at given T, P.
    Input:
    - temperature, in Kelvin, valid range [273.15, 1273.15],
    - pressure, in bar, valid range [0, 8000],
    Output:
    - fugacity_coefficient, no unit.

Browse the source files for more.

How to use

The implementations for Scilab on the one hand, and Octave/Matlab on the other are
contained in two sets of files with extension .sci for Scilab and .m for Octave/Matlab.
Execution the file "ch4_duan_mao" with the proper extension defines several functions
which can be used in your computations. The simplest thing to do is to run the example
script delivered.

  1. Put all the files in the same directory.
  2. Launch Scilab/Octave/Matlab.
  3. Set the current working directory to this directory via the "cd" command or the appropriate menu entry.
  4. Execute the file "example.sci".

Files

For each paper listed in the REFERENCE section below there is:

  • a Scilab implementation file (extension .sci, in the directory scilab);
  • an Octave/Matlab implementation file (extension .m, in the directory matlab);
  • a Scilab test file (starts with "test_", extension .sci);
  • an Octave/Matlab test file (starts with "test_", extension .m);

The test files can be used to check the validity of the implementation. Detailed file list:

  • example.sci, example.m
    A file showing how to use the functions. You should start here.
  • ch4_eos_duan_moller_weare.[sci,m]
    Implementation of the EOS for CH4 solutions, see [2].
  • test_ch4_eos_duan_moller_weare.[sci,m]
    Test suite for the former.
  • nacl_shibue.[sci,m]
    Vapor pressure for NaCl solutions, see [3].
  • test_nacl_shibue.[sci,m]
    Test suite for the former.
  • h2o_wagner_pruss.[sci,m]
    Water saturation properties, see [4].
  • test_h2o_wagner_pruss.[sci,m]
    Test suite for the former.
  • ch4_duan_mao.[sci,m]
    Methane solubility in salted water, see [1].
  • test_ch4_duan_mao.[sci,m]
    Test suite for the former.
  • nacl_spivey.[sci,m]
    Density for NaCl solutions, see [5].
  • README.txt
    The file you are reading.
  • ch4_nacl_h2o_systems.tar.gz
    Gzipped tar archive of the package.

Contact, availability, licensing

This package is available at https://www.calcul.isto.cnrs-orleans.fr/redmine/projects/ch4-nacl-h2o-systems/wiki.
The author is Emmanuel LE TRONG <>. It is released under the MIT license.

Copyright (c) 2012 Emmanuel LE TRONG

Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
and associated documentation files (the "Software"), to deal in the Software without restriction,
 including without limitation the rights to use, copy, modify, merge, publish, distribute, 
sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial 
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

References

1 "A thermodynamic model for calculating methane solubility, density and gas phase composition of methane-bearing aqueous fluids from 273 to 523 K and from 1 to 2000 bar"
Duan Z. and Mao S.
Geochimica et Cosmochimica Acta, 70, pp. 3369--3386, 2006.

2 "An equation of state for the CH4-CO2-H2O system: I. Pure systems from 0 to 1000°C and 0 to 8000 bar"
Duan, Moller and Weare,
Geochimica et Cosmochemica acta, 56,
pp. 2605--2617, 1992.

3 "Vapor pressures of aqueous NaCl and CaCl2 solutions at elevated temperature"
Yasuhiro Shibue
Fluid phase equilibria, 213, pp. 39--51, 2003.

4 "International equations for the saturation properties of ordinary water subtances. Revised according to the international temperature scale of 1990"
W. Wagner and A. Pruss
J. Phys. Chem. Data, 22(3), pp. 783--787, 1993.

5 "Estimating density, formation volume factor, compressibility, methane solubility, and viscosity for oilfield brines at temperatures from 0 to 275°C, pressures to 200 MPa, and salinities to 5.7 mole/kg"
Spivey J. P., McCain W. D. and North R.
Journal of canadian petroleum technology, 43(7), pp. 52--61, 2004.