gaspype.activity#
- gaspype.activity(f, t, p, species)#
Calculate the activity of a substance in the equilibrium state of a fluid at a given temperature and pressure. The substance does not need to be part of the fluid system, it can be a condensed phase species (solid or liquid, see gaspype.species(condensed=True)) or a gas phase species.
For a condensed phase species the activity is relative to the pure substance: At a value of 1 the fluid is in equilibrium with the substance. At a value > 1 formation of the substance is thermodynamic favored. At a value < 1 a depletion of the substance is favored. For a gas phase species the activity is its equilibrium partial pressure divided by the standard pressure p0.
The activity is derived from the chemical potentials of the elements in the equilibrated fluid, therefore it does not depend on a specific formation reaction. The shapes of f, t and p are broadcast against each other.
For repeated calls a species_system with the substance as single species can be passed instead of its name. Its properties are then interpolated from the precalculated data of the species_system, like the properties of the fluid, instead of being calculated from the polynomials for each call.
- Parameters:
t (
float|ndarray[tuple[int,...],dtype[float64]]) – Temperature in Kelvinp (
float|ndarray[tuple[int,...],dtype[float64]]) – Pressure in Pascalspecies (
str|species_system) – Name of the substance, e.g. ‘C(gr)’, ‘Ni(cr)’ or ‘O2’, or a species_system (or fluid_system) with a single species and the same backend as the fluid
- Return type:
ndarray[tuple[int,...],dtype[float64]]- Returns:
The activity of the substance. It is 0 if the fluid does not contain all elements of the substance and nan if the activity is not defined: For temperatures outside of the temperature range of the substance or if the chemical potential of an element can not be determined (e.g. for carbon in a fluid system with CO as only carbon containing species).