BenThelen / python-refprop

Python (3.x & 2.x) API for NIST Standard Reference Database 23 (a.k.a. Refprop) on Linux and Windows
Other
43 stars 25 forks source link

Integration with Qt #8

Closed jjgomera closed 7 years ago

jjgomera commented 10 years ago

Hi, First thanks for this package.

I'm trying to integrate it in my project as plugin for thermodynamic properties calculations, https://sourceforge.net/p/pychemqt/code/HEAD/tree/lib/refProp.py

A code like this work great, it give same values as in refprop UI program:

fluido=RefProp(fluido=[u"water"], T=303.15, P=101325.)
print fluido.Liquido.rho, fluido.Liquido.h, fluido.Liquido.s, fluido.Liquido.cv, fluido.Liquido.cp, fluido.Liquido.Z, fluido.Liquido.G

If i try to use the library in a gui component using Qt I have a strange error raised, i was crazy debugging the error, and finally checking the input values (same in gui and in above sample), i can reproduce the error only added the qt loop line:

import sys
app = QApplication(sys.argv)
fluido=RefProp(fluido=[u"water"], T=303.15, P=101325.)
print fluido.Liquido.rho, fluido.Liquido.h, fluido.Liquido.s, fluido.Liquido.cv, fluido.Liquido.cp, fluido.Liquido.Z, fluido.Liquido.G
sys.exit(app.exec_())

The raised error is:

At line 115 of file /usr/local/lib/refprop/FOR/TRNS_TCX.FOR (unit = 12, file = '/usr/local/lib/refprop/fluids/WATER.FLD')
Fortran runtime error: Error during floating point read

My RefProp Class use your multithreading library, so, there is any incompatibility with the qt threading platform?

jjgomera commented 10 years ago

Same problem if i use only your refprop library, without multiRP.

jjgomera commented 7 years ago

It might be a qt bug because it's solved with qt version 5.7