Index

Ideal Models

All Clapeyron.jl models can be separated between an ideal and a residual contribution. The ideal contribution can be obtained via integration of the ideal isobaric heat capacity:

$\frac{A_{\mathrm{ideal}}}{Nk_\mathrm{B}T} = \sum_{i=1}^{N_{\mathrm{Component}}} x_i\left[\ln{\frac{\rho_i}{\rho_0}} + \frac{1}{Nk_\mathrm{B}T} \int_{T_0}^T \!\!C_{p,i}^0 dT + \frac{H_{0,i}}{Nk_\mathrm{B}T}- \frac{1}{Nk_{B}}\!\!\int_{T_0}^T \frac{C_{p,i}^0}{T} dT -\ln{\frac{T}{T_0}}-\frac{S_{0,i}}{Nk_\mathrm{B}} - 1\right]$

Normally, EoS models contain an ideal model. This model can be accessed by using Clapeyron.idealmodel.

Clapeyron.BasicIdealType
BasicIdeal <: IdealModel

BasicIdeal(components;
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

None

Description

Default Ideal Model. Constant specific heat capacity equal to 5R/2. It's Helmholtz energy is equal to:

    a₀ = A₀/nRT = ∑(xᵢlog(nxᵢ/V)) - 1 - 1.5log(T)

Model Construction Examples

# Because this model does not have parameters, all those constructors are equivalent:
idealmodel = BasicIdeal()
idealmodel = BasicIdeal("water")
idealmodel = BasicIdeal(["water","carbon dioxide"])
source
Clapeyron.ReidIdealType
ReidIdeal <: IdealModel

ReidIdeal(components; 
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • a: Single Parameter (Float64) - polynomial coefficient
  • b: Single Parameter (Float64) - polynomial coefficient
  • c: Single Parameter (Float64) - polynomial coefficient
  • d: Single Parameter (Float64) - polynomial coefficient
  • e: Single Parameter (optional) (Float64) - polynomial coefficient
  • Mw: Single Parameter (Float64) (Optional) - Molecular Weight [g·mol⁻¹]

Model parameters

  • a: Single Parameter (Float64) - polynomial coefficient
  • b: Single Parameter (Float64) - polynomial coefficient
  • c: Single Parameter (Float64) - polynomial coefficient
  • d: Single Parameter (Float64) - polynomial coefficient
  • e: Single Parameter (optional) (Float64) - polynomial coefficient for 1/T^2
  • coeffs: Single Parameter (NTuple{5,Float64})
  • Mw: Single Parameter (Float64) (Optional) - Molecular Weight [g·mol⁻¹]

Description

Reid Ideal Model. Helmholtz energy obtained via integration of specific heat capacity:

Cpᵢ(T) = aᵢ  + bᵢT + cᵢT^2 + dᵢT^3 + eᵢT^4
Cp(T) = ∑Cpᵢxᵢ

Model Construction Examples

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

# Using user-provided parameters

# Passing files or folders
idealmodel = ReidIdeal(["neon","hydrogen"]; userlocations = ["path/to/my/db","reid.csv"])

# Passing parameters directly
idealmodel = ReidIdeal(["water","butane"];
            userlocations = (a = [32.24, 9.487], 
                        b = [0.00192, 0.3313], 
                        c = [1.06e-5, -0.0001108],
                        d = [-3.6e-9, -2.822e-9],
                        Mw = [18.01, 58.12])
                        ) #e is not used
source
Clapeyron.JobackIdealType
JobackIdeal <: JobackIdealModel

JobackIdeal(components; 
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • N_a: Single Parameter (Float64)
  • T_c: Single Parameter (Float64)
  • P_c: Single Parameter (Float64)
  • V_c: Single Parameter (Float64)
  • T_b: Single Parameter (Float64)
  • T_m: Single Parameter (Float64)
  • H_form: Single Parameter (Float64)
  • G_form: Single Parameter (Float64)
  • a: Single Parameter (Float64)
  • b: Single Parameter (Float64)
  • c: Single Parameter (Float64)
  • d: Single Parameter (Float64)
  • H_fusion: Single Parameter (Float64)
  • H_vap: Single Parameter (Float64)
  • eta_a: Single Parameter (Float64)
  • eta_b: Single Parameter (Float64)

Description

Joback Group Contribution Ideal Model. GC version of ReidIdeal. Helmholtz energy obtained via integration of specific heat capacity:

aᵢ = ∑(νᵢₖbₖ) - 37.93
bᵢ = ∑(νᵢₖbₖ) + 0.210
cᵢ = ∑(νᵢₖcₖ) - 3.91e-4
dᵢ = ∑(νᵢₖbₖ) + 2.06e-7
Cpᵢ(T) = aᵢ  + bᵢT + cᵢT^2 + dᵢT^3

The GC-averaged Reid Model is available by using ReidIdeal(model::JobackIdeal). The estimated critical point of a single component can be obtained via crit_pure(model::JobackIdeal)

Group Fragmentation

Molecule fragmentation into functional groups is available in GCIdentifier.jl, using JobackGroups

References

  1. Joback, K. G., & Reid, R. C. (1987). Estimation of pure-component properties from group-contributions. Chemical Engineering Communications, 57(1–6), 233–243. doi:10.1080/00986448708960487

List of available groups

NameDescription
-CH3Methyl
-CH2-Methylene
>CH-
>C<
CH2=CH-
-CH=CH-
=C<
=C=
CH
C
ring-CH2-Cyclic alkane
ring>CH-
ring>C<
ring=CH-Aromatic group
ring=C<
-FFluoride
-ClChloride
-BrBromide
-IIodide
-OH (alcohol)Hydroxyl group
-OH (phenol)
-O- (non-ring)
-O- (ring)
>C=O (non-ring)Ketone
>C=O (ring)
O=CH- (aldehyde)Aldehyde
-COOH (acid)Carboxylic acid
-COO- (ester)Ester
O (other than above)Ketone
-NH2Amine
>NH (non-ring)
>NH (ring)
>N- (non-ring)
-N= (non-ring)
-N= (ring)
=NH
-CNNitrile
-NO3Nitroxide
-SH
-S- (non-ring)
-S- (ring)
source
Clapeyron.MonomerIdealType
MonomerIdeal <: MonomerIdealModel

MonomerIdeal(components; 
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]

Model Parameters

None

Description

Monomer Ideal Model, result obtained from statistical mechanics Λ

    Λᵢ = h/√(kᵦTMwᵢ/Nₐ)    
    a₀ = A₀/nRT = ∑xᵢlog(ρᵢΛᵢ^3)

Model Construction Examples

# Using the default database
idealmodel = MonomerIdeal("water") #single input
idealmodel = MonomerIdeal(["water","ethanol"]) #multiple components

# Using user-provided parameters

# Passing files or folders
idealmodel = MonomerIdeal(["neon","hydrogen"]; userlocations = ["path/to/my/db","mw.csv"])

# Passing parameters directly
idealmodel = MonomerIdeal(["neon","hydrogen"];userlocations = (;Mw = [20.17, 2.]))
source
Clapeyron.WalkerIdealType
WalkerIdeal <: WalkerIdealModel

WalkerIdeal(components; 
userlocations = String[],
group_userlocations = String[]
verbose = false)

Input parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • Nrot: Single Parameter (Int)
  • theta1: Single Parameter (Float64)
  • theta2: Single Parameter (Float64)
  • theta3: Single Parameter (Float64)
  • theta4: Single Parameter (Float64)
  • deg1: Single Parameter (Int)
  • deg2: Single Parameter (Int)
  • deg3: Single Parameter (Int)
  • deg4: Single Parameter (Int)

Description

Walker [1] Group Contribution Ideal Model.

Cpᵢ(T)/R = (5+NRot)/2 ∑νᵢₖ∑gₖᵥ(θₖᵥ/T)^2*exp(θₖᵥ/T)/(1-exp(θₖᵥ/T)) , v ∈ 1:4 
Group Fragmentation

Molecule fragmentation into functional groups is available in GCIdentifier.jl, using WalkerGroups

References

  1. Walker, P. J., & Haslam, A. J. (2020). A new predictive group-contribution ideal-heat-capacity model and its influence on second-derivative properties calculated using a free-energy equation of state. Journal of Chemical and Engineering Data, 65(12), 5809–5829. doi:10.1021/acs.jced.0c00723
source
Clapeyron.LJRefIdealType
LJRefIdeal <: IdealModel
LJRef(components;
userlocations = String[],
verbose = false)

Input parameters

  • sigma: Single Parameter (Float64) - particle size [Å]
  • epsilon: Single Parameter (Float64) - dispersion energy [K]
  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]

Description

Lennard-Jones Reference equation of state. Ideal Part. Valid from 0.5 < T/Tc < 7 and pressures up to p/pc = 500.

τᵢ = 1.32ϵᵢ/T
δᵢ = n(Nₐσᵢ^3)/0.31V
a⁰ᵢ(δ,τ) = log(δᵢ) + 1.5log(τᵢ) - 1.515151515τᵢ + 6.262265814
a⁰(δ,τ,z) = ∑xᵢ(a⁰ᵢ + log(xᵢ))

LJRefIdeal acts as a wrapper of LJRef model, you can access it with LJRef(model::LJRefIdeal).

Mutiple component warning

The original model was done with only one component in mind. To support multiple components, a VDW 1-fluid mixing rule (shown above) is implemented, but it is not tested.

References

  1. Thol, M., Rutkai, G., Köster, A., Lustig, R., Span, R., & Vrabec, J. (2016). Equation of state for the Lennard-Jones fluid. Journal of physical and chemical reference data, 45(2), 023101. doi:10.1063/1.4945000
source
Clapeyron.AlyLeeIdealType
AlyLeeIdeal <: AlyLeeIdealModel

AlyLeeIdeal(components; 
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • A: Single Parameter (Float64) - Model Coefficient
  • B: Single Parameter (Float64) - Model Coefficient
  • C: Single Parameter (Float64) - Model Coefficient
  • D: Single Parameter (Float64) - Model Coefficient
  • E: Single Parameter (Float64) - Model Coefficient
  • F: Single Parameter (Float64) - Model Coefficient
  • G: Single Parameter (Float64) - Model Coefficient
  • H: Single Parameter (Float64) - Model Coefficient
  • I: Single Parameter (Float64) - Model Coefficient
  • Mw: Single Parameter (Float64) (Optional) - Molecular Weight [g·mol⁻¹]

Description

Aly-Lee Ideal Model (extended):

Cpᵢ(T)/R = A + B(CT⁻¹/sinh(CT⁻¹))² + D(ET⁻¹/cosh(ET⁻¹))² + F(GT⁻¹/sinh(GT⁻¹))² + H(IT⁻¹/cosh(IT⁻¹))²

Model Construction Examples

# Using the default database
idealmodel = AlyLeeIdeal("water") #single input
idealmodel = AlyLeeIdeal(["water","ethanol"]) #multiple components

# Using user-provided parameters

# Passing files or folders
idealmodel = AlyLeeIdeal(["neon","hydrogen"]; userlocations = ["path/to/my/db","alylee.csv"])

# Passing parameters directly
idealmodel = AlyLeeIdeal(["water","carbon dioxide"];
                        userlocations = (A = [4.004, 3.5],
                        B = [0.01, 2.044],
                        C = [268.8, 919.3],
                        D = [0.99, -1.06],
                        E = [1141.4, -865.1],
                        F = [3.07, 2.034],
                        G = [2507.37, 483.55],
                        H = [0.0, 0.0139],
                        I = [0.0, 341.11])
                        )

References

  1. Aly, F. A., & Lee, L. L. (1981). Self-consistent equations for calculating the ideal gas heat capacity, enthalpy, and entropy. Fluid Phase Equilibria, 6(3–4), 169–179. doi:10.1016/0378-3812(81)85002-9
source
Clapeyron.PPDSIdealType
PPDSIdeal <: PPDSIdealModel

PPDSIdeal(components;
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • A: Single Parameter (Float64) - Model Coefficient
  • B: Single Parameter (Float64) - Model Coefficient
  • C: Single Parameter (Float64) - Model Coefficient
  • D: Single Parameter (Float64) - Model Coefficient
  • E: Single Parameter (Float64) - Model Coefficient
  • F: Single Parameter (Float64) - Model Coefficient
  • G: Single Parameter (Float64) - Model Coefficient
  • Mw: Single Parameter (Float64) (Optional) - Molecular Weight [g·mol⁻¹]

Description

PPDS Ideal Model:

Cpᵢ(T)/R = B + (C - B)y²[1 + (y − 1)(D + Ey + Fy² + Gy³)]
y = T/(A + T)

Model Construction Examples

# Using the default database
idealmodel = PPDSIdeal("water") #single input
idealmodel = PPDSIdeal(["water","ethanol"]) #multiple components

# Using user-provided parameters

# Passing files or folders
idealmodel = PPDSIdeal(["neon","hydrogen"]; userlocations = ["path/to/my/db","alylee.csv"])

# Passing parameters directly
idealmodel = PPDSIdeal(["water","carbon dioxide"];
                        userlocations = (A = [4.004, 3.5],
                        B = [0.01, 2.044],
                        C = [268.8, 919.3],
                        D = [0.99, -1.06],
                        E = [1141.4, -865.1],
                        F = [3.07, 2.034],
                        G = [2507.37, 483.55],
                        H = [0.0, 0.0139],
                        I = [0.0, 341.11])
                        )

References

  1. Gmehling, J., Kleiber, M., Kolbe, B., & Rarey, J. (2019). Chemical thermodynamics for process simulation (2nd ed.). Berlin, Germany: Blackwell Verlag.
source
Clapeyron.ShomateIdealType
ShomateIdeal <: ShomateIdealModel

ShomateIdeal(components; 
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • a: Single Parameter (Float64) - polynomial coefficient
  • b: Single Parameter (Float64) - polynomial coefficient
  • c: Single Parameter (Float64) - polynomial coefficient
  • d: Single Parameter (Float64) - polynomial coefficient
  • e: Single Parameter (optional) (Float64) - polynomial coefficient for 1/T^2
  • Mw: Single Parameter (Float64) (Optional) - Molecular Weight [g·mol⁻¹]

Model parameters

  • a: Single Parameter (Float64) - polynomial coefficient
  • b: Single Parameter (Float64) - polynomial coefficient
  • c: Single Parameter (Float64) - polynomial coefficient
  • d: Single Parameter (Float64) - polynomial coefficient
  • e: Single Parameter (optional) (Float64) - polynomial coefficient for 1/T^2
  • coeffs: Single Parameter (NTuple{5,Float64})
  • Mw: Single Parameter (Float64) (Optional) - Molecular Weight [g·mol⁻¹]

Description

Shomate Ideal Model. Helmholtz energy obtained via integration of specific heat capacity:

Cpᵢ(T) = aᵢ  + bᵢT + cᵢT^2 + dᵢT^3 + eᵢT^-2
Cp(T) = ∑Cpᵢxᵢ

Model Construction Examples

# Using the default database
idealmodel = ShomateIdeal("water") #single input
idealmodel = ShomateIdeal(["water","ethanol"]) #multiple components

# Using user-provided parameters

# Passing files or folders
idealmodel = ShomateIdeal(["neon","hydrogen"]; userlocations = ["path/to/my/db","shomate.csv"])

# Passing parameters directly
idealmodel = ShomateIdeal(["water","butane"];
            userlocations = (a = [32.24, 9.487], 
                        b = [0.00192, 0.3313], 
                        c = [1.06e-5, -0.0001108],
                        d = [-3.6e-9, -2.822e-9],
                        Mw = [18.01, 58.12])
                        ) #e is not used
source
Clapeyron.CPLNGEstIdealType
CPLNGEstIdeal <: ReidIdealModel

CPLNGEstIdeal(components; 
userlocations = String[],
reference_state = nothing,
verbose = false)

Input parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]

Model parameters

  • Mw: Single Parameter (Float64) - Molecular Weight [g·mol⁻¹]
  • coeffs: Single Parameter (NTuple{5,Float64}) - polynomial coefficients

Description

Estimation of Reid polynomial, using the molecular weight as input:

Cpᵢ(T) = aᵢ  + bᵢT + cᵢT^2 + dᵢT^3
Cp(T) = ∑Cpᵢxᵢ
a = -10.9602   * γ₀ + 25.9033
b = 2.1517e-1  * γ₀ - 6.8687e-2 
c = -1.3337e-4 * γ₀ + 8.6387e-5
d = 3.1474e-8  * γ₀ -2.8396e-8
γ₀ = Mw/Mw(air)

Model Construction Examples

# Using the default database
idealmodel = CPLNGEstIdeal("water") #single input
idealmodel = CPLNGEstIdeal(["water","ethanol"]) #multiple components

# Using user-provided parameters

# Passing files or folders
idealmodel = CPLNGEstIdeal(["neon","hydrogen"]; userlocations = ["path/to/my/db","mw.csv"])

# Passing parameters directly
idealmodel = CPLNGEstIdeal(["neon","hydrogen"];userlocations = (;Mw = [20.17, 2.]))

References

  1. Kareem, L. A., Iwalewa, T. M., & Omeke, J. E. (2014). Isobaric specific heat capacity of natural gas as a function of specific gravity, pressure and temperature. Journal of Natural Gas Science and Engineering, 19, 74–83. doi:10.1016/j.jngse.2014.04.011
source
Clapeyron.GlennJLType
GlennJL <: IdealModel

GlennJL(calc::Union{Glenn.Calculator,Glenn.ThermoDB}, input;
        Rgas = Clapeyron.Rgas(),
        R0 = 8.314510,
        reference_state = nothing,
        verbose = false,
        strict = true)

Input arguments

  • calc: a database of Glenn.jl parameters
  • input: input species, it can be strings, integers (ID of the database), Glenn.SpeciesInfo or a vector of those elements.
  • Rgas: molar gas constant used by the model.
  • R0: molar gas constant used in the fitting of each species. by default it used the original R constant used in the fitting of NASA-7 polynomials.
  • reference_state: if a change of reference state is needed.
  • verbose: if set to true, displays additional information to the REPL.
  • strict: if set to true, check if all components have the same phase and if their temperature ranges do not intersect

Description

Ideal model using the NASA-7 polynomial coefficients provided by the Glenn.jl package. the polynomials are standarized to fit specific values of enthalpy and entropy at 1 bar, 298.15K.

Note

Clapeyron.GlennJL requires the package Glenn.jl to be loaded in the enviroment.

Model Construction Examples

# Using the default database
calc = Calculator()

# Using a string
idealmodel = GlennJL(calc,"o2")

# Using the ID of O2 in the default database
idealmodel = GlennJL(calc,931)

# Using a SpeciesInfo to search the database
o2 = only(get_available_species(calc, "O2", exact_match = true))
idealmodel = GlennJL(calc,o2)

# Multiple components, any of the types above can be used instead of strings
idealmodel = GlennJL(calc,["o2","n2"])

Glenn.jl integrations

the model GlennJL has the following integrations with Glenn.jl package:

  • Glenn.calculate_h(model::GlennJL,T,z = [1.0])
  • Glenn.calculate_s(model::GlennJL,T,z = [1.0])
  • Glenn.calculate_cp(model::GlennJL,T,z = [1.0])
  • Glenn.calculate_formation_enthalpy(model::GlennJL,T,z = [1.0])
  • Glenn.calculate_enthalpy_change(model::GlennJL,T1,T2,z = [1.0])
  • Glenn.calculate_properties(model::GlennJL,T,z = [1.0])
  • Glenn.get_properties_range(model::GlennJL,T,z = [1.0])

get_properties and get_properties_range will return NaN for properties outside their ranges. in particular, get_properties_range will return a vector of the same size as the input, with NaN on invalid inputs.

References

  1. NASA TP-2002-211556, “NASA Glenn Coefficients for Calculating Thermodynamic Properties of Individual Species,” by B.J. McBride, M.J. Zehe, and S. Gordon. September 2002.
source

Joback GC Utilities

Clapeyron.JobackGCModule
JobackGC

Module containing group contribution calculations using the joback method. The available functions are:

  • JobackGC.T_c(model::JobackModel): critical temperature (in [K])
  • JobackGC.P_c(model::JobackModel): critical pressure (in [Pa])
  • JobackGC.V_c(model::JobackModel): critical volume (in [m³·mol⁻¹])
  • JobackGC.T_b(model::JobackModel): normal boiling point (in [K])
  • JobackGC.H_form(model::JobackModel): enthalpy of formation at 298 K, ideal gas (in [J·mol⁻¹])
  • JobackGC.G_form(model::JobackModel): Gibbs energy of formation at 298 K, ideal gas (in [J·mol⁻¹])
  • JobackGC.S_form(model::JobackModel): entropy of formation at 298 K, ideal gas (in [J·mol⁻¹·K⁻¹])
  • JobackGC.H_fusion(model::JobackModel): enthalpy of fusion (in [J·mol⁻¹], at 1 atm)
  • JobackGC.H_vap(model::JobackModel): molar enthalpy of vaporization (in [J·mol⁻¹], at normal boiling point)
  • JobackGC.C_p(model::JobackModel, T): ideal gas isobaric heat capacity (in [J·mol⁻¹·K⁻¹])
  • JobackGC.Visc(model::JobackModel, T): liquid dynamic viscocity (in [Pa·s])
source