Cool Prop online and cool prop dll #2361
Replies: 11 comments 1 reply
-
I don't follow what you did. Please show the calculated values and input values, each with units. None of the functions you are using are from CoolProp itself, so I have no clue what you actually did. Also, provide a runnable example. None of the main developers are TRNSYS people so you need to help us help you. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
None of that is helpful for figuring out what is going on. An example like this is required: import CoolProp.CoolProp as CP
for T in [82, 301]:
for p_MPa in [1, 10, 1000]:
print(T, p_MPa, CP.PropsSI('Hmass','T',T,'P',p_MPa*1e6,'Air')) yielding
Do you get these results? If not, have you set the reference state in your code? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
The coolprop online results are the same as from the Python code, as I expected. The difference is caused by TRNSYS, so they will have to debug on their side. I suspect they may be doing something like setting the reference state, but without seeing how they call CoolProp it is impossible to say. Besides, you should only ever be comparing differences in enthalpy between state points. |
Beta Was this translation helpful? Give feedback.
-
I know, If you see the first message I was writing delta Enthalpy as the first result, I'll send to them again, but do you think if it's problem of dll file as they say, can we just change this dll file, by correct one from you? |
Beta Was this translation helpful? Give feedback.
-
As I mentioned in my response, the DLL/python and the online interface are giving the same result so everything is consistent on the CoolProp side. Why TRNSYS gives a different result I have no idea. As I said, you need to contact TRNSYS to understand why their result is different. import CoolProp.CoolProp as CP
for p_MPa in [0.1, 1, 10, 100, 1000]:
T1 = 82 # K
T2 = 301 # K
h1 = CP.PropsSI('Hmass','T',T1,'P',p_MPa*1e6,'Air')/1e3
h2 = CP.PropsSI('Hmass','T',T2,'P',p_MPa*1e6,'Air')/1e3
print(p_MPa, h2-h1) yielding
|
Beta Was this translation helpful? Give feedback.
-
Hii |
Beta Was this translation helpful? Give feedback.
-
@gehadrabee24 , I think there are some possible issues here:
|
Beta Was this translation helpful? Give feedback.
-
What are dew and bubble temps for given pressure? (Or same for pressures
for given T) Vapor quality is not in general defined for pseudo fluid eos
anyhow.
|
Beta Was this translation helpful? Give feedback.
-
the same pressure (P=1.01325 bar) and i tried T=78, 82 and various temperatures and still quality =-1 when i tried to get it from the enthalpy equation : h= h_fg * x + h_f , where h_fg = enthalpy(Air_ha,x=1,P=P) - enthalpy(Air_ha,x=0,P=P) |
Beta Was this translation helpful? Give feedback.
-
I'm trying to use cool prop function in trnsys 18 to get enthalpies of air at low temperature, what i found that the online cool prop do not get the same numbers at built in function in trnsys 18, I tried too many trials and I recognized that the function did not recognize pressure change, T1=82 K and T2= 301 K and the pressure changes as following data, these values is actually correct at atmospheric pressure only (when i tried to p =0.1 mpa, i get floating point error), I checked it by the online cool prop, also if the function works only on atmospheric pressure,
delta enthalpy Enthalpy 1 Enthalpy 2 Pressure in Mpa
220.597156 207.085887 427.683043 10.000000
220.62198 207.05882 427.680 1000.00
220.5969 207.0861 427.6830 1.00
here is the code of the type i made:
nRef = 729! !Air
prop(1) = -192
prop(2) = 1
Call CoolProp_Fluid_Properties(prop,nRef,12,iFlag)
If (ErrorFound()) Return
enthalpy_1 = prop(3)
prop(1) = 28
prop(2) = 1
Call CoolProp_Fluid_Properties(prop,nRef,12,iFlag)
If (ErrorFound()) Return
enthalpy_2 = prop(3)
delta_H= enthalpy_2-enthalpy_1
open(94, file = 'results.dat', status='old', position="append")
write(94,*) delta_H, enthalpy_1, enthalpy_2, prop(2)
close(94)
Also I contacted Trnsys Technical support and they checked the same values of mine and get the same enthalpies, then they told me to ask cool prop system why do I get different values from the online version and the DLL.
Beta Was this translation helpful? Give feedback.
All reactions