Clapeyron.jl

Clapeyron provides a framework for the development and use of fluid-thermodynamic models, including SAFT, cubic, activity, multi-parameter, and COSMO-SAC.

MIT License

Stars
183
Committers
22

Bot releases are hidden (Show)

Clapeyron.jl - v0.5.11 Latest Release

Published by longemen3000 7 months ago

v0.5.11

New Features

  • Support for reference states. A reference state is a point in V-T space where H = H₀ and S = S₀. Setting those have uses in Reaction equilibria and when comparing between different models.In particular, Reference states are stored in a ReferenceState <: ClapeyronParam in the ideal model parameters. The BasicIdeal model is, intentionally, the only ideal model in Clapeyron that does not have this struct and, as a consequence, it is not able to set reference states.
  • Support for superancillaries via EoSSuperancillaries.jl. When the package is loaded, initial saturation points for cubics and PCSAFT are overloaded to use superancillary evaluations instead of the general x0_sat_pure function. in the case of PCSAFT models, it also speeds up the evaluation of crit_pure.
  • New EoS: EOS-CG (2021) (EOS_CG), a reference model for humid gases and CCS mixtures.
  • New EoS: Lee-Kesler-Plöcker (LKP)
  • New EoS: Shomate ideal model (ShomateIdeal)
  • database: PCPSAFT,gcPCSAFT and gcPCPSAFT are updated to use the values of Rehner (2023).
  • new functions: helmholtz_free_energy_res,gibbs_free_energy_res,internal_energy_res, enthalpy_res
  • database: ReidIdeal now uses the poling coefficients by default.
  • database: JobackIdeal has support for more common group fragments used in gcPCSAFT.
  • melting_temperature, sublimation_temperature does not allocate anymore. Note that the function can still allocate if the EoS model itself allocates.

bug fixes

  • Incorrect value for CPA with water (#256)
  • Bug in SAFT-VR-SW (#165)
  • Bug in CP-PC-SAFT

Merged PRs

Full Changelog: https://github.com/ClapeyronThermo/Clapeyron.jl/compare/v0.5.10...v0.5.11

Clapeyron.jl - v0.5.0

Published by longemen3000 about 1 year ago

New Features

  • rework of @newmodel, @newmodelgc and newmodelsingle macros. Now they also define the outer constructor. for a simple EoS that does not require transformation of parameters, you can now do:
@newmodel MyModel EoSModel MyModelParam
#define locations for your model, relative to the current database location
Clapeyron.default_locations(::Type{MyModel}) = ["models/mymodel"]
#define references
Clapeyron.default_references(::Type{MyModel}) = ["TODO"]
  • new macro @newmodelsingleton, that defines "singleton" EoSModels.
  • Rework of MultiParameter EoS. there are two new EoSModels that represent Empiric, Multiparameter EoS:
    • SingleFluid: for single component fluids
    • MultiFluid: for multicomponent fluids, with specific mixing and departure rules
      SingleFluid and MultiFluid constructors are capable of parsing CoolProp JSON single component files. furthermore, you can use the available CoolProp single fluid library by just importing CoolProp into the current working enviroment (using CoolProp).
  • Cubic models that have an alpha dependent of the acentric factor, can be built by passing acentricfactor directly to userlocations, instead of alpha_userlocations (#188)
  • New Function: RGas(model) and Rgas(), that gives the value of the gas constant used by the model. defaults to Clapeyron.R̄ = 8.31446261815324
  • New model: HelmAct, to use multiparameter EoS + activity coefficient models as the departure.
  • New model: XiangDeiters
  • New model: TholLJ (used in LJRef)
  • New model: EmpiricIdeal, the ideal part of a multiparameter model, to be used in conjuction with other EoS
  • New model: AlyLeeIdeal
  • New model: CPLNGEstIdeal (http://dx.doi.org/10.1016/j.jngse.2014.04.011)
  • CSVs allow defining a sep keyword in the inline CSV options:
Clapeyron Database File
my parameters [csvtype = like, sep = ;]
species,Mw
1,3,5,7-CYCLOOCTATETRAENE;156.22368

Breaking changes

  • IAPWS95, PropaneRef, Ammonia2023 are now of type SingleFluid{EmpiricAncillary}.
  • GERG2008, EOS-LNG are now of type MultiFluid{EmpiricAncillary,AsymmetricMixing,EmpiricDeparture}
  • @newmodel macros don't require defining external constructors anymore.
  • SpecialComp (used by pharmaPCSAFT) is now a ClapeyronParam instead of an EoSModel
Clapeyron.jl - v0.4.7

Published by longemen3000 over 1 year ago

bug fixes

  • @newmodel,@newmodelsimple and@newmodelgc macros had a bug where some structs and types didn't have the proper namespace (#154)
Clapeyron.jl - v0.4.6

Published by longemen3000 over 1 year ago

Bug fixes

fixed bug on Michelsen TP flash introduced in the last release.

Clapeyron.jl - v0.4.5

Published by longemen3000 over 1 year ago

Bug fixes

DETPFlash now returns results sorted by increasing molar volume (heavy liquid ->light liquid -> vapour) (fixes #151)

Clapeyron.jl - v0.4.4

Published by longemen3000 over 1 year ago

New Features

  • New EoS: Ammonia2023, an Empiric EoS with a new term (https://doi.org/10.1063/5.0128269)
  • Speed improvements on some Empiric EoS
  • Estimation Framework: the method is now specified as a csv option instead of just the title.
  • Estimation Framework: support for setting species to be estimated.

Bug fixes

  • some references in the SAFTVRMie's csv were incorrect.
  • recombine! now works with StructGroupParam.
Clapeyron.jl - v0.4.3

Published by longemen3000 over 1 year ago

Bug fixes

  • incorrect indexing of sites when doing group-to-component transformation (e.g SAFTgammaMie) with more than one association site per molecule.
  • better error handling when incorrect group types are assigned.
Clapeyron.jl - v0.4.2

Published by longemen3000 over 1 year ago

Bug Fixes

  • Typo in assoc_translator field when creating assoc sites with groups that have multiple association groups.
  • Correct initialization of β in rachfordrice
Clapeyron.jl - v0.4.1

Published by longemen3000 almost 2 years ago

New Features

  • New Clapeyron Parameter StructGroupParam, that stores groups, as well as it's bonds between them, used in heteronuclear GC approaches
  • New EOS: structural SAFT-γ-Mie (structSAFTgammaMie)
  • New EOS: heteronuclear GC-PC-SAFT (gcPCSAFT)
  • in some limited cases, split_model can now differenciate between group and component parameters inside a model
Clapeyron.jl - v0.4.0

Published by longemen3000 almost 2 years ago

New Features

  • New estimation framework, to fit new model parameters from known data. at the moment of this release, it should support all SAFTs, Cubics, Activity models and models that don't require any special pre-computed cache.

  • Base.transpose(model::EoSModel) is defined. now this is valid code:

T = 300:350
comp = ["water"]
models = [m(comp) for m in (PR,PCSAFT,SAFTVRMie)]
saturation_pressure.(transpose(models),T) #produces a 51×3 Matrix{Tuple{Float64, Float64, Float64}}:

Breaking Changes

  • x0_sat_pure now returns Vl and Vv (in [m^3]) instead of log10(Vl) and log10(Vv).
  • in databases, segment is used instead of m
  • in databases, Vc is used instead of vc
  • in databases, Pc is used instead of pc
  • in databases, acentricfactor is used instead of w
Clapeyron.jl - v0.3.12

Published by longemen3000 almost 2 years ago

new features

  • new EoS: RKPR (RKPR)
  • new functions: cross_second_virial and equivol_cross_second_virial, to calculate B12, at specified z conditions, or by setting equivolumetric mixing.
  • cubic EoS now support recombine!
  • PenelouxTranslation and RackettTranslation now cache their results, resulting in a speed up when using volume translated EoS.
  • Clapeyron.cite now accepts the optional argument out, that can be doi (current default, DOI) or :bib (for BibTeX)

Bug fixes

  • various bug fixes in SAFT-VRQ-Mie. the Hard sphere term now performs the non-additive mixing rule for the multicomponent case. initializations with integer values are fixed.
Clapeyron.jl - v0.3.11

Published by longemen3000 almost 2 years ago

New features

  • new EoS: PCSAFT with activity mixing rules (GEPCSAFT(components; activity)) (https://doi.org/10.1021/acs.iecr.2c03464)
  • new EoS: UNIFAC-FV (UNIFACFV)
  • new EoS UNIFAC-FV-poly (UNIFACFVPoly)
  • getparams now supports inline csvs, custom locations and the ability to replace or swap out certain parameters, check getparams docs for more information
  • new function: recombine! to recalculate combining and mixing rules after one parameter is modified. at the moment, SAFT and activity models have this defined.
  • all quadratic mixing rules have an implace version (sigma_LorentzBerthelot(sigma,zeta) -> sigma_LorentzBerthelot!(sigma,zeta))
  • AssocParam has getindex/setindex! methods defined.
  • GroupParam has a new field, grouptype, to differenciate group parametrizations

Deprecations

  • icomponents was removed, use Clapeyron.@comps or 1:length(model) instead
  • PairParam.diagvalues was removed, use Clapeyron.diagvalues(param) instead
Clapeyron.jl - v0.3.10

Published by longemen3000 about 2 years ago

New features

  • dew_pressure and dew_temperature can now by calculated with ActivityModels. options available can be passed via the new methods ActivityBubblePressure, ActivityBubblwTemperature, ActivityDewPressure, ActivityDewTemperature. helmholtz-based models also support solving bubble_pressure and dew_pressure using those methods (http://dx.doi.org/10.1021/acs.iecr.1c03800).
  • There is support for γ-ϕ equilibria on bubble_pressure and dew_pressure with activity models, that is:, solving yᵢϕᵢp = γᵢp₀ᵢϕ₀ᵢ𝒫ᵢ
  • New Correlation models: LeeKeslerSat, DIPPR101Sat for saturation pressure and temperature, COSTALD, RackettLiquid,DIPPR105Liquid, for saturated liquid volume.
  • New models: Second Virial models (AbbottVirial,TsonopoulosVirial and EoSVirial2)
  • New model: CompositeModel, used to hold saturation, liquid and vapor correlations. For example, instantiating an Activity Model, that uses Peng-Robinson for a gas model, DIPPR 101 for saturation and COSTALD for liquid volume, with a wilson activity coefficient, can be written as:
    julia> com = CompositeModel(["water","methanol"],liquid = COSTALD,saturation = DIPPR101Sat,gas = PR)
    Composite Model:
    Gas Model: PR{BasicIdeal, PRAlpha, NoTranslation, vdW1fRule}("water", "methanol")
    Liquid Model: COSTALD("water", "methanol")
    Saturation Model: DIPPR101Sat("water", "methanol")
    
    # Wilson activity model, using the composite model as the pure model
    julia> model = Wilson(["water","methanol"],puremodel = com) 
    Wilson{CompositeModel{PR{BasicIdeal, PRAlpha, NoTranslation, vdW1fRule}, COSTALD, Nothing, DIPPR101Sat, Nothing}} with 2 components:       
    "water"
    "methanol"
    Contains parameters: g, Tc, Pc, ZRA, Mw
    
  • Improved initial points for bubble_temperature and dew_temperature.
  • MichelsenTPFlash no uses an accelerated successive substitution method.

Bug fixes

  • cross-association weren't counted in some cases.
  • incorrect initialization on FugBubbleTemperature
  • Clapeyron.lnϕ uses the specialized algorithm for volume instead of the general one.
Clapeyron.jl - v0.3.9

Published by longemen3000 about 2 years ago

New features

  • New combining rules that are done at model creation time instead of runtime: :cr1 and :esd/elliott. the old elliott combining rule was renamed to elliott_runtime (it is only used on PharmaPCSAFT, where is required)

Bug fixes

  • crit_pure on CPA was failing (#112, #113)
  • error on bubble/dew pressure/temperature when using the v0 starting point (#113)
  • crit_pure was slower than expected on julia 1.8
  • add error path on SingleParam when all data is missing
Clapeyron.jl - v0.3.8

Published by longemen3000 about 2 years ago

New features

  • bubble_pressure, bubble_temperature, dew_pressure, and dew_temperature can now support custom methods. (subtyping BubblePointMethod or DewPointMethod). the default methods are now named ChemPotBubblePressure, ChemPotBubbleTemperature,ChemPotDewPressure,ChemPotDewTemperature. you can provide some or all necessary initial conditions to those new methods:

    res = bubble_pressure(model,T,x,ChemPotBubblePressure(;y0;p0;vol0))
    
  • New bubble/dew methods based on isofugacity conditions: FugtBubblePressure, FugBubbleTemperature,FugDewPressure,FugtDewTemperature.

  • All bubble methods now support leaving some components out of the bubble phase,via the nonvolatiles keyword, supported by all available bubble solvers. similarly, all dew methods support the noncondensables keyword to leave some components out of the dew phase.

  • MichelsenTPFlash can support both nonvolatiles and noncondensables.

  • SingleParam and PairParam support indexing and broadcasting. PairParam has a modified indexing scheme, where param[i] will return the diagonal elements, param[i,j] will return off-diagonal elements. setindex! on PairParam is symmetric by default, that is, param[i,j] = k will also set param[j,i]. you can opt out of this by doing param[i,j,false] = k

  • New function: diagvalues, for obtaining a vector view of the diagonal elements of a Pair or Single Parameter.

  • New functions: VT_gibbs_free_energy_res and VT_helmholtz_free_energy_res

  • New saturation method: saturation_temperature(model,p,::SuperAncSaturation)

  • index_reduction(model,x::AbstractVector{Bool}) will return a reduced model, according to the true values of the vector x. Passing another vector will perform the index reduction based on non-empty values, as usual.

  • Initial (and optional) support for solid phase volume solving, via x0_volume_solid

  • New EoS (experimental): AnalyticalSLV, that supports solid, liquid and vapour phases in one continous helmholtz functional.

  • the database parser is faster and has better verbose reporting.

  • SAFTVRMie and SAFTGammaMie should be a little faster on single component evaluations

Bug Fixes

  • activity_coefficient and fugacity_coefficient now works with SVector #104
  • there was a bug on calculating the length of GC models that went under split_model

Deprecations

  • model.params.param.diagvalues is not longer used in the codebase and it will be removed at the next breaking version. use diagvalues(model.params.param) or model.params.param[i] instead.

  • model.icomponents is not longer used in the codebase and it will be removed at the next breaking version. 1:length(model) or Clapeyron.@comps instead.

Clapeyron.jl - v0.3.7

Published by longemen3000 over 2 years ago

New features

  • You can now define custom saturation (temperature or pressure) solvers, via subtyping SaturationMethod. The default solver is now named ChemPotVSaturation.
  • New methods for saturation pressure: IsoFugacitySaturation, ChemPotDensitySaturation, SuperAncSaturation (for cubics)
  • All saturation methods support passing the crit keyword, to allow using precomputed critical points.
  • All saturation methods that use a non linear solver support passing convergence options.
  • The default solver for saturation_temperature was changed (now named AntoineSaturation). The new model is much faster and with a similar reliability. the old one is available via ClapeyronSaturation.
  • New method for TP-Flash: MichelsenTPFlash
  • New function: tpd, that tries to find all negative tangent plane distances
  • New function: lle_init, that tries to find good LLE starting points, via tpd
  • New function: x0_saturation_temperature(model,p), that returns starting points for saturation_temperature.
  • New function: x0_psat(model,p), that returns starting points for IsoFugacitySaturation.
  • New function: antoine_coef for reduced antoine coefficients. used to accelerate initial points, if available.
  • New function: cite(model) returns all references used in the evaluation of a model.
  • bubble_temperature, dew_temperature, lle_temperature, azeotrope_temperature and vlle_temperature methods now iterate directly over the extended-with-temperature non linear system that their pressure cointerparts.
  • Cubics were revamped and generalized even more. those changes opened the way to introduce more non-standard cubics, all while being compatible with the initial guess procedures, advanced mixing rules and other Clapeyron optimizations for cubics.
  • New cubic EoS: Clausius
  • New cubic EoS: Berthelot
  • New cubic EoS: Patel-Teja (PatelTeja)
  • New cubic EoS: Patel-Teja-Valderrama (PatelTeja)
  • New cubic EoS: Kumar-Upadhyay two parameter EoS (KU)
  • New mixing rule: Modified Wong-Sandler (ModWS)
  • SoaveAlpha now works with vdW and PR (returning the same value of PRAlpha)
  • New EoS: Perturbed, truncated and shifted LJ EoS (PeTS)
  • SPUNG is now a constructor for the new ECS model.
  • volume now accepts a vol0 initial point.
  • PCSAFT should be a little bit faster for single component cases
Clapeyron.jl - v0.3.6

Published by longemen3000 over 2 years ago

New Features

  • ZeroResidual model (a_res = 0)

Bug fixes

  • HVRule uses the original rule instead of the modified one.
  • ismissingvalues is preserved when a combining rule is applied. this allows us to track inputed parameters vs calculated ones.

In particular, this release is the one used in the Clapeyron.jl paper. and it's results should be reproducible by locking the version to v0.3.6.

Clapeyron.jl - Initial Public Release

Published by ypaul21 about 4 years ago

This is the first public release of OpenSAFT.jl.

Package Rankings
Top 15.91% on Juliahub.com
Badges
Extracted from project README
DOI Build Status codecov Dev project chat Clapeyron.jl: An Extensible Implementation of Equations of State | Paul Yew et al | JuliaCon2021
Related Projects