mixtures: converting representations of mixtures

Code author: Peter Kraus

Includes functions to convert namespaces containing mixtures of chemicals between various representations, such as mole fractions etc.

Functions

flows_to_fractions(total[, vdot, output, _inp])

Calculates the volume fractions of components in the provided namespace vdot, given the total flow in total.

fractions_to_flows(total[, x, fillnan, ...])

Calculates the partial flow rates in the mixture given mole fractions in the provided namespace x and the total flow in total.

dgpost.transform.mixtures.flows_to_fractions(total: Quantity, vdot: dict[str, Quantity] = None, output: str = 'x', _inp: dict = {}) dict[str, Quantity]

Calculates the volume fractions of components in the provided namespace vdot, given the total flow in total.

Parameters:
  • total – The total flow, by default in m³/s. Negative or zero values are ignored.

  • vdot – The dictionary containing flows of all species/components. By default in m³/s.

  • output – Prefix of the output namespace. Defaults to “x” for mole fraction.

dgpost.transform.mixtures.fractions_to_flows(total: Quantity, x: dict[str, Quantity] = None, fillnan: bool = True, output: str = 'vdot', _inp: dict = {}) dict[str, Quantity]

Calculates the partial flow rates in the mixture given mole fractions in the provided namespace x and the total flow in total.

Parameters:
  • total – The total flow, by default in m³/s. Negative or zero values are ignored.

  • x – The dictionary containing mole fractions of all species/components.

  • output – Prefix of the output namespace. Defaults to “vdot” for flow rates.