OpenPNM

OpenPNM is a comprehensive framework for performing pore network simulations of porous materials.

For more details about the package can be found in the on-line documentation

To be notified of new releases click the Watch button on the Github repo page. To show your support for this project click the Star button, as we use this as a proxy for the size of our userbase when applying for funding.

Installation and Requirements

Preferred method

The preferred way of installing OpenPNM is through Anaconda Cloud using:

conda install -c conda-forge openpnm

Alternative method

OpenPNM can also be installed from the Python Package Index using:

pip install openpnm

However, we don't recommend installing using pip since pypardiso, which is a blazing fast direct solver, is not available for Windows users who use Python 3.7+.

For developers

For developers who intend to change the source code or contribute to OpenPNM, the source code can be downloaded from Github and installed by running:

pip install -e 'path/to/downloaded/files'

The advantage to installing from the source code is that you can edit the files and have access to your changes each time you import OpenPNM.

OpenPNM requires the Scipy Stack (Numpy, Scipy, Matplotlib, etc), which is most conveniently obtained by installing the Anaconda Distribution.

Example Usage

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


import openpnm as op
pn = op.network.Cubic(shape=[10, 10, 10], spacing=0.0001)
geo = op.geometry.StickAndBall(network=pn, pores=pn.Ps, throats=pn.Ts)
Hg = op.phases.Mercury(network=pn)
phys = op.physics.Standard(network=pn, phase=Hg, geometry=geo)
mip = op.algorithms.Porosimetry(network=pn)
mip.setup(phase=Hg)
mip.set_inlets(pores=pn.pores(['left', 'right', 'top', 'bottom']))
mip.run()

The network can be visualized in ParaView giving the following:

77927983-dc3dd000-7275-11ea-8700-c96c2d51aa1f

The drainage curve can be visualized with mip.plot_intrusion_curve() giving something like this:

77930201-96363b80-7278-11ea-95fd-4a55fb1d6148

A collection of examples is available in the examples folder of this repository: Examples

GitHub

https://github.com/PMEAL/OpenPNM