gaspype.elements#

class gaspype.elements(composition, fs=None, shape=None)#

Bases: object

Represent a fluid by composition of elements.

array_element_composition#

Array of the element composition

Type:

FloatArray

Instantiates an elements object.

Parameters:
  • composition (fluid | dict[str, float] | list[str] | list[float] | ndarray[tuple[Any, ...], dtype[float64]]) – A fluid object, a dict of element names with their composition, e.g.: {‘O’:1,’H’:2} or a list/numpy-array of compositions. The array can be multidimensional, the size of the last dimension must match the number of elements used in the fluid_system. The indices of the last dimension correspond to the indices in the active_species list of the fluid_system.

  • fs (fluid_system | None) – Reference to a fluid_system.

  • shape (Optional[Sequence[int]]) – Tuple or list for the dimensions the fluid array. Can only be used if composition argument is a dict. Otherwise the dimensions are specified by the composition argument.

get_elemental_composition()#

Get a dict of the molar amount of each element

Return type:

dict[str, float]

Returns:

Returns a dict of floats with the molar amount of each element in mol

get_mass()#

Get absolute mass of elements

Return type:

ndarray[tuple[Any, ...], dtype[float64]] | float

Returns:

Mass of the fluid in kg