Contents

Index

Bubble/Dew Points

Clapeyron.bubble_pressure — Function
bubble_pressure(model::EoSModel, T, x, method = ChemPotBubblePressure())

Calculates the bubble pressure and properties at a given temperature T. Returns a tuple, containing:

  • Bubble Pressure [Pa]
  • Liquid molar volume at Bubble Point [m³·mol⁻¹]
  • Vapour molar volume at Bubble Point [m³·mol⁻¹]
  • Vapour composition at Bubble Point

By default, uses equality of chemical potentials, via ChemPotBubblePressure

source
Clapeyron.bubble_temperature — Function
bubble_temperature(model::EoSModel, p, x,method::ThermodynamicMethod = ChemPotBubbleTemperature())

Calculates the bubble temperature and properties at a given pressure p. Returns a tuple, containing:

  • Bubble Temperature [K]
  • Liquid volume at Bubble Point [m³]
  • Vapour volume at Bubble Point [m³]
  • Vapour composition at Bubble Point

By default, uses equality of chemical potentials, via ChemPotBubbleTemperature

source
Clapeyron.dew_pressure — Function
dew_pressure(model::EoSModel, T, y; kwargs...)
dew_pressure(model::EoSModel, T, y, method = ChemPotDewPressure())

Calculates the dew pressure and properties at a given temperature T. The default method uses equality of chemical potentials. See ChemPotDewPressure

Inputs:

  • T, Temperature [K]
  • y, overall composition (vapour-side)

Keywords:

  • Packed-state path:
    • v0: packed initial state vector [T0, log10(vL0), log10(vV0), x0...] v0 can be constructed via Clapeyron.x0_dew_temperature(model, T, y, T0). Note: to trigger this path, v0 must be the only keyword.
  • Keyword-forwarding path:
    • p0: initial pressure guess [Pa]
    • Additional keywords are forwarded to the selected dew-point method. See ChemPotDewTemperature for supported keywords.

Returns a Tuple, containing:

  • Dew Pressure [Pa]
  • Liquid molar volume at Dew Point [m³·mol⁻¹]
  • Vapour molar volume at Dew Point [m³·mol⁻¹]
  • Liquid molar composition at Dew Point
source
Clapeyron.dew_temperature — Function
dew_temperature(model::EoSModel, p, y; kwargs...)
dew_temperature(model::EoSModel, p, y, method = ChemPotDewTemperature())
dew_temperature(model::EoSModel, p, y, T0::Number)

Calculates the dew-point temperature and properties at a given pressure p. The default method uses equality of chemical potentials. See ChemPotDewTemperature

Inputs:

  • p, Pressure [Pa]
  • y, overall composition (vapour-side)

Keywords:

  • Packed-state path:
    • v0: packed initial state vector [T0, log10(vL0), log10(vV0), x0...] v0 can be constructed via Clapeyron.x0_dew_temperature(model, T, y, T0). Note: to trigger this path, v0 must be the only keyword.
  • Keyword-forwarding path:
    • T0: initial temperature guess [K]
    • Additional keywords are forwarded to the selected dew-point method. See ChemPotDewTemperature for supported keywords.

Returns a Tuple, containing:

  • Dew Temperature [K]
  • Liquid molar volume at Dew Point [m³·mol⁻¹]
  • Vapour molar volume at Dew Point [m³·mol⁻¹]
  • Liquid molar composition at Dew Point
source
Clapeyron.gibbs_solvation — Function
gibbs_solvation(model::EoSModel, T; threaded=true, vol0=(nothing,nothing))

Calculates the solvation Gibbs energy as:

g_solv = -R̄*T*log(K)

Where the first component is the solvent and second is the solute.

source

Azeotropes, LLE and VLLE equilibria

Clapeyron.azeotrope_pressure — Function
azeotrope_pressure(model::EoSModel, T; v0 = x0_azeotrope_pressure(model,T))

Calculates the azeotrope pressure and properties at a given temperature T. Returns a tuple, containing:

  • Azeotrope Pressure [Pa]
  • Liquid volume at Azeotrope Point [m³]
  • Vapour volume at Azeotrope Point [m³]
  • Azeotrope composition
source
Clapeyron.azeotrope_temperature — Function
azeotrope_temperature(model::EoSModel, T; v0 = x0_bubble_pressure(model,T,[0.5,0.5]))

Calculates the azeotrope temperature and properties at a given pressure p. Returns a tuple, containing:

  • Azeotrope Temperature [K]
  • Liquid volume at Azeotrope Point [m³]
  • Vapour volume at Azeotrope Point [m³]
  • Azeotrope composition
source
Clapeyron.LLE_pressure — Function
LLE_pressure(model::EoSModel, T, x; v0 = x0_LLE_pressure(model,T,x))

Calculates the Liquid-Liquid equilibrium pressure and properties at a given temperature T.

Returns a tuple, containing:

  • LLE Pressure [Pa]
  • Liquid molar volume of composition x₁ = x at LLE Point [m³·mol⁻¹]
  • Liquid molar volume of composition x₂ at LLE Point [m³·mol⁻¹]
  • Liquid composition x₂
source
Clapeyron.LLE_temperature — Function
LLE_temperature(model::EoSModel, p, x; T0 = x0_LLE_temperature(model,p,x))

Calculates the Liquid-Liquid equilibrium temperature and properties at a given pressure p.

Returns a tuple, containing:

  • LLE Pressure [Pa]
  • Liquid molar volume of composition x₁ = x at LLE Point [m³·mol⁻¹]
  • Liquid molar volume of composition x₂ at LLE Point [m³·mol⁻¹]
  • Liquid composition x₂
source
Clapeyron.LLE — Function
LLE(model::ActivityModel, T; v0=nothing)

Calculates the Liquid-Liquid equilibrium compositions at a given temperature T in [K].

Returns a tuple, containing:

  • Liquid composition x₁
  • Liquid composition x₂

v0 is a vector containing vcat(x1[1:nc-1],x2[1:nc-1]).

source
Clapeyron.VLLE_pressure — Function
VLLE_pressure(model::EoSModel, T; v0 = x0_LLE_pressure(model,T))

Calculates the Vapor-Liquid-Liquid equilibrium pressure and properties of a binary mixture at a given temperature T.

Returns a tuple, containing:

  • VLLE Pressure [Pa]
  • Liquid volume of composition x₁ at VLLE Point [m³]
  • Liquid volume of composition x₂ at VLLE Point [m³]
  • Vapour volume of composition y at VLLE Point [m³]
  • Liquid composition x₁
  • Liquid composition x₂
  • Vapour composition y
source
Clapeyron.VLLE_temperature — Function
VLLE_temperature(model::EoSModel, p; T0 = x0_LLE_temperature(model,p))

Calculates the Vapor-Liquid-Liquid equilibrium temperature and properties of a binary mixture at a given pressure p.

Returns a tuple, containing:

  • VLLE temperature [K]
  • Liquid volume of composition x₁ at VLLE Point [m³]
  • Liquid volume of composition x₂ at VLLE Point [m³]
  • Vapour volume of composition y at VLLE Point [m³]
  • Liquid composition x₁
  • Liquid composition x₂
  • Vapour composition y
source

Critical points, spinodals and stability limits

Clapeyron.crit_mix — Function
crit_mix(model::EoSModel,z;v0=x=x0_crit_mix(model,z))

Returns the critical mixture point at a given composition.

Returns a tuple, containing:

  • Critical Mixture Temperature [K]
  • Critical Mixture Pressure [Pa]
  • Critical Mixture Volume [m³]
source
Clapeyron.mechanical_critical_point — Function
mechanical_critical_point(model,z = SA[1.0],x0 = x0_crit_pure(model,z))

Returns the mechanical critical point of an EoSModel. The mechanical critical point is the point where the first and second derivatives of the pressure function vanish. For single component models, the function is equivalent to crit_pure. Returns a tuple, containing:

  • Mechanical critical temperature [K]
  • Mechanical critical pressure [Pa]
  • Mechanical critical molar volume [m³·mol⁻¹]
source
Clapeyron.spinodal_pressure — Function
spinodal_pressure(model::EoSModel, T, z; v0, phase)

Calculates the spinodal pressure p and V volume for a given temperature T and composition z. Returns a tuple, containing:

  • Spinodal pressure [Pa]
  • Spinodal volume [m³]

Calculates either the liquid or the vapor spinodal point depending on the given starting volume v0 or the phase. The keyword phase is ignored if v0 is given.

source
Clapeyron.spinodal_temperature — Function
spinodal_temperature(model::EoSModel, p, z; T0, v0, phase)

Calculates the spinodal temperature T and volume V for a given pressure p and composition z. Returns a tuple, containing:

  • Spinodal temperature [K]
  • Spinodal volume [m³]

Calculates either the liquid or the vapor spinodal point depending on the given starting temperature T0 and volume v0 or the phase. The keyword phase is ignored if T0 or v0 is given.

source
Clapeyron.spinodal_maximum — Function
spinodal_maximum(model::EoSModel,z;v0=x=x0_crit_mix(model,z))

Returns the maximum temperature/pressure at which there is a mixture spinodal point.

Returns a tuple, containing:

  • Spinodal maximum Temperature [K]
  • Spinodal maximum Pressure [Pa]
  • Volume at spinodal maximum [m³]
source
Clapeyron.edge_pressure — Function
edge_pressure(model,T,z,v0 = nothing)

Calculates the pressure at which two fluid phases have the same Gibbs energy and pressure at the specified temperature T.

Returns a tuple, containing:

  • Edge Pressure [Pa]
  • Liquid volume of edge Point [m³]
  • Vapour volume at edge Point [m³]
source
Clapeyron.edge_temperature — Function
edge_temperature(model,p,z,v0 = nothing)

Calculates the temperature at which two fluid phases have the same Gibbs energy and temperature at the specified pressure p.

Returns a tuple, containing:

  • Edge Temperature [K]
  • Liquid volume of edge Point [m³]
  • Vapour volume at edge Point [m³]
source
Clapeyron.UCEP_mix — Function
UCEP_mix(model::EoSModel;v0=x0_UCEP_mix(model))

Calculates the Upper Critical End Point of a binary mixture.

returns:

  • UCEP Temperature [K]
  • UCEP Pressure [Pa]
  • Liquid volume at UCEP Point [m³]
  • Vapour volume at UCEP Point [m³]
  • Liquid molar composition at UCEP Point
  • Vapour molar composition at UCEP Point
source
Clapeyron.UCST_pressure — Function
UCST_pressure(model::EoSModel,T;v0=x0_UCST_pressure(model,T))
UCST_mix(model::EoSModel,T;v0=x0_UCST_pressure(model,T))

Calculates the Upper critical solution point of a mixture at a given temperature T.

returns:

  • UCST Pressure [Pa]
  • Volume at UCST Point [m³]
  • Molar composition at UCST Point
source
Clapeyron.UCST_temperature — Function
UCST_temperature(model::EoSModel,p,x;v0 = nothing)

Calculates the Upper critical solution point of a mixture at a given pressure p.

inputs:

  • model: EoS model
  • p: pressure [Pa]
  • v0 (optional): an initial guess, consisting of a tuple of initial temperature, volume and composition.

returns:

  • UCST Temperature [K]
  • volume at UCST Point [m³]
  • molar composition at UCST Point
source
Clapeyron.UCST_mix — Function
UCST_pressure(model::EoSModel,T;v0=x0_UCST_pressure(model,T))
UCST_mix(model::EoSModel,T;v0=x0_UCST_pressure(model,T))

Calculates the Upper critical solution point of a mixture at a given temperature T.

returns:

  • UCST Pressure [Pa]
  • Volume at UCST Point [m³]
  • Molar composition at UCST Point
source
Clapeyron.krichevskii_parameter — Function

krichevskii_parameter(model::EoSModel, T, crit = nothing)

Calculates the Krichevskii parameter, defined as:

∂p/∂x₂ |T → Tc₁,V → Vc₁, x₂ → 0

where the first component is the solvent and second is the solute.

source

SLE Equilibria

Clapeyron.sle_solubility — Function
sle_solubility(model::CompositeModel, p, T, z; solute)

Calculates the solubility of each component within a solution of the other components, at a given temperature T, pressure p and composition z. Returns a matrix containing the composition of the SLE phase boundary for each component. If solute is specified, returns only the solubility of the specified component.

Can only function when solid and fluid models are specified within a CompositeModel.

source
sle_solubility(model::CompositeModel, p, T, z; solute)

Calculates the solubility of each component within a solution of the other components, at a given temperature T and composition z. Returns a matrix containing the composition of the SLE phase boundary for each component. If solute is specified, returns only the solubility of the specified component.

Can only function when solid and fluid models are specified within a CompositeModel.

source
Clapeyron.sle_solubility_T — Function
sle_solubility_T(model::CompositeModel, z, p=1e5; solute=nothing, x0=nothing)

Calculates the solid-liquid coexistence temperature at composition z. Returns the temperature of the most stable solid complex.

Can only function when solid and fluid models are specified within a CompositeModel.

source
Clapeyron.slle_solubility — Function
slle_solubility(model::CompositeModel, p, T)

Calculates the phase boundary for solid-liquid-liquid equilibrium of a ternary mixture, at a given temperature T and pressure p. Returns a matrix containing the composition of the two liquids phases.

Can only function when solid and liquid models are specified within a CompositeModel and when the third component is the solute.

source
Clapeyron.eutectic_point — Function
eutectic_point(model::CompositeModel, p = 1e5; x0 = x0_eutectic_point(model,p))
eutectic_point(model::SolidHFus, p = 1e5; x0 = x0_eutectic_point(model,p))

Calculates the eutectic point of a binary mixture at a given pressure p.

Arguments

  • model: A CompositeModel (with solid and liquid models specified) or a SolidHFusModel
  • p: Pressure in [Pa] (default: 1e5)
  • x0: Initial guess as a vector or tuple [T, x₁] containing the temperature ([K]) and mole fraction of the first component (default: x0_eutectic_point(model, p))

Returns

A tuple (T_eutectic, x_eutectic) containing:

  • Eutectic temperature in [K]
  • Liquid composition at the eutectic point as a vector [x₁, x₂]
source

Bubble/Dew methods

Clapeyron.ChemPotBubblePressure — Type
ChemPotBubblePressure(kwargs...)

Function to compute bubble_pressure via chemical potentials. It directly solves the equality of chemical potentials system of equations.

Inputs:

  • y0 = nothing: optional, initial guess for the vapor phase composition
  • p0 = nothing: optional, initial guess for the bubble pressure [Pa]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • atol = 1e-8: optional, absolute tolerance of the non linear system of equations
  • rtol = 1e-12: optional, relative tolerance of the non linear system of equations
  • max_iters = 1000: optional, maximum number of iterations
  • nonvolatiles = nothing: optional, Vector of strings containing non volatile compounds. Those will be set to zero on the vapour phase.
  • verbose = false: optional, if set to true, the method will display additional information in the REPL.
source
Clapeyron.FugBubblePressure — Type
FugBubblePressure(kwargs...)

Function to compute bubble_pressure via fugacity coefficients. First it uses successive substitution to update the phase composition and an outer Newton's loop to update the pressure. If no convergence is reached after itmax_newton iterations, the system is solved using a multidimensional non-linear system of equations.

Inputs:

  • y0 = nothing: optional, initial guess for the vapor phase composition
  • p0 = nothing: optional, initial guess for the bubble pressure [Pa]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • itmax_newton = 10: optional, number of iterations to update the pressure using Newton's method
  • itmax_ss = 5: optional, number of iterations to update the liquid phase composition using successive substitution
  • tol_x = 1e-8: optional, tolerance to stop successive substitution cycle
  • tol_p = 1e-8: optional, tolerance to stop Newton's cycle
  • tol_of = 1e-8: optional, tolerance to check if the objective function is zero.
  • nonvolatiles = nothing: optional, Vector of strings containing non volatile compounds. Those will be set to zero on the vapour phase.
  • second_order: optional, decide if the algorithm uses second order information when updating the guess estimates. Second order methods are slower, but more reliable.
source
Clapeyron.ActivityBubblePressure — Type
ActivityBubblePressure(kwargs...)

Function to compute bubble_pressure using Activity Coefficients. On activity coefficient models it solves the problem via succesive substitucion. On Helmholtz-based models, it approximates the activity coefficient using the saturated pure state as reference.

Inputs:

  • y0 = nothing: optional, initial guess for the vapor phase composition
  • p0 = nothing: optional, initial guess for the bubble pressure [Pa]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • atol = 1e-8: optional, absolute tolerance of the non linear system of equations
  • rtol = 1e-12: optional, relative tolerance of the non linear system of equations
  • itmax_ss = 40: optional, maximum number of sucesive substitution iterations
  • nonvolatiles = nothing: optional, Vector of strings containing non volatile compounds. Those will be set to zero on the vapour phase.
source
Clapeyron.ChemPotBubbleTemperature — Type
ChemPotBubbleTemperature(kwargs...)

Function to compute bubble_temperature via chemical potentials. It directly solves the equality of chemical potentials system of equations.

Inputs:

  • y0 = nothing: optional, initial guess for the vapor phase composition.
  • T0 = nothing: optional, initial guess for the bubble temperature [K].
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • atol = 1e-8: optional, absolute tolerance of the non linear system of equations
  • rtol = 1e-12: optional, relative tolerance of the non linear system of equations
  • max_iters = 1000: optional, maximum number of iterations
  • nonvolatiles = nothing: optional, Vector of strings containing non volatile compounds. Those will be set to zero on the vapour phase.
  • verbose = false: optional, if set to true, the method will display additional information in the REPL.
source
Clapeyron.FugBubbleTemperature — Type
FugBubbleTemperature(kwargs...)

Function to compute bubble pressure via fugacity coefficients. First it uses successive substitution to update the phase composition and an outer Newton's (or secant) loop to update the temperature. If no convergence is reached after itmax_newton iterations, the system is solved using a multidimensional non-linear system of equations.

Inputs:

  • y = nothing: optional, initial guess for the vapor phase composition.
  • T0 = nothing: optional, initial guess for the bubble temperature [K].
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • itmax_newton = 10: optional, number of iterations to update the pressure using Newton's (or secant) method
  • itmax_ss = 5: optional, number of iterations to update the liquid phase composition using successive substitution
  • tol_x = 1e-8: optional, tolerance to stop successive substitution cycle
  • tol_T = 1e-8: optional, tolerance to stop Newton's cycle
  • tol_of = 1e-8: optional, tolerance to check if the objective function is zero.
  • nonvolatiles: optional, Vector of strings containing non volatile compounds. Those will be set to zero on the vapour phase.
  • second_order: optional, decide if the algorithm uses second order information when updating the guess estimates. Second order methods are slower, but more reliable.
source
Clapeyron.ChemPotDewPressure — Type
ChemPotDewPressure(kwargs...)

Function to compute dew_pressure via chemical potentials. It directly solves the equality of chemical potentials system of equations.

Inputs:

  • x0 = nothing: optional, initial guess for the liquid phase composition
  • p0 = nothing: optional, initial guess for the dew pressure [Pa]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • atol = 1e-8: optional, absolute tolerance of the non linear system of equations
  • rtol = 1e-12: optional, relative tolerance of the non linear system of equations
  • max_iters = 1000: optional, maximum number of iterations
  • noncondensables = nothing: optional, Vector of strings containing non condensable compounds. Those will be set to zero on the liquid phase.
  • verbose = false: optional, if set to true, the method will display additional information in the REPL.
source
Clapeyron.FugDewPressure — Type
FugDewPressure(kwargs...)

Method to compute dew_pressure via fugacity coefficients. First it uses successive substitution to update the phase composition and an outer Newton's loop to update the pressure. If no convergence is reached after itmax_newton iterations, the system is solved using a multidimensional non-linear system of equations.

Inputs:

  • x0 = nothing: optional, initial guess for the liquid phase composition
  • p0 = nothing: optional, initial guess for the dew pressure [Pa]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • itmax_newton = 10: optional, number of iterations to update the pressure using Newton's method
  • itmax_ss = 5: optional, number of iterations to update the liquid phase composition using successive substitution
  • tol_x = 1e-8: optional, tolerance to stop successive substitution cycle
  • tol_p = 1e-8: optional, tolerance to stop Newton's cycle
  • tol_of = 1e-8: optional, tolerance to check if the objective function is zero.
  • noncondensables = nothing: optional, Vector of strings containing non condensable compounds. Those will be set to zero on the liquid phase.
source
Clapeyron.ActivityDewPressure — Type
ActivityDewPressure(kwargs...)

Function to compute dew_pressure using Activity Coefficients. On activity coefficient models it solves the problem via succesive substitucion. On Helmholtz-based models, it approximates the activity coefficient using the saturated pure state as reference.

Inputs:

  • x0 = nothing: optional, initial guess for the liquid phase composition
  • p0 = nothing: optional, initial guess for the dew pressure [Pa]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • atol = 1e-8: optional, absolute tolerance of the non linear system of equations
  • rtol = 1e-12: optional, relative tolerance of the non linear system of equations
  • itmax_ss = 40: optional, maximum number of sucesive substitution iterations
  • noncondensables: optional, Vector of strings containing non condensable compounds. Those will be set to zero on the liquid phase.
source
Clapeyron.ChemPotDewTemperature — Type
ChemPotDewTemperature(kwargs...)

Function to compute dew_temperature via chemical potentials. It directly solves the equality of chemical potentials system of equations.

Inputs:

  • x0 = nothing: optional, initial guess for the liquid phase composition
  • T0 = nothing: optional, initial guess for the dew temperature [K]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • atol = 1e-8: optional, absolute tolerance of the non linear system of equations
  • rtol = 1e-12: optional, relative tolerance of the non linear system of equations
  • max_iters = 1000: optional, maximum number of iterations
  • noncondensables = nothing: optional, Vector of strings containing non condensable compounds. Those will be set to zero on the liquid phase.
  • verbose = false: optional, if set to true, the method will display additional information in the REPL.
source
Clapeyron.FugDewTemperature — Type
FugDewTemperature(kwargs...)

Method to compute dew_temperature via fugacity coefficients. First it uses successive substitution to update the phase composition and an outer Newton's loop to update the temperature. If no convergence is reached after itmax_newton iterations, the system is solved using a multidimensional non-linear system of equations.

Inputs:

  • x0 = nothing: optional, initial guess for the liquid phase composition
  • T0 = nothing: optional, initial guess for the dew temperature [K]
  • vol0 = nothing: optional, initial guesses for the liquid and vapor phase volumes [m³]
  • itmax_newton = 10: optional, number of iterations to update the temperature using Newton's method
  • itmax_ss = 5: optional, number of iterations to update the liquid phase composition using successive substitution
  • tol_x = 1e-8: optional, tolerance to stop successive substitution cycle
  • tol_T = 1e-8: optional, tolerance to stop Newton's cycle
  • tol_of = 1e-8: optional, tolerance to check if the objective function is zero.
  • noncondensables = nothing: optional, Vector of strings containing non condensable compounds. Those will be set to zero on the liquid phase.
source

Consistency and Stability

Clapeyron.gibbs_duhem — Function
gibbs_duhem(model,V,T,z=[1.0])

Performs a Gibbs-Duhem check on the input conditions:

∑zᵢμᵢ - G ≈ 0

Where G is the total Gibbs energy [J]. It can help diagnose if a user-defined eos is consistent.

Returns |∑zᵢμᵢ - G|, ∑zᵢμᵢ and G at the specified conditions.

source
Clapeyron.isstable — Function
isstable(model,p,T,z)::Bool

Performs stability tests for a (p,T,z) pair, and warn if any tests fail. Returns true/false.

Checks, in order of complexity:

  • mechanical stability: isothermal compressibility is not negative.
  • diffusive stability: all eigenvalues of ∂²A/∂n² are positive.
  • chemical stability: there isn't any other combinations of compositions at p(V,T),T that are more stable than the input composition.

For checking (V,T,z) pairs, use Clapeyron.VT_isstable(model,V,T,z) instead.

source
Clapeyron.VT_mechanical_stability — Function
VT_mechanical_stability(model,V,T,z = SA[1.0])::Bool

Performs a mechanical stability for a (V,T,z) pair, returns true/false. Checks if isothermal compressibility is not negative.

Note

This function does not have a p,T counterpart, because if we calculate the volume via volume(model,p,T,z), it will be, by definition, a mechanically stable phase.

source
Clapeyron.VT_diffusive_stability — Function
VT_diffusive_stability(model,V,T,z)::Bool

Performs a diffusive stability for a (V,T,z) pair, returns true/false. Checks if all eigenvalues of ∂²A/∂n² are positive. Returns false if the eos calculation failed. This normally occurs when evaluating on densities lower than the maximum density (given by Clapeyron.lb_volume(model,T,z)).

source
Clapeyron.diffusive_stability — Function
diffusive_stability(model,p,T,z = SA[1.0];phase = :unknown,threaded = true,vol0 = nothing)

Performs a diffusive stability for a (V,T,z) pair, returns true/false.

Checks if all eigenvalues of `∂²A/∂n²` are positive.

The keywords phase, threaded and vol0 are passed to the Clapeyron.volume solver.

source
Clapeyron.chemical_stability — Function
chemical_stability(model,V,T,z)::Bool

Performs a chemical stability check using the tangent plane distance criterion, using the tpd function.

source
Clapeyron.tpd — Function
tpd(model,p,T,z;break_first = false,lle = false,tol_trivial = 1e-5, di = nothing)

Calculates the Tangent plane distance function (tpd). It returns:

  • a vector with trial phase compositions where tpd < 0
  • a vector with the tpd values
  • a vector with symbols indicating the phase of the input composition
  • a vector with symbols indicating the phase of the trial composition

It iterates over each two-phase combination, starting from pure trial compositions, it does succesive substitution, then Gibbs optimization.

If the vectors are empty, then the procedure couldn't find a negative tpd. That is an indication that the phase is (almost) surely stable.

source