auxi.modelling.process.materials package¶
chemistry material 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)¶ 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)¶ 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]
psd material module¶
This module provides psd material and material package classes that can do size distribution calculations.
-
class
auxi.modelling.process.materials.psd.
Material
(name, file_path, description=None)¶ Represents a particulate material consisting of multiple particle size classes.
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 particle size, followed by mass fractions.
- Particle sizes are indicated in [meter].
- The first column lists the particle sizes in the material. Each class must be interpreted as “mass fraction retained”. In other words if the size class is indicated as 307.2E-3, it means that it is the class of material retained on a 307.2mm screen, and can also be though of as +307.2mm material. The first size class represents the largest particles. The final size class should be zero, as it represents all material that passed through the smallest aperture screen.
- All subsequent columns describe assays of the material.
The following is an example of a material text file:
Compound FeedA MillCharge 307.2E-3 0.20 0.02 108.6E-3 0.18 0.06 38.4E-3 0.17 0.04 13.6E-3 0.07 0.03 4.8E-3 0.13 0.03 1.7E-3 0.07 0.04 600.0E-6 0.06 0.18 210.0E-6 0.02 0.50 75.0E-6 0.10 0.10 0.0E0 0.00 0.00
-
add_assay
(name, assay)¶ Add an assay to the material.
Parameters: - name – The name of the new assay.
- assay – A numpy array containing the size class mass fractions for the assay. The sequence of the assay’s elements must correspond to the sequence of the material’s size classes.
-
create_empty_assay
()¶ Create an empty array to store an assay. The array’s length will be equal to the number of size classes 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_size_class_index
(size_class)¶ Determine the index of the specified size class.
Parameters: size_class – The formula and phase of the specified size class, e.g. ‘Fe2O3[S1]’. Returns: The index of the specified size class.
-
class
auxi.modelling.process.materials.psd.
MaterialPackage
(material, size_class_masses)¶ A package of a material consisting of multiple particle size classes.
Properties defined here:
Parameters: - material – A reference to the Material to which self belongs.
- size_class_masses – [kg] [kg] The masses of the size classes in the package.
-
add_to
(other)¶ Add another psd material package to this material package.
Parameters: other – The other material package.
-
clear
()¶ Set all the size class 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 (size class, mass): The other tuple specifies the mass of a size class to be extracted. It is extracted from self and the extracted mass is returned as a new package.
- string: The ‘other’ string specifies the size class to be extracted. All of the mass of that size class 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_mass
()¶ Determine the mass of self.
returns: [kg] The mass of self.
-
get_size_class_mass
(size_class)¶ Determine the mass of the specified size class in self.
Parameters: size_class – The formula and phase of the size class, e.g. ‘Fe2O3[S1]’ Returns: [kg] The mass of the size class in self.
-
get_size_class_mass_fraction
(size_class)¶ Determine the mass fraction of the specified size class in self.
Parameters: size_class – The formula and phase of the size class, e.g. ‘Fe2O3[S1]’ Returns: The mass fraction of the size class in self.
psd slurry material module¶
This module provides material and material package classes that can do size distribution and slurry calculations.
-
class
auxi.modelling.process.materials.slurry.
Material
(name, file_path, description=None)¶ Represents a particulate material consisting of multiple particle size classes.
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.
- The second line contains the density of the solid material.
- The third line contains the water fraction of the slurry (wet basis).
- All subsequent lines contain a particle size, followed by mass fractions (dry basis).
- Particle sizes are indicated in [meter].
- The first column lists the particle sizes in the material. Each class must be interpreted as “mass fraction retained”. In other words if the size class is indicated as 307.2E-3, it means that it is the class of material retained on a 307.2mm screen, and can also be though of as +307.2mm material. The first size class represents the largest particles. The final size class should be zero, as it represents all material that passed through the smallest aperture screen.
- All subsequent columns describe assays of the material.
The following is an example of a material text file:
SizeClass DryFeedA DryMillCharge WetFeedA WetMillCharge Water solid_density 3.00 3.00 3.00 3.00 1.0. H2O 0.00 0.00 0.80 0.60 1.00 307.2E-3 0.20 0.02 0.20 0.02 0.00 108.6E-3 0.18 0.06 0.18 0.06 0.00 38.4E-3 0.17 0.04 0.17 0.04 0.00 13.6E-3 0.07 0.03 0.07 0.03 0.00 4.8E-3 0.13 0.03 0.13 0.03 0.00 1.7E-3 0.07 0.04 0.07 0.04 0.00 600.0E-6 0.06 0.18 0.06 0.18 0.00 210.0E-6 0.02 0.50 0.02 0.50 0.00 75.0E-6 0.10 0.09 0.10 0.09 0.00 0.0E0 0.00 0.00 0.00 0.00 0.00
-
add_assay
(name, solid_density, H2O_fraction, assay)¶ Add an assay to the material.
Parameters: - name – The name of the new assay.
- assay – A numpy array containing the size class mass fractions for the assay. The sequence of the assay’s elements must correspond to the sequence of the material’s size classes.
-
create_empty_assay
()¶ Create an empty array to store an assay. The array’s length will be equal to the number of size classes 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_size_class_index
(size_class)¶ Determine the index of the specified size class.
Parameters: size_class – The formula and phase of the specified size class, e.g. ‘Fe2O3[S1]’. Returns: The index of the specified size class.
-
class
auxi.modelling.process.materials.slurry.
MaterialPackage
(material, solid_density, H2O_mass, size_class_masses)¶ A package of a slurry material consisting of multiple particle size classes.
Parameters: - material – A reference to the Material to which self belongs.
- size_class_masses – [kg] [kg] The masses of the size classes in the package.
-
clear
()¶ Set all the size class masses and H20_mass in the package to zero and the solid_density to 1.0
-
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 (size class, mass): The other tuple specifies the mass of a size class to be extracted. It is extracted from self and the extracted mass is returned as a new package.
- string: The ‘other’ string specifies the size class to be extracted. All of the mass of that size class 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_density
()¶ Determine the density of self.
-
get_mass
()¶ Determine the mass of self.
Returns: [kg] The mass of self.
-
get_mass_fraction_solids
()¶ Determine the mass fraction of the solids of self.
-
get_size_class_mass
(size_class)¶ Determine the mass of the specified size class in self.
Parameters: size_class – The formula and phase of the size class, e.g. ‘Fe2O3[S1]’ Returns: [kg] The mass of the size class in self.
-
get_size_class_mass_fraction
(size_class)¶ Determine the mass fraction of the specified size class in self.
Parameters: size_class – The formula and phase of the size class, e.g. Fe2O3[S1] Returns: The mass fraction of the size class in self.
-
get_solid_mass
()¶ Determine the solid mass of self.
Returns: [kg] The solid mass of self.
-
get_volume
()¶ Determine the volume of self.
-
get_volume_fraction_solids
()¶ Determine the volume fraction of the solids of self.
thermochemistry material module¶
This module provides a material class that can do thermochemical calculations.
-
class
auxi.modelling.process.materials.thermo.
Material
(name, file_path, description=None)¶ Represents a material consisting of multiple chemical compounds, having the ability to do thermochemical calculations.
Parameters: - name – A name for the material.
- file_path – The location of the file containing the material’s data.
- description – the material’s description
The format of the text file is as follows:
- The items in a line are separated by one or more spaces or tabs.
- The first line is a heading line. It contains the word “Compound” followed by zero or more assay names.
- Subsequent lines contain a compound formula and phase, followed by a mass fraction for each assay.
- The list of compounds and mass fractions can be ended off with a “#” character. This indicates that custom material properties follow below in the lines below the hash.
- If a custom material property is defined, a value must be provided for each assay name. A price custom property is used as an example below.
The following is an example of a material text file:
Compound IlmeniteA IlmeniteB IlmeniteC Al2O3[S1] 0.01160 0.01550 0.00941 CaO[S] 0.00022 0.00001 0.00017 Cr2O3[S] 0.00008 0.00022 0.00011 Fe2O3[S1] 0.20200 0.47300 0.49674 Fe3O4[S1] 0.00000 0.00000 0.00000 FeO[S1] 0.27900 0.19100 0.00000 K2O[S] 0.00004 0.00001 0.00005 MgO[S] 0.01040 0.00580 0.01090 MnO[S] 0.00540 0.00480 0.00525 Na2O[S1] 0.00007 0.00005 0.00031 P4O10[S] 0.00001 0.00032 0.00015 SiO2[S1] 0.00850 0.00490 0.01744 TiO2[S1] 0.47700 0.29400 0.45949 V2O5[S] 0.00360 0.00800 0.00000 # Price[USD/kg] 1.2 1.3 1.1
-
add_assay
(name, assay)¶ Add an assay to the material.
Parameters: - name – Assay name.
- assay – Numpy array 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.
-
compound_count
= None¶ The number of chemical compounds in the material.
-
compounds
= None¶ The material’s list of chemical compounds.
-
converted_assays
= None¶ A dictionary containing converted assays for this material.
-
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: Empty assay array.
-
create_package
(assay=None, mass=0.0, P=1.0, T=25.0, normalise=True)¶ Create a MaterialPackage based on the specified parameters.
Parameters: - assay – Name of the assay to be used to create the package.
- mass – Package mass. [kg]
- P – Package pressure. [atm]
- T – Package temperature. [°C]
- normalise – Indicates whether the assay must be normalised before creating the package.
Returns: MaterialPackage object.
-
description
= None¶ The material’s description.
-
get_assay_total
(name)¶ Calculate the total/sum of the specified assay’s mass fractions.
Parameters: name – Assay name. Returns: Total mass fraction.
-
get_compound_index
(compound)¶ Determine the specified compound’s index.
Parameters: compound – Formula and phase of a compound, e.g. “Fe2O3[S1]”. Returns: Compound index.
-
name
= None¶ The material’s name.
-
raw_assays
= None¶ A dictionary containing raw assays for this material.
-
class
auxi.modelling.process.materials.thermo.
MaterialPackage
(material, compound_masses, P=1.0, T=25.0)¶ Represents a quantity of material consisting of multiple chemical compounds, having a specific mass, pressure, temperature and enthalpy.
Parameters: - material – A reference to the Material to which self belongs.
- compound_masses – Package compound masses. [kg]
- P – Package pressure. [atm]
- T – Package temperature. [°C]
-
H
¶ Get the enthalpy of the package.
Returns: Enthalpy. [kWh]
-
P
¶ Determine the pressure of the package.
Returns: Pressure. [atm]
-
T
¶ Get the temperature of of the package.
Returns: Temperature. [°C]
-
amount
¶ Determine the sum of mole amounts of all the compounds.
Returns: Amount. [kmol]
-
clear
()¶ Set all the compound masses in the package to zero. Set the pressure to 1, the temperature to 25 and the enthalpy to zero.
-
clone
()¶ Create a complete copy of the package.
Returns: A new MaterialPackage object.
-
extract
(other)¶ Extract ‘other’ from this package, modifying this package 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.
- Material: The ‘other’ material specifies the list of compounds to extract.
Returns: New MaterialPackage object.
-
get_assay
()¶ Determine the assay of the package.
Returns: Array of mass fractions.
-
get_compound_amount
(compound)¶ Determine the mole amount of the specified compound.
Returns: Amount. [kmol]
-
get_compound_amounts
()¶ Determine the mole amounts of all the compounds.
Returns: List of amounts. [kmol]
-
get_compound_mass
(compound)¶ Determine the mass of the specified compound in the package.
Parameters: compound – Formula and phase of a compound, e.g. “Fe2O3[S1]”. Returns: Mass. [kg]
-
get_element_mass
(element)¶ Determine the mass of the specified elements in the package.
Returns: Masses. [kg]
-
get_element_mass_dictionary
()¶ Determine the masses of elements in the package and return as a dictionary.
Returns: Dictionary of element symbols and masses. [kg]
-
get_element_masses
(elements=None)¶ Determine the masses of elements in the package.
Returns: Array of element masses. [kg]
-
mass
¶ Get the mass of the package.
Returns: [kg]