/OpenPNM

A Python package for performing pore network modeling of porous media

Primary LanguagePythonMIT LicenseMIT

https://travis-ci.org/PMEAL/OpenPNM.svg?branch=master Join the chat at https://gitter.im/PMEAL/OpenPNM https://readthedocs.org/projects/openpnm/badge/?version=latest

Overview of OpenPNM

OpenPNM is an open source project aiming to provide porous media researchers with a ready-made framework for performing a wide range of pore network simulations. The main features and capabilities of OpenPNM are:

Installation

OpenPNM can be install from the Python Package index using:

pip install openpnm

Or the source code can be downloaded from Github and installed by running:

python setup.py

Example Usage

The following code block illustrates how to use OpenPNM to perform a mercury intrusion porosimetry simulation in just 10 lines:

>>> import OpenPNM as op
>>> pn = op.Network.Cubic(shape=[10, 10, 10], spacing=0.0001)
>>> geo = op.Geometry.Stick_and_Ball(network=pn, pores=pn.Ps,
...                                  throats=pn.Ts)
>>> Hg = op.Phases.Mercury(network=pn)
>>> Air = op.Phases.Air(network=pn)
>>> phys = op.Physics.Standard(network=pn, phase=Hg, pores=pn.Ps,
...                            throats=pn.Ts)
>>> MIP = op.Algorithms.Drainage(network=pn)
>>> MIP.setup(invading_phase=Hg, defending_phase=Air)
>>> MIP.set_inlets(pores=pn.pores(['top', 'bottom']))
>>> MIP.run()

The network can be visualized in Paraview giving the following:

http://i.imgur.com/GbUNy0bm.png

The drainage curve can be visualized with MIP.plot_drainage_curve() giving something like this:

http://i.imgur.com/ZxuCictm.png

A collection of examples is available as a separate Github repository: OpenPNM-Examples.

Release Management and Versioning

OpenPNM uses Semantic Versioning (i.e. X.Y.Z) to label releases. All major and minor versions (X.Y.z) are available on PyPI, but bugfixes (x.y.Z) updates are not generally pushed unless the bug is particularly egregious.

OpenPNM uses the Github Flow system of Git branching. Any code added to master is done via Pull Requests (PRs). When new PRs are merged into the master branch, they are generally not given a new version number. Once enough new features have been added, or a sufficient amount of time has passed, the minor release number (x.Y.z) will be incremented. Any code added to the Master branch between incrementing the version number is subject to change, but once a version number has been tagged to code can be considered up-to-date and stable.

OpenPNM depends on several other packages widely known as the Scipy Stack. It is our policy to always support the latest version of all these packages and their dependencies.

The main developer for this project is Prof. Jeff Gostick (jgostick@gmail.com).

Related Links

OpenPNM Homepage - http://openpnm.org
Github is used to host the code - https://www.github.com/PMEAL/OpenPNM
Github is also used as the project's issue and bug tracker - https://www.github.com/PMEAL/OpenPNM/issues
A collection of examples using OpenPNM is available in a separate repository - https://www.github.com/PMEAL/OpenPNM-Examples
The documentation is hosted on ReadTheDocs - http://openpnm.readthedocs.org/
Gitter is used to help users with questions about using the code - https://gitter.im/PMEAL/OpenPNM
Scipy is a major component of OpenPNM - http://www.scipy.org
Anaconda is the most general way to setup a numerical Python environment - https://www.continuum.io/downloads
WinPython is a slightly easier way to use numerical Python on Windows - https://github.com/winpython/winpython
Spyder is the recommended IDE when working with OpenPNM, it is included in Ananconda and WinPython - https://github.com/spyder-ide/spyder
Paraview is suggested for visualizing OpenPNM data - http://www.paraview.org
OpenPNM is offered under an MIT License - http://opensource.org/licenses/MIT