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
If you are dealing with a carbonatious material, nou must add the: following custom properties: * IsCoal: Set it equal to 1 for a carbonaceous material, and to 0
otherwise.- HHV[MJ/kg]: Set it equal to the higher heating value of the material with units of MJ/kg.
-
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.
-
create_stream
(assay=None, mfr=0.0, P=1.0, T=25.0, normalise=True)¶ Create a MaterialStream based on the specified parameters.
Parameters: - assay – Name of the assay to be used to create the stream.
- mfr – Stream mass flow rate. [kg/h]
- P – Stream pressure. [atm]
- T – Stream temperature. [°C]
- normalise – Indicates whether the assay must be normalised
before creating the Stream.
Returns: MaterialStream 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, isCoal=False, HHV=None)¶ 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 – [kg] package compound masses
- P – [atm] package pressure
- T – [°C] package temperature
- isCoal – a boolean that indicates whether the material is coal
- HHV – [MJ/kg] higher heating value of the coal
-
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]
-
class
auxi.modelling.process.materials.thermo.
MaterialStream
(material, compound_mfrs, P=1.0, T=25.0, isCoal=False, HHV=None)¶ Bases:
auxi.core.objects.Object
Represents a flow of material consisting of multiple chemical compounds, having a specific mass flow rate, pressure, temperature and enthalpy.
Parameters: - material – A reference to the Material to which the stream belongs.
- compound_mfrs – Compound mass flow rates. [kg/h]
- P – Stream pressure. [atm]
- T – Stream temperature. [°C]
- isCoal – a boolean that indicates whether the material is coal
- HHV – [MJ/kg] higher heating value of the coal
-
HHV
¶ Get the higher heating value of the stream.
Returns: MJ/kg coal, higher heating value
-
Hfr
¶ Get the enthalpy flow rate of the stream.
Returns: Enthalpy flow rate. [kWh/h]
-
P
¶ Determine the pressure of the stream.
Returns: Pressure. [atm]
-
T
¶ Get the temperature of the stream.
Returns: Temperature. [°C]
-
afr
¶ Determine the sum of amount flow rates of all the compounds.
Returns: Amount flow rate. [kmol/h]
-
clear
()¶ Set all the compound mass flow rates in the stream to zero. Set the pressure to 1, the temperature to 25 and the enthalpy to zero.
-
clone
()¶ Create a complete copy of the stream.
Returns: A new MaterialStream object.
-
extract
(other)¶ Extract ‘other’ from this stream, modifying this stream and returning the extracted material as a new stream.
Parameters: other – Can be one of the following:
- float: A mass flow rate equal to other is extracted from self. Self is reduced by other and the extracted stream is returned as a new stream.
- tuple (compound, mass): The other tuple specifies the mass flow rate of a compound to be extracted. It is extracted from self and the extracted mass flow rate is returned as a new stream.
- string: The ‘other’ string specifies the compound to be extracted. All of the mass flow rate of that compound will be removed from self and a new stream created with it.
- Material: The ‘other’ material specifies the list of compounds to extract.
Returns: New MaterialStream object.
-
get_assay
()¶ Determine the assay of the stream.
Returns: Array of mass fractions.
-
get_compound_afr
(compound)¶ Determine the amount flow rate of the specified compound.
Returns: Amount flow rate. [kmol/h]
-
get_compound_afrs
()¶ Determine the amount flow rates of all the compounds.
Returns: List of amount flow rates. [kmol/h]
-
get_compound_mfr
(compound)¶ Determine the mass flow rate of the specified compound in the stream.
Parameters: compound – Formula and phase of a compound, e.g. “Fe2O3[S1]”. Returns: Mass flow rate. [kg/h]
-
get_element_mfr
(element)¶ Determine the mass flow rate of the specified elements in the stream.
Returns: Mass flow rates. [kg/h]
-
get_element_mfr_dictionary
()¶ Determine the mass flow rates of elements in the stream and return as a dictionary.
Returns: Dictionary of element symbols and mass flow rates. [kg/h]
-
get_element_mfrs
(elements=None)¶ Determine the mass flow rates of elements in the stream.
Returns: Array of element mass flow rates. [kg/h]
-
mfr
¶ Get the mass flow rate of the stream.
Returns: Mass flow rate. [kg/h]