class GenericPhase(*args, **kwargs)[source]

Bases: openpnm.core.Base.ParamMixin, openpnm.core.Base.Base, openpnm.core.ModelsMixin.ModelsMixin, openpnm.core.Base.LegacyMixin, openpnm.core.Base.LabelMixin

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

This class produces a blank-slate object with no pore-scale models for calculating any thermophysical properties. Users must add models and specify parameters for all the properties they require.

  • network (OpenPNM network object) – The network with which this object is associated

  • project (OpenPNM Project object, optional) – The Project with which the object should be assigned. If not supplied then a new Project is created

  • name (string, optional) – The unique name of the object. If not given one will be generated.


Create a new empty phase:

>>> import openpnm as op
>>> pn =[10, 10, 10])
>>> phase = op.phases.GenericPhase(network=pn)

And add a model:

>>> phase.add_model(propname='pore.molar_density',
...                 model=op.models.phases.molar_density.ideal_gas)

Now confirm that the model was added and data was calculated. The models attribute can be printed:

>>> print(phase.models)
#   Property Name                       Parameter                 Value
1   pore.molar_density                  model:                    ideal_gas
                                        pressure:                 pore.pressure
                                        temperature:              pore.temperature
                                        regeneration mode:        normal

And the Phase itself has a nice printout using print(phase).