Please cite as:
Gostick et al. "OpenPNM: a pore network modeling package." Computing in Science & Engineering 18, no. 4 (2016): 60-74. doi:10.1109/MCSE.2016.49
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
OpenPNM can be installed from the Python Package Index using:
pip install openpnm
or from Anaconda Cloud using:
conda install -c conda-forge openpnm
or 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.
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:
The drainage curve can be visualized with mip.plot_intrusion_curve()
giving something like this:
A collection of examples is available in the examples folder of this repository: Examples
OpenPNM is developed by the Porous Materials Engineering and Analysis Lab (PMEAL), in the Department of Chemical Engineering at the University of Waterloo in Waterloo, Ontario, Canada.
The lead developer for this project is Prof. Jeff Gostick ([email protected]).