LSMPQS Software

version 0.5

Maša Prodanović
masa.prodanovic at

LSMPQS is a software package for simulating capillarity controlled, immiscible fluid displacement  (drainage and imbibition) in porous media.

carbonate mask
Pore-grain surface extracted from an x-ray microcomputed tomography image  of a naturally fractured carbonate sample (approximately 600 microns on each side).
Non-wetting (NW) phase configuration at imbibition (curvature C=0.09 micron-1). Non-wetting/wetting fluid contact is shown in red, NW phase/grain contact is in gray, and snapped-off (trapped) blobs are in blue. For more information see LSMQPS documenation


  • Porous medium can be of arbitrary complexity, described analytically (e.g. sphere packs) or from segmented images of real rocks.

  • No pre-set parameters other than detailed description of the porous medium are needed.

  • The fluid configurations obtained from LSMPQS simulation are detailed and quantifying saturation, volumes, interfacial areas etc. is straightforward. Having suitable geometry, you can obtain capillary-pressure curves or study pore scale phenomena in a small ensemble of pores.

  • LSMPQS is developed on Linux, and should compile on any Unix-like system (on Windows try Cygwin). C/C++ and FORTRAN compilers are required.

Download LSMPQS and follow the installation instructions in the manual below (also provided with the distribution). LSMPQS is distributed under the terms of the University of Texas at Austin research software license.

  • Manual (pdf) (also included in doc/ subdirectory of the LSMPQS distribution)
  • Online code documentation (doxygen based)
  • Slides from my talk might be a good visual guide into software capabilities
  • My research webpage (as well as the manual) cite relevant research papers.
Problems? Submit a report using bug tracking system or email me.


Many thanks to Steven L. Bryant for the continued encouragement, Elena Rodriguez-Pin for helping  to test the code, and Kevin Chu for always being knowledgeable and helpful be it level sets or websites!
Since 2006, the code development has been, at various levels, supported by:
  • ICES postdoctoral fellowship
  • Baker Atlas
  • Departement of Energy, grant DE-FC26-06NT43067, " Mechanisms Leading to Co-Existence of Gas and Hydrate in Ocean Sediments"
  • Department of Agriculture, grant 2007-35102-18162, "Quantifying the Mechanisms of Pathogen Retention In Unsaturated Soils"

Last but not the least...

Needless to say, this code is work in progress. Please email me if you find the software useful, and have any type of feedback - this will motivate future improvements.
Further, if you use the code in your work, I would appreciate if you cite the paper that started it all along with this webpage, as that will help my academic career.

Maintained by Maša Prodanović
Last Update April 2009.