Multiphase Mixtures#
- MultiPhase()
MultiPhase(phases::AbstractVector{<:Pair{Solution,<:Real}})
A mixture of one or more phases. Construct empty and add phases with
add_phase!followed byinit!, or pass a vector ofsolution => molespairs to add and initialize in one step.gas = Solution("gri30.yaml") mix = MultiPhase([gas => 1.0]) set_temperature!(mix, 1200.0); set_pressure!(mix, one_atm) equilibrate!(mix, "TP")
- add_phase!(mp::MultiPhase, solution::Solution, moles::Real)
Add
solutionto the mixture with the given number ofmoles. Callinit!after all phases have been added.
- init!(mp::MultiPhase)
Finalize the mixture after all phases have been added. Required before any property or equilibrium calculation.
- update_phases!(mp::MultiPhase)
Synchronize the constituent phase objects with the mixture’s current state.
- n_phases(mp::MultiPhase)
Number of phases in the mixture.
- set_temperature!(mp::MultiPhase, T::Real)
Set the mixture temperature [K].
- set_pressure!(mp::MultiPhase, P::Real)
Set the mixture pressure [Pa].
- charge(mp::MultiPhase)
Total electric charge [C/mol] of the mixture.
- enthalpy(mp::MultiPhase)
Total enthalpy [J].
- entropy(mp::MultiPhase)
Total entropy [J/K].
- gibbs(mp::MultiPhase)
Total Gibbs free energy [J].
- volume(mp::MultiPhase)
Total volume [m^3].
- phase_moles(mp::MultiPhase, n::Integer)
Number of moles in phase
n(1-based).
- set_phase_moles!(mp::MultiPhase, n::Integer, moles::Real)
Set the number of moles in phase
n(1-based).
- species_moles(mp::MultiPhase, k::Integer)
Moles of global species
k(1-based).
- element_moles(mp::MultiPhase, m::Integer)
Moles of element
m(1-based).
- mole_fraction(mp::MultiPhase, k::Integer)
Mole fraction of global species
k(1-based).
- set_moles!(mp::MultiPhase, moles)
Set the moles of all global species from a numeric vector, or from a composition string (e.g.
"CH4:1, O2:2").