mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-01 03:00:13 -04:00
Added melting lines for many fluids - nearly all that are in REFPROP
Signed-off-by: Ian Bell <ian.h.bell@gmail.com>
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
% This file was created with JabRef 2.9.2.
|
||||
% Encoding: ASCII
|
||||
|
||||
@ARTICLE{Abramson-HPR-2011,
|
||||
author = {Evan H. Abramson},
|
||||
title = {Melting curves of argon and methane},
|
||||
journal = {High Pressure Research},
|
||||
year = {2011},
|
||||
volume = {31},
|
||||
pages = {549-554},
|
||||
number = {4},
|
||||
owner = {Belli},
|
||||
timestamp = {2014.06.09}
|
||||
}
|
||||
|
||||
@CONFERENCE{Akasaka-DELFT-2013,
|
||||
author = {Ryo Akasaka and Yukihiro Higashi and Shigeru Koyama},
|
||||
title = {{A Fundamental Equation of State For Low-GWP Refrigerant HFO-1234ze(Z)}},
|
||||
|
||||
@@ -4,6 +4,27 @@
|
||||
"ARGON"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Tegeler-JPCRD-1999",
|
||||
"T_m": 87.28,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 83.8058,
|
||||
"T_max": 254.0,
|
||||
"T_min": 83.806,
|
||||
"a": [
|
||||
-7476.2665,
|
||||
9959.0613
|
||||
],
|
||||
"p_0": 68891,
|
||||
"t": [
|
||||
1.05,
|
||||
1.275
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 150.687,
|
||||
"Tmax": 150.68699999999976,
|
||||
|
||||
@@ -7,6 +7,27 @@
|
||||
"CARBONDIOXIDE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Span-JPCRD-1996",
|
||||
"T_m": 216.58,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 216.592,
|
||||
"T_max": 327.6,
|
||||
"T_min": 216.592,
|
||||
"a": [
|
||||
1955.539,
|
||||
2055.4593
|
||||
],
|
||||
"p_0": 517950,
|
||||
"t": [
|
||||
1,
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Theta"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 304.1282,
|
||||
"Tmax": 304.1281999999994,
|
||||
|
||||
@@ -4,6 +4,21 @@
|
||||
"CARBONMONOXIDE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Barreiros-JCT-1982",
|
||||
"T_m": 81.63,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 1,
|
||||
"T_max": 87.5,
|
||||
"T_min": 68.16,
|
||||
"a": 19560.8,
|
||||
"c": 2.10747,
|
||||
"p_0": -142921439.2
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 132.86,
|
||||
"Tmax": 132.8599999999997,
|
||||
|
||||
@@ -4,6 +4,21 @@
|
||||
"CYCLOHEXANE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Penoncello-IJT-1995",
|
||||
"T_m": 279.96,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 279.7,
|
||||
"T_max": 401.7,
|
||||
"T_min": 279.47,
|
||||
"a": 383400000.0,
|
||||
"c": 1.41,
|
||||
"p_0": 0
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 553.6,
|
||||
"Tmax": 553.5999999999988,
|
||||
|
||||
@@ -4,6 +4,27 @@
|
||||
"ETHANE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Buecker-JCRD-2006",
|
||||
"T_m": 184.6,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 90.368,
|
||||
"T_max": 110.2,
|
||||
"T_min": 90.368,
|
||||
"a": [
|
||||
223626315.0,
|
||||
105262374.0
|
||||
],
|
||||
"p_0": 1.14,
|
||||
"t": [
|
||||
1.0,
|
||||
2.55
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 305.322,
|
||||
"Tmax": 305.3219999999994,
|
||||
|
||||
@@ -4,6 +4,37 @@
|
||||
"ETHYLENE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Smukala-JPCRD-2000",
|
||||
"T_m": 169,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 103.989,
|
||||
"T_max": 110.369,
|
||||
"T_min": 103.989,
|
||||
"a": [
|
||||
2947001.84
|
||||
],
|
||||
"p_0": 122.65,
|
||||
"t": [
|
||||
2.045
|
||||
]
|
||||
},
|
||||
{
|
||||
"T_0": 110.369,
|
||||
"T_max": 188,
|
||||
"T_min": 110.369,
|
||||
"a": [
|
||||
6.82693421
|
||||
],
|
||||
"p_0": 46800000.0,
|
||||
"t": [
|
||||
1.089
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 282.35,
|
||||
"Tmax": 282.3499999999994,
|
||||
|
||||
@@ -4,6 +4,25 @@
|
||||
"FLUORINE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "deReuck-BOOK-1990",
|
||||
"T_m": 85.2,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 53.4811,
|
||||
"T_max": 55.4,
|
||||
"T_min": 53.4811,
|
||||
"a": [
|
||||
988043.478261
|
||||
],
|
||||
"p_0": 252,
|
||||
"t": [
|
||||
2.1845
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 144.414,
|
||||
"Tmax": 144.41399999999967,
|
||||
|
||||
@@ -7,6 +7,25 @@
|
||||
"R600a"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Buecker-JPCRD-2006B",
|
||||
"T_m": 262,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 113.73,
|
||||
"T_max": 124.9,
|
||||
"T_min": 113.73,
|
||||
"a": [
|
||||
1953637130.9
|
||||
],
|
||||
"p_0": 0.0219,
|
||||
"t": [
|
||||
6.12
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 407.817,
|
||||
"Tmax": 407.81699999999915,
|
||||
|
||||
@@ -5,6 +5,21 @@
|
||||
"ISOPENTANE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Reeves-JCP-1964",
|
||||
"T_m": 113.22999999999999,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 112.5,
|
||||
"T_max": 212.16,
|
||||
"T_min": 112.65,
|
||||
"a": 591600000.0,
|
||||
"c": 1.563,
|
||||
"p_0": 0
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 460.35,
|
||||
"Tmax": 460.3499999999989,
|
||||
|
||||
@@ -4,6 +4,21 @@
|
||||
"KRYPTON"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Michels-PHYSICA-1962",
|
||||
"T_m": 115.95,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 1,
|
||||
"T_max": 168.7,
|
||||
"T_min": 115.77,
|
||||
"a": 109479.2307,
|
||||
"c": 1.6169841,
|
||||
"p_0": -237497645.7
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 209.48,
|
||||
"Tmax": 209.4799999999995,
|
||||
|
||||
@@ -5,6 +5,21 @@
|
||||
"METHANE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Abramson-HPR-2011",
|
||||
"T_m": 90.7,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 90.6941,
|
||||
"T_max": 700,
|
||||
"T_min": 90.6941,
|
||||
"a": 208000000.0,
|
||||
"c": 1.698,
|
||||
"p_0": 11700.0
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 190.564,
|
||||
"Tmax": 190.56399999999954,
|
||||
|
||||
@@ -4,6 +4,29 @@
|
||||
"METHANOL"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "deReuck-BOOK-1993",
|
||||
"T_m": 337.8,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 175.61,
|
||||
"T_max": 245.9,
|
||||
"T_min": 175.61,
|
||||
"a": [
|
||||
5330770000.0,
|
||||
4524780000.0,
|
||||
38888610000.0
|
||||
],
|
||||
"p_0": 0.187,
|
||||
"t": [
|
||||
1,
|
||||
1.5,
|
||||
4
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Theta"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 512.5,
|
||||
"Tmax": 512.4999999999987,
|
||||
|
||||
@@ -5,6 +5,25 @@
|
||||
"N2"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Span-JPCRD-2000",
|
||||
"T_m": 77.34,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 63.151,
|
||||
"T_max": 283.8,
|
||||
"T_min": 63.151,
|
||||
"a": [
|
||||
12798.61
|
||||
],
|
||||
"p_0": 12523,
|
||||
"t": [
|
||||
1.78963
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 126.192,
|
||||
"Tmax": 126.19199999999978,
|
||||
|
||||
@@ -5,6 +5,21 @@
|
||||
"O2"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Younglove-NIST-1982",
|
||||
"T_m": 90.2,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 1,
|
||||
"T_max": 63.1,
|
||||
"T_min": 54.361,
|
||||
"a": 227606.348,
|
||||
"c": 1.769,
|
||||
"p_0": -266999247.652
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 154.581,
|
||||
"Tmax": 154.58099999999973,
|
||||
|
||||
@@ -5,6 +5,29 @@
|
||||
"PARAHYDROGEN"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Younglove-NIST-1982",
|
||||
"T_m": 18.9,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 1,
|
||||
"T_max": 22,
|
||||
"T_min": 13.8033,
|
||||
"a": 125746.643,
|
||||
"c": 1.955,
|
||||
"p_0": -21155737.752
|
||||
},
|
||||
{
|
||||
"T_0": 1,
|
||||
"T_max": 164.5,
|
||||
"T_min": 22,
|
||||
"a": 248578.596,
|
||||
"c": 1.764739,
|
||||
"p_0": -26280332.904
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 32.938,
|
||||
"Tmax": 32.93799999999992,
|
||||
|
||||
@@ -4,6 +4,29 @@
|
||||
"PROPYLENE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Reeves-JCP-1964",
|
||||
"T_m": 88.05999999999997,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 86.0,
|
||||
"T_max": 129,
|
||||
"T_min": 86.0,
|
||||
"a": 319600000.0,
|
||||
"c": 2.821,
|
||||
"p_0": 0
|
||||
},
|
||||
{
|
||||
"T_0": 109.6,
|
||||
"T_max": 145.3,
|
||||
"T_min": 129,
|
||||
"a": 306400000.0,
|
||||
"c": 3.871,
|
||||
"p_0": 445000000.0
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 364.211,
|
||||
"Tmax": 364.2109999999991,
|
||||
|
||||
@@ -6,6 +6,65 @@
|
||||
"h2o"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "IAPWS",
|
||||
"T_m": -1,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 273.16,
|
||||
"T_max": 251.165,
|
||||
"T_min": 273.16,
|
||||
"a": [
|
||||
-1195393.37,
|
||||
-80818.3159,
|
||||
-3338.2686
|
||||
],
|
||||
"p_0": 611.657,
|
||||
"t": [
|
||||
3.0,
|
||||
25.75,
|
||||
103.75
|
||||
]
|
||||
},
|
||||
{
|
||||
"T_0": 251.165,
|
||||
"T_max": 256.164,
|
||||
"T_min": 251.165,
|
||||
"a": [
|
||||
0.299948
|
||||
],
|
||||
"p_0": 208566000.0,
|
||||
"t": [
|
||||
60
|
||||
]
|
||||
},
|
||||
{
|
||||
"T_0": 256.164,
|
||||
"T_max": 273.31,
|
||||
"T_min": 256.164,
|
||||
"a": [
|
||||
1.18721
|
||||
],
|
||||
"p_0": 350100000.0,
|
||||
"t": [
|
||||
8
|
||||
]
|
||||
},
|
||||
{
|
||||
"T_0": 273.31,
|
||||
"T_max": 355,
|
||||
"T_min": 273.31,
|
||||
"a": [
|
||||
1.07476
|
||||
],
|
||||
"p_0": 623400000.0,
|
||||
"t": [
|
||||
4.6
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 647.096,
|
||||
"Tmax": 647.0959999999985,
|
||||
|
||||
@@ -5,6 +5,21 @@
|
||||
"XENON"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Michels-PHYSICA-1962",
|
||||
"T_m": 165.02,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 1,
|
||||
"T_max": 366.4,
|
||||
"T_min": 161.4,
|
||||
"a": 80890.5544859,
|
||||
"c": 1.589165,
|
||||
"p_0": -260932309.446
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 289.733,
|
||||
"Tmax": 289.7329999999995,
|
||||
|
||||
@@ -6,6 +6,25 @@
|
||||
"N-BUTANE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Buecker-JPCRD-2006B",
|
||||
"T_m": 135.23,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 134.895,
|
||||
"T_max": 163.9,
|
||||
"T_min": 134.895,
|
||||
"a": [
|
||||
558558236.4
|
||||
],
|
||||
"p_0": 0.653,
|
||||
"t": [
|
||||
2.206
|
||||
]
|
||||
}
|
||||
],
|
||||
"type": "polynomial_in_Tr"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 425.125,
|
||||
"Tmax": 425.124999999999,
|
||||
|
||||
@@ -7,6 +7,21 @@
|
||||
"R601"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Reeves-JCP-1964",
|
||||
"T_m": 143.26,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 143.5,
|
||||
"T_max": 156.2,
|
||||
"T_min": 143.47,
|
||||
"a": 660000000.0,
|
||||
"c": 1.649,
|
||||
"p_0": 0.0
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 469.7,
|
||||
"Tmax": 469.69999999999914,
|
||||
|
||||
@@ -8,6 +8,21 @@
|
||||
"N-PROPANE"
|
||||
],
|
||||
"ANCILLARIES": {
|
||||
"melting_line": {
|
||||
"BibTeX": "Reeves-JCP-1964",
|
||||
"T_m": 85.39999999999998,
|
||||
"parts": [
|
||||
{
|
||||
"T_0": 85.3,
|
||||
"T_max": 168.63,
|
||||
"T_min": 85.525,
|
||||
"a": 718000000.0,
|
||||
"c": 1.283,
|
||||
"p_0": 0.0
|
||||
}
|
||||
],
|
||||
"type": "Simon"
|
||||
},
|
||||
"pL": {
|
||||
"T_r": 369.89,
|
||||
"Tmax": 369.8899999999991,
|
||||
|
||||
@@ -1,84 +1,96 @@
|
||||
import os, json
|
||||
|
||||
|
||||
Simon_curves = {
|
||||
"n-Propane" : {
|
||||
"T_0" : 85.3, "a" : 7.180e8, "c" : 1.283, "p_0" : 0.0, "T_max" : 168.63, "BibTeX" : "Reeves-JCP-1964"
|
||||
"BibTeX" : "Reeves-JCP-1964", "T_m": -187.75 + 273.15, "parts": [{"T_0" : 85.3, "a" : 7.180e8, "c" : 1.283, "p_0" : 0.0, "T_max" : 168.63}]
|
||||
},
|
||||
"n-Pentane" : {
|
||||
"T_0" : 143.5, "a" : 6.600e8, "c" : 1.649, "p_0" : 0.0, "T_max" : 156.2, "BibTeX" : "Reeves-JCP-1964"
|
||||
"BibTeX" : "Reeves-JCP-1964", "T_m": -129.89 + 273.15, "parts": [{"T_0" : 143.5, "a" : 6.600e8, "c" : 1.649, "p_0" : 0.0, "T_max" : 156.2}]
|
||||
},
|
||||
"Isopentane" : {
|
||||
"T_0" : 112.5, "a" : 5.916e8, "c" : 1.563, "p_0" : 0, "T_max" : 212.16, "BibTeX" : "Reeves-JCP-1964"
|
||||
"BibTeX" : "Reeves-JCP-1964", "T_m": -159.92 + 273.15, "parts": [{"T_0" : 112.5, "a" : 5.916e8, "c" : 1.563, "p_0" : 0, "T_max" : 212.16}]
|
||||
},
|
||||
"Propylene" : {
|
||||
"BibTeX" : "Reeves-JCP-1964", "T_m": -185.09 + 273.15, "parts": [{"T_0" : 86.0, "a" : 3.196e8, "c" : 2.821, "p_0" : 0, "T_min": 86.0, "T_max" : 129},
|
||||
{"T_0" : 109.6, "a" : 3.064e8, "c" : 3.871, "p_0" : 4.450e8, "T_min": 129, "T_max" : 145.3}]
|
||||
},
|
||||
"Propylene" : [
|
||||
{
|
||||
"T_0" : 86.0, "a" : 3.196e8, "c" : 2.821, "p_0" : 0, "T_min": 86.0, "T_max" : 129, "BibTeX" : "Reeves-JCP-1964"
|
||||
},
|
||||
{
|
||||
"T_0" : 109.6, "a" : 3.064e8, "c" : 3.871, "p_0" : 4.450e8, "T_min": 129, "T_max" : 145.3, "BibTeX" : "Reeves-JCP-1964"
|
||||
}
|
||||
],
|
||||
"Cyclohexane" : {
|
||||
"T_0" : 279.7, "a" : 383.4e6, "c" : 1.41, "p_0" : 0, "T_max" : 401.7, "BibTeX" : "Penoncello-IJT-1995"
|
||||
"BibTeX" : "Penoncello-IJT-1995", "T_m": 6.81 + 273.15, "parts": [{"T_0" : 279.7, "a" : 383.4e6, "c" : 1.41, "p_0" : 0, "T_max" : 401.7}]
|
||||
},
|
||||
"Krypton" : {
|
||||
"T_0" : 1, "a" : 109479.2307, "c" : 1.6169841, "p_0" : -237497645.7, "T_max" : 168.7, "BibTeX" : "Michels-PHYSICA-1962"
|
||||
"BibTeX" : "Michels-PHYSICA-1962", "T_m": 115.95, "parts": [{"T_0" : 1, "a" : 109479.2307, "c" : 1.6169841, "p_0" : -237497645.7, "T_max" : 168.7}]
|
||||
},
|
||||
"Xenon" : {
|
||||
"T_0" : 1, "a" : 80890.5544859, "c" : 1.5891650, "p_0" : -260932309.446, "T_max" : 366.4, "BibTeX" : "Michels-PHYSICA-1962"
|
||||
"BibTeX" : "Michels-PHYSICA-1962", "T_m": 165.02, "parts": [{"T_0" : 1, "a" : 80890.5544859, "c" : 1.5891650, "p_0" : -260932309.446, "T_max" : 366.4}]
|
||||
},
|
||||
"CarbonMonoxide" : {
|
||||
"T_0" : 1, "a" : 19560.8, "c" : 2.10747, "p_0" : -142921439.2, "T_max" : 87.5, "BibTeX" : "Barreiros-JCT-1982"
|
||||
"BibTeX" : "Barreiros-JCT-1982", "T_m": 81.63, "parts": [{"T_0" : 1, "a" : 19560.8, "c" : 2.10747, "p_0" : -142921439.2, "T_max" : 87.5}]
|
||||
},
|
||||
"Oxygen": {
|
||||
"T_0" : 1, "a" : 227606.348, "c" : 1.769, "p_0" : -266999247.652, "T_max" : 63.1, "BibTeX" : "Younglove-NIST-1982"
|
||||
"BibTeX" : "Younglove-NIST-1982", "T_m": 90.2, "parts": [{"T_0" : 1, "a" : 227606.348, "c" : 1.769, "p_0" : -266999247.652, "T_max" : 63.1}]
|
||||
},
|
||||
"ParaHydrogen": [
|
||||
{
|
||||
"T_0" : 1, "a" : 125746.643, "c" : 1.955, "p_0" : -21155737.752, "T_min" : 13.8033, "T_max" : 22, "BibTeX" : "Younglove-NIST-1982"
|
||||
"ParaHydrogen": {
|
||||
"BibTeX" : "Younglove-NIST-1982", "T_m": 18.9, "parts": [{"T_0" : 1, "a" : 125746.643, "c" : 1.955, "p_0" : -21155737.752, "T_min" : 13.8033, "T_max" : 22},
|
||||
{"T_0" : 1, "a" : 248578.596, "c" : 1.764739, "p_0" : -26280332.904, "T_min" : 22, "T_max" : 164.5}]
|
||||
},
|
||||
{
|
||||
"T_0" : 1, "a" : 248578.596, "c" : 1.764739, "p_0" : -26280332.904, "T_min" : 22, "T_max" : 164.5, "BibTeX" : "Younglove-NIST-1982"
|
||||
"Methane": {
|
||||
"BibTeX" : "Abramson-HPR-2011", "T_m": 90.7, "parts": [{"T_0" : 90.6941, "a" : 0.208e9, "c" : 1.698, "p_0" : 1.17e4, "T_max" : 700}]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
polynomial_in_Tr = {
|
||||
"Argon" : {
|
||||
"T_t" : 83.8058, "a" : [-7476.2665, 9959.0613], "t" : [1.05,1.275], "p_t" : 68891, "T_max" : 254.0, "BibTeX" : "Tegeler-JPCRD-1999"
|
||||
"BibTeX" : "Tegeler-JPCRD-1999", "T_m": 87.28, "parts": [{"T_0" : 83.8058, "a" : [-7476.2665, 9959.0613], "t" : [1.05,1.275], "p_0" : 68891, "T_max" : 254.0}]
|
||||
},
|
||||
"Fluorine" : {
|
||||
"T_t" : 53.4811, "a" : [988043.478261], "t" : [2.1845], "p_t" : 252, "T_max" : 55.4, "BibTeX" : "deReuck-BOOK-1990"
|
||||
"BibTeX" : "deReuck-BOOK-1990", "T_m": 85.2, "parts": [{"T_0" : 53.4811, "a" : [988043.478261], "t" : [2.1845], "p_0" : 252, "T_max" : 55.4}]
|
||||
},
|
||||
"Nitrogen" : {
|
||||
"T_t" : 63.151, "a" : [12798.61], "t" : [1.78963], "p_t" : 12523, "T_max" : 283.8, "BibTeX" : "Span-JPCRD-2000"
|
||||
"BibTeX" : "Span-JPCRD-2000", "T_m": 77.34, "parts": [{"T_0" : 63.151, "a" : [12798.61], "t" : [1.78963], "p_0" : 12523, "T_max" : 283.8}]
|
||||
},
|
||||
"Ethane" : {
|
||||
"T_t" : 90.368, "a" : [2.23626315e8, 1.05262374e8], "t" : [1.0, 2.55], "p_t" : 1.14, "T_max" : 110.2, "BibTeX" : "Buecker-JCRD-2006"
|
||||
"BibTeX" : "Buecker-JCRD-2006", "T_m": 184.6, "parts": [{"T_0" : 90.368, "a" : [2.23626315e8, 1.05262374e8], "t" : [1.0, 2.55], "p_0" : 1.14, "T_max" : 110.2}]
|
||||
},
|
||||
"Isobutane" : {
|
||||
"T_t" : 113.73, "a" : [1.9536371309e9], "t" : [6.12], "p_t" : 0.0219, "T_max" : 124.9, "BibTeX" : "Buecker-JPCRD-2006B"
|
||||
"BibTeX" : "Buecker-JPCRD-2006B", "T_m": 262, "parts": [{"T_0" : 113.73, "a" : [1.9536371309e9], "t" : [6.12], "p_0" : 0.0219, "T_max" : 124.9}]
|
||||
},
|
||||
"Ethylene" : [
|
||||
{
|
||||
"T_t" : 103.989, "a" : [2947001.84], "t" : [2.045], "p_t" : 122.65, "T_min" : 103.989, "T_max" : 110.369, "BibTeX" : "Smukala-JPCRD-2000"
|
||||
"Ethylene" : {
|
||||
"BibTeX" : "Smukala-JPCRD-2000", "T_m": 169, "parts": [{"T_0" : 103.989, "a" : [2947001.84], "t" : [2.045], "p_0" : 122.65, "T_min" : 103.989, "T_max" : 110.369},
|
||||
{"T_0" : 110.369, "a" : [6.82693421], "t" : [1.089], "p_0" : 46.8e6, "T_min" : 110.369, "T_max" : 188}]
|
||||
},
|
||||
{
|
||||
"T_t" : 110.369, "a" : [6.82693421], "t" : [1.089], "p_t" : 46.8e6, "T_min" : 110.369, "T_max" : 188, "BibTeX" : "Smukala-JPCRD-2000"
|
||||
}
|
||||
],
|
||||
"n-Butane" : {
|
||||
"T_t" : 134.895, "a" : [5.585582364e8], "t" : [2.206], "p_t" : 0.653, "T_max" : 163.9, "BibTeX" : "Buecker-JPCRD-2006B"
|
||||
"BibTeX" : "Buecker-JPCRD-2006B", "T_m": -137.92 + 273.15, "parts": [{"T_0" : 134.895, "a" : [5.585582364e8], "t" : [2.206], "p_0" : 0.653, "T_max" : 163.9}]
|
||||
},
|
||||
"Water" : {
|
||||
"BibTeX" : "IAPWS", "T_m": -1, "parts": [{"T_0" : 273.16, "a" : [-0.119539337e7,-0.808183159e5,-0.333826860e4], "t" : [0.3000000e1, 0.257500e2, 0.103750e3], "p_0" : 611.657, "T_min": 273.16, "T_max" : 251.165},
|
||||
{"T_0" : 251.165, "a" : [0.299948], "t" : [60], "p_0" : 208.566e6, "T_min": 251.165, "T_max" : 256.164},
|
||||
{"T_0" : 256.164, "a" : [1.18721], "t" : [8], "p_0" : 350.1e6, "T_min": 256.164, "T_max" : 273.31},
|
||||
{"T_0" : 273.31, "a" : [1.07476], "t" : [4.6], "p_0" : 623.4e6, "T_min": 273.31, "T_max" : 355}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
polynomial_in_theta = {
|
||||
"Methanol" : {
|
||||
"T_t" : 175.61, "a" : [5.330770e9, 4.524780e9, 3.888861e10], "t" : [1, 1.5, 4], "p_t" : 0.187, "T_max" : 245.9, "BibTeX" : "deReuck-BOOK-1993"
|
||||
"BibTeX" : "deReuck-BOOK-1993", "T_m": 337.8, "parts": [{"T_0" : 175.61, "a" : [5.330770e9, 4.524780e9, 3.888861e10], "t" : [1, 1.5, 4], "p_0" : 0.187, "T_max" : 245.9}]
|
||||
},
|
||||
"CarbonDioxide" : {
|
||||
"T_t" : 216.592, "a" : [1955.5390, 2055.4593], "t" : [1, 2], "p_t" : 517950, "T_max" : 327.6, "BibTeX" : "Span-JPCRD-1996"
|
||||
"BibTeX" : "Span-JPCRD-1996", "T_m": 216.58, "parts": [{"T_0" : 216.592, "a" : [1955.5390, 2055.4593], "t" : [1, 2], "p_0" : 517950, "T_max" : 327.6}]
|
||||
}
|
||||
}
|
||||
|
||||
import CoolProp
|
||||
__ = 0
|
||||
for fluid in CoolProp.__fluids__:
|
||||
if fluid not in Simon_curves and fluid not in polynomial_in_Tr and fluid not in polynomial_in_theta:
|
||||
print fluid
|
||||
__ += 1
|
||||
else:
|
||||
print ' '*30, fluid
|
||||
print __
|
||||
|
||||
import CoolProp.CoolProp as CP
|
||||
import json, numpy as np, matplotlib.pyplot as plt, pandas
|
||||
|
||||
ip = 1
|
||||
@@ -105,6 +117,7 @@ def plot_rho(T, rho, fit = False):
|
||||
def simon():
|
||||
global ip, irho
|
||||
|
||||
|
||||
for fluid, values in Simon_curves.iteritems():
|
||||
axp = figp.add_subplot(Nrow, Ncol, ip); ip += 1
|
||||
axrho = figrho.add_subplot(Nrow, Ncol, irho); irho += 1
|
||||
@@ -115,21 +128,36 @@ def simon():
|
||||
axp.set_title(fluid)
|
||||
axrho.set_title(fluid)
|
||||
|
||||
if not isinstance(values, list):
|
||||
values = [values]
|
||||
df = pandas.read_csv('melting_curves/'+fluid+'.mlt',names=['T','p','rho'])
|
||||
axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
axrho.plot(x,y, 'o', mfc='none')
|
||||
else:
|
||||
for i in ['I','II']:
|
||||
df = pandas.read_csv('melting_curves/'+fluid+'-'+i+'.mlt',names=['T','p','rho'])
|
||||
axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
axrho.plot(x,y, 'o', mfc='none')
|
||||
fname = os.path.join('fluids',fluid+'.json')
|
||||
j = json.load(open(fname,'r'))
|
||||
for part in values['parts']:
|
||||
if 'T_min' not in part:
|
||||
part['T_min'] = round(CP.Props(fluid,"Tmin"),4)
|
||||
values['type'] = 'Simon'
|
||||
|
||||
j['ANCILLARIES']['melting_line'] = values
|
||||
|
||||
for i,value in enumerate(values):
|
||||
Tmin = value.get('T_min',min(df['T']))
|
||||
fp = open(fname,'w')
|
||||
from package_json import json_options
|
||||
fp.write(json.dumps(j,**json_options))
|
||||
fp.close()
|
||||
|
||||
# if not isinstance(values, list):
|
||||
# values = [values]
|
||||
# df = pandas.read_csv('melting_curves/'+fluid+'.mlt',names=['T','p','rho'])
|
||||
# axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
# x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
# axrho.plot(x,y, 'o', mfc='none')
|
||||
# else:
|
||||
# for i in ['I','II']:
|
||||
# df = pandas.read_csv('melting_curves/'+fluid+'-'+i+'.mlt',names=['T','p','rho'])
|
||||
# axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
# x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
# axrho.plot(x,y, 'o', mfc='none')
|
||||
|
||||
for i, value in enumerate(values['parts']):
|
||||
|
||||
Tmin = value.get('T_min',CP.Props(fluid,"Tmin"))
|
||||
Tmax = value['T_max']
|
||||
|
||||
T = np.linspace(Tmin, Tmax, 200)
|
||||
@@ -155,35 +183,50 @@ def Tr():
|
||||
axp.set_title(fluid)
|
||||
axrho.set_title(fluid)
|
||||
|
||||
fname = os.path.join('fluids',fluid+'.json')
|
||||
j = json.load(open(fname,'r'))
|
||||
for part in values['parts']:
|
||||
if 'T_min' not in part:
|
||||
part['T_min'] = round(CP.Props(fluid,"Tmin"),4)
|
||||
values['type'] = 'polynomial_in_Tr'
|
||||
|
||||
j['ANCILLARIES']['melting_line'] = values
|
||||
|
||||
fp = open(fname,'w')
|
||||
from package_json import json_options
|
||||
fp.write(json.dumps(j,**json_options))
|
||||
fp.close()
|
||||
|
||||
if fluid == 'Ethylene':
|
||||
T = [104.003, 104.059, 104.13, 104.2, 104.27, 104.41, 104.55, 104.69, 104.83, 104.969, 105.108, 105.386, 106.077, 106.764, 107.446, 111.384, 119.283, 127.136, 158.146, 188.621]
|
||||
p = np.array([0.1, 0.5, 1, 1.5, 2, 3, 4, 5, 6, 7, 8, 10, 15, 20, 25, 50, 75, 100, 200, 300])*1e6
|
||||
|
||||
axp.plot(T,p,'*')
|
||||
|
||||
if not isinstance(values, list):
|
||||
values = [values]
|
||||
df = pandas.read_csv('melting_curves/'+fluid+'.mlt',names=['T','p','rho'])
|
||||
axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
axrho.plot(x,y, 'o', mfc='none')
|
||||
|
||||
else:
|
||||
for i in ['I','II']:
|
||||
df = pandas.read_csv('melting_curves/'+fluid+'-'+i+'.mlt',names=['T','p','rho'])
|
||||
axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
axrho.plot(x,y, 'o', mfc='none')
|
||||
# if not isinstance(values, list):
|
||||
# values = [values]
|
||||
# df = pandas.read_csv('melting_curves/'+fluid+'.mlt',names=['T','p','rho'])
|
||||
# axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
# x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
# axrho.plot(x,y, 'o', mfc='none')
|
||||
#
|
||||
# else:
|
||||
# for i in ['I','II']:
|
||||
# df = pandas.read_csv('melting_curves/'+fluid+'-'+i+'.mlt',names=['T','p','rho'])
|
||||
# axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
# x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
# axrho.plot(x,y, 'o', mfc='none')
|
||||
|
||||
for i,value in enumerate(values):
|
||||
Tmin = value.get('T_min',min(df['T']))
|
||||
for i,value in enumerate(values['parts']):
|
||||
|
||||
Tmin = value.get('T_min',CP.Props(fluid,"Tmin"))
|
||||
Tmax = value['T_max']
|
||||
T = np.linspace(Tmin, Tmax, 200)
|
||||
|
||||
a = value['a']
|
||||
t = value['t']
|
||||
T_t = value['T_t']
|
||||
p_t = value['p_t']
|
||||
T_t = value['T_0']
|
||||
p_t = value['p_0']
|
||||
|
||||
RHS = 0
|
||||
for i in range(len(a)):
|
||||
@@ -196,7 +239,7 @@ def Tr():
|
||||
|
||||
def theta():
|
||||
global ip, irho
|
||||
for fluid, value in polynomial_in_theta.iteritems():
|
||||
for fluid, values in polynomial_in_theta.iteritems():
|
||||
|
||||
axp = figp.add_subplot(Nrow, Ncol, ip); ip += 1
|
||||
axrho = figrho.add_subplot(Nrow, Ncol, irho); irho += 1
|
||||
@@ -207,29 +250,45 @@ def theta():
|
||||
axp.set_title(fluid)
|
||||
axrho.set_title(fluid)
|
||||
|
||||
a = value['a']
|
||||
t = value['t']
|
||||
T_t = value['T_t']
|
||||
p_t = value['p_t']
|
||||
fname = os.path.join('fluids',fluid+'.json')
|
||||
j = json.load(open(fname,'r'))
|
||||
for part in values['parts']:
|
||||
if 'T_min' not in part:
|
||||
part['T_min'] = round(CP.Props(fluid,"Tmin"),4)
|
||||
values['type'] = 'polynomial_in_Theta'
|
||||
|
||||
j['ANCILLARIES']['melting_line'] = values
|
||||
|
||||
Tmin = T_t
|
||||
Tmax = value['T_max']
|
||||
T = np.linspace(Tmin, Tmax, 200)
|
||||
fp = open(fname,'w')
|
||||
from package_json import json_options
|
||||
fp.write(json.dumps(j,**json_options))
|
||||
fp.close()
|
||||
|
||||
RHS = 0
|
||||
for i in range(len(a)):
|
||||
RHS += a[i]*(T/T_t - 1)**t[i]
|
||||
for value in values['parts']:
|
||||
|
||||
a = value['a']
|
||||
t = value['t']
|
||||
T_t = value['T_0']
|
||||
p_t = value['p_0']
|
||||
|
||||
Tmin = T_t
|
||||
Tmax = value['T_max']
|
||||
T = np.linspace(Tmin, Tmax, 200)
|
||||
|
||||
RHS = 0
|
||||
for i in range(len(a)):
|
||||
RHS += a[i]*(T/T_t - 1)**t[i]
|
||||
|
||||
p = p_t*(RHS + 1)
|
||||
|
||||
#df = pandas.read_csv('melting_curves/' + fluid + '.mlt', names=['T','p','rho'])
|
||||
|
||||
#axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
|
||||
axp.plot(T, p)
|
||||
|
||||
p = p_t*(RHS + 1)
|
||||
|
||||
df = pandas.read_csv('melting_curves/' + fluid + '.mlt', names=['T','p','rho'])
|
||||
|
||||
axp.plot(df['T'], df['p'], 'o', mfc='none')
|
||||
|
||||
axp.plot(T, p)
|
||||
|
||||
x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
axrho.plot(x,y, 'o', mfc='none')
|
||||
#x,y = plot_rho(df['T'],df['rho'],fit = True)
|
||||
#axrho.plot(x,y, 'o', mfc='none')
|
||||
|
||||
if __name__=='__main__':
|
||||
simon()
|
||||
|
||||
@@ -112,6 +112,7 @@ struct ConductivityCriticalSimplifiedOlchowySengersData{
|
||||
qD = 2e9; //[m]
|
||||
|
||||
// Set to invalid number, can be provided in the JSON file
|
||||
// Default is 1.5*Tc
|
||||
T_ref = _HUGE;
|
||||
}
|
||||
};
|
||||
@@ -365,14 +366,105 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
class MeltingLine
|
||||
struct MeltingLinePiecewiseSimonSegment
|
||||
{
|
||||
long double T_0, a, c, p_0, T_max, T_min;
|
||||
};
|
||||
struct MeltingLinePiecewiseSimonData
|
||||
{
|
||||
std::vector<MeltingLinePiecewiseSimonSegment> parts;
|
||||
};
|
||||
struct MeltingLinePiecewisePolynomialInTrSegment
|
||||
{
|
||||
std::vector<long double> a, t;
|
||||
long double T_0, p_0, T_max, T_min;
|
||||
};
|
||||
struct MeltingLinePiecewisePolynomialInTrData
|
||||
{
|
||||
std::vector<MeltingLinePiecewisePolynomialInTrSegment> parts;
|
||||
};
|
||||
struct MeltingLinePiecewisePolynomialInThetaSegment
|
||||
{
|
||||
std::vector<long double> a, t;
|
||||
long double T_0, p_0, T_max, T_min;
|
||||
};
|
||||
struct MeltingLinePiecewisePolynomialInThetaData
|
||||
{
|
||||
std::vector<MeltingLinePiecewisePolynomialInThetaSegment> parts;
|
||||
};
|
||||
class MeltingLineVariables
|
||||
{
|
||||
public:
|
||||
enum MeltingLineVariablesEnum{
|
||||
MELTING_LINE_SIMON_TYPE,
|
||||
MELTING_LINE_POLYNOMIAL_IN_TR_TYPE,
|
||||
MELTING_LINE_POLYNOMIAL_IN_THETA_TYPE,
|
||||
MELTING_LINE_NOT_SET
|
||||
};
|
||||
long double evaluate(int OF, int GIVEN, long double value)
|
||||
{
|
||||
if (type == MELTING_LINE_NOT_SET){throw ValueError("Melting line curve not set");}
|
||||
if (OF == iP && GIVEN == iT){
|
||||
long double T = value;
|
||||
if (type == MELTING_LINE_SIMON_TYPE){
|
||||
// Need to find the right segment
|
||||
for (std::size_t i = 0; i < simon.parts.size(); ++i){
|
||||
MeltingLinePiecewiseSimonSegment &part = simon.parts[i];
|
||||
if (T >= part.T_min && T <= part.T_max){
|
||||
return part.p_0 + part.a*(pow(T/part.T_0,part.c)-1);
|
||||
}
|
||||
}
|
||||
throw ValueError("unable to calculate melting line (p,T) for Simon curve");
|
||||
}
|
||||
else if (type == MELTING_LINE_POLYNOMIAL_IN_TR_TYPE){
|
||||
// Need to find the right segment
|
||||
for (std::size_t i = 0; i < polynomial_in_Tr.parts.size(); ++i){
|
||||
MeltingLinePiecewisePolynomialInTrSegment &part = polynomial_in_Tr.parts[i];
|
||||
if (T >= part.T_min && T <= part.T_max){
|
||||
long double summer = 0;
|
||||
for (std::size_t i =0; i < part.a.size(); ++i){
|
||||
summer += part.a[i]*(pow(T/part.T_0,part.t[i])-1);
|
||||
}
|
||||
return part.p_0*(1+summer);
|
||||
}
|
||||
}
|
||||
throw ValueError("unable to calculate melting line (p,T) for polynomial_in_Tr curve");
|
||||
}
|
||||
else if (type == MELTING_LINE_POLYNOMIAL_IN_THETA_TYPE){
|
||||
// Need to find the right segment
|
||||
for (std::size_t i = 0; i < polynomial_in_Theta.parts.size(); ++i){
|
||||
MeltingLinePiecewisePolynomialInThetaSegment &part = polynomial_in_Theta.parts[i];
|
||||
if (T >= part.T_min && T <= part.T_max){
|
||||
long double summer = 0;
|
||||
for (std::size_t i =0; i < part.a.size(); ++i){
|
||||
summer += part.a[i]*pow(T/part.T_0-1,part.t[i]);
|
||||
}
|
||||
return part.p_0*(1+summer);
|
||||
}
|
||||
}
|
||||
throw ValueError("unable to calculate melting line (p,T) for polynomial_in_Theta curve");
|
||||
}
|
||||
else{
|
||||
throw ValueError("only Simon supported now");
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw ValueError("only melt(P,T) supported now");
|
||||
}
|
||||
}
|
||||
std::string BibTeX;
|
||||
long double T_m; ///< Melting temperature at 1 atmosphere
|
||||
MeltingLinePiecewiseSimonData simon;
|
||||
MeltingLinePiecewisePolynomialInTrData polynomial_in_Tr;
|
||||
MeltingLinePiecewisePolynomialInThetaData polynomial_in_Theta;
|
||||
int type;
|
||||
MeltingLineVariables(){type = MELTING_LINE_NOT_SET;};
|
||||
};
|
||||
|
||||
struct Ancillaries
|
||||
{
|
||||
SaturationAncillaryFunction pL, pV, rhoL, rhoV;
|
||||
MeltingLine melting_line;
|
||||
MeltingLineVariables melting_line;
|
||||
SurfaceTensionCorrelation surface_tension;
|
||||
};
|
||||
|
||||
|
||||
@@ -100,6 +100,20 @@ namespace cpjson
|
||||
return out;
|
||||
};
|
||||
|
||||
/// A convenience function to get a long double array compactly
|
||||
inline std::vector<long double> get_long_double_array(rapidjson::Value &v, std::string name)
|
||||
{
|
||||
std::vector<long double> out;
|
||||
if (!v.HasMember(name.c_str())){ throw CoolProp::ValueError(format("Does not have member [%s]",name.c_str())); }
|
||||
if (!v[name.c_str()].IsArray()) { throw CoolProp::ValueError("input is not an array"); }
|
||||
for (rapidjson::Value::ValueIterator itr = v[name.c_str()].Begin(); itr != v[name.c_str()].End(); ++itr)
|
||||
{
|
||||
if (!itr->IsNumber()){throw CoolProp::ValueError("input is not a number");}
|
||||
out.push_back(itr->GetDouble());
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
/// A convenience function to get a string array compactly
|
||||
inline std::vector<std::string> get_string_array(rapidjson::Value &v)
|
||||
{
|
||||
|
||||
@@ -311,7 +311,7 @@ protected:
|
||||
EOS.reduce.rhomolar = cpjson::get_double(reducing_state,"rhomolar");
|
||||
EOS.reduce.p = cpjson::get_double(reducing_state,"p");
|
||||
|
||||
/// todo: define limits of EOS better
|
||||
/// \todo: define limits of EOS better
|
||||
EOS.limits.Tmin = cpjson::get_double(satminL_state, "T");
|
||||
EOS.Ttriple = EOS.limits.Tmin;
|
||||
|
||||
@@ -804,6 +804,71 @@ protected:
|
||||
fluid.transport.epsilon_over_k = Tc/1.3593; // [K]
|
||||
}
|
||||
|
||||
void parse_melting_line(rapidjson::Value &melting_line, CoolPropFluid & fluid)
|
||||
{
|
||||
fluid.ancillaries.melting_line.T_m = cpjson::get_double(melting_line, "T_m");
|
||||
fluid.ancillaries.melting_line.BibTeX = cpjson::get_string(melting_line, "BibTeX");
|
||||
|
||||
if (melting_line.HasMember("type"))
|
||||
{
|
||||
std::string type = cpjson::get_string(melting_line, "type");
|
||||
if (!type.compare("Simon"))
|
||||
{
|
||||
rapidjson::Value &parts = melting_line["parts"];
|
||||
for (rapidjson::Value::ValueIterator itr = parts.Begin(); itr != parts.End(); ++itr)
|
||||
{
|
||||
MeltingLinePiecewiseSimonSegment data;
|
||||
data.a = cpjson::get_double((*itr),"a");
|
||||
data.c = cpjson::get_double((*itr),"c");
|
||||
data.T_min = cpjson::get_double((*itr),"T_min");
|
||||
data.T_max = cpjson::get_double((*itr),"T_max");
|
||||
data.T_0 = cpjson::get_double((*itr),"T_0");
|
||||
data.p_0 = cpjson::get_double((*itr),"p_0");
|
||||
fluid.ancillaries.melting_line.simon.parts.push_back(data);
|
||||
}
|
||||
fluid.ancillaries.melting_line.type = MeltingLineVariables::MELTING_LINE_SIMON_TYPE;
|
||||
}
|
||||
else if (!type.compare("polynomial_in_Tr"))
|
||||
{
|
||||
rapidjson::Value &parts = melting_line["parts"];
|
||||
for (rapidjson::Value::ValueIterator itr = parts.Begin(); itr != parts.End(); ++itr)
|
||||
{
|
||||
MeltingLinePiecewisePolynomialInTrSegment data;
|
||||
data.a = cpjson::get_long_double_array((*itr),"a");
|
||||
data.t = cpjson::get_long_double_array((*itr),"t");
|
||||
data.T_min = cpjson::get_double((*itr),"T_min");
|
||||
data.T_max = cpjson::get_double((*itr),"T_max");
|
||||
data.T_0 = cpjson::get_double((*itr),"T_0");
|
||||
data.p_0 = cpjson::get_double((*itr),"p_0");
|
||||
fluid.ancillaries.melting_line.polynomial_in_Tr.parts.push_back(data);
|
||||
}
|
||||
fluid.ancillaries.melting_line.type = MeltingLineVariables::MELTING_LINE_POLYNOMIAL_IN_TR_TYPE;
|
||||
}
|
||||
else if (!type.compare("polynomial_in_Theta"))
|
||||
{
|
||||
rapidjson::Value &parts = melting_line["parts"];
|
||||
for (rapidjson::Value::ValueIterator itr = parts.Begin(); itr != parts.End(); ++itr)
|
||||
{
|
||||
MeltingLinePiecewisePolynomialInThetaSegment data;
|
||||
data.a = cpjson::get_long_double_array((*itr),"a");
|
||||
data.t = cpjson::get_long_double_array((*itr),"t");
|
||||
data.T_min = cpjson::get_double((*itr),"T_min");
|
||||
data.T_max = cpjson::get_double((*itr),"T_max");
|
||||
data.T_0 = cpjson::get_double((*itr),"T_0");
|
||||
data.p_0 = cpjson::get_double((*itr),"p_0");
|
||||
fluid.ancillaries.melting_line.polynomial_in_Theta.parts.push_back(data);
|
||||
}
|
||||
fluid.ancillaries.melting_line.type = MeltingLineVariables::MELTING_LINE_POLYNOMIAL_IN_THETA_TYPE;
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("melting line type [%s] is not understood for fluid %s", type.c_str(), fluid.name.c_str()));
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw ValueError(format("melting line does not have \"type\" for fluid %s", fluid.name.c_str()));
|
||||
}
|
||||
};
|
||||
|
||||
/// Parse the critical state for the given EOS
|
||||
void parse_states(rapidjson::Value &states, CoolPropFluid & fluid)
|
||||
{
|
||||
@@ -936,6 +1001,16 @@ public:
|
||||
parse_surface_tension(fluid_json["ANCILLARIES"]["surface_tension"], fluid);
|
||||
}
|
||||
|
||||
// Melting line
|
||||
if (!(fluid_json["ANCILLARIES"].HasMember("melting_line"))){
|
||||
if (get_debug_level() > 0){
|
||||
std::cout << format("Melting line curves are missing for fluid [%s]\n", fluid.name.c_str()) ;
|
||||
}
|
||||
}
|
||||
else{
|
||||
parse_melting_line(fluid_json["ANCILLARIES"]["melting_line"], fluid);
|
||||
}
|
||||
|
||||
// Parse the environmental parameters
|
||||
if (!(fluid_json.HasMember("ENVIRONMENTAL"))){
|
||||
if (get_debug_level() > 0){
|
||||
|
||||
@@ -115,6 +115,17 @@ long double HelmholtzEOSMixtureBackend::calc_molar_mass(void)
|
||||
}
|
||||
return summer;
|
||||
}
|
||||
long double HelmholtzEOSMixtureBackend::calc_melt_p_T(long double T)
|
||||
{
|
||||
if (is_pure_or_pseudopure)
|
||||
{
|
||||
return components[0]->ancillaries.melting_line.evaluate(iP, iT, T);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw NotImplementedError(format("calc_melt_p_T not implemented for mixtures"));
|
||||
}
|
||||
}
|
||||
long double HelmholtzEOSMixtureBackend::calc_surface_tension(void)
|
||||
{
|
||||
if (is_pure_or_pseudopure)
|
||||
@@ -1591,8 +1602,8 @@ long double HelmholtzEOSMixtureBackend::calc_speed_sound(void)
|
||||
long double d2ar_dDelta2 = d2alphar_dDelta2();
|
||||
long double d2ar_dDelta_dTau = d2alphar_dDelta_dTau();
|
||||
long double d2ar_dTau2 = d2alphar_dTau2();
|
||||
long double R_u = static_cast<long double>(_gas_constant);
|
||||
long double mm = static_cast<long double>(_molar_mass);
|
||||
long double R_u = gas_constant();
|
||||
long double mm = molar_mass();
|
||||
|
||||
// Get speed of sound
|
||||
_speed_sound = sqrt(R_u*_T/mm*(1+2*_delta.pt()*dar_dDelta+pow(_delta.pt(),2)*d2ar_dDelta2 - pow(1+_delta.pt()*dar_dDelta-_delta.pt()*_tau.pt()*d2ar_dDelta_dTau,2)/(pow(_tau.pt(),2)*(d2ar_dTau2 + d2a0_dTau2))));
|
||||
|
||||
@@ -17,10 +17,10 @@ class FlashRoutines;
|
||||
class HelmholtzEOSMixtureBackend : public AbstractState {
|
||||
protected:
|
||||
std::vector<CoolPropFluid*> components; ///< The components that are in use
|
||||
|
||||
|
||||
bool is_pure_or_pseudopure; ///< A flag for whether the substance is a pure or pseudo-pure fluid (true) or a mixture (false)
|
||||
std::vector<long double> mole_fractions; ///< The mole fractions of the components
|
||||
std::vector<long double> mole_fractions_liq, ///< The mole fractions of the saturated liquid
|
||||
std::vector<long double> mole_fractions_liq, ///< The mole fractions of the saturated liquid
|
||||
mole_fractions_vap, ///< The mole fractions of the saturated vapor
|
||||
K, ///< The K factors for the components
|
||||
lnK; ///< The natural logarithms of the K factors of the components
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
|
||||
friend class FlashRoutines; // Allows the static methods in the FlashRoutines class to have access to all the protected members and methods of this class
|
||||
friend class TransportRoutines; // Allows the static methods in the TransportRoutines class to have access to all the protected members and methods of this class
|
||||
//friend class MixtureDerivatives; //
|
||||
//friend class MixtureDerivatives; //
|
||||
|
||||
// Helmholtz EOS backend uses mole fractions
|
||||
bool using_mole_fractions(){return true;}
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
std::vector<long double> &get_K(){return K;};
|
||||
std::vector<long double> &get_lnK(){return lnK;};
|
||||
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL, SatV; ///<
|
||||
shared_ptr<HelmholtzEOSMixtureBackend> SatL, SatV; ///<
|
||||
|
||||
void update(long input_pair, double value1, double value2);
|
||||
|
||||
@@ -69,19 +69,19 @@ public:
|
||||
void set_excess_term();
|
||||
|
||||
/// Set the mole fractions
|
||||
/**
|
||||
/**
|
||||
@param mole_fractions The vector of mole fractions of the components
|
||||
*/
|
||||
void set_mole_fractions(const std::vector<long double> &mole_fractions);
|
||||
|
||||
const std::vector<long double> &get_mole_fractions(){return mole_fractions;};
|
||||
|
||||
|
||||
/// Set the mass fractions
|
||||
/**
|
||||
/**
|
||||
@param mass_fractions The vector of mass fractions of the components
|
||||
*/
|
||||
void set_mass_fractions(const std::vector<long double> &mass_fractions){throw std::exception();};
|
||||
|
||||
|
||||
long double calc_molar_mass(void);
|
||||
long double calc_gas_constant(void);
|
||||
|
||||
@@ -118,6 +118,7 @@ public:
|
||||
long double calc_d2alpha0_dDelta_dTau(void);
|
||||
long double calc_d2alpha0_dTau2(void);
|
||||
|
||||
long double calc_melt_p_T(long double T);
|
||||
long double calc_surface_tension(void);
|
||||
long double calc_viscosity(void);
|
||||
long double calc_viscosity_dilute(void);
|
||||
@@ -137,7 +138,7 @@ public:
|
||||
std::string calc_name(void);
|
||||
|
||||
long double calc_alphar_deriv_nocache(const int nTau, const int nDelta, const std::vector<long double> & mole_fractions, const long double &tau, const long double &delta);
|
||||
|
||||
|
||||
/**
|
||||
\brief Take derivatives of the ideal-gas part of the Helmholtz energy, don't use any cached values, or store any cached values
|
||||
|
||||
@@ -163,7 +164,7 @@ public:
|
||||
\sa Table B5, GERG 2008 from Kunz Wagner, JCED, 2012
|
||||
*/
|
||||
long double calc_alpha0_deriv_nocache(const int nTau, const int nDelta, const std::vector<long double> & mole_fractions, const long double &tau, const long double &delta, const long double &Tr, const long double &rhor);
|
||||
|
||||
|
||||
void calc_reducing_state(void);
|
||||
SimpleState calc_reducing_state_nocache(const std::vector<long double> & mole_fractions);
|
||||
|
||||
@@ -183,11 +184,11 @@ public:
|
||||
|
||||
void mass_to_molar_inputs(long &input_pair, double &value1, double &value2);
|
||||
|
||||
// ***************************************************************
|
||||
// ***************************************************************
|
||||
// ***************************************************************
|
||||
// ************* PHASE DETERMINATION ROUTINES ******************
|
||||
// ***************************************************************
|
||||
// ***************************************************************
|
||||
// ***************************************************************
|
||||
void T_phase_determination_pure_or_pseudopure(int other, long double value);
|
||||
void p_phase_determination_pure_or_pseudopure(int other, long double value);
|
||||
void DmolarP_phase_determination();
|
||||
@@ -197,8 +198,8 @@ public:
|
||||
// ***************************************************************
|
||||
// ******************* SOLVER ROUTINES *************************
|
||||
// ***************************************************************
|
||||
// ***************************************************************
|
||||
|
||||
// ***************************************************************
|
||||
|
||||
long double solver_rho_Tp(long double T, long double p, long double rho_guess = -1);
|
||||
long double solver_rho_Tp_SRK(long double T, long double p, int phase);
|
||||
long double solver_for_rho_given_T_oneof_HSU(long double T, long double value, int other);
|
||||
@@ -310,7 +311,7 @@ public:
|
||||
\f[
|
||||
n\left(\frac{\partial \ln \phi_i}{\partial n_j}\right)_{T,p} = n\left(\frac{\partial^2n\alpha^r}{\partial n_j \partial n_i} \right)_{T,V}+1+\frac{n}{RT}\frac{\left(\frac{\partial p}{\partial n_j}\right)_{T,V,n_i}\left(\frac{\partial p}{\partial n_i}\right)_{T,V,n_j}}{\left(\frac{\partial p}{\partial V}\right)_{T,\bar n}}
|
||||
\f]
|
||||
which is also equal to
|
||||
which is also equal to
|
||||
\f[
|
||||
n\left(\frac{\partial \ln \phi_i}{\partial n_j}\right)_{T,p} = n\left(\frac{\partial^2n\alpha^r}{\partial n_j \partial n_i} \right)_{T,V}+1-\frac{\hat v_i}{RT}\left[n\left(\frac{\partial p}{\partial n_j}\right)_{T,V,n_i}\right]
|
||||
\f]
|
||||
@@ -320,7 +321,7 @@ public:
|
||||
/// Gernert Equation 3.115
|
||||
/// Catch test provided
|
||||
long double mixderiv_dln_fugacity_coefficient_dxj__constT_p_xi(int i, int j);
|
||||
|
||||
|
||||
/// Gernert Equation 3.130
|
||||
/// Catch test provided
|
||||
long double mixderiv_dpdxj__constT_V_xi(int j);
|
||||
@@ -390,7 +391,7 @@ public:
|
||||
\f]
|
||||
GERG 2004 Monograph equation 7.47:
|
||||
\f{eqnarray*}{
|
||||
n\left( \frac{\partial}{\partial n_j}\left(n\left(\frac{\partial \alpha^r}{\partial n_i}\right)_{T,V,n_j} \right) \right)_{T,V,n_i} &=& \left( \frac{\partial}{\partial \delta}\left(n\left(\frac{\partial\alpha^r}{\partial n_i}\right)_{T,V,n_j}\right)\right)_{\tau,\bar x}\cdot n\left(\frac{\partial\delta}{\partial n_j}\right)_{T,V,n_i}\\
|
||||
n\left( \frac{\partial}{\partial n_j}\left(n\left(\frac{\partial \alpha^r}{\partial n_i}\right)_{T,V,n_j} \right) \right)_{T,V,n_i} &=& \left( \frac{\partial}{\partial \delta}\left(n\left(\frac{\partial\alpha^r}{\partial n_i}\right)_{T,V,n_j}\right)\right)_{\tau,\bar x}\cdot n\left(\frac{\partial\delta}{\partial n_j}\right)_{T,V,n_i}\\
|
||||
&+& \left( \frac{\partial}{\partial \tau}\left(n\left(\frac{\partial\alpha^r}{\partial n_i}\right)_{T,V,n_j}\right)\right)_{\tau,\bar x}\cdot n\left(\frac{\partial\tau}{\partial n_j}\right)_{T,V,n_i}\\
|
||||
&+& \left( \frac{\partial}{\partial x_j}\left(n\left(\frac{\partial\alpha^r}{\partial n_i}\right)_{T,V,n_j}\right)\right)_{\delta,\tau,x_i}-\sum_{k=1}^{N}x_k \left( \frac{\partial}{\partial x_k}\left(n\left(\frac{\partial\alpha^r}{\partial n_i}\right)_{T,V,n_j}\right)\right)_{\delta,\tau,x_i}\\
|
||||
\f}
|
||||
@@ -404,7 +405,7 @@ public:
|
||||
\f]
|
||||
*/
|
||||
long double mixderiv_nddeltadni__constT_V_nj(int i);
|
||||
|
||||
|
||||
/// GERG 2004 Monograph equation 7.49
|
||||
/** The derivative term
|
||||
\f[
|
||||
|
||||
Reference in New Issue
Block a user