-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathSRK.jl
executable file
·90 lines (78 loc) · 3.16 KB
/
SRK.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
"""
SRK(components::Vector{String};
idealmodel = BasicIdeal,
alpha = SoaveAlpha,
mixing = vdW1fRule,
activity = nothing,
translation = NoTranslation,
userlocations = String[],
ideal_userlocations = String[],
alpha_userlocations = String[],
mixing_userlocations = String[],
activity_userlocations = String[],
translation_userlocations = String[],
reference_state = nothing,
verbose = false)
## Description
Soave-Redlich-Kwong equation of state. it uses the following models:
- Translation Model: [`NoTranslation`](@ref)
- Alpha Model: [`SoaveAlpha`](@ref)
- Mixing Rule Model: [`vdW1fRule`](@ref)
## Model Construction Examples
```julia
# Using the default database
model = SRK("water") #single input
model = SRK(["water","ethanol"]) #multiple components
model = SRK(["water","ethanol"], idealmodel = ReidIdeal) #modifying ideal model
model = SRK(["water","ethanol"],alpha = Soave2019) #modifying alpha function, using 2019 correlation
model = SRK(["water","ethanol"],translation = RackettTranslation) #modifying translation
model = SRK(["water","ethanol"],mixing = KayRule) #using another mixing rule
model = SRK(["water","ethanol"],mixing = WSRule, activity = NRTL) #using advanced EoS+gᴱ mixing rule
# Passing a prebuilt model
my_alpha = SoaveAlpha(["ethane","butane"],userlocations = Dict(:acentricfactor => [0.1,0.2]))
model = SRK(["ethane","butane"],alpha = my_alpha)
# User-provided parameters, passing files or folders
model = SRK(["neon","hydrogen"]; userlocations = ["path/to/my/db","cubic/my_k_values.csv"])
# User-provided parameters, passing parameters directly
model = SRK(["neon","hydrogen"];
userlocations = (;Tc = [44.492,33.19],
Pc = [2679000, 1296400],
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.
l = [0. 0.01; 0.01 0.])
)
```
## References
1. Soave, G. (1972). Equilibrium constants from a modified Redlich-Kwong equation of state. Chemical Engineering Science, 27(6), 1197–1203. [doi:10.1016/0009-2509(72)80096-4](https://doi.org/10.1016/0009-2509(72)80096-4)
"""
function SRK(components;
idealmodel = BasicIdeal,
alpha = SoaveAlpha,
mixing = vdW1fRule,
activity = nothing,
translation = NoTranslation,
userlocations = String[],
ideal_userlocations = String[],
alpha_userlocations = String[],
mixing_userlocations = String[],
activity_userlocations = String[],
translation_userlocations = String[],
reference_state = nothing,
verbose = false)
return RK(components;
idealmodel = idealmodel,
alpha = alpha,
mixing = mixing,
activity = activity,
translation = translation,
userlocations = userlocations,
ideal_userlocations = ideal_userlocations,
alpha_userlocations = alpha_userlocations,
mixing_userlocations = mixing_userlocations,
activity_userlocations = activity_userlocations,
translation_userlocations = translation_userlocations,
reference_state = reference_state,
verbose = verbose)
end
export SRK