From f96ffb72bae51ec7eb39e85abb5ac84f342941ef Mon Sep 17 00:00:00 2001
From: Ian Bell <ian.bell@nist.gov>
Date: Thu, 15 Jul 2021 09:51:33 -0400
Subject: [PATCH] A test of the pure models agreeing with CoolProp
 implementations

---
 notebooks/test_pure_multfluid.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 notebooks/test_pure_multfluid.py

diff --git a/notebooks/test_pure_multfluid.py b/notebooks/test_pure_multfluid.py
new file mode 100644
index 0000000..cae26fd
--- /dev/null
+++ b/notebooks/test_pure_multfluid.py
@@ -0,0 +1,21 @@
+import glob, os
+import numpy as np
+
+import CoolProp.CoolProp as CP 
+
+import teqp
+
+for jname in glob.glob('../mycp/dev/fluids/*.json'):
+    name = os.path.split(jname)[1].split('.')[0]
+    try:
+        model = teqp.build_multifluid_model([name], '../mycp', '../mycp/dev/mixtures/mixture_binary_pairs.json',{'estimate':'linear'})
+        Tc = model.get_Tcvec()[0]
+        rhoc = 1/model.get_vcvec()[0]
+        z = np.array([1.0])
+        # print(Tc, rhoc)
+        diff = model.get_Ar00(Tc+10, rhoc, z) - CP.PropsSI('alphar', 'T', Tc+10, 'Dmolar', rhoc, name)
+
+        if abs(diff) > 1e-13:
+            print(name, diff, rhoc, Tc+10, model.get_Ar00(Tc+10, rhoc, z), CP.PropsSI('alphar','T',Tc+10, 'Dmolar',rhoc,name))
+    except BaseException as BE:
+        print(name, BE)
\ No newline at end of file
-- 
GitLab