11# a GC averaged UNIFAC.
2- struct UNIFACFVCache <: EoSModel
2+ struct UNIFACFVCache{T} <: EoSModel
33 components:: Vector{String}
4- r:: Vector{Float64 }
5- q:: Vector{Float64 }
6- m:: Vector{Float64 }
7- Mw:: Vector{Float64 }
4+ r:: Vector{T }
5+ q:: Vector{T }
6+ m:: Vector{T }
7+ Mw:: Vector{T }
88end
99
10- UNIFACFVCache (groups :: GroupParam ,params ) = UNIFACFVCache (groups,params . Q,params . R,params . Mw)
10+ UNIFACFVCache (components,r,q,q_p ) = UNIFACFVCache {eltype(r)} (components,r,q,m, Mw)
1111
1212function UNIFACFVCache (groups:: GroupParam ,Q,R,Mw)
1313 Mw = group_sum (groups,Mw. values)
1414 r = group_sum (groups,R. values) ./ Mw
1515 q = group_sum (groups,Q. values) ./ Mw
1616 m = group_sum (groups,nothing )
17-
1817 return UNIFACFVCache (groups. components,r,q,m,Mw)
1918end
2019
@@ -38,6 +37,8 @@ struct UNIFACFVParam{T} <: EoSParam
3837 Mw:: SingleParam{T}
3938end
4039
40+ UNIFACFVParam (volume,A,R,Q,Mw) = build_parametric_param (UNIFACFVParam,volume,c,A,R,Q,Mw)
41+
4142abstract type UNIFACFVModel <: ActivityModel end
4243
4344struct UNIFACFV{c<: EoSModel ,T} <: UNIFACFVModel
@@ -46,7 +47,13 @@ struct UNIFACFV{c<:EoSModel,T} <: UNIFACFVModel
4647 params:: UNIFACFVParam{T}
4748 puremodel:: EoSVectorParam{c}
4849 references:: Array{String,1}
49- UNIFACFV_cache:: UNIFACFVCache
50+ UNIFACFV_cache:: UNIFACFVCache{T}
51+ end
52+
53+ function UNIFACFV (components,groups,params,puremodel,references,unifac_cache)
54+ c = eltype (puremodel)
55+ T = eltype (params)
56+ return UNIFACFV {c,T} (components,groups,params,puremodel,references,unifac_cache)
5057end
5158
5259export UNIFACFV
0 commit comments