-
bubble_pressure,bubble_temperature,dew_pressure, anddew_temperaturecan now support custom methods. (subtypingBubblePointMethodorDewPointMethod). the default methods are now namedChemPotBubblePressure,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
nonvolatileskeyword, supported by all available bubble solvers. similarly, all dew methods support thenoncondensableskeyword to leave some components out of the dew phase.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using Roots | |
| function X_exact2!(K,X) | |
| k1 = K[1,2] | |
| k2 = K[2,1] | |
| #this computation is equivalent to the one done in Clapeyron.X_exact1 | |
| _a = k2 | |
| _b = 1 - k2 + k1 | |
| _c = -1 | |
| denom = _b + sqrt(_b*_b - 4*_a*_c) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #tested on Julia 1.8.3 | |
| using Downloads #stdlib, other versions use HTTP | |
| const DOI2BIB_CACHE = Dict{String,String}() | |
| function doi2bib(doi::String) | |
| if haskey(DOI2BIB_CACHE,doi) | |
| return DOI2BIB_CACHE[doi] #caching requests | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using BenchmarkTools, Random | |
| Random.seed!(123) | |
| BenchmarkTools.DEFAULT_PARAMETERS.time_tolerance = 1.0e-11 # may or may not matter | |
| BenchmarkTools.DEFAULT_PARAMETERS.evals = 1 # important | |
| #== | |
| alternative implementation of square root. | |
| #aproximation of the square root using the float representation as a trick | |
| used in providing an initial value for calculations of square roots. |