Users
Elements
AuChimiste.has_element
— Functionhas_element(e::Union{String, Symbol})
Check if element exists in list of atomic symbols.
AuChimiste.list_elements
— Functionlist_elements()
Provides access to the list of atomic symbols.
AuChimiste.reset_elements_table
— Functionreset_elements_table()
Remove any user-defined element.
AuChimiste.add_element
— Functionadd_element(
symbol::String,
name::String,
number::Int64,
mass::Float64;
verbose = true
)
Create chemical element name
with associated symbol
and atomic number
. The value of atomic mass
is given in grams per mole.
AuChimiste.add_isotope
— Functionadd_isotope(
symbol::String,
mass::Float64;
name = nothing,
verbose = true
)
Create isotope of element symbol
with provided mass
in grams per mole. If isothope is known by a specific name
then use it instead of a name-mass naming scheme.
AuChimiste.atomic_mass
— Functionatomic_mass(e::AtomicData)
atomic_mass(e::Union{String,Symbol})
Atomic mass of element [g/mol].
AuChimiste.atomic_number
— Functionatomic_number(e::AtomicData)
atomic_number(e::Union{String,Symbol})
Atomic number of element.
AuChimiste.element_name
— Functionelement_name(e::AtomicData)
element_name(e::Union{String,Symbol})
Element name from atomic symbol.
AuChimiste.element
— Functionelement(e::Int64)
element(e::Union{String,Symbol})
Element data from symbol or number.
AuChimiste.AtomicData
— TypeRepresents a chemical element.
Fields
symbol::String
: Element symbol in periodic table.name::String
: Element name in periodic table.number::Int64
: Element number in atomic units.mass::Float64
: Element atomic mass [kg/kmol].
Components
AuChimiste.ChemicalComponent
— TypeRepresents a chemical component.
Fields
elements::Vector{Symbol}
: Array of component symbols.coefficients::Vector{Float64}
: Array of stoichiometric coefficients.mole_fractions::Vector{Float64}
: Array of elemental mole fractions.mass_fractions::Vector{Float64}
: Array of elemental mass fractions.molar_mass::Float64
: Molar mass of corresponding stoichiometry.charge::Number
: Global charge of component.
Notes
This structure is not intended to be called as a constructor, safe use of its features require using
component
construction in combination with a composition specification.The array of elements is unsorted when construction is performed through
component
but may get rearranged when composing new chemical components through supported algebra.Care must be taken when using
molar_mass
because it is given for the associated coefficients. That is always the expected behavior for molecular components but might not be the case in other applications (solids, solutions) when the mean molecular mass may be required.
AuChimiste.ComponentQuantity
— TypeRepresents a quantity of component.
Fields
mass::Float64
: Mass of component in arbitrary units.composition::AuChimiste.ChemicalComponent
: Elemental composition of component.
AuChimiste.component
— Functioncomponent(spec; kw...)
component(c::Composition{Stoichiometry}, charge)
component(c::Composition{MoleProportion}, charge)
component(c::Composition{MassProportion}, charge)
component(c::Dict, charge)
Compile component from given composition specification. This function is a wrapper eliminating the need of calling stoichiometry
, mole_proportions
or mass_proportions
directly. The value of spec
must be the symbol representing one of their names.
Note: the overload supporting a dictionary input is intended only for parsing database species data; its direct use is discouraged.
AuChimiste.stoichiometry
— Functionstoichiometry(; kw...)
Create composition based on elemental stoichiometry.
AuChimiste.mole_proportions
— Functionmole_proportions(; scale = nothing, kw...)
Create composition based on relative molar proportions. The main different w.r.t. stoichiometry
is the presence of a scaling factor to correct stoichiometry representation of the given composition.
AuChimiste.mass_proportions
— Functionmass_proportions(; scale = nothing, kw...)
Create composition based on relative molar proportions. This is essentially the same thing as mole_proportions
but in this case the element keywords are interpreted as being the mass proportions ofa associated elements.
AuChimiste.stoichiometry_map
— Functionstoichiometry_map(c::ChemicalComponent)
Returns component map of elemental stoichiometry.
AuChimiste.mole_fractions_map
— Functionmole_fractions_map(c::ChemicalComponent)
Returns component map of elemental mole fractions.
AuChimiste.mass_fractions_map
— Functionmass_fractions_map(c::ChemicalComponent)
Returns component map of elemental mass fractions.
AuChimiste.quantity
— Functionquantity(c::ChemicalComponent, mass::Float64)
quantity(spec::Symbol, mass::Float64; kw...)
Creates a quantity of chemical component. It may be explicit, i.e. by providing directly a ChemicalComponent
, or implicit, that means, by creating a component directly from its chemical composition and specification method (wrapping component
).
The following are not exported but is worth the end-user to known them:
AuChimiste.CompositionTypes
— TypeProvides specification of allowed chemical composition types, which are used to declare compositions in terms of one of the following specification methods:
Stoichiometry
: stoichiometric coefficientsMoleProportion
: molar proportions of elementsMassProportion
: mass proportions of elements
AuChimiste.Composition
— TypeCreates a typed composition specification for later construction of chemical component with component
. Generally the end-user is not expected to use this structure directly, wrappers being provided by the available composition types through functions stoichiometry
, mole_proportions
, and mass_proportions
.
Fields
data::NamedTuple
: Tuple of elements and their amounts.scale::Pair{Symbol, <:Number}
: Scaler element and coefficient for construction of component.
Interfaces
The following interfaces are provided as a centralization of names for the package. Generally these functions will take an object with the type for which they implement the quantity associated with their name, and other relevant parameters, such as temperature, pressure, and/or an array of mass fractions. In all cases values are expected to be returned in SI units, as documented by each function.
AuChimiste.molar_mass
— Functionmolar_mass(args...; kwargs...)
Evaluation of the molar mass of a substance. Its return value must be in $kg\cdotp{}mol^{-3}$.
AuChimiste.density
— Functiondensity(args...; kwargs...)
Evaluation of the density of a substance. Its return value must be in $kg\cdotp{}m^{-3}$.
AuChimiste.specific_heat
— Functionspecific_heat(args...; kwargs...)
Evaluation of the specific heat of a substance. Its return value must be in $J\cdotp{}kg^{-1}\cdotp{}K^{-1}$.
AuChimiste.enthalpy
— Functionenthalpy(args...; kwargs...)
Evaluation of the enthalpy of a substance. Its return value must be in $J\cdotp{}kg^{-1}$.
AuChimiste.entropy
— Functionentropy(args...; kwargs...)
Evaluation of the entropy of a substance. Its return value must be in $J\cdotp{}K^{-1}$.
AuChimiste.thermal_conductivity
— Functionthermal_conductivity(args...; kwargs...)
Evaluation of the thermal conductivity of a substance. Its return value must be in $W\cdotp{}m^{-1}\cdotp{}K^{-1}$.
AuChimiste.viscosity
— Functionviscosity(args...; kwargs...)
Evaluation of the viscosity of a substance. Its return value must be in $Pa\cdotp{}s$.
Reactors
Combustion
Physical Chemistry
AuChimiste.mean_molecular_mass_y
— Functionmean_molecular_mass_y(Y, W)
Mean molecular mass computed from mass fractions.
AuChimiste.mean_molecular_mass_x
— Functionmean_molecular_mass_x(X, W)
Mean molecular mass computed from mole fractions.
AuChimiste.mean_molecular_mass
— Functionmean_molecular_mass(U, W; basis)
Compute mean molecular mass based on given composition data.
AuChimiste.get_mole_fractions
— Functionget_mole_fractions(Y, W)
get_mole_fractions(Y, W, M)
Get mole fractions from mass fractions.
AuChimiste.get_mass_fractions
— Functionget_mass_fractions(X, W)
get_mass_fractions(X, W, M)
Get mass fractions from mole fractions.
Thermodynamics
AuChimiste.ThermoData
— TypeGeneric storage of thermodynamic data with arbitrary sizes. This structure is not associated to any specific thermodynamic model/representation.
AuChimiste.NASAThermo
— TypeStores data for NASA-K
parametrization with N
temperature ranges.
AuChimiste.ShomateThermo
— TypeStores data for Shomate parametrization with N
temperature ranges. Model equations are based in the ideas of Shomate [9].
Note: Shomate data provided in literature is often found in JANAF tables which report values on a per mole basis.
AuChimiste.MaierKelleyThermo
— TypeStores data for Maier-Kelley parametrization with N
temperature ranges. Model equations are based in the ideas of Maier and Kelley [10].
Note: Maier-Kelley data provided in literature is often provided in calorie per mole units; convert to joules before providing it here!
Hardcoded
AuChimiste.MujumdarFlueProperties
— TypeProvides properties for flue gases as proposed by [5] for the simulation of rotary kilns. These properties are provided for benchmarking against reference model only and are not recommended to be used in simulations as they are known not to be very accurate and do not account for composition dependency. This type implements the traits of specific_heat
, thermal_conductivity
, and viscosity
.
Thermal conductivity is extracted from [11]. The other properties are tracked back to [12]. Although the later also provides a model for thermal conductivity, it is not used by the authors of [5], probably due to its linear dependency on the temperature.
AuChimiste.specific_heat
— Methodspecific_heat(::MujumdarFlueProperties, T)
Provides specific heat capacity for flue gases [5].
AuChimiste.thermal_conductivity
— Methodthermal_conductivity(::MujumdarFlueProperties, T)
Provides thermal conductivity for flue gases [5].
AuChimiste.viscosity
— Methodviscosity(::MujumdarFlueProperties, T)
Provides dynamic viscosity for flue gases [5].
AuChimiste.LawnHfoProperties
— TypeProvides properties for heavy fuel-oil as proposed by [2]. This type implements the traits of specific_heat
.
AuChimiste.specific_heat
— Methodspecific_heat(::LawnHfoProperties, T, S)
Heavy fuel-oil specific heat estimation in terms of relative density $S$ as provided by Cragoe (1929). Temperature supplied in kelvin.
AuChimiste.enthalpy_net_bs2869
— Functionenthalpy_net_bs2869(; rho, pct_water, pct_ash, pct_sulphur)
enthalpy_net_bs2869(rho, x, y, s)
Heavy fuel-oil net energy capacity accordinto to BS2869:1983. Value is computed in [MJ/kg].
For the key-word interface (recommended) parameters are given as:
rho
: HFO density at 15 °C, [kg/m³].pct_water
: Mass percentage of water, [%].pct_ash
: Mass percentage of ashes, [%].pct_sulphur
: Mass percentage of sulphur, [%].
For the positional interface (internal) parameters are given as:
rho
: HFO density at 15 °C, [kg/L].x
: Mass fraction of water.y
: Mass fraction of ashes.s
: Mass fraction of sulphur.
Database parsing
Constants
AuChimiste.ELECTRON_MASS
— ConstantElectron Mass $m_e$ [9.109382915e-31 kg]
AuChimiste.AVOGADRO
— ConstantAvogadro's Number $N_\mathrm{A}$ [6.02214076e26 number/kmol]
AuChimiste.GAS_CONSTANT
— ConstantIdeal gas constant $R$ [8.31446261815324 J/(mol.K)].
AuChimiste.STEFAN_BOLTZMANN
— ConstantStefan-Boltzmann constant $\sigma$ [5.670374419e-8 W/(m².K⁴)].
AuChimiste.P_NORMAL
— ConstantReference atmospheric pressure [101325.0 Pa].
AuChimiste.T_NORMAL
— ConstantNormal atmospheric temperature [273.15 K].
AuChimiste.C_NORMAL
— ConstantNormal atmospheric concentration [44.61503340547032 mol/m³].
AuChimiste.T_STANDARD
— ConstantStandard atmospheric temperature [298.15 K].
AuChimiste.JOULE_PER_CALORIE
— ConstantConversion factor from calories to joules [4.184 J/cal].
Exception types
Exception types are not exported as they are not intended for other purposes than handling errors inside AuChimiste
. The documentation below is provided so that the end-user can better understand their occurrence for debugging their own code or reporting bugs:
AuChimiste.NoSuchElementError
— TypeElement (or isotope) was not found in user database.
AuChimiste.NoIsotopeProvidedError
— TypeUnstable elements do not provide atomic mass.
AuChimiste.EmptyCompositionError
— TypeA composition set is missing for the given component.
AuChimiste.InvalidScalerError
— TypeThe provided scaler targets an unspecified element.