Some times you would like to use freely available software tools to get independent estimates for water saturation. Even when you have access to pricey petrophysical software applications, you may want to compare, validate or even make modifications to the original models and equations, instead of blindly rely on a black-box software package.

Other times, you would like to know in detail what equations and assumptions were made to compute water saturations, use your own formulae, correlations and ideas, or even use different published models not yet implemented in other commercial packages.

To get independent estimations of water saturations, you either write a custom and indeed very complex Excel spreadsheet, or you can use the freely available GLS GeolOil Logging Scripting to do the task.

The simple GLS scripting programming language, allows you to code exactly what you need. It automatically takes care of missed -999.25 values, as well as append and save your new derived curves into a new LAS well log file.

The example source code showed below, is small reference script to compute the formation water saturation using three well known and popular models:

- The basic and always classic Archie equation model for non shaly rocks. (Vsh=0 or very low)
- The Simandoux model, for shaly rocks. (Vsh>0)
- The Schlumberger model, for shaly rocks. (Vsh>0)

The simple Archie equation (1) model, only requires to know deep formation resistivity Rt, formation water resistivity Rw, and porosity Phi. The factor c is usually set to 0.90 for sands and 1.0 for carbonates. The shale dependent Simandoux (2) and Schlumberger (3) models, also requires to input the volume of shale Vsh, as well as the pure shale resistivity Rsh. The factor c in Simandoux equation (2) is usually set to 0.40 for sands, and 0.45 for carbonates.

You are welcome to freely use the script below for your work, even for commercial projects. But please refer you used, or adapted the script from www.geoloil.com, giving us fair credits. You don't need to type the code, as it comes shipped with your license into its built-in data-set "GeolOil_DB".

The script uses whole curves for Rw and Rsh (recommended), rather than points. If you just only have constant values, you can set them to the fixed numbers. If you have a collection of points {(depth MD, Rw)}, and {(depth MD, Rsh)}, then the GLS-API, can interpolate continuous spline curves or straight piece-wise lines for you, which is our recommended approach.

The code example shown below, runs "out of the box" with your license. On a typical Windows installation just follow: [File] -> [Open_GLS_Script] -> [Open] -> [UserHomeDir] -> [GeolOil_DB] -> [GLS_examples] -> [sw_example.gls] -> [Run]. The script will create a .LAS file called sw_models.las