auxi.modelling.process.materials.thermo module¶
This module provides a material class that can do thermochemical calculations.
-
class
auxi.modelling.process.materials.thermo.
Material
(name, file_path, description=None)¶ Bases:
auxi.core.objects.NamedObject
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)¶ Bases:
auxi.core.objects.Object
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]