diff --git a/database/LatticeFluid/SanchezLacombe/SanchezLacombe_like.csv b/database/LatticeFluid/SanchezLacombe/SanchezLacombe_like.csv index 199420303..e6969fb30 100644 --- a/database/LatticeFluid/SanchezLacombe/SanchezLacombe_like.csv +++ b/database/LatticeFluid/SanchezLacombe/SanchezLacombe_like.csv @@ -1,17 +1,17 @@ Clapeyron Database File SanchezLacombe Like Parameters species,epsilon,vol,segment -carbon dioxide,2276.66,3.638,8.564 -ethane,2444.62,7.865,6.653 -ethylene,2273.34,7.238,6.518 -Xenon,2943.30,11.854,3.644 -Biphenyl,5280.12,14.985,11.708 -Naphthalene,5509.75,12.407,9.600 -"2,3-Dimethylnaphthalene",5604.69,13.069,11.245 -"2,6-Dimethylnaphthalene",5540.04,13.069,11.244 -Fluorene,5866.55,10.676,11.821 -Phenanthrene,6354.58,13.804,11.378 -Anthracene,6372.58,13.804,11.378 -Pyrene,6732.91,14.733,11.980 -n-Octacosane,5295.78,17.360,22.989 -Benzoic Acid,4920.81,6.196,15.431 \ No newline at end of file +carbon dioxide,2276.66,3.638e-6,8.564 +ethane,2444.62,7.865e-6,6.653 +ethylene,2273.34,7.238e-6,6.518 +Xenon,2943.30,11.854e-6,3.644 +Biphenyl,5280.12,14.985e-6,11.708 +Naphthalene,5509.75,12.407e-6,9.600 +"2,3-Dimethylnaphthalene",5604.69,13.069e-6,11.245 +"2,6-Dimethylnaphthalene",5540.04,13.069e-6,11.244 +Fluorene,5866.55,10.676e-6,11.821 +Phenanthrene,6354.58,13.804e-6,11.378 +Anthracene,6372.58,13.804e-6,11.378 +Pyrene,6732.91,14.733e-6,11.980 +n-Octacosane,5295.78,17.360e-6,22.989 +Benzoic Acid,4920.81,6.196e-6,15.431 \ No newline at end of file diff --git a/database/cubic/EPPR78/EPPR78_groups.csv b/database/cubic/EPPR78/EPPR78_groups.csv new file mode 100644 index 000000000..0b7be874f --- /dev/null +++ b/database/cubic/EPPR78/EPPR78_groups.csv @@ -0,0 +1,31 @@ +Clapeyron Database File, +EPPR78 Groups, +species,groups +ethane,"[""CH3"" => 2]" +propane,"[""CH3"" => 2, ""CH2"" => 1]" +butane,"[""CH3"" => 2, ""CH2"" => 2]" +isobutane,"[""CH3"" => 3, ""CH"" => 1]" +pentane,"[""CH3"" => 2, ""CH2"" => 3]" +hexane,"[""CH3"" => 2, ""CH2"" => 4]" +heptane,"[""CH3"" => 2, ""CH2"" => 5]" +octane,"[""CH3"" => 2, ""CH2"" => 6]" +nonane,"[""CH3"" => 2, ""CH2"" => 7]" +decane,"[""CH3"" => 2, ""CH2"" => 8]" +undecane,"[""CH3"" => 2, ""CH2"" => 9]" +pentadecane,"[""CH3"" => 2, ""CH2"" => 13]" +eicosane,"[""CH3"" => 2, ""CH2"" => 18]" +pentacosane,"[""CH3"" => 2, ""CH2"" => 23]" +triacontane,"[""CH3"" => 2, ""CH2"" => 28]" +methane,"[""CH4""=>1]" +carbon dioxide,"[""CO2""=>1]" +water,"[""H2O""=>1]" +hydrogen,"[""H2""=>1]" +helium,"[""He""=>1]" +argon,"[""Ar""=>1]" +oxygen,"[""O2""=>1]" +nitrogen,"[""N2""=>1]" +carbon monoxide,"[""CO""=>1]" +sulfur dioxide,"[""SO2""=>1]" +hydrogen sulfide,"[""H2S""=>1]" +benzene,"[""CH aro""=>6]" +isooctane,"[""CH3""=>5,""CH2""=>1,""CH""=>1,""C""=>1]" \ No newline at end of file diff --git a/database/cubic/EPPR78/EPPR78_unlike.csv b/database/cubic/EPPR78/EPPR78_unlike.csv new file mode 100644 index 000000000..95c5dea1a --- /dev/null +++ b/database/cubic/EPPR78/EPPR78_unlike.csv @@ -0,0 +1,358 @@ +Clapeyron Database File +E-PPR78 unlike Parameters +species1,species2,A,B +CH3,CH2,65.54,105.7 +CH3,CH,214.9,294.9 +CH3,C,431.6,575.0 +CH3,CH4,28.48,20.25 +CH3,C2H6,3.775,8.922 +CH3,CH aro,98.83,136.2 +CH3,C aro,103.6,103.6 +CH3,C fused aromatic rings,624.9,774.1 +CH3,CH2 cyclic,43.58,60.05 +CH3,CH cyclic~|~C cyclic,0.0,170.9 +CH3,CO2,144.8,401.5 +CH3,N2,38.09,88.19 +CH3,H2S,159.6,227.8 +CH3,SH,789.6,1829.0 +CH3,H2O,3557.0,11195.0 +CH3,C2H4,7.892,35.0 +CH3,CH2 alkenic~|~CH alkenic,0.0,44.27 +CH3,C alkenic,102.6,260.1 +CH3,CH cycloalkenic~|~C cycloalkenic,0.0,169.5 +CH3,H2,174.0,239.5 +CH3,C2F6,119.1,118.4 +CH3,CF3,123.2,133.8 +CH3,CF2,58.33,65.2 +CH3,CF2 double bond~|~CF double bond,0.0,16.54 +CH3,C2H4F2,128.3,292.4 +CH3,C2H2F4,158.5,3565.0 +CH3,CO,91.24,94.24 +CH3,He,416.3,513.4 +CH3,Ar,11.27,55.48 +CH3,SO2,322.2,201.4 +CH3,O2,86.1,87.5 +CH3,C2H2,-6.86,41.52 +CH3,HC=-C-,306.1,1167.0 +CH3,-C=-C-,72.06,1219.5 +CH2,CH,39.05,41.59 +CH2,C,134.5,183.9 +CH2,CH4,37.75,74.81 +CH2,C2H6,29.85,65.88 +CH2,CH aro,25.05,64.51 +CH2,C aro,5.147,-7.549 +CH2,C fused aromatic rings,-17.84,-4.118 +CH2,CH2 cyclic,8.579,27.79 +CH2,CH cyclic~|~C cyclic,0.0,-74.46 +CH2,CO2,141.4,237.1 +CH2,N2,83.73,188.7 +CH2,H2S,136.6,124.6 +CH2,SH,439.9,504.8 +CH2,H2O,4324.0,12126.0 +CH2,C2H4,59.71,82.35 +CH2,CH2 alkenic~|~CH alkenic,0.0,50.79 +CH2,C alkenic,64.85,51.82 +CH2,CH cycloalkenic~|~C cycloalkenic,0.0,51.13 +CH2,H2,155.4,240.9 +CH2,C2F6,105.0,130.4 +CH2,CF3,195.6,199.0 +CH2,CF2,58.33,68.63 +CH2,C2H4F2,107.1,119.8 +CH2,C2H2F4,86.47,-40.49 +CH2,CO,44.0,45.55 +CH2,He,520.52,673.22 +CH2,Ar,113.6,231.6 +CH2,SO2,55.9,-28.5 +CH2,O2,107.4,200.8 +CH2,C2H2,421.0,1193.8 +CH2,HC=-C-,303.3,316.0 +CH2,-C=-C-,488.0,826.6 +CH,C,-86.13,85.1 +CH,CH4,131.4,157.5 +CH,C2H6,156.1,96.77 +CH,CH aro,56.62,129.7 +CH,C aro,48.73,-89.22 +CH,CH2 cyclic,73.09,71.37 +CH,CH cyclic~|~C cyclic,0.0,18.53 +CH,CO2,191.8,380.9 +CH,N2,383.6,375.4 +CH,H2S,192.5,562.8 +CH,SH,374.0,520.9 +CH,H2O,971.4,567.6 +CH,C2H4,147.9,-55.59 +CH,CH2 alkenic~|~CH alkenic,0.0,193.2 +CH,C alkenic,91.62,54.9 +CH,CH cycloalkenic~|~C cycloalkenic,0.0,-7.2 +CH,H2,326.0,287.9 +CH,CF3,531.5,-1945.0 +CH,CF2,-122.8,458.8 +CH,C2H4F2,143.8,15.78 +CH,C2H2F4,121.5,-44.61 +CH,He,728.1,750.9 +CH,Ar,185.8,634.2 +CH,SO2,-70.0,233.7 +CH,HC=-C-,206.9,3975.0 +CH,-C=-C-,4.46,-245.4 +C,CH4,309.5,35.69 +C,C2H6,388.1,-224.8 +C,CH aro,170.5,284.1 +C,C aro,128.3,189.1 +C,CH2 cyclic,208.6,294.4 +C,CH cyclic~|~C cyclic,0.0,81.33 +C,CO2,377.5,162.7 +C,N2,341.8,635.2 +C,H2S,330.8,-297.2 +C,SH,685.9,1547.0 +C,C2H4,366.8,-219.3 +C,CH2 alkenic~|~CH alkenic,0.0,419.0 +C,H2,548.3,2343.0 +C,CF3,413.1,975.2 +C,CF2 double bond~|~CF double bond,0.0,1430.0 +C,Ar,899.0,4655.0 +CH4,C2H6,9.951,13.73 +CH4,CH aro,67.26,167.5 +CH4,C aro,106.7,190.8 +CH4,C fused aromatic rings,249.1,408.3 +CH4,CH2 cyclic,33.97,5.49 +CH4,CH cyclic~|~C cyclic,0.0,473.9 +CH4,CO2,136.6,214.8 +CH4,N2,30.88,37.06 +CH4,H2S,190.1,307.5 +CH4,SH,701.7,1318.0 +CH4,H2O,2277.1,4719.6 +CH4,C2H4,19.22,33.29 +CH4,CH2 alkenic~|~CH alkenic,0.0,60.29 +CH4,H2,156.1,92.99 +CH4,CO,14.43,20.92 +CH4,He,394.5,378.1 +CH4,Ar,15.97,24.48 +CH4,SO2,205.9,323.6 +CH4,COS,44.61,-95.05 +CH4,NH3,436.1,958.8 +CH4,N2O,74.81,107.1 +C2H6,CH aro,41.18,50.79 +C2H6,C aro,67.94,210.7 +C2H6,CH2 cyclic,12.7,73.43 +C2H6,CH cyclic~|~C cyclic,0.0,-212.8 +C2H6,CO2,136.2,235.7 +C2H6,N2,61.59,84.92 +C2H6,H2S,157.2,217.1 +C2H6,H2O,2333.0,5147.0 +C2H6,C2H4,7.549,20.93 +C2H6,CH2 alkenic~|~CH alkenic,0.0,-5.147 +C2H6,H2,137.6,150.0 +C2H6,C2F6,96.08,123.5 +C2H6,CF3,87.16,143.8 +C2H6,CF2,79.27,15.1 +C2H6,CF2 double bond~|~CF double bond,0.0,-231.1 +C2H6,C2H2F4,72.4,-305.4 +C2H6,CO,15.42,33.3 +C2H6,He,581.3,517.1 +C2H6,Ar,43.81,53.1 +C2H6,C2H2,137.9,168.1 +CH aro,C aro,-16.47,16.47 +CH aro,C fused aromatic rings,52.5,251.2 +CH aro,CH2 cyclic,28.82,65.54 +CH aro,CH cyclic~|~C cyclic,0.0,36.72 +CH aro,CO2,98.48,253.6 +CH aro,N2,185.3,490.7 +CH aro,H2S,21.28,6.177 +CH aro,SH,277.6,449.5 +CH aro,H2O,2268.0,6218.0 +CH aro,C2H4,25.74,78.92 +CH aro,CH2 alkenic~|~CH alkenic,0.0,19.9 +CH aro,C alkenic,-16.47,61.42 +CH aro,CH cycloalkenic~|~C cycloalkenic,0.0,1.716 +CH aro,H2,288.9,189.1 +CH aro,CF3,680.1,421.7 +CH aro,CF2,-31.57,43.24 +CH aro,CF2 double bond~|~CF double bond,0.0,-411.7 +CH aro,CO,153.4,153.4 +CH aro,He,753.6,590.5 +CH aro,Ar,195.6,361.3 +CH aro,SO2,37.1,-23.7 +CH aro,O2,233.4,404.9 +CH aro,C2H2,29.17,123.5 +CH aro,HC=-C-,96.08,148.2 +CH aro,-C=-C-,403.9,403.9 +C aro,C fused aromatic rings,-328.0,-569.3 +C aro,CH2 cyclic,37.4,53.53 +C aro,CH cyclic~|~C cyclic,0.0,-193.5 +C aro,CO2,154.4,374.4 +C aro,N2,343.8,1712.0 +C aro,H2S,9.608,-36.72 +C aro,SH,1002.0,-736.4 +C aro,H2O,543.5,411.8 +C aro,C2H4,97.8,67.94 +C aro,CH2 alkenic~|~CH alkenic,0.0,27.79 +C aro,C alkenic,343.1,880.2 +C aro,CH cycloalkenic~|~C cycloalkenic,0.0,-7.206 +C aro,H2,400.1,1201.0 +C aro,CF3,733.0,866.8 +C aro,CF2,-8.922,5.147 +C aro,CF2 double bond~|~CF double bond,0.0,-108.0 +C aro,CO,0.0,-231.1 +C aro,He,0.0,590.5 +C aro,SO2,0.0,-397.4 +C aro,O2,0.0,2259.4 +C aro,HC=-C-,0.0,-459.5 +C aro,-C=-C-,0.0,518.5 +C fused aromatic rings,CH2 cyclic,140.7,277.6 +C fused aromatic rings,CH cyclic~|~C cyclic,0.0,-193.5 +C fused aromatic rings,CO2,331.1,276.6 +C fused aromatic rings,N2,702.4,1889.0 +C fused aromatic rings,H2S,9.608,-36.72 +C fused aromatic rings,SH,1002.0,-736.4 +C fused aromatic rings,H2O,1340.0,-65.88 +C fused aromatic rings,C2H4,209.7,3819.0 +C fused aromatic rings,CH2 alkenic~|~CH alkenic,0.0,589.5 +C fused aromatic rings,H2,602.9,1463.0 +C fused aromatic rings,CO,197.0,-238.8 +C fused aromatic rings,He,753.6,590.5 +CH2 cyclic,CH cyclic~|~C cyclic,0.0,35.69 +CH2 cyclic,CO2,144.1,354.1 +CH2 cyclic,N2,179.5,546.6 +CH2 cyclic,H2S,117.4,166.4 +CH2 cyclic,SH,493.1,832.1 +CH2 cyclic,H2O,4211.0,13031.0 +CH2 cyclic,C2H4,35.34,52.5 +CH2 cyclic,CH2 alkenic~|~CH alkenic,0.0,24.36 +CH2 cyclic,C alkenic,159.6,140.7 +CH2 cyclic,CH cycloalkenic~|~C cycloalkenic,0.0,69.32 +CH2 cyclic,H2,236.1,192.5 +CH2 cyclic,CF3,216.2,343.1 +CH2 cyclic,CF2,42.55,-68.63 +CH2 cyclic,CO,113.1,143.6 +CH2 cyclic,Ar,1269.0,18666.0 +CH2 cyclic,O2,181.2,281.4 +CH2 cyclic,NO,-27.5,50.1 +CH2 cyclic,HC=-C-,496.2,496.2 +CH2 cyclic,-C=-C-,845.9,845.9 +CH cyclic~|~C cyclic,CO2,0.0,389.8 +CH cyclic~|~C cyclic,H2S,0.0,-127.7 +CH cyclic~|~C cyclic,SH,0.0,-337.7 +CH cyclic~|~C cyclic,H2O,0.0,-60.39 +CH cyclic~|~C cyclic,C2H4,0.0,-647.2 +CH cyclic~|~C cyclic,CH2 alkenic~|~CH alkenic,0.0,134.9 +CH cyclic~|~C cyclic,CH cycloalkenic~|~C cycloalkenic,0.0,2.745 +CH cyclic~|~C cyclic,H2,0.0,34.31 +CH cyclic~|~C cyclic,O2,0.0,988.0 +CH cyclic~|~C cyclic,HC=-C-,0.0,863.7 +CO2,N2,113.9,212.4 +CO2,H2S,135.2,199.0 +CO2,SH,484.15,646.58 +CO2,H2O,559.3,277.9 +CO2,C2H4,73.09,106.7 +CO2,CH2 alkenic~|~CH alkenic,0.0,183.9 +CO2,C alkenic,74.81,-266.6 +CO2,CH cycloalkenic~|~C cycloalkenic,0.0,66.91 +CO2,H2,261.1,300.9 +CO2,C2F6,126.6,241.2 +CO2,CF3,156.5,-116.0 +CO2,CF2,125.2,340.1 +CO2,CF2 double bond~|~CF double bond,0.0,63.49 +CO2,C2H4F2,48.73,751.1 +CO2,C2H2F4,29.51,89.9 +CO2,CO,87.85,190.8 +CO2,He,685.9,559.3 +CO2,Ar,177.8,86.82 +CO2,SO2,54.9,59.02 +CO2,O2,154.4,109.8 +CO2,NO,5.1,48.4 +CO2,COS,83.04,165.7 +CO2,NO2~|~N2O4,0.0,241.6 +CO2,N2O,3.77,14.07 +CO2,HC=-C-,60.05,-80.98 +N2,H2S,319.5,550.1 +N2,SH,1042.0,1722.68 +N2,H2O,2574.0,5490.0 +N2,C2H4,45.3,92.65 +N2,CH2 alkenic~|~CH alkenic,0.0,227.2 +N2,C alkenic,541.5,94.71 +N2,H2,65.2,70.1 +N2,CO,23.33,-25.4 +N2,He,204.7,222.8 +N2,Ar,6.488,8.774 +N2,SO2,282.4,362.7 +N2,O2,2.4,4.8 +N2,NO,258.7,100.5 +N2,NH3,585.8,1011.3 +N2,NO2~|~N2O4,0.0,260.0 +N2,N2O,101.6,230.9 +H2S,SH,-157.8,153.7 +H2S,H2O,603.9,599.1 +H2S,H2,145.8,823.5 +H2S,CO,278.6,404.2 +H2S,COS,101.9,98.14 +SH,H2O,30.88,-113.6 +H2O,C2H4,1650.0,1661.0 +H2O,CH2 alkenic~|~CH alkenic,0.0,5199.0 +H2O,H2,830.8,-137.9 +H2O,CO,715.1,-89.9 +H2O,Ar,1197.0,1211.0 +H2O,SO2,374.4,148.6 +H2O,O2,1376.0,1609.0 +H2O,NH3,-550.1,-1404.2 +H2O,N2O,568.9,-144.8 +H2O,C2H2,436.8,-200.1 +H2O,HC=-C-,-2395.5,-11671.0 +C2H4,CH2 alkenic~|~CH alkenic,0.0,11.32 +C2H4,C alkenic,-518.2,6815.0 +C2H4,CH cycloalkenic~|~C cycloalkenic,0.0,1809.0 +C2H4,H2,151.3,165.1 +C2H4,CF3,453.0,-611.5 +C2H4,CF2 double bond~|~CF double bond,0.0,548.3 +C2H4,CO,84.55,-7.515 +C2H4,He,569.6,536.7 +CH2 alkenic~|~CH alkenic,C alkenic,0.0,121.8 +CH2 alkenic~|~CH alkenic,CH cycloalkenic~|~C cycloalkenic,0.0,-12.35 +CH2 alkenic~|~CH alkenic,H2,0.0,373.0 +CH2 alkenic~|~CH alkenic,C2F6,0.0,219.6 +CH2 alkenic~|~CH alkenic,CF3,0.0,154.4 +CH2 alkenic~|~CH alkenic,CF2,0.0,154.4 +CH2 alkenic~|~CH alkenic,CF2 double bond~|~CF double bond,0.0,12.87 +CH2 alkenic~|~CH alkenic,C2H4F2,0.0,-145.5 +CH2 alkenic~|~CH alkenic,C2H2F4,0.0,-41.86 +CH2 alkenic~|~CH alkenic,He,0.0,687.7 +CH2 alkenic~|~CH alkenic,Ar,0.0,-11.78 +CH2 alkenic~|~CH alkenic,SO2,0.0,26.8 +CH2 alkenic~|~CH alkenic,C2H2,0.0,39.8 +CH2 alkenic~|~CH alkenic,HC=-C-,0.0,568.9 +CH2 alkenic~|~CH alkenic,-C=-C-,0.0,676.7 +C alkenic,CH cycloalkenic~|~C cycloalkenic,0.0,87.5 +C alkenic,H2,621.4,-495.5 +C alkenic,SO2,-141.7,-151.3 +C alkenic,HC=-C-,212.8,-2182.8 +C alkenic,-C=-C-,-874.3,1040.1 +CH cycloalkenic~|~C cycloalkenic,H2,0.0,2167.0 +CH cycloalkenic~|~C cycloalkenic,CF3,0.0,-495.5 +H2,CO,75.84,74.81 +H2,He,138.7,95.49 +H2,Ar,128.2,102.9 +H2,NH3,701.7,931.3 +C2F6,CF3,-14.47,-87.05 +C2F6,CF2 double bond~|~CF double bond,0.0,-193.3 +C2F6,C2H2F4,60.74,217.6 +CF3,CF2,0.0,0.0 +CF3,CF2 double bond~|~CF double bond,0.0,-92.99 +CF3,C2H4F2,113.2,247.1 +CF3,C2H2F4,28.14,8.235 +CF2,C2H4F2,120.1,264.2 +CF2,C2H2F4,229.9,259.1 +C2H4F2,C2H2F4,-4.118,4.118 +C2H4F2,C2H2,-58.68,303.7 +CO,He,260.1,259.9 +CO,Ar,4.042,8.18 +CO,NO,309.2,28.82 +He,Ar,243.1,305.6 +Ar,SO2,299.9,354.1 +Ar,O2,4.8,7.89 +Ar,NO,110.8,155.5 +Ar,NH3,630.0,1794.0 +Ar,NO2~|~N2O4,0.0,274.5 +SO2,O2,340.0,665.7 +SO2,NO,172.3,1343.0 +O2,NO2~|~N2O4,0.0,362.4 +O2,N2O,120.1,105.7 +C2H2,HC=-C-,122.5,247.8 +HC=-C-,-C=-C-,-497.6,-824.2 \ No newline at end of file diff --git a/database/cubic/QCPR/QCPR_critical.csv b/database/cubic/QCPR/QCPR_critical.csv new file mode 100644 index 000000000..affa54609 --- /dev/null +++ b/database/cubic/QCPR/QCPR_critical.csv @@ -0,0 +1,7 @@ +Clapeyron Database File,,,,,, +Critical QCPR Like Parameters,,,,,, +species,Mw,Tc,pc +hydrogen,2.01588,33.19,12.964e5 +deuterium,4.0282035556,38.34,16.796e5 +helium,4.002602,5.1953,2.276e5 +neon,20.1797,44.492,26.79e5 \ No newline at end of file diff --git a/database/cubic/QCPR/QCPR_like.csv b/database/cubic/QCPR/QCPR_like.csv new file mode 100644 index 000000000..49ecf3bcb --- /dev/null +++ b/database/cubic/QCPR/QCPR_like.csv @@ -0,0 +1,7 @@ +Clapeyron Database File,,,,,, +QCPR Like Parameters,,,,,, +species,A,B +hydrogen,3.0696,12.682 +deuterium,1.6501,7.309 +helium,1.4912,3.2634 +neon,0.22069,-0.65243 \ No newline at end of file diff --git a/database/cubic/QCPR/QCPR_translation.csv b/database/cubic/QCPR/QCPR_translation.csv new file mode 100644 index 000000000..5ce73198d --- /dev/null +++ b/database/cubic/QCPR/QCPR_translation.csv @@ -0,0 +1,7 @@ +Clapeyron Database File,,,,, +Constant translation for QCPR Like Parameters,,,,, +species,c +hydrogen,-3.8139e-6 +helium,-3.1791e-6 +neon,-2.5676e-6 +deuterium,-3.8718e-6 \ No newline at end of file diff --git a/database/cubic/QCPR/QCPR_unlike.csv b/database/cubic/QCPR/QCPR_unlike.csv new file mode 100644 index 000000000..090b4f99c --- /dev/null +++ b/database/cubic/QCPR/QCPR_unlike.csv @@ -0,0 +1,8 @@ +Clapeyron Database File +QCPR unlike Parameters +species1,species2,k,l +helium,deuterium,0.45,0 +helium,hydrogen,0.17,-0.16 +neon,deuterium,0.18,0.0 +neon,hydrogen,0.18,0.0 +neon,helium,-0.17,0.0 diff --git a/database/cubic/QCPR/Twu_QCPR.csv b/database/cubic/QCPR/Twu_QCPR.csv new file mode 100644 index 000000000..870243aac --- /dev/null +++ b/database/cubic/QCPR/Twu_QCPR.csv @@ -0,0 +1,8 @@ +Clapeyron Database File,,,,, +TwuAlpha for QCPR Like Parameters,,,,, +species,DIPPR Number,L,M,N,source +hydrogen,,156.21,-0.0062072,5.047, +helium,,0.48558,1.7173,0.30271 +neon,,0.3981,0.96535,0.82696 +deuterium,,55.007,-0.016981,3.1621 + diff --git a/database/properties/critical.csv b/database/properties/critical.csv index cb968779e..7ec82643c 100644 --- a/database/properties/critical.csv +++ b/database/properties/critical.csv @@ -23,6 +23,7 @@ nonadecane,629925,758,1.21E+06,1.60E-03,0.851 eicosane,112958,768,1.17E+06,1.68E-03,0.912 isobutane,75285,408.14,3.62E+06,2.88E-04,0.177 isopentane,78784,460.43,3.37E+06,3.49E-04,0.226 +isooctane,,543.9,25.7e5,0.468e-3,0.301 "2,3-Dimethylbutane",79298,499.98,3.13E+06,4.08E-04,0.246 2-Methylpentane,107835,497.5,3.02E+06,4.21E-04,0.279 "2,3-Dimethylpentane",565593,537.35,2.88E+06,4.77E-04,0.292 @@ -208,7 +209,7 @@ Chlorobenzene,108907,632.35,4.53E+06,3.57E-04,0.251 Bromobenzene,108861,670.15,4.52E+06,3.79E-04,0.251 Air,132259100,132.45,3.79E+06,8.93E-05,0 Hydrogen,1333740,33.19,1.32E+06,6.43E-05,-0.215 -Helium-4,7440597,5.2,2.30E+05,5.78E-05,-0.388 +helium,7440597,5.2,2.30E+05,5.78E-05,-0.388 Neon,7440019,44.4,2.67E+06,4.25E-05,-0.038 Argon,7440371,150.86,4.90E+06,7.87E-05,0 Fluorine,7782414,144.12,5.17E+06,7.12E-05,0.053 diff --git a/database/properties/molarmass.csv b/database/properties/molarmass.csv index 087fb3971..94c569fc0 100644 --- a/database/properties/molarmass.csv +++ b/database/properties/molarmass.csv @@ -25,6 +25,7 @@ tetracosane,77,338.65 hexatriacontane,2086,506.97 isobutane,4,58.12 isopentane,8,72.15 +isooctane,,114.23 neopentane,9,72.15 "2,2-dimethylbutane",14,86.18 "2,3-dimethylbutane",15,86.18 @@ -545,7 +546,12 @@ ethylamine,,45.09 1-propylamine,,59.11 2-propylamine,,59.11 aniline,,93.13 -acetic acid,,60.053 +formic acid,64186,46.02538 +acetic acid,64197,60.05 +propionic acid,79094,74.08 +n-Butyric acid,107926,88.11 +isobutyric acid,79312,88.11 +benzoic acid,65850,122.12 neon,,20.1797 sulfur hexafluoride,,146.055 nitrous oxide,,44.013 diff --git a/src/Clapeyron.jl b/src/Clapeyron.jl index b86b4d9ed..c81fd3b90 100644 --- a/src/Clapeyron.jl +++ b/src/Clapeyron.jl @@ -136,6 +136,8 @@ include("models/cubic/RK/variants/PSRK.jl") include("models/cubic/PR/variants/PR78.jl") include("models/cubic/PR/variants/VTPR.jl") include("models/cubic/PR/variants/UMRPR.jl") +include("models/cubic/PR/variants/QCPR.jl") +include("models/cubic/PR/variants/EPPR78.jl") include("models/LatticeFluid/SanchezLacombe/SanchezLacombe.jl") diff --git a/src/methods/property_solvers/multicomponent/LLE_point.jl b/src/methods/property_solvers/multicomponent/LLE_point.jl index 69bdb1902..bbedec5ec 100644 --- a/src/methods/property_solvers/multicomponent/LLE_point.jl +++ b/src/methods/property_solvers/multicomponent/LLE_point.jl @@ -9,6 +9,7 @@ function x0_LLE_pressure(model::EoSModel,T,x) prepend!(xx,log10.((V0_l,V0_ll))) return xx[1:end-1] end + """ LLE_pressure(model::EoSModel, T, x; v0 = x0_LLE_pressure(model,T,x)) @@ -77,4 +78,25 @@ end function x0_LLE_temperature(model,p,x) return 1.5*sum(T_scales(model))/length(x) -end \ No newline at end of file +end + +function presents_LLE(model,p,T) + pure = split_model(model) + g_pure = gibbs_free_energy.(pure,p,T) + + function mixing_gibbs(x1) + z = FractionVector(x1) + log∑z = log(sum(z)) + g_mix = gibbs_free_energy(model,p,T,z) + for i in 1:length(z) + g_mix -= z[i]*(g_pure[i] + R̄*T*(log(z[i]) - log∑z)) + end + return g_mix + end + + f0(x1) = ForwardDiff.derivative(mixing_gibbs,x1) + prob = Roots.ZeroProblem(f0,(0.9)) + res = Roots.solve(prob) + return (res,mixing_gibbs(res)) + +end diff --git a/src/models/LatticeFluid/SanchezLacombe/SanchezLacombe.jl b/src/models/LatticeFluid/SanchezLacombe/SanchezLacombe.jl index 11bc98c34..076313a13 100644 --- a/src/models/LatticeFluid/SanchezLacombe/SanchezLacombe.jl +++ b/src/models/LatticeFluid/SanchezLacombe/SanchezLacombe.jl @@ -18,6 +18,9 @@ struct SanchezLacombe{T <: SLMixingRule,I<:IdealModel} <:SanchezLacombeModel references::Array{String,1} end @registermodel SanchezLacombe + + + const SL = SanchezLacombe function SanchezLacombe(components; @@ -32,8 +35,6 @@ function SanchezLacombe(components; segment = params["segment"] unmixed_epsilon = params["epsilon"] unmixed_vol = params["vol"] - unmixed_epsilon.values #.*= k_B #to convert from temperature to eps - unmixed_vol.values .*= 1e-6 #convert from cm3/mol to m3/mol Mw = params["Mw"] mixmodel = init_model(mixing,components,mixing_userlocations,verbose) ideal = init_model(idealmodel,components,ideal_userlocations,verbose) diff --git a/src/models/LatticeFluid/SanchezLacombe/mixing/SLKrule.jl b/src/models/LatticeFluid/SanchezLacombe/mixing/SLKrule.jl index 1b0f7e68b..ab47f4937 100644 --- a/src/models/LatticeFluid/SanchezLacombe/mixing/SLKrule.jl +++ b/src/models/LatticeFluid/SanchezLacombe/mixing/SLKrule.jl @@ -4,7 +4,7 @@ struct SLKRule <: SLMixingRule end @registermodel SLKRule - +export SLKRule function sl_mix(unmixed_vol,unmixed_epsilon,mixmodel::SLKRule) #dont mind the function names, it performs the correct mixing premixed_vol= epsilon_LorentzBerthelot(unmixed_vol) diff --git a/src/models/cubic/PR/variants/EPPR78.jl b/src/models/cubic/PR/variants/EPPR78.jl new file mode 100644 index 000000000..6a4dfb321 --- /dev/null +++ b/src/models/cubic/PR/variants/EPPR78.jl @@ -0,0 +1,93 @@ +#= +groups: +CH3 +CH2 +CH +C +CH4 +C2H6 +CH aro +C aro +C fused aromatic rings +CH2 cyclic +CH cyclic~|~C cyclic +CO2 +N2 +H2S +SH +H2O +C2H4 +CH2 alkenic~|~CH alkenic +C alkenic +CH cycloalkenic~|~C cycloalkenic +H2 +C2F6 +CF3 +CF2 +CF2 double bond~|~CF double bond +C2H4F2 +C2H2F4 +CO +He +Ar +SO2 +O2 +NO +COS +NH3 +NO2~|~N2O4 +N2O +C2H2 +HC=-C- +-C=-C- +=# + +""" + EPPR78(components::Vector{String}; idealmodel=BasicIdeal, + alpha = PR78Alpha, + mixing = vdW1fRule, + activity = nothing, + translation=NoTranslation, + userlocations=String[], + ideal_userlocations=String[], + alpha_userlocations = String[], + mixing_userlocations = String[], + translation_userlocations = String[], + verbose=false) + +Enhanced Predictive Peng Robinson equation of state. it uses the following models: + +- Translation Model: `NoTranslation` +- Alpha Model: `PR78Alpha` +- Mixing Rule Model: `PPR78Rule` + +## References + +1. Robinson DB, Peng DY. The characterization of the heptanes and heavier fractions for the GPA Peng-Robinson programs. Tulsa: Gas Processors Association; 1978 +""" +function EPPR78(components::Vector{String}; idealmodel=BasicIdeal, + alpha = PR78Alpha, + mixing = PPR78Rule, + activity = nothing, + translation=NoTranslation, + userlocations=String[], + ideal_userlocations=String[], + alpha_userlocations = String[], + mixing_userlocations = String[], + translation_userlocations = String[], + verbose=false) + + return PR(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, + translation_userlocations = translation_userlocations, + verbose = verbose) +end +export EPPR78 \ No newline at end of file diff --git a/src/models/cubic/PR/variants/PR78.jl b/src/models/cubic/PR/variants/PR78.jl index 89e401d2f..59cfa1d05 100644 --- a/src/models/cubic/PR/variants/PR78.jl +++ b/src/models/cubic/PR/variants/PR78.jl @@ -8,11 +8,12 @@ ideal_userlocations=String[], alpha_userlocations = String[], mixing_userlocations = String[], + translation_userlocations = String[], verbose=false) Peng Robinson (1978) equation of state. it uses the following models: -- Translation Model: `PR78Alpha` +- Translation Model: `NoTranslation` - Alpha Model: `PR78Alpha` - Mixing Rule Model: `vdW1fRule` @@ -29,6 +30,7 @@ function PR78(components::Vector{String}; idealmodel=BasicIdeal, ideal_userlocations=String[], alpha_userlocations = String[], mixing_userlocations = String[], + translation_userlocations = String[], verbose=false) return PR(components; @@ -41,6 +43,7 @@ function PR78(components::Vector{String}; idealmodel=BasicIdeal, ideal_userlocations = ideal_userlocations, alpha_userlocations = alpha_userlocations, mixing_userlocations = mixing_userlocations, + translation_userlocations = translation_userlocations, verbose = verbose) end export PR78 \ No newline at end of file diff --git a/src/models/cubic/PR/variants/QCPR.jl b/src/models/cubic/PR/variants/QCPR.jl new file mode 100644 index 000000000..eaf14b5f0 --- /dev/null +++ b/src/models/cubic/PR/variants/QCPR.jl @@ -0,0 +1,114 @@ +""" + QCPR(components::Vector{String}; idealmodel=BasicIdeal, + userlocations=String[], + ideal_userlocations=String[], + alpha_userlocations = String[], + mixing_userlocations = String[], + activity_userlocations = String[], + translation_userlocations = String[], + verbose=false) + +Quantum-corrected Peng Robinson equation of state. it uses the following models: + +- Translation Model: `ConstantTranslation` +- Alpha Model: `TwuAlpha` +- Mixing Rule Model: `QCPRRule` + +## References + +1. Aasen, A., Hammer, M., Lasala, S., Jaubert, J.-N., & Wilhelmsen, Ø. (2020). Accurate quantum-corrected cubic equations of state for helium, neon, hydrogen, deuterium and their mixtures. Fluid Phase Equilibria, 524(112790), 112790. doi:10.1016/j.fluid.2020.112790 + +""" +function QCPR(components::Vector{String}; idealmodel=BasicIdeal, + userlocations=String[], + ideal_userlocations=String[], + alpha_userlocations = String[], + mixing_userlocations = String[], + activity_userlocations = String[], + translation_userlocations = String[], + verbose=false) + + userlocations = vcat(alpha_userlocations,translation_userlocations,userlocations) + + params = getparams(components, ["cubic/QCPR/QCPR_critical.csv", "cubic/QCPR/QCPR_unlike.csv","cubic/QCPR/Twu_QCPR.csv","cubic/QCPR/QCPR_translation.csv"]; userlocations=userlocations, verbose=verbose) + k = params["k"] + pc = params["pc"] + Mw = params["Mw"] + Tc = params["Tc"] + init_mixing = init_model(QCPRRule,components,nothing,mixing_userlocations,activity_userlocations,verbose) + a,b = ab_premixing(PR,init_mixing,Tc,pc,k) + init_idealmodel = init_model(idealmodel,components,ideal_userlocations,verbose) + + M = params["M"] + N = params["N"] + L = params["L"] + packagedparams = TwuAlphaParam(M,N,L) + init_alpha = TwuAlpha(packagedparams, verbose=verbose) + + c = params["c"] + packagedparams = ConstantTranslationParam(c) + init_translation = ConstantTranslation(packagedparams, verbose=verbose) + + icomponents = 1:length(components) + packagedparams = PRParam(a,b,Tc,pc,Mw) + references = String["10.1021/I160057A011"] + model = PR(components,icomponents,init_alpha,init_mixing,init_translation,packagedparams,init_idealmodel,references) + return model +end + +export QCPR + + +const QCPRModel = PR{T,TwuAlpha,QCPRRule,ConstantTranslation} where T + +function cubic_ab(model::QCPRModel,V,T,z=SA[1.0],n=sum(z)) + invn2 = (one(n)/n)^2 + a = model.params.a.values + b = model.params.b.values + T = T*float(one(T)) + α = @f(α_function,model.alpha) + c = @f(translation,model.translation) + if length(z)>1 + ā,b̄,c̄ = @f(mixing_rule,model.mixing,α,a,b,c) + else + ā = a[1,1]*α[1] + A = model.mixing.params.A.values[1,1] + B = model.mixing.params.B.values[1,1] + Tc = model.params.Tc.values[1] + β = (1 + A/(T + B))^3 / (1 + A/(Tc + B))^3 + b̄ = b[1,1]*β + c̄ = c[1] + end + return ā ,b̄, c̄ +end + +function lb_volume(model::QCPRModel,z=SA[1.0]) + A = model.mixing.params.A.values + B = model.mixing.params.B.values + l = mixing_model.params.l.values + Tc = model.params.Tc.values + n = sum(z) + invn = (one(n)/n) + c = model.translation.params.c.values + c̄ = dot(c,z) + b̄ = zero(first(z)) + for i in 1:length(z) + zi = z[i] + zi2 = zi^2 + Bi = B[i] + Ai = A[i] + βi = (1 + Ai/Bi)^3 / (1 + Ai/(Tc[i] + Bi))^3 + bqi = βi*b[i,i] + b̄ += bqi*zi2 + for j in 1:(i-1) + zij = zi*z[j] + Bj = B[j] + Aj = A[j] + βj = (1 + Aj/Bj)^3 / (1 + Aj/(Tc[j] + Bj))^3 + bqj = βj*b[j,j] + b̄ += zij*(bqi+bqj)*(1-l[i,j]) #2 * zij * 0.5(bi + bj) + end + end + return invn*(b̄ - c̄) +end + diff --git a/src/models/cubic/PR/variants/UMRPR.jl b/src/models/cubic/PR/variants/UMRPR.jl index 46c87cd9a..39ddf13e9 100644 --- a/src/models/cubic/PR/variants/UMRPR.jl +++ b/src/models/cubic/PR/variants/UMRPR.jl @@ -8,6 +8,8 @@ ideal_userlocations=String[], alpha_userlocations = String[], mixing_userlocations = String[], + activity_userlocations = String[], + translation_userlocations = String[], verbose=false) Universal Mixing Rule Peng Robinson equation of state. it uses the following models: @@ -30,6 +32,8 @@ function UMRPR(components::Vector{String}; idealmodel=BasicIdeal, ideal_userlocations=String[], alpha_userlocations = String[], mixing_userlocations = String[], + activity_userlocations = String[], + translation_userlocations = String[], verbose=false) return PR(components; @@ -42,6 +46,8 @@ function UMRPR(components::Vector{String}; idealmodel=BasicIdeal, ideal_userlocations = ideal_userlocations, alpha_userlocations = alpha_userlocations, mixing_userlocations = mixing_userlocations, + activity_userlocations = activity_userlocations, + translation_userlocations = translation_userlocations, verbose = verbose) end export UMRPR \ No newline at end of file diff --git a/src/models/cubic/PR/variants/VTPR.jl b/src/models/cubic/PR/variants/VTPR.jl index 7524f5c9b..8f6b1a3ca 100644 --- a/src/models/cubic/PR/variants/VTPR.jl +++ b/src/models/cubic/PR/variants/VTPR.jl @@ -8,6 +8,8 @@ ideal_userlocations=String[], alpha_userlocations = String[], mixing_userlocations = String[], + activity_userlocations = String[], + translation_userlocations = String[], verbose=false) Volume-translated Peng Robinson equation of state. it uses the following models: @@ -30,6 +32,7 @@ function VTPR(components::Vector{String}; idealmodel=BasicIdeal, ideal_userlocations=String[], alpha_userlocations = String[], mixing_userlocations = String[], + translation_userlocations = String[], verbose=false) return PR(components; @@ -42,6 +45,7 @@ function VTPR(components::Vector{String}; idealmodel=BasicIdeal, ideal_userlocations = ideal_userlocations, alpha_userlocations = alpha_userlocations, mixing_userlocations = mixing_userlocations, + translation_userlocations = translation_userlocations, verbose = verbose) end export VTPR \ No newline at end of file diff --git a/src/models/cubic/equations.jl b/src/models/cubic/equations.jl index fcc0f287c..17627ad4f 100644 --- a/src/models/cubic/equations.jl +++ b/src/models/cubic/equations.jl @@ -23,18 +23,17 @@ function ab_premixing(::Type{T},mixing,Tc,pc,kij) where T <: ABCubicModel end function cubic_ab(model::ABCubicModel,V,T,z=SA[1.0],n=sum(z)) - invn2 = (one(n)/n)^2 a = model.params.a.values b = model.params.b.values T = T*float(one(T)) α = @f(α_function,model.alpha) c = @f(translation,model.translation) if length(z)>1 - ā,b̄,c̄ = @f(mixing_rule,model.mixing,α,a,b,c) + ā,b̄,c̄ = @f(mixing_rule,model.mixing,α,a,b,c) else - ā = a[1,1]*α[1] - b̄ = b[1,1] - c̄ = c[1,1] + ā = a[1,1]*α[1] + b̄ = b[1,1] + c̄ = c[1] end return ā ,b̄, c̄ end @@ -51,7 +50,7 @@ function lb_volume(model::CubicModel,z = SA[1.0]) invn = one(n)/n b = model.params.b.values c = @f(translation,model.translation) - b̄ = dot(z,Symmetric(b),z)*invn*invn + b̄ = dot(z,Symmetric(b),z)*invn #b has m3/mol units, result should have m3 units c̄ = dot(z,c)*invn return b̄-c̄ end diff --git a/src/models/cubic/mixing/PPR78.jl b/src/models/cubic/mixing/PPR78.jl new file mode 100644 index 000000000..edaa963d5 --- /dev/null +++ b/src/models/cubic/mixing/PPR78.jl @@ -0,0 +1,149 @@ +abstract type PPR78RuleModel <: MixingRule end + +struct PPR78Param <: EoSParam + A::PairParam{Float64} + B::PairParam{Float64} +end + +struct PPR78Rule <: PPR78RuleModel + groups::GroupParam + components::Vector{String} + params::PPR78Param + references::Vector{String} +end +@registermodel PPR78Rule + +""" + PPR78Rule <: PPR78RuleModel + + PPR78Rule(components; + userlocations::Vector{String}=String[], + verbose::Bool=false) + +## Input Parameters + +- `A`: Pair Parameter (`Float64`) - Fitted Parameter `[K]` +- `B`: Pair Parameter (`Float64`) - Fitted Parameter `[K]` + +## Description + +PPR78 Mixing Rule +``` +aᵢⱼ = √(aᵢaⱼ) +bᵢⱼ = (bᵢ +bⱼ)/2 +b̄ = ∑bᵢⱼxᵢxⱼ +c̄ = ∑cᵢxᵢ +ā = b̄(∑[xᵢaᵢᵢαᵢ/(bᵢᵢ)] - ∑xᵢxⱼbᵢbⱼEᵢⱼ/2b̄) +Eᵢⱼ = ∑(z̄ᵢₖ - z̄ⱼₖ)(z̄ᵢₗ - z̄ⱼₗ) × Aₖₗ × (298.15/T)^(Aₖₗ/Bₖₗ - 1) +``` + +## References +1. Jaubert, J.-N., Privat, R., & Mutelet, F. (2010). Predicting the phase equilibria of synthetic petroleum fluids with the PPR78 approach. AIChE Journal. American Institute of Chemical Engineers, 56(12), 3225–3235. doi:10.1002/aic.12232 +2. Jaubert, J.-N., Qian, J.-W., Lasala, S., & Privat, R. (2022). The impressive impact of including enthalpy and heat capacity of mixing data when parameterising equations of state. Application to the development of the E-PPR78 (Enhanced-Predictive-Peng-Robinson-78) model. Fluid Phase Equilibria, (113456), 113456. doi:10.1016/j.fluid.2022.113456 + +""" +PPR78Rule + +export PPR78Rule + +function PPR78Rule(components; activity = nothing, userlocations::Vector{String}=String[],activity_userlocations::Vector{String}=String[], verbose::Bool=false) + groups = GroupParam(components,["cubic/EPPR78/EPPR78_groups.csv"]; verbose=verbose) + params = getparams(groups, ["cubic/EPPR78/EPPR78_unlike.csv"]; userlocations=userlocations) + pkgparams = PPR78Param(params["A"],params["B"]) + references = ["10.1002/aic.12232","10.1016/j.fluid.2022.113456"] + model = PPR78Rule(groups,groups.components,pkgparams,references) + return model +end + + +function mixing_rule(model::CubicModel,V,T,z,mixing_model::PPR78Rule,α,a,b,c) + n = sum(z) + invn = 1/n + invn2 = invn*invn + T̄ = 298.15/T + b̄ = dot(z,diag(b)) * invn + c̄ = dot(z,c)*invn + _0 = zero(T+first(z)) + gᴱ = _0 + + A = mixing_model.params.A.values + B = mixing_model.params.B.values + groups = mixing_model.groups + gc = groups.i_flattenedgroups + z̄n = groups.n_groups_cache + + for i ∈ @comps + zni = z̄n[i] + ∑zni⁻¹ = 1/sum(zni) + bi = b[i,i] + for j in 1:i-1 + znj = z̄n[j] + ∑znj⁻¹ = 1/sum(znj) + Eij = _0 + for k in gc + αik =zni[k]* ∑zni⁻¹ + αjk =znj[k]* ∑znj⁻¹ + Δαk = (αik - αjk) + for l in 1:k-1 #Δαk*Δαl = Δαl*Δαk + αil =zni[l]* ∑zni⁻¹ + αjl =znj[l]* ∑znj⁻¹ + Δαl = (αil - αjl) + Akl = A[k,l] + Bkl = B[k,l] + if !iszero(Akl) + Eij -= Δαk*Δαl*Akl*T̄^(Bkl/Akl - 1) # -1/2 * 2 + end + end + end + gᴱ += bi*b[j,j]*z[i]*z[j]*Eij #(0.5 * 2) + end + end + gᴱ = gᴱ*invn2/b̄*1e6 + ∑ab = sum(z[i]*a[i,i]*α[i]/b[i,i] for i ∈ @comps)*invn + ā = b̄*(∑ab-gᴱ) + return ā,b̄,c̄ +end + +#= +groups: +["CH3", +"CH2", +"CH", +"C", +"CH4", +"C2H6", +"CH aro", +"C aro", +"C fused aromatic rings", +"CH2 cyclic", +"CH cyclic~|~C cyclic", +"CO2", +"N2", +"H2S", +"SH", +"H2O", +"C2H4", +"CH2 alkenic~|~CH alkenic", +"C alkenic", +"CH cycloalkenic~|~C cycloalkenic", +"H2", +"C2F6", +"CF3", +"CF2", +"CF2 double bond~|~CF double bond", +"C2H4F2", +"C2H2F4", +"CO", +"He", +"Ar", +"SO2", +"O2", +"NO", +"COS", +"NH3", +"NO2~|~N2O4", +"N2O", +"C2H2", +"HC=-C-", +"-C=-C-"] +=# \ No newline at end of file diff --git a/src/models/cubic/mixing/QCPR.jl b/src/models/cubic/mixing/QCPR.jl new file mode 100644 index 000000000..bb9338dd2 --- /dev/null +++ b/src/models/cubic/mixing/QCPR.jl @@ -0,0 +1,100 @@ +struct QCPRRuleParam <: EoSParam + A::SingleParam{Float64} + B::SingleParam{Float64} + l::PairParam{Float64} +end + +abstract type QCPRRuleModel <: MixingRule end + +struct QCPRRule <: QCPRRuleModel + components::Array{String,1} + params::QCPRRuleParam + references::Array{String,1} +end + +@registermodel QCPRRule + +""" + QCPRRule <: MHV2RuleModel + + QCPRRule(components::Vector{String}; + activity = Wilson, + userlocations::Vector{String}=String[], + activity_userlocations::Vector{String}=String[], + verbose::Bool=false) + +## Input Parameters + +None + +## Input models + +- `activity`: Activity Model + +## Description + +Quantum-Corrected Mixing Rule: +``` +aᵢⱼ = √(aᵢaⱼ)(1 - kᵢⱼ) +bᵢⱼ = (1-lᵢⱼ)(bqᵢ + bqⱼ)/2 +bqᵢ = bᵢβᵢ(T) +βᵢ(T) = (1 + Aᵢ/(T + Bᵢ))^3 / (1 + Aᵢ/(Tcᵢ + Bᵢ))^3 +ā = ∑aᵢⱼxᵢxⱼ√(αᵢ(T)αⱼ(T)) +b̄ = ∑bᵢⱼxᵢxⱼ +c̄ = ∑cᵢxᵢ +``` + +## References +1. Aasen, A., Hammer, M., Lasala, S., Jaubert, J.-N., & Wilhelmsen, Ø. (2020). Accurate quantum-corrected cubic equations of state for helium, neon, hydrogen, deuterium and their mixtures. Fluid Phase Equilibria, 524(112790), 112790. doi:10.1016/j.fluid.2020.112790 + +""" +QCPRRule + + +function QCPRRule(components::Vector{String}; activity = nothing, userlocations::Vector{String}=String[],activity_userlocations::Vector{String}=String[], verbose::Bool=false) + params = getparams(components, ["cubic/QCPR/QCPR_like.csv","cubic/QCPR/QCPR_unlike.csv"]; userlocations=userlocations, verbose=verbose) + references = String["10.1016/j.fluid.2020.112790"] + pkgparams = QCPRRuleParam(params["A"],params["B"],params["l"]) + model = QCPRRule(components, pkgparams ,references) + return model +end + +function mixing_rule(model::PRModel,V,T,z,mixing_model::QCPRRuleModel,α,a,b,c) + n = sum(z) + invn = (one(n)/n) + invn2 = invn^2 + A = mixing_model.params.A.values + B = mixing_model.params.B.values + l = mixing_model.params.l.values + Tc = model.params.Tc.values + ā = zero(T+first(z)) + b̄ = zero(first(z)) + for i in 1:length(z) + zi = z[i] + αi = α[i] + zi2 = zi^2 + Bi = B[i] + Ai = A[i] + βi = (1 + Ai/(T + Bi))^3 / (1 + Ai/(Tc[i] + Bi))^3 + bqi = βi*b[i,i] + b̄ += bqi*zi2 + ā += a[i,i]*αi*zi2 + for j in 1:(i-1) + zij = zi*z[j] + Bj = B[j] + Aj = A[j] + βj = (1 + Aj/(T + Bj))^3 / (1 + Aj/(Tc[j] + Bj))^3 + bqj = βj*b[j,j] + ā += 2*a[i,j]*sqrt(αi*α[j])*zij + b̄ += zij*(bqi+bqj)*(1-l[i,j]) #2 * zij * 0.5(bi + bj) + end + end + ā *= invn2 + b̄ *= invn2 + c̄ = dot(z,c)*invn + #dot(z,Symmetric(a .* sqrt.(α*α')),z) * invn2 + return ā,b̄,c̄ +end + + + diff --git a/src/models/cubic/mixing/mixing.jl b/src/models/cubic/mixing/mixing.jl index cc5db7005..b9b022d7b 100644 --- a/src/models/cubic/mixing/mixing.jl +++ b/src/models/cubic/mixing/mixing.jl @@ -1,7 +1,5 @@ abstract type MixingRule <:EoSModel end - - """ mixing_rule(model::CubicModel,V,T,z,mixing_model::MixingRule,α,a,b,c) @@ -41,4 +39,6 @@ include("LCVM.jl") include("WS.jl") include("PSRK.jl") include("VTPR.jl") -include("UMR.jl") \ No newline at end of file +include("UMR.jl") +include("QCPR.jl") +include("PPR78.jl") \ No newline at end of file diff --git a/src/models/cubic/translation/ConstantTranslation.jl b/src/models/cubic/translation/ConstantTranslation.jl new file mode 100644 index 000000000..5c2363855 --- /dev/null +++ b/src/models/cubic/translation/ConstantTranslation.jl @@ -0,0 +1,47 @@ +abstract type ConstantTranslationModel <: TranslationModel end + +struct ConstantTranslationParam <: EoSParam + c::SingleParam{Float64} +end + +@newmodelsimple ConstantTranslation ConstantTranslationModel ConstantTranslationParam + +""" + + ConstantTranslation <: ConstantTranslationModel + + ConstantTranslation(components::Vector{String}; + userlocations::Vector{String}=String[], + verbose::Bool=false) + +## Input Parameters + +- `c`: Single Parameter (`Float64`) - Volume shift `[m³/mol]` + +## Description + +Constant Translation model for cubics: +``` +V = V₀ + mixing_rule(cᵢ) +``` +where `cᵢ` is constant. + +It does not have parameters by default, the volume shifts must be user-supplied. + +""" +ConstantTranslation + +export ConstantTranslation + +function ConstantTranslation(components::Vector{String}; userlocations::Vector{String}=String[], verbose::Bool=false) + params = getparams(components, String[]; userlocations=userlocations, verbose=verbose) + c = params["c"] + packagedparams = ConstantTranslationParam(c) + model = ConstantTranslation(packagedparams, verbose=verbose) + return model +end + +function translation(model::CubicModel,V,T,z,translation_model::ConstantTranslationModel) + return translation_model.params.c.values +end + diff --git a/src/models/cubic/translation/translation.jl b/src/models/cubic/translation/translation.jl index 3f76a10a4..a2db655d7 100644 --- a/src/models/cubic/translation/translation.jl +++ b/src/models/cubic/translation/translation.jl @@ -33,4 +33,5 @@ end include("NoTranslation.jl") include("Rackett.jl") include("Peneloux.jl") -include("MT.jl") \ No newline at end of file +include("MT.jl") +include("ConstantTranslation.jl") \ No newline at end of file diff --git a/test/test_models.jl b/test/test_models.jl index 9d72efdcb..db626f3b2 100644 --- a/test/test_models.jl +++ b/test/test_models.jl @@ -212,6 +212,16 @@ end @test Clapeyron.a_res(system, V, T, z) ≈ -1.1447318247939071 rtol = 1e-6 end + @testset "QCPR" begin + system = QCPR(["neon","helium"]) + @test Clapeyron.a_res(system, V, 25, z) ≈ -0.04727878068343511 rtol = 1e-6 + end + + @testset "EPPR78" begin + system = EPPR78(["benzene","isooctane"]) + @test Clapeyron.a_res(system, V, T, z) ≈ -1.138852387092216 rtol = 1e-6 + end + @testset "PR w/ BMAlpha" begin system = PR(["ethane","undecane"];alpha = BMAlpha) @test Clapeyron.a_res(system, V, T, z) ≈ -1.244507550417118 rtol = 1e-6 @@ -411,11 +421,29 @@ end @test Clapeyron.shape_factors(system, V, T, z)[1] ≈ 1.3499576779924594 rtol = 1e-6 end end - @testset "lattice models" begin - T = 298.15 - V = 1e-4 - z = [1.] - system = Clapeyron.SanchezLacombe(["carbon dioxide"]) - @test Clapeyron.a_res(system, V, T, z) ≈ -0.9511044462267396 rtol = 1e-6 + + @testset "single component" begin + T = 298.15 + V = 1e-4 + z = [1.] + system = Clapeyron.SanchezLacombe(["carbon dioxide"]) + @test Clapeyron.a_res(system, V, T, z) ≈ -0.9511044462267396 rtol = 1e-6 + end + + @testset "Sanchez-Lacombe,Kij rule" begin + T = 298.15 + V = 1e-4 + z = [0.5,0.5] + system = SanchezLacombe(["carbon dioxide","benzoic acid"],mixing = SLKRule) + @test Clapeyron.a_res(system, V, T, z) ≈ -6.494291842858994 rtol = 1e-6 + end + + @testset "Sanchez-Lacombe K0-K1-L rule" begin + T = 298.15 + V = 1e-4 + z = [0.5,0.5] + system = SanchezLacombe(["carbon dioxide","benzoic acid"],mixing = SLk0k1lMixingRule) + @test Clapeyron.a_res(system, V, T, z) ≈ -5.579621796375229 rtol = 1e-6 + end end