Skip to content

MichaelHoeh/OpenPNM

 
 

Repository files navigation

image

image

image

Join the chat at https://gitter.im/PMEAL/OpenPNM

image

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:

image

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

image

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).

OpenPNM Homepage
Github is used to host the code
Github is also used as the project's issue and bug tracker
A collection of examples using OpenPNM is available in a separate repository
The documentation is hosted on ReadTheDocs
Gitter is used to help users with questions about using the code
Scipy is a major component of OpenPNM
Anaconda is the most general way to setup a numerical Python environment
WinPython is a slightly easier way to use numerical Python on Windows
Spyder is the recommended IDE when working with OpenPNM, it is included in Ananconda and WinPython
Paraview is suggested for visualizing OpenPNM data
OpenPNM is offered under an MIT License

About

A Python package for performing pore network modeling of porous media

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%