auxi.modelling.process.materials.chem module

This module provides classes to work with materials and material packages that are described with chemical compositions.

class auxi.modelling.process.materials.chem.Material(name, file_path, description=None)

Bases: auxi.core.objects.NamedObject

A material consisting of multiple chemical compounds.

Parameters:
  • name – The material’s name.
  • file_path – The path of the material definition file.
  • description – the material’s description

The format of the text file is as follows:

  • The lines are space separated. The values in a line are separated by one or more spaces.
  • The first line is a heading line.
  • All subsequent lines contain a compound formula, followed by mass fractions.
  • The first column lists the compounds in the material.
  • All subsequent columns describe assays of the material.

The following is an example of a material text file:

Compound   IlmeniteA  IlmeniteB  IlmeniteC
Al2O3      0.01160    0.01550    0.00941
CaO        0.00022    0.00001    0.00017
Cr2O3      0.00008    0.00022    0.00011
Fe2O3      0.20200    0.47300    0.49674
Fe3O4      0.00000    0.00000    0.00000
FeO        0.27900    0.19100    0.00000
K2O        0.00004    0.00001    0.00005
MgO        0.01040    0.00580    0.01090
MnO        0.00540    0.00480    0.00525
Na2O       0.00007    0.00005    0.00031
P4O10      0.00001    0.00032    0.00015
SiO2       0.00850    0.00490    0.01744
TiO2       0.47700    0.29400    0.45949
V2O5       0.00360    0.00800    0.00000
add_assay(name, assay)

Add an assay to the material.

Parameters:
  • name – The name of the new assay.
  • assay – A list containing the compound mass fractions for the assay. The sequence of the assay’s elements must correspond to the sequence of the material’s compounds.
create_empty_assay()

Create an empty array to store an assay. The array’s length will be equal to the number of compounds in the material.

Returns:A floating point array.
create_package(assay=None, mass=0.0, normalise=True)

Create a MaterialPackage based on the specified parameters.

Parameters:
  • assay – The name of the assay based on which the package must be created.
  • mass – [kg] The mass of the package.
  • normalise – Indicates whether the assay must be normalised before creating the package.
Returns:

The created MaterialPackage.

get_assay_total(name)

Calculate the total of the specified assay.

Parameters:name – The name of the assay.
Returns:The total mass fraction of the specified assay.
get_compound_index(compound)

Determine the index of the specified compound.

Parameters:compound – The formula and phase of the specified compound, e.g. ‘Fe2O3[S1]’.
Returns:The index of the specified compound.
class auxi.modelling.process.materials.chem.MaterialPackage(material, compound_masses)

Bases: auxi.core.objects.Object

A package of a material consisting of multiple chemical compounds.

Parameters:
  • material – A reference to the Material to which self belongs.
  • compound_masses – [kg] The masses of the compounds in the package.
add_to(other)

Add another chem material package to this material package.

Parameters:other – The other material package.
clear()

Set all the compound masses in the package to zero.

clone()

Create a complete copy of self.

Returns:A MaterialPackage that is identical to self.
extract(other)

Extract ‘other’ from self, modifying self and returning the extracted material as a new package.

Parameters:other

Can be one of the following:

  • float: A mass equal to other is extracted from self. Self is reduced by other and the extracted package is returned as a new package.
  • tuple (compound, mass): The other tuple specifies the mass of a compound to be extracted. It is extracted from self and the extracted mass is returned as a new package.
  • string: The ‘other’ string specifies the compound to be extracted. All of the mass of that compound will be removed from self and a new package created with it.
Returns:A new material package containing the material that was extracted from self.
get_assay()

Determine the assay of self.

Returns:[mass fractions] An array containing the assay of self.
get_compound_mass(compound)

Get the mass of the specified compound in the package.

Parameters:compound – The formula of the compound, e.g. Fe2O3.
Returns:[kg]
get_compound_mass_fraction(compound)

Get the mass fraction of the specified compound in self.

Parameters:compound – The formula and phase of the compound, e.g. Fe2O3.
Returns:[]
get_element_mass(element)

Determine the masses of elements in the package.

Returns:[kg] An array of element masses. The sequence of the elements in the result corresponds with the sequence of elements in the element list of the material.
get_element_mass_dictionary()

Determine the masses of elements in the package and return as a dictionary.

Returns:[kg] A dictionary of element symbols and masses.
get_element_masses()

Get the masses of elements in the package.

Returns:[kg] An array of element masses. The sequence of the elements in the result corresponds with the sequence of elements in the element list of the material.
get_mass()

Get the mass of the package.

Returns:[kg]