# Thermodynamic Properties (jl-function-n-species)= ::::{describe} n_species(g::Union{Solution, ThermoPhase}) Number of chemical species in the phase. ```julia n_species(mp::MultiPhase) ``` Total number of species across all phases. :::: (jl-function-n-elements)= ::::{describe} n_elements(g::Union{Solution, ThermoPhase}) Number of elements in the phase. ```julia n_elements(mp::MultiPhase) ``` Number of elements in the mixture. :::: (jl-function-species-name)= ::::{describe} species_name(g::Union{Solution, ThermoPhase}, k::Integer) Name of species `k` (1-based). :::: (jl-function-species-names)= ::::{describe} species_names(g::Union{Solution, ThermoPhase}) Vector of all species names. :::: (jl-function-species-index)= ::::{describe} species_index(gas, name) -> Int 1-based index of species `name`, or `0` if it is not present. :::: (jl-function-element-name)= ::::{describe} element_name(g::Union{Solution, ThermoPhase}, m::Integer) Name of element `m` (1-based). :::: (jl-function-element-names)= ::::{describe} element_names(g::Union{Solution, ThermoPhase}) Vector of all element names. :::: (jl-function-temperature)= ::::{describe} temperature(g::Union{Solution, ThermoPhase}) Temperature [K]. ```julia temperature(mp::MultiPhase) ``` Temperature [K]. ```julia temperature(sa::SolutionArray) ``` Temperatures [K] of all stored states. :::: (jl-function-pressure)= ::::{describe} pressure(g::Union{Solution, ThermoPhase}) Pressure [Pa]. ```julia pressure(mp::MultiPhase) ``` Pressure [Pa]. ```julia pressure(sa::SolutionArray) ``` Pressures [Pa] of all stored states. :::: (jl-function-density)= ::::{describe} density(g::Union{Solution, ThermoPhase}) Mass density [kg/m^3]. ```julia density(sa::SolutionArray) ``` Mass densities [kg/m^3] of all stored states. :::: (jl-function-molar-density)= ::::{describe} molar_density(g::Union{Solution, ThermoPhase}) Molar density [kmol/m^3]. :::: (jl-function-mean-molecular-weight)= ::::{describe} mean_molecular_weight(g::Union{Solution, ThermoPhase}) Mean molecular weight [kg/kmol]. :::: (jl-function-gibbs-mole)= ::::{describe} gibbs_mole(g::Union{Solution, ThermoPhase}) Molar Gibbs free energy [J/kmol]. :::: (jl-function-internal-energy-mass)= ::::{describe} internal_energy_mass(r::Reactor) Specific internal energy [J/kg]. :::: (jl-function-internal-energy-mole)= ::::{describe} internal_energy_mole(g::Union{Solution, ThermoPhase}) Molar internal energy [J/kmol]. :::: (jl-function-cv-mole)= ::::{describe} cv_mole(g::Union{Solution, ThermoPhase}) Molar heat capacity at constant volume [J/kmol/K]. :::: (jl-function-gibbs-mass)= ::::{describe} gibbs_mass(g::Union{Solution, ThermoPhase}) Specific Gibbs free energy [J/kg]. :::: (jl-function-cv-mass)= ::::{describe} cv_mass(g::Union{Solution, ThermoPhase}) Specific heat capacity at constant volume [J/kg/K]. :::: (jl-function-enthalpy-mass)= ::::{describe} enthalpy_mass(r::Reactor) Specific enthalpy [J/kg]. :::: (jl-function-enthalpy-mole)= ::::{describe} enthalpy_mole(g::Union{Solution, ThermoPhase}) Molar enthalpy [J/kmol]. :::: (jl-function-cp-mole)= ::::{describe} cp_mole(g::Union{Solution, ThermoPhase}) Molar heat capacity at constant pressure [J/kmol/K]. :::: (jl-function-cp-mass)= ::::{describe} cp_mass(g::Union{Solution, ThermoPhase}) Specific heat capacity at constant pressure [J/kg/K]. :::: (jl-function-entropy-mole)= ::::{describe} entropy_mole(g::Union{Solution, ThermoPhase}) Molar entropy [J/kmol/K]. :::: (jl-function-entropy-mass)= ::::{describe} entropy_mass(g::Union{Solution, ThermoPhase}) Specific entropy [J/kg/K]. :::: (jl-function-isothermal-compressibility)= ::::{describe} isothermal_compressibility(g::Union{Solution, ThermoPhase}) Isothermal compressibility [1/Pa]. :::: (jl-function-thermal-expansion-coeff)= ::::{describe} thermal_expansion_coeff(g::Union{Solution, ThermoPhase}) Thermal (volumetric) expansion coefficient [1/K]. :::: (jl-function-max-temp)= ::::{describe} max_temp(g::Union{Solution, ThermoPhase}) Maximum temperature [K] for which the phase's thermo data are valid. ```julia max_temp(mp::MultiPhase) ``` Maximum temperature [K] of the mixture's valid range. :::: (jl-function-min-temp)= ::::{describe} min_temp(g::Union{Solution, ThermoPhase}) Minimum temperature [K] for which the phase's thermo data are valid. ```julia min_temp(mp::MultiPhase) ``` Minimum temperature [K] of the mixture's valid range. :::: (jl-function-reference-pressure)= ::::{describe} reference_pressure(g::Union{Solution, ThermoPhase}) Reference pressure [Pa] used for standard-state thermo data. :::: (jl-function-electric-potential)= ::::{describe} electric_potential(g::Union{Solution, ThermoPhase}) Electric potential [V] of the phase. :::: (jl-function-set-electric-potential-bang)= ::::{describe} set_electric_potential!(g::Union{Solution, ThermoPhase}, v) Set the electric potential [V] of the phase. :::: (jl-function-sound-speed)= ::::{describe} sound_speed(g::Union{Solution, ThermoPhase}) Speed of sound `sqrt(cp/cv · p/ρ)` [m/s]. :::: (jl-function-volume-mass)= ::::{describe} volume_mass(g::Union{Solution, ThermoPhase}) Specific volume [m^3/kg]. :::: (jl-function-volume-mole)= ::::{describe} volume_mole(g::Union{Solution, ThermoPhase}) Molar volume [m^3/kmol]. :::: (jl-function-critical-temperature)= ::::{describe} critical_temperature(g::Union{Solution, ThermoPhase}) Critical temperature [K]. :::: (jl-function-critical-pressure)= ::::{describe} critical_pressure(g::Union{Solution, ThermoPhase}) Critical pressure [Pa]. :::: (jl-function-critical-density)= ::::{describe} critical_density(g::Union{Solution, ThermoPhase}) Critical density [kg/m^3]. :::: (jl-function-vapor-fraction)= ::::{describe} vapor_fraction(g::Union{Solution, ThermoPhase}) Vapor fraction (quality) of a two-phase state. :::: (jl-function-sat-temperature)= ::::{describe} sat_temperature(g::Union{Solution, ThermoPhase}, p) Saturation temperature [K] at pressure `p` [Pa]. :::: (jl-function-sat-pressure)= ::::{describe} sat_pressure(g::Union{Solution, ThermoPhase}, T) Saturation pressure [Pa] at temperature `T` [K]. :::: (jl-function-element-index)= ::::{describe} element_index(gas, name) -> Int 1-based index of element `name`, or `0` if it is not present. ```julia element_index(mp::MultiPhase, name) -> Int ``` 1-based global index of element `name`, or `0` if not present. :::: (jl-function-n-atoms)= ::::{describe} n_atoms(g::Union{Solution, ThermoPhase}, k::Integer, m::Integer) Number of atoms of element `m` (1-based) in species `k` (1-based). ```julia n_atoms(mp::MultiPhase, k, m) -> Float64 ``` Number of atoms of element `m` in global species `k` (both 1-based). :::: (jl-function-atomic-weights)= ::::{describe} atomic_weights(g::Union{Solution, ThermoPhase}) Atomic weights of all elements [kg/kmol]. :::: (jl-function-atomic-weight)= ::::{describe} atomic_weight(g::Union{Solution, ThermoPhase}, m::Integer) Atomic weight of element `m` (1-based) [kg/kmol]. :::: (jl-function-charges)= ::::{describe} charges(g::Union{Solution, ThermoPhase}) Species electric charges (per elementary charge). :::: (jl-function-elemental-mole-fraction)= ::::{describe} elemental_mole_fraction(gas, m) -> Float64 Mole fraction of element `m` (1-based) — moles of that element per mole of all elements in the mixture. :::: (jl-function-elemental-mass-fraction)= ::::{describe} elemental_mass_fraction(gas, m) -> Float64 Mass fraction of element `m` (1-based) in the mixture. :::: (jl-function-equivalence-ratio)= ::::{describe} equivalence_ratio(gas) -> Float64 Fuel/air equivalence ratio from the elemental composition (C, H, O, S), using complete-combustion available-oxygen accounting: `φ = (2·Z_C + Z_H/2 + 2·Z_S) / Z_O`. :::: (jl-function-set-equivalence-ratio-bang)= ::::{describe} set_equivalence_ratio!(gas, phi, fuel, oxidizer) Set the mixture composition to the given equivalence ratio `phi` for the given `fuel` and `oxidizer` compositions (name-value strings), holding T and p. :::: (jl-function-standard-gibbs-rt)= ::::{describe} standard_gibbs_RT(g::Union{Solution, ThermoPhase}) Nondimensional standard-state species Gibbs energies g°_k/RT. :::: (jl-function-standard-entropies-r)= ::::{describe} standard_entropies_R(g::Union{Solution, ThermoPhase}) Nondimensional standard-state species entropies s°_k/R. :::: (jl-function-standard-cp-r)= ::::{describe} standard_cp_R(g::Union{Solution, ThermoPhase}) Nondimensional standard-state species heat capacities cp°_k/R. :::: (jl-function-standard-enthalpies-rt)= ::::{describe} standard_enthalpies_RT(g::Union{Solution, ThermoPhase}) Nondimensional standard-state species enthalpies h°_k/RT. :::: (jl-function-standard-int-energies-rt)= ::::{describe} standard_int_energies_RT(g::Union{Solution, ThermoPhase}) Nondimensional standard-state species internal energies u°_k/RT. :::: (jl-function-molecular-weights)= ::::{describe} molecular_weights(g::Union{Solution, ThermoPhase}) Molecular weights of all species [kg/kmol]. :::: (jl-function-molecular-weights-bang)= ::::{describe} molecular_weights!(out, g::Union{Solution, ThermoPhase}) In-place [`molecular_weights`](#jl-function-molecular-weights). :::: (jl-function-mole-fractions)= ::::{describe} mole_fractions(g::Union{Solution, ThermoPhase}) Mole fractions of all species. ```julia mole_fractions(sa::SolutionArray) ``` Mole fractions of all stored states, `nSpecies x nStates`. :::: (jl-function-mole-fractions-bang)= ::::{describe} mole_fractions!(out, g::Union{Solution, ThermoPhase}) In-place [`mole_fractions`](#jl-function-mole-fractions). :::: (jl-function-mass-fractions)= ::::{describe} mass_fractions(g::Union{Solution, ThermoPhase}) Mass fractions of all species. ```julia mass_fractions(r::Reactor) ``` Mass fractions in the reactor. ```julia mass_fractions(sa::SolutionArray) ``` Mass fractions of all stored states, `nSpecies x nStates`. :::: (jl-function-mass-fractions-bang)= ::::{describe} mass_fractions!(out, g::Union{Solution, ThermoPhase}) In-place [`mass_fractions`](#jl-function-mass-fractions). :::: (jl-function-concentrations)= ::::{describe} concentrations(g::Union{Solution, ThermoPhase}) Species concentrations [kmol/m^3]. :::: (jl-function-partial-molar-int-energies)= ::::{describe} partial_molar_int_energies(g::Union{Solution, ThermoPhase}) Partial molar internal energies of the species [J/kmol]. :::: (jl-function-partial-molar-volumes)= ::::{describe} partial_molar_volumes(g::Union{Solution, ThermoPhase}) Partial molar volumes of the species [m^3/kmol]. :::: (jl-function-electrochemical-potentials)= ::::{describe} electrochemical_potentials(g::Union{Solution, ThermoPhase}) Electrochemical potentials of the species [J/kmol]. :::: (jl-function-partial-molar-cp)= ::::{describe} partial_molar_cp(g::Union{Solution, ThermoPhase}) Partial molar heat capacities at constant pressure [J/kmol/K]. :::: (jl-function-partial-molar-entropies)= ::::{describe} partial_molar_entropies(g::Union{Solution, ThermoPhase}) Partial molar entropies of the species [J/kmol/K]. :::: (jl-function-chemical-potentials)= ::::{describe} chemical_potentials(mp::MultiPhase) Chemical potentials of the species [J/kmol]. ```julia chemical_potentials(mp::MultiPhase) -> Vector{Float64} ``` Chemical potentials [J/kmol] of all global species. :::: (jl-function-partial-molar-enthalpies)= ::::{describe} partial_molar_enthalpies(g::Union{Solution, ThermoPhase}) Partial molar enthalpies of the species [J/kmol]. :::: (jl-function-chemical-potentials-bang)= ::::{describe} chemical_potentials!(out, g::Union{Solution, ThermoPhase}) In-place [`chemical_potentials`](#jl-function-chemical-potentials). :::: (jl-function-partial-molar-entropies-bang)= ::::{describe} partial_molar_entropies!(out, g::Union{Solution, ThermoPhase}) In-place [`partial_molar_entropies`](#jl-function-partial-molar-entropies). :::: (jl-function-partial-molar-enthalpies-bang)= ::::{describe} partial_molar_enthalpies!(out, g::Union{Solution, ThermoPhase}) In-place [`partial_molar_enthalpies`](#jl-function-partial-molar-enthalpies). :::: (jl-function-partial-molar-cp-bang)= ::::{describe} partial_molar_cp!(out, g::Union{Solution, ThermoPhase}) In-place [`partial_molar_cp`](#jl-function-partial-molar-cp). :::: (jl-function-set-mole-fractions-bang)= ::::{describe} set_mole_fractions!(gas, X) Set mole fractions from a numeric vector or a composition string (e.g. `"CH4:1, O2:2"`). The values are normalized by Cantera. :::: (jl-function-set-mass-fractions-bang)= ::::{describe} set_mass_fractions!(gas, Y) Set mass fractions from a numeric vector or a composition string. :::: (jl-function-set-tp-bang)= ::::{describe} set_TP!(g::Union{Solution, ThermoPhase}, T, P) Set temperature [K] and pressure [Pa]. :::: (jl-function-set-tpx-bang)= ::::{describe} set_TPX!(gas, T, p, X) Set temperature, pressure and mole fractions in one call. `X` may be a numeric vector or a composition string. :::: (jl-function-set-tpy-bang)= ::::{describe} set_TPY!(gas, T, p, Y) Set temperature, pressure and mass fractions in one call. `Y` may be a numeric vector or a composition string. :::: (jl-function-set-td-bang)= ::::{describe} set_TD!(g::Union{Solution, ThermoPhase}, T, rho) Set temperature `T` [K] and density `rho` [kg/m^3]. :::: (jl-function-set-dp-bang)= ::::{describe} set_DP!(g::Union{Solution, ThermoPhase}, rho, p) Set density `rho` [kg/m^3] and pressure `p` [Pa]. :::: (jl-function-set-uv-bang)= ::::{describe} set_UV!(g::Union{Solution, ThermoPhase}, u, v) Set specific internal energy `u` [J/kg] and specific volume `v` [m^3/kg]. :::: (jl-function-set-sp-bang)= ::::{describe} set_SP!(g::Union{Solution, ThermoPhase}, s, p) Set specific entropy `s` [J/kg/K] and pressure `p` [Pa]. :::: (jl-function-set-sv-bang)= ::::{describe} set_SV!(g::Union{Solution, ThermoPhase}, s, v) Set specific entropy `s` [J/kg/K] and specific volume `v` [m^3/kg]. :::: (jl-function-set-hp-bang)= ::::{describe} set_HP!(g::Union{Solution, ThermoPhase}, h, p) Set specific enthalpy `h` [J/kg] and pressure `p` [Pa]. :::: (jl-function-equilibrate-bang)= ::::{describe} equilibrate!(gas, XY; solver="auto", rtol=1e-9, max_steps=1000, ```julia max_iter=100, estimate_equil=0) ``` Set the phase to a state of chemical equilibrium holding the property pair `XY` (e.g. `"TP"`, `"HP"`, `"UV"`) fixed. ```julia equilibrate!(mp::MultiPhase, XY; solver="auto", rtol=1e-9, max_steps=1000, max_iter=200, estimate_equil=0) ``` Bring the mixture to chemical equilibrium holding the property pair `XY` (e.g. `"TP"`) fixed. :::: (jl-function-report)= ::::{describe} report(gas; show_thermo=true, threshold=1e-14) -> String Return Cantera's formatted state report for the phase. ::::