Common classes#
Here we can find the documentation for the common functions and classes implemented in the Combustion Toolbox (CT).
Constants#
- class Constants#
Bases:
handle
Class with constants data
- R0#
Universal gas constant [J/(K mol)]
- Type:
float
- G#
Standard gravity [m/s2]
- Type:
float
- NA#
Avogadro’s number [molecule/mol]
- Type:
float
- release#
Release of the Combustion Toolbox
- Type:
char
- date#
Date of the release
- Type:
char
Examples
R0 = Constants.R0
g = Constants.G
release = Constants.release
- G = '9.80665'
Standard gravity [m/s2]
- NA = '6.0221415e23'
Avogadro’s number [molecule/mol]
- R0 = '8.31446261815324'
Universal gas constant [J/(K mol)]
- date = "'03 Sep 2024'"
Release date
- release = "'v1.1.0'"
Release version
Units#
- class Units#
Bases:
handle
Class with conversion factors between different units
- Pa2atm = '101325^-1'#
Conversion factor from Pa to atm
- Pa2bar = '1e-5'#
Conversion factor from Pa to bar
- atm2Pa = '101325'#
Conversion factor from atm to Pa
- atm2bar = '1.01325'#
Pressure
- bar2Pa = '1e5'#
Conversion factor from bar to Pa
- bar2atm = '1.01325^-1'#
Conversion factor from bar to atm
- static convert(value_in, unit_in, unit_out)#
Convert a value from one unit to another
- Parameters:
value_in (
double
) – Value to convertunit_in (
char
) – Unit of the input valueunit_out (
char
) – Unit of the output value
- Returns:
value_out – Value converted to the output unit
Example
Units.convert(1, ‘atm’, ‘bar’)
- static convertWeightPercentage2moles(listSpecies, weightPercentage, database)#
Convert weight percentage (wt%) to moles
- Parameters:
listSpecies (
cell
) – List of speciesweightPercentage (
float
) – Weight percentage of the species [%]database (
Database
) – Database with custom thermodynamic polynomials functions generated from NASAs 9 polynomials fits
- Returns:
moles (float) – Number of moles [mol]
Example
moles = Units.WeightPercentage2moles({‘H2O’, ‘CO2’}, [50, 50], database)