OpenPNM is open-source framework for conducting pore network modeling simulations of multiphase transport in porous materials. It includes modules for generating various common network topologies, pore and throat geometry models, pore scale physics models, and fluid property estimation. It also contains a large set of algorithms for running various simulations such as drainage curves, gas diffusion, permeability, and more.
OpenPNM is written in Python making extensive use of Scipy. Python is a very flexible object oriented programming language that will be familiar to those with experience using Matlab. Our goal is to help other scientists and engineers harness the power and intuitive pore network modeling approach, so if you are interested in this package, please contact us through Github, or email one of the developers directly.
OpenPNM is written in Python, which has many user-friendly features including an interactive command line. OpenPNM is meant to be called from the command line, or by running scripts of commands. The following script illustrates how to generated a cubic network, assign it geometrical sizes, and run a drainage algorithm to simulate mercury intrusion porosimetry:
>>> 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:
The drainage curve can be visualized with MIP.plot_drainage_curve() giving something like this: