Welcome to the TRNSYS Users Forum.

The forum is a place where people can interact and have discussions about different topics involving the use of the TRNSYS software package. Here you can post topics for discussion or questions on using TRNSYS and get advice from other users or TRNSYS experts. This forum is not intended for detailed technical support. Users should contact their distributor’s hotline for such assistance.

Some tips for success on using the forum:

  • Follow the Forum Rules posted in Forum Administration.
  • There are categories for different types of topics and questions. Post your topic or question into the proper category.
  • Before posting a topic or question search the existing topics  (and the TRNSYS Users listserv archive) to see if a similar topic or question has already been answered.
  • Use a descriptive topic name. Don’t use attention getting subjects, they don’t get attention and only annoy people.
  • State the version of TRNSYS and which add-ons your are using.
  • Include enough specific details for your topic of question to be answered. Just posting “Why am I getting an error?” without describing the specific error and what you are trying to do when you get the error will not receive a response that fixes your issue.
  • Remember when people help you, they are doing you a favor. Be patient, help people out by posting good descriptions of what you need help with, and be polite even if a response does not solve your issue.
  • Moderators may edit your post for clarity or move your topic to a more appropriate category.

Notifications
Clear all

[Closed] CoolProp function wrong outputs

4 Posts
2 Users
0 Likes
79 Views
0
Topic starter

Heyy there, 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 in the attached file, these values is actually correct at atmospheric pressure only, I checked it by the online cool prop, also if the function works only on atmospheric pressure, can i call refprop in this coolprop function like what we do in python codes? 

This topic was modified 1 month ago 2 times by Gehad Azmy
Gehad Azmy Topic starter 23/03/2024 11:44 pm

Heyy there, 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, can i call refprop in this coolprop function like what we do in python codes? 

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)

DavidBradley 01/04/2024 2:53 pm

@gehadrabee24

If I understand correctly, when you call the CoolProp_Fluid_Properties() routine from a Type that you wrote you are getting back fluid properties that correspond to atmospheric pressure regardless of what pressure you send to the routine? This sounds like a possible bug that I want to investigate further but I want to make sure that I understand the issue first.
kind regards,
David

kind regards,
David

Gehad Azmy Topic starter 01/04/2024 10:55 pm

Exactly David!
I sent an email to Trnsys Technical support and they solved the problem by editing the dll file for the interface between coolprop and trnsys and they sent it back to me, it works correctly now!
Thank you !

Share: