y#
- GasMixture.y(compname=None, y=None)[source]#
Helper method for getting and setting mole fractions of a component
- Parameters:
compname (str, optional) – The name of the component i.e.
obj.name
. Ify
is not provided this will return the mole fraction of the requested component. Ify
is provided this will set the mole fraction of the specified component toy
.y (scalar or ndarray, optional) – The mole fraction of the given species in the mixture. If not provided this method works as a getter and will return the mole fraction of the requested component. If
compname
is also not provided then the mole fractions of all components will be returned as a dictionary with the components names as keys.
Notes
This method is equivalent to
mixture['pore.mole_fraction.<compname>'] = y