Object model for storing intrinsic thermophysical properties

This module contains the GenericPhase class, plus several subclasses which are preconfigured to have the properties of specific fluids

The GenericPhase Class

The GenericPhase class is a direct child of the Base class, so contains the usual methods such as find pore indices based on labels. It does, however, also inherit from ModelsMixin so has methods for add, removing and regenerating models.

Library of Preconfigured Phase Classes

OpenPNM include a few Phase subclasses that contain a suite of pre-configured models that predict the thermophysical properties of certain common phases.

Customizing a GenericPhase Instance

The GenericPhase class has no pore-scale models attached, so is a blank slate for creating custom Phases. The following code snippet illustrates how to do this to create an oil phase with a temperature dependent viscosity model based on a simple 2nd order polynomial:

>>> import openpnm as op
>>> import numpy as np
>>> pn =[5, 5, 5])
>>> oil = op.phases.GenericPhase(network=pn)

Now add the pore-scale model for viscosity from the models module:

>>> oil.add_model(propname='pore.viscosity',
...               model=op.models.misc.polynomial,
...               a=[50000, 1, -.1],
...               prop='pore.temperature')

Upon adding the model, values are immediately calculated at the Phase’s current temperature:

>>> np.round(oil['pore.viscosity'][0])

If the temperature is changed, the model can be regenerated to update the viscosity values:

>>> oil['pore.temperature'] = 355
>>> np.round(oil['pore.viscosity'][0])

Note that the oil viscosity has NOT changed! To propigate the new temperature to all the other calculated pore-scale properties, call the regenerate_models function:

>>> oil.regenerate_models()
>>> np.round(oil['pore.viscosity'][0])



Creates a Phase object with preset models and values for air.


This generic class is meant as a starter for custom Phase objects


Creates Phase object with a default name 'Hg' and preset values and pore-scale models for mercury.


Creates Phase object that represents a multiphase system consisting of a given list of GenericPhases.


Creates Phase object with preset values for Water