Skip to content

Commit dabc55b

Browse files
committed
Merge branch 'master' of https://github.com/ClapeyronThermo/Clapeyron.jl into implicit-solvent
2 parents ed829ea + 49b283a commit dabc55b

File tree

17 files changed

+61
-42
lines changed

17 files changed

+61
-42
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## New Features
44

5+
- Implicit differentiation: the core implicit differentiation routines were replaced by `IFTDuals.ift`.
6+
57
## package deprecations
68

79
## Bug fixes
10+
11+
- Fixes in Multifluid initial volume
12+
- Fixes in `MultiPhaseTPFlash`

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ Downloads = "1"
6262
EoSSuperancillaries = "1.2.3"
6363
FillArrays = "^0.12, 0.13, 1"
6464
ForwardDiff = "0.10.36,1"
65-
IFTDuals = "0.1.2"
65+
IFTDuals = "0.1.4"
6666
JSON = "1"
6767
JutulDarcy = "0.2, 0.3"
6868
LinearAlgebra = "1"

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ We support many equations of state and properties. Some examples of figures you
2424

2525
- Isobaric heat capacity of carbon dioxide at 20 MPa:
2626

27-
![CO2_cp](docs/CO2_cp.svg)
27+
![CO2_cp](docs/CO2_cp.svg)
2828

2929
- Water VLE envelope:
3030

@@ -38,7 +38,7 @@ We support many equations of state and properties. Some examples of figures you
3838

3939
![CH3OH_CyHx](docs/CH3OH_CyHex.svg)
4040

41-
If you find any issues, feel free to contact us directly on the [Zulip Channel](https://julialang.zulipchat.com/#narrow/stream/265161-Clapeyron.2Ejl), or open a Github issue.
41+
If you find any issues, feel free to contact us directly on the [Zulip Channel](https://julialang.zulipchat.com/#narrow/stream/265161-Clapeyron.2Ejl), or open a Github issue.
4242

4343
# Installing Clapeyron
4444

@@ -93,7 +93,7 @@ uv add pyclapeyron
9393

9494
If you are using Clapeyron for your research work, please cite the following:
9595

96-
```
96+
```json
9797
@article{Clapeyron-2022,
9898
title={Clapeyron.jl: An Extensible, Open-Source Fluid Thermodynamics Toolkit},
9999
author={Pierre J. Walker, Hon-Wa Yew, and Andrés Riedemann},
@@ -112,4 +112,4 @@ If you are using Clapeyron for your research work, please cite the following:
112112

113113
Note that at its current stage, Clapeyron is still in the early stages of development, and things may be moving around or changing rapidly, but we are very excited to see where this project may go!
114114

115-
We are open to contributions. New models, improved methods and more databases are always appreciated!
115+
We are open to contributions. New models, improved methods and more databases are always appreciated!

docs/src/installation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ Here is a list of packages the developers of Clapeyron recommend using:
5656
Clapeyron.jl is also available in python via the [pyclapeyron](github.com/ClapeyronThermo/pyclapeyron) package.
5757
You can install `pyclapeyron` from PyPI via `pip` or `uv`:
5858

59-
```
59+
```sh
6060
pip install pyclapeyron
6161
```
6262

6363
or
6464

65-
```
65+
```sh
6666
uv add pyclapeyron
67-
```
67+
```

src/methods/pT.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ export gibbs_energy,helmholtz_energy,gibbs_energy_res,helmholtz_energy_res
10521052
export mass_enthalpy,mass_entropy,mass_internal_energy,mass_gibbs_energy,mass_gibbs_free_energy,mass_helmholtz_energy,mass_helmholtz_free_energy
10531053
#second derivative order properties
10541054
export isochoric_heat_capacity, isobaric_heat_capacity,adiabatic_index
1055-
export mass_isobaric_heat_capacity,mass_isobaric_heat_capacity
1055+
export mass_isobaric_heat_capacity,mass_isochoric_heat_capacity
10561056
export isothermal_compressibility, isentropic_compressibility, speed_of_sound
10571057
export isobaric_expansivity, joule_thomson_coefficient, inversion_temperature
10581058
#higher derivative order properties

src/methods/property_solvers/multicomponent/bubble_point.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ function bubble_temperature_init(model,p,x,vol0,T0,y0,volatiles)
525525
end
526526

527527
"""
528-
bubble_temperature(model::EoSModel, p, x,method::BubblePointMethod = ChemPotBubbleTemperature())
528+
bubble_temperature(model::EoSModel, p, x,method::ThermodynamicMethod = ChemPotBubbleTemperature())
529529
530530
Calculates the bubble temperature and properties at a given pressure `p`.
531531
Returns a tuple, containing:

src/methods/property_solvers/multicomponent/tp_flash/multiphase.jl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ function set_idx_vapour!(idx_vapour,model,result)
10351035
v = result.volumes
10361036
β = result.fractions
10371037
x = result.compositions
1038-
1038+
10391039
for i in 1:np
10401040
if is_vapour(identify_phase(model,p,T,x[i],vol = v[i]))
10411041
idx_vapour[] = i
@@ -1171,15 +1171,25 @@ function multi_g_obj(model,p,T,z,_result,ss_cache)
11711171
xnp .= z ./ t
11721172
vnp = vols[np]
11731173
phase_np = __mpflash_phase(idx_vapour[],np)
1174-
g = modified_gibbs(model,p,T,xnp,phase_np,vnp)[1]
1174+
11751175
#g = βnp*(eos(model,vnp,T,xnp) + p*vnp)
1176+
if has_a_res(model)
1177+
g = βnp*(eos(model,vnp,T,xnp) + p*vnp)
1178+
else
1179+
g = βnp*modified_gibbs(model,p,T,xnp,phase_np,vnp)[1]
1180+
end
1181+
11761182
for i in 1:np-1
11771183
Ki = viewn(𝕏,nc,i)
11781184
xi .= xnp .* exp.(Ki)
11791185
vi = exp(vols[i])
1180-
#g += β[i]*(eos(model,vi,T,xi) + p*vi)
11811186
phase_i = __mpflash_phase(idx_vapour[],i)
1182-
g += modified_gibbs(model,p,T,xi,phase_i,vi)[1]
1187+
#g += β[i]*(eos(model,vi,T,xi) + p*vi)
1188+
if has_a_res(model)
1189+
g += β[i]*(eos(model,vi,T,xi) + p*vi)
1190+
else
1191+
g += β[i]*modified_gibbs(model,p,T,xi,phase_i,vi)[1]
1192+
end
11831193
end
11841194
return g/(Rgas(model)*T)
11851195
end
@@ -1197,7 +1207,7 @@ function initial_beta!(comps,z)
11971207
reconstitute_x!(comps,z,βi,imin)
11981208
end
11991209
βi ./= sum(βi)
1200-
return βi
1210+
return βi
12011211
end
12021212

12031213
function reconstitute_x!(comps,z,bi,i0)

src/models/CompositeModel/GammaPhi.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ function modified_∂lnϕ∂n(wrapper::PTFlashWrapper{<:GammaPhi}, p, T, z, cach
485485
end
486486
end
487487

488-
function ∂lnϕ∂n∂P∂T(wrapper::PTFlashWrapper, p, T, z=SA[1.],cache = ∂lnϕ_cache(model,p,T,z,Val{true}());
488+
function ∂lnϕ∂n∂P∂T(wrapper::PTFlashWrapper, p, T, z=SA[1.],cache = ∂lnϕ_cache(wrapper,p,T,z,Val{true}());
489489
phase=:unknown,
490490
vol0=nothing,
491491
threaded = true,
@@ -511,7 +511,7 @@ function ∂lnϕ∂n∂P∂T(wrapper::PTFlashWrapper, p, T, z=SA[1.],cache = ∂
511511
end
512512
end
513513

514-
function ∂lnϕ∂n∂P(wrapper::PTFlashWrapper, p, T, z=SA[1.],cache = ∂lnϕ_cache(model,p,T,z,Val{false}());
514+
function ∂lnϕ∂n∂P(wrapper::PTFlashWrapper, p, T, z=SA[1.],cache = ∂lnϕ_cache(wrapper,p,T,z,Val{false}());
515515
phase=:unknown,
516516
vol0=nothing,
517517
threaded = true,
@@ -537,7 +537,7 @@ function ∂lnϕ∂n∂P(wrapper::PTFlashWrapper, p, T, z=SA[1.],cache = ∂lnϕ
537537
end
538538
end
539539

540-
function ∂lnϕ∂P(wrapper::PTFlashWrapper, p, T, z=SA[1.], cache = ∂lnϕ_cache(model,p,T,z,Val{false}());
540+
function ∂lnϕ∂P(wrapper::PTFlashWrapper, p, T, z=SA[1.], cache = ∂lnϕ_cache(wrapper,p,T,z,Val{false}());
541541
phase=:unknown,
542542
vol0=nothing,
543543
threaded = true,
@@ -560,7 +560,7 @@ function ∂lnϕ∂P(wrapper::PTFlashWrapper, p, T, z=SA[1.], cache = ∂lnϕ_ca
560560
end
561561
end
562562

563-
function ∂lnϕ∂T(wrapper::PTFlashWrapper, p, T, z=SA[1.], cache = ∂lnϕ_cache(model,p,T,z,Val{false}());
563+
function ∂lnϕ∂T(wrapper::PTFlashWrapper, p, T, z=SA[1.], cache = ∂lnϕ_cache(wrapper,p,T,z,Val{true}());
564564
phase=:unknown,
565565
vol0=nothing,
566566
threaded = true,

src/models/CompositeModel/LiquidVolumeModel/LiquidVolumeModel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
abstract type LiquidVolumeModel <: GibbsBasedModel end
22

3-
include("NaNLiquid/NaNLiquid.jl")
3+
include("ZeroLiquid/ZeroLiquid.jl")
44
include("Rackett/RackettLiquid.jl")
55
include("COSTALD/costald.jl")
66
include("DIPPR105Liquid/DIPPR105Liquid.jl")

src/models/CompositeModel/LiquidVolumeModel/NaNLiquid/NaNLiquid.jl renamed to src/models/CompositeModel/LiquidVolumeModel/ZeroLiquid/ZeroLiquid.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ liquid = ZeroLiquid(["water","carbon dioxide"])
2525
ZeroLiquid
2626

2727
export ZeroLiquid
28-
const NaNLiquid = ZeroLiquid
28+
29+
@deprecate NaNLiquid(args...;kwargs...) ZeroLiquid(args...;kwargs...)
2930

3031
function volume_impl(model::ZeroLiquidModel,p,T,z,phase,threaded,vol0)
3132
_0 = zero(first(z))

0 commit comments

Comments
 (0)