class openpnm.phases.mixtures.GenericMixture(*args, **kwargs)[source]

Creates Phase object that represents a multicomponent mixture system consisting of a given list of GenericPhases as components.

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

  • settings (dataclass-like or dict, optional) – User defined settings for the object to override defaults. Can be a dataclass-type object with settings stored as attributes or a python dicionary of key-value pairs. Settings are stored in the settings attribute of the object.

  • name (string, optional) – A unique name to assign to the object for easier identification. If not given one will be generated.

  • components (list[GenericPhase]s) – A list of all components that constitute this mixture


All mixtures assume that mole fractions are always stored as 'pore.mole_fraction' and that concentration is always stored as 'pore.concentration'.


A shortcut to query the total number of pores on the object


A shortcut to query the total number of throats on the object


A shortcut to get a list of all pores on the object


A shortcut to get a list of all throats on the object


List of available models on the objects


String representing the name of the object


A shortcut to get a handle to the associated network.


A shortcut to get a handle to the associated phase (itself).


A shortcut to query the associated physics(es).


A shortcut to get a handle to the associated project.


Dictionary containing object settings.


add_model(propname, model[, regen_mode])

Adds a new model to the models dictionary.


Checks the "health" of the mixture

filter_by_label([pores, throats, labels, mode])

Returns which of the supplied pores (or throats) has the specified label(s)

get_conduit_data(poreprop[, throatprop, mode])

Combines requested data into a single 3-column array.


Retrieves requested property from associated objects, to produce a full Np or Nt length array.

interpolate_data(propname[, mode])

Determines a pore (or throat) property as the average of it's neighboring throats (or pores)

labels([pores, throats, element, mode])

Returns a list of labels present on the object

num_pores([labels, mode])

Returns the number of pores of the specified labels

num_throats([labels, mode])

Return the number of throats of the specified labels


Return parameter names and values in a dictionary

pores([labels, mode, asmask, to_global])

Returns pore indicies where given labels exist, according to the logic specified by the mode argument.


Returns a list containing the names of all defined pore or throat properties.

regenerate_models([propnames, exclude, deep])

Re-runs the specified model or models.

remove_model([propname, mode])

Removes model and data from object.

set_component(component[, mode])

Add another component to the mixture

set_concentration(component[, values])

Specify the concentration of a component in each pore

set_label(label[, pores, throats, mode])

Creates or updates a label array

set_mole_fraction(component[, values])

Specify mole fraction of each component in each pore

show_hist([props, bins, fontsize])

Shows a quick plot of key property distributions.

throats([labels, mode, asmask, to_global])

Returns throat locations where given labels exist, according to the logic specified by the mode argument.


Converts a boolean mask to a list of pore or throat indices.

to_mask([pores, throats])

Convert a list of pore or throat indices into a boolean mask of the correct length.


Updates all unspecified concentrations from mole fractions and molar density.


Updates mole fraction values so the sum of all mole fractions is 1.0 in each pore.