Index

Extended Corresponding states Model

Missing docstring.

Missing docstring for Clapeyron.ECS. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Clapeyron.shape_factors. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Clapeyron.SPUNG. Check Documenter's build log for details.

Clapeyron.LKP — Type
LKP <: EmpiricHelmholtzModel
LKP(components;
    idealmodel=BasicIdeal,
    verbose=false)

Input parameters

  • Tc: Single Parameter (Float64) - Critical Temperature [K]
  • Pc: Single Parameter (Float64) - Critical Pressure [Pa]
  • Vc_fit: Single Parameter (Float64) - Fitted Critical Volume [m³·mol⁻¹]
  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • acentricfactor: Single Parameter (Float64) - Acentric Factor (no units)
  • k: Pair Parameter (Float64) (optional) - Binary Interaction Parameter (no units)

Input models

  • idealmodel: Ideal Model

Description

Lee-Kesler-Plöker equation of state. Corresponding states using interpolation between a simple, spherical fluid (methane, ∅) and a reference fluid (n-octane, ref):

αᵣ = (1 - ωᵣ)*αᵣ(δr,τ,params(∅)) + ωᵣ*αᵣ(δr,τ,params(ref))
τ = Tr/T
δr = Vr/V/Zr
Zr = (0.2905 - 0.085*ω̄)
ωᵣ = (ω̄ - ω(∅))/(ω(ref) - ω(∅))
ω̄ = ∑xᵢωᵢ
Tr = ∑xᵢ*xⱼ*Tcᵢⱼ*Vcᵢⱼ^η * (1-kᵢⱼ)
Vr = ∑xᵢ*xⱼ*Tcᵢⱼ*Vcᵢⱼ
Tcᵢⱼ = √Tcᵢ*Tcⱼ
Vcᵢⱼ = 0.125*(∛Vcᵢ + ∛Vcⱼ)^3
η = 0.25

Model Construction Examples

# Using the default database
model = LKP("water") #single input
model = LKP(["water","ethanol"]) #multiple components
model = LKP(["water","ethanol"], idealmodel = ReidIdeal) #modifying ideal model

# Passing a prebuilt model

my_idealmodel = MonomerIdeal(["neon","hydrogen"];userlocations = (;Mw = [20.17, 2.]))
model =  LKP(["neon","hydrogen"],idealmodel = my_idealmodel)

# User-provided parameters, passing files or folders
model = LKP(["neon","hydrogen"]; userlocations = ["path/to/my/db","lkp/my_k_values.csv"])

# User-provided parameters, passing parameters directly

model = LKP(["neon","hydrogen"];
        userlocations = (;Tc = [44.492,33.19],
                        Pc = [2679000, 1296400],
                        Vc = [4.25e-5, 6.43e-5],
                        Mw = [20.17, 2.],
                        acentricfactor = [-0.03,-0.21]
                        k = [0. 0.18; 0.18 0.]) #k,l can be ommited in single-component models.
                    )

References

  1. Plöcker, U., Knapp, H., & Prausnitz, J. (1978). Calculation of high-pressure vapor-liquid equilibria from a corresponding-states correlation with emphasis on asymmetric mixtures. Industrial & Engineering Chemistry Process Design and Development, 17(3), 324–332. doi:10.1021/i260067a020
source
Clapeyron.LKPSJT — Type
LKPSJT <: LKPModel
LKPSJT(components;
    version = 2,
    idealmodel=BasicIdeal,
    userlocations = String[],
    ideal_userlocations = String[],
    verbose=false,
    reference_state = nothing)

enhancedLKP(components;
idealmodel=BasicIdeal,
verbose=false)

Input parameters

  • Tc: Single Parameter (Float64) - Critical Temperature [K]
  • Pc: Single Parameter (Float64) - Critical Pressure [Pa]
  • Vc: Single Parameter (Float64) (optional) - Critical Volume [m³]
  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • acentricfactor: Single Parameter (Float64) - Acentric Factor (no units)
  • k: Pair Parameter (Float64) (optional) - Binary Interaction Parameter (no units)

Input models

  • idealmodel: Ideal Model

Description

Lee-Kesler-Plöker-equation of state, Sabozin-Jäger-Thol enhancement. Corresponding states using interpolation between a simple, spherical fluid (methane, ∅) and a reference fluid (n-octane, ref):

Instead of using the original BWR formulation, multiparameter equations of state are used.

αᵣ = (1 - ωᵣ)*αᵣ(simple,δ,τ) + ωᵣ*αᵣ(reference,δ,τ)
τ = Tr/T
δ = Vr/V
ωᵣ = (ω̄ - ω(∅))/(ω(ref) - ω(∅))
ω̄ = ∑xᵢωᵢ
Tr = ∑xᵢ*xⱼ*Tcᵢⱼ*Vcᵢⱼ^η * (1-kᵢⱼ)
Vr = ∑xᵢ*xⱼ*Tcᵢⱼ*Vcᵢⱼ
Tcᵢⱼ = √Tcᵢ*Tcⱼ
Vcᵢⱼ = 0.125*(∛Vcᵢ + ∛Vcⱼ)^3
η = 0.25

If Vcᵢ is not provided, it can be estimated from the critical temperature and pressure:

Zcᵢ = Zᴵ + Zᴵᴵ ω

There are two versions of this EoS, that can be selected via the version argument.

  • First version (version = 1): the simple fluid is the methane multiparameter EoS, and the reference fluid is octane. For estimating the critical volumes, Zc = 0.2905 - 0.085ω is used.
  • Second version (version = 1): the simple fluid is replaced by the propane multiparameter EoS. For estimating the critical volumes, Zc is an interpolation of the critical compressibilities from the simple and reference fluids: Zc(ω0) = Z0, Zc(ωref) = Zref
  • version = 2 : interpolation between the simple and the reference fluid.

Model Construction Examples

# Using the default database
model = LKPSJT("water") #single input
model = LKPSJT(["water","ethanol"],version = 1) #multiple components, using original version
model = LKPSJT(["water","ethanol"], idealmodel = ReidIdeal) #modifying ideal model
model = enhancedLKP(["water","ethanol"], idealmodel = ReidIdeal) #enhancedLKP is just an alias to LKPSJT

# Passing a prebuilt model

my_idealmodel = MonomerIdeal(["neon","hydrogen"];userlocations = (;Mw = [20.17, 2.]))
model =  LKPSJT(["neon","hydrogen"],idealmodel = my_idealmodel)

# User-provided parameters, passing files or folders
model = LKPSJT(["neon","hydrogen"]; userlocations = ["path/to/my/db","lkp/my_k_values.csv"])

# User-provided parameters, passing parameters directly

model = LKPSJT(["neon","hydrogen"];
        userlocations = (;Tc = [44.492,33.19],
                        Pc = [2679000, 1296400],
                        Vc = [4.25e-5, 6.43e-5],
                        Mw = [20.17, 2.],
                        acentricfactor = [-0.03,-0.21]
                        k = [0. 0.18; 0.18 0.]) #k,l can be ommited in single-component models.
                    )

References

  1. Plöcker, U., Knapp, H., & Prausnitz, J. (1978). Calculation of high-pressure vapor-liquid equilibria from a corresponding-states correlation with emphasis on asymmetric mixtures. Industrial & Engineering Chemistry Process Design and Development, 17(3), 324–332. doi:10.1021/i260067a020
  2. Sabozin, F., Jäger, A., & Thol, M. (2024). Enhancement of the Lee–Kesler–Plöcker equation of state for calculating thermodynamic properties of long-chain alkanes. International Journal of Thermophysics, 45(5). doi:10.1007/s10765-024-03360-0
source
Clapeyron.enhancedLKP — Type
LKPSJT <: LKPModel
LKPSJT(components;
    version = 2,
    idealmodel=BasicIdeal,
    userlocations = String[],
    ideal_userlocations = String[],
    verbose=false,
    reference_state = nothing)

enhancedLKP(components;
idealmodel=BasicIdeal,
verbose=false)

Input parameters

  • Tc: Single Parameter (Float64) - Critical Temperature [K]
  • Pc: Single Parameter (Float64) - Critical Pressure [Pa]
  • Vc: Single Parameter (Float64) (optional) - Critical Volume [m³]
  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • acentricfactor: Single Parameter (Float64) - Acentric Factor (no units)
  • k: Pair Parameter (Float64) (optional) - Binary Interaction Parameter (no units)

Input models

  • idealmodel: Ideal Model

Description

Lee-Kesler-Plöker-equation of state, Sabozin-Jäger-Thol enhancement. Corresponding states using interpolation between a simple, spherical fluid (methane, ∅) and a reference fluid (n-octane, ref):

Instead of using the original BWR formulation, multiparameter equations of state are used.

αᵣ = (1 - ωᵣ)*αᵣ(simple,δ,τ) + ωᵣ*αᵣ(reference,δ,τ)
τ = Tr/T
δ = Vr/V
ωᵣ = (ω̄ - ω(∅))/(ω(ref) - ω(∅))
ω̄ = ∑xᵢωᵢ
Tr = ∑xᵢ*xⱼ*Tcᵢⱼ*Vcᵢⱼ^η * (1-kᵢⱼ)
Vr = ∑xᵢ*xⱼ*Tcᵢⱼ*Vcᵢⱼ
Tcᵢⱼ = √Tcᵢ*Tcⱼ
Vcᵢⱼ = 0.125*(∛Vcᵢ + ∛Vcⱼ)^3
η = 0.25

If Vcᵢ is not provided, it can be estimated from the critical temperature and pressure:

Zcᵢ = Zᴵ + Zᴵᴵ ω

There are two versions of this EoS, that can be selected via the version argument.

  • First version (version = 1): the simple fluid is the methane multiparameter EoS, and the reference fluid is octane. For estimating the critical volumes, Zc = 0.2905 - 0.085ω is used.
  • Second version (version = 1): the simple fluid is replaced by the propane multiparameter EoS. For estimating the critical volumes, Zc is an interpolation of the critical compressibilities from the simple and reference fluids: Zc(ω0) = Z0, Zc(ωref) = Zref
  • version = 2 : interpolation between the simple and the reference fluid.

Model Construction Examples

# Using the default database
model = LKPSJT("water") #single input
model = LKPSJT(["water","ethanol"],version = 1) #multiple components, using original version
model = LKPSJT(["water","ethanol"], idealmodel = ReidIdeal) #modifying ideal model
model = enhancedLKP(["water","ethanol"], idealmodel = ReidIdeal) #enhancedLKP is just an alias to LKPSJT

# Passing a prebuilt model

my_idealmodel = MonomerIdeal(["neon","hydrogen"];userlocations = (;Mw = [20.17, 2.]))
model =  LKPSJT(["neon","hydrogen"],idealmodel = my_idealmodel)

# User-provided parameters, passing files or folders
model = LKPSJT(["neon","hydrogen"]; userlocations = ["path/to/my/db","lkp/my_k_values.csv"])

# User-provided parameters, passing parameters directly

model = LKPSJT(["neon","hydrogen"];
        userlocations = (;Tc = [44.492,33.19],
                        Pc = [2679000, 1296400],
                        Vc = [4.25e-5, 6.43e-5],
                        Mw = [20.17, 2.],
                        acentricfactor = [-0.03,-0.21]
                        k = [0. 0.18; 0.18 0.]) #k,l can be ommited in single-component models.
                    )

References

  1. Plöcker, U., Knapp, H., & Prausnitz, J. (1978). Calculation of high-pressure vapor-liquid equilibria from a corresponding-states correlation with emphasis on asymmetric mixtures. Industrial & Engineering Chemistry Process Design and Development, 17(3), 324–332. doi:10.1021/i260067a020
  2. Sabozin, F., Jäger, A., & Thol, M. (2024). Enhancement of the Lee–Kesler–Plöcker equation of state for calculating thermodynamic properties of long-chain alkanes. International Journal of Thermophysics, 45(5). doi:10.1007/s10765-024-03360-0
source

Sanchez–Lacombe Model

Clapeyron.SanchezLacombe — Type
SanchezLacombe(components;
idealmodel = BasicIdeal,
mixing = SLk0k1lMixingRule,
userlocations = String[],
ideal_userlocations = String[],
mixing_userlocations = String[],
reference_state = false,
verbose = false)

Input parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • segment: Single Parameter (Float64) - Number of segments (no units)
  • epsilon: Single Parameter (Float64) - Nonbonded interaction energy per monomer [J·mol⁻¹]
  • vol: Single Parameter (Float64) - Closed Packed Specific volume [m³·mol⁻¹]

Model Parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • segment: Single Parameter (Float64) - Number of segments (no units)
  • epsilon: Pair Parameter (Float64) - Nonbonded interaction energy per monomer [J·mol⁻¹]
  • vol: Pair Parameter (Float64) - Closed Packed Specific volume [m³·mol⁻¹]

Input models

  • idealmodel: Ideal Model
  • mixing: Mixing model

Description

Sanchez-Lacombe Lattice Fluid Equation of State.

xᵢ = zᵢ/∑zᵢ
r̄ = ∑xᵢrᵢ
vᵣ,εᵣ = mix_vε(model,V,T,z,model.mixing,r̄,∑zᵢ)
ρ̃ = r̄*vᵣ/v
T̃ = R̄*T/εᵣ
aᵣ = r̄*(- ρ̃ /T̃ + (1/ρ̃  - 1)*log(1 - ρ̃ ) + 1)

References

  1. Neau, E. (2002). A consistent method for phase equilibrium calculation using the Sanchez–Lacombe lattice–fluid equation-of-state. Fluid Phase Equilibria, 203(1–2), 133–140. doi:10.1016/s0378-3812(02)00176-0
source
Clapeyron.SL — Type
SanchezLacombe(components;
idealmodel = BasicIdeal,
mixing = SLk0k1lMixingRule,
userlocations = String[],
ideal_userlocations = String[],
mixing_userlocations = String[],
reference_state = false,
verbose = false)

Input parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • segment: Single Parameter (Float64) - Number of segments (no units)
  • epsilon: Single Parameter (Float64) - Nonbonded interaction energy per monomer [J·mol⁻¹]
  • vol: Single Parameter (Float64) - Closed Packed Specific volume [m³·mol⁻¹]

Model Parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • segment: Single Parameter (Float64) - Number of segments (no units)
  • epsilon: Pair Parameter (Float64) - Nonbonded interaction energy per monomer [J·mol⁻¹]
  • vol: Pair Parameter (Float64) - Closed Packed Specific volume [m³·mol⁻¹]

Input models

  • idealmodel: Ideal Model
  • mixing: Mixing model

Description

Sanchez-Lacombe Lattice Fluid Equation of State.

xᵢ = zᵢ/∑zᵢ
r̄ = ∑xᵢrᵢ
vᵣ,εᵣ = mix_vε(model,V,T,z,model.mixing,r̄,∑zᵢ)
ρ̃ = r̄*vᵣ/v
T̃ = R̄*T/εᵣ
aᵣ = r̄*(- ρ̃ /T̃ + (1/ρ̃  - 1)*log(1 - ρ̃ ) + 1)

References

  1. Neau, E. (2002). A consistent method for phase equilibrium calculation using the Sanchez–Lacombe lattice–fluid equation-of-state. Fluid Phase Equilibria, 203(1–2), 133–140. doi:10.1016/s0378-3812(02)00176-0
source
Clapeyron.mix_vε — Function
mix_vε(model::SanchezLacombeModel,V,T,z,mix::SLMixingRule,r̄ = @f(rmix),∑z = sum(z))

Function used to dispatch on the different mixing rules available for Sanchez-Lacombe.

Example:

function mix_vε(model::SanchezLacombe,V,T,z,mix::SLKRule,r̄,Σz = sum(z))
    v = model.params.vol.values
    ε = model.params.epsilon.values
    r = model.params.segment.values
    k = mix.k.values
    x = z ./ Σz
    ϕ = @. r * x / r̄
    εᵣ = sum(ε[i,j]*(1-k[i,j])*ϕ[i]*ϕ[j] for i ∈ @comps for j ∈ @comps)
    vᵣ = sum(v[i,j]*ϕ[i]*ϕ[j] for i ∈ @comps for j ∈ @comps)
    return vᵣ,εᵣ
source
Clapeyron.SLKRule — Type
SLKRule(components; userlocations = String[], verbose = false)

Input parameters

  • k: Pair Parameter (Float64) (optional) - Binary Interaction Parameter (no units)

Constant Kᵢⱼ mixing rule for Sanchez-Lacombe:

εᵢⱼ = √εᵢεⱼ*(1-kᵢⱼ)
vᵢⱼ = (vᵢ + vⱼ)/2
ϕᵢ = rᵢ*xᵢ/r̄
εᵣ = ΣΣϕᵢϕⱼεᵢⱼ
vᵣ = ΣΣϕᵢϕⱼvᵢⱼ
source
Clapeyron.SLk0k1lMixingRule — Type
SLKRule(components; userlocations = String[], verbose = false)

Input parameters

  • k0,k: Pair Parameter (Float64, optional) - Binary Interaction Parameter (no units)
  • k1: Pair Parameter (Float64, optional) - Binary Interaction Parameter (no units)
  • l: Pair Parameter (Float64,optional) - Binary Interaction Parameter (no units)

Neau's Consistent k₀,k₁,l mixing rule for Sanchez-Lacombe:

εᵢⱼ = √εᵢεⱼ
vᵢⱼ = (1 - lᵢⱼ)(vᵢ + vⱼ)/2
ϕᵢ = rᵢ*xᵢ/r̄
εᵣ = ΣΣϕᵢϕⱼεᵢⱼ*(1 - k₀ᵢⱼ + (1 - δᵢⱼ)(Σϕₖk₁ᵢₖ + Σϕₖk₁ₖⱼ))
vᵣ = ΣΣϕᵢϕⱼvᵢⱼ

Where δᵢⱼ is i == j ? 1 : 0

References

  1. Neau, E. (2002). A consistent method for phase equilibrium calculation using the Sanchez–Lacombe lattice–fluid equation-of-state. Fluid Phase Equilibria, 203(1–2), 133–140. doi:10.1016/s0378-3812(02)00176-0
source

Other molecular Models

Missing docstring.

Missing docstring for Clapeyron.PeTS. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Clapeyron.KolafaNezbeda. Check Documenter's build log for details.

Missing docstring.

Missing docstring for Clapeyron.FeANNMie. Check Documenter's build log for details.

Composite and Utility Models

Clapeyron.CompositeModel — Type

function CompositeModel(components ; mapping = nothing, liquid = nothing, gas = nothing, fluid = nothing, solid = nothing, saturation = nothing, melting = nothing, sublimation = nothing, gasuserlocations = String[], liquiduserlocations = String[], fluiduserlocations = String[], soliduserlocations = String[], saturationuserlocations = String[], meltinguserlocations = String[], sublimationuserlocations = String[], verbose = false, referencestate = nothing)

Model that holds representations of fluid (and/or solid) that aren't evaluated using the Helmholtz energy-based approach used in the rest of the library.

It contains a fluid model, a solid model (optional), and a mapping between the solid and liquid components (if necessary).

There are three available representations for the fluid model:

  • A Helmholtz-based EoS.
  • Fluid Correlations, consisting in a gas model, a correlation for obtaining the saturation pressure, and a liquid model. Both gas and liquid models can optionally be Helmholtz models too, but correlations for saturated liquid and vapour are also allowed.
  • Activity models, consisting of a liquid activity and a model for the fluid. The fluid model can be a Helmholtz-based model, or another CompositeModel containing correlations.

When the solid field is specified, some properties (like volume) start taking in account the solid phase in their calculations. Optionally, there are other models that provide specific correlations for SLE equilibria (like SolidHfus).

The solid model is optional and does not impact VLE (and LLE) calculations. There are two available representations for the solid model:

  • a Helmholtz-based EoS, can be used to calculate both melting/sublimation and solubilities.
  • Chemical Potential models, can be used for solubilities.

Examples:

  • Saturation pressure calculated using Correlations:
#Rackett correlation for liquids, DIPPR 101 correlation for the saturation pressure, ideal gas for the vapour volume.
julia> model = CompositeModel(["water"],liquid = RackettLiquid,saturation = DIPPR101Sat,gas = BasicIdeal)
Composite Model (Correlation-Based) with 1 component:
 Gas Model: BasicIdeal()
 Liquid Model: RackettLiquid("water")
 Saturation Model: DIPPR101Sat("water")

julia> saturation_pressure(model,373.15)
(101260.56298096628, 1.8234039042643886e-5, 0.030639190960720403)
  • Bubble Pressure, calculated using fluid correlations and a Raoult solver:
julia> model = CompositeModel(["octane","heptane"],liquid = RackettLiquid,saturation = DIPPR101Sat,gas = BasicIdeal)
Composite Model (Correlation-Based) with 2 components:
 Gas Model: BasicIdeal()
 Liquid Model: RackettLiquid("octane", "heptane")
 Saturation Model: DIPPR101Sat("octane", "heptane")

julia> bubble_pressure(model,300.15,[0.9,0.1])
(2552.3661540464022, 0.00015684158726046333, 0.9777538974501402, [0.7376170278676232, 0.2623829721323768])
  • Bubble Pressure, using an Activity Model along with another model for fluid properties:
#using a Helmholtz-based fluid
julia> model = CompositeModel(["octane","heptane"],liquid = UNIFAC,fluid = PR)
Composite Model (γ-ϕ) with 2 components:
 Activity Model: UNIFAC{PR{BasicIdeal, PRAlpha, NoTranslation, vdW1fRule}}("octane", "heptane")
 Fluid Model: PR{BasicIdeal, PRAlpha, NoTranslation, vdW1fRule}("octane", "heptane")

julia> bubble_pressure(model,300.15,[0.9,0.1])
(2694.150594740186, 0.00016898441224336215, 0.9239727973658585, [0.7407077952279438, 0.2592922047720562])

#using a correlation-based fluid
julia> fluidmodel = CompositeModel(["octane","heptane"],liquid = RackettLiquid,saturation = DIPPR101Sat,gas = BasicIdeal);
model2 = CompositeModel(["octane","heptane"],liquid = UNIFAC, fluid = fluidmodel)
Composite Model (γ-ϕ) with 2 components:
 Activity Model: UNIFAC{PR{BasicIdeal, PRAlpha, NoTranslation, vdW1fRule}}("octane", "heptane")
 Fluid Model: FluidCorrelation{BasicIdeal, RackettLiquid, DIPPR101Sat}("octane", "heptane")

julia> bubble_pressure(model2,300.15,[0.9,0.1])
(2551.6008524130893, 0.00015684158726046333, 0.9780471551726359, [0.7378273929683233, 0.2621726070316766])
source
Clapeyron.FluidCorrelation — Type
FluidCorrelation{V,L,Sat,Cp} <: RestrictedEquilibriaModel

Wrapper struct to signal that a CompositeModel uses correlations for calculation of saturation points, vapour and liquid phase volumes.

source
Clapeyron.GammaPhi — Type
GammaPhi{γ,Φ} <: RestrictedEquilibriaModel

Wrapper struct to signal that a CompositeModel uses an activity model in conjunction with a fluid.

source
Clapeyron.ZeroResidual — Type
ZeroResidual <: EoSModel
ZeroResidual(components; 
idealmodel = BasicIdeal,
ideal_userlocations = String[],
verbose = false)

Input parameters

None

Description

Zero residual model.

    a_res(model,V,T,z) = 0
source