cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

CoolProp 6.3.0 Released - Wrappers for Mathcad 15 and Prime

JeffH1
14-Alexandrite

CoolProp 6.3.0 Released - Wrappers for Mathcad 15 and Prime

Since we can't post on the Tips forum, I'll leave this here...

 

Coolprop version 6.3.0 is released.  Coolprop is an open-source C++ library that implements:

  • Pure and pseudo-pure fluid equations of state and transport properties for 122 components
  • Mixture properties using high-accuracy Helmholtz energy formulations
  • Correlations of properties of incompressible fluids and brines
  • Highest accuracy psychrometric routines (Humid Air properties) 
  • User-friendly interface around the full capabilities of NIST REFPROP (if you own REFPROP already)
  • Fast IAPWS-IF97 (Industrial Formulation) for Water/Steam

Fully featured wrappers are available for both Mathcad 15 and Mathcad Prime as Add-in DLLs.  Documentation can be found at http:/www.coolprop.org.  Instructions for downloading the Add-in wrappers from SourceForge for either version of Mathcad can be found here.  A Mathcad worksheet is included with the DLL that demonstrates how to use the add-in.

1 ACCEPTED SOLUTION

Accepted Solutions
JeffH1
14-Alexandrite
(To:ValeryOchkov)

Yep.  That's .045% relative error in Cp between IF97 and IAPWS-95.  To be expected.  These are the differences between IAPWS-95 and IF97.

 

The IF97 computational validation points match the verification points in IAPWS R7-97(2012) to 8 decimal places in most cases.

View solution in original post

21 REPLIES 21

The CoolPro uses the IAPWS-95 not the IAPWS-IF97 formulation! It is a bag!

JeffH1
14-Alexandrite
(To:ValeryOchkov)

Not true.  I spent the last year coding IF97 into it.  You just use the fluid "IF97::Water" instead of "Water".  This calls the IAPWS-IF97 backend, which is now included.  See the docs.

 

The Mathcad add-in was re-implemented in version 6.0.0 and full IF97 was implemented in 6.2.0.

Last Maple uses CoolProp with IAPWS-95 formulation!

One my fine picture
iapws95-97surface.PNG

JeffH1
14-Alexandrite
(To:ValeryOchkov)

Again, please read the documentation.   Just use the fluid "IF97::Water" instead of just "Water" or "HEOS::Water"; the HEOS implementation is IAPWS-95.  There's no reason this won't work in the Maple wrapper as well.  It's been tested in Python, Mathcad, and Excel wrappers.  You might have to download the latest version of CoolProp if Maple is distributing an older version.  Version 6.3.0 is hot off the press, so I doubt they have it yet in their distribution.

JeffH1
14-Alexandrite
(To:ValeryOchkov)

I see that the latest Maple 2018 release only includes CoolProp 6.1.0.  I believe that IF97 is only partially implemented in that release of CoolProp.  That was about when I started working on it.

Cool Prop IF97 vs WaterSteamPro

8-КПД-Plots-Cool_Prop.png

JeffH1
14-Alexandrite
(To:ValeryOchkov)

@ValeryOchkov What is the JeffH1_0-1701310920046.png function that you are plotting against the Liquid Saturation Temperature? 

 

What are the parameters being passed in?

JeffH1
14-Alexandrite
(To:ValeryOchkov)

@ValeryOchkov - Thanks for this.  I've looked at your SMath document and reproduced it in Mathcad, with errors.  Indeed there is an error when using IF97, but not using the default HEOS for water (which uses IAPWS-95) and not in the IF97 backend.  The trick is that your efficiency function makes a few calls to the backward formulation for h(p,s).  There is no function documented in the IF97 release for this so CoolProp has evaluate it manually in all phase regions, which is fairly straight forward.  In the two-phase region, however, it requires a lever law calculation, which is not being evaluated correctly (although I'm not sure why yet).   I will look into this and make sure something gets into the next patch release.

JeffH1
14-Alexandrite
(To:ValeryOchkov)

If you are making the Coolprop call to "H2O" you are using the IAPWS-95 functions.  IF97 requires "IF97::H2O" or "IF97::Water".

53.png

JeffH1
14-Alexandrite
(To:ValeryOchkov)

Yep.  That's .045% relative error in Cp between IF97 and IAPWS-95.  To be expected.  These are the differences between IAPWS-95 and IF97.

 

The IF97 computational validation points match the verification points in IAPWS R7-97(2012) to 8 decimal places in most cases.

JeffH1
14-Alexandrite
(To:JeffH1)

The CoolProp 6.3.0 binaries have been verified using the new release of Mathcad Prime 6.0.

 

 

I'm a longtime user of Mathcad 15 with steam table extension and a novice using Prime.  I've copied the latest CoolProp .dll file to the "Custom Functions" folder but Prime doesn't recognize any of the thermodynamic functions.  I'm looking for some help using CoolProp in Mathcad Prime.

The best stwem tables for Prime 6 is WaterSteamPro 

Cp.png

JeffH1
14-Alexandrite
(To:RM_4611061)

Make sure you've got the correct DLL.  The one for Mathcad 15 is 32-bit, while the one for Mathcad Prime is 64-bit and compiled specifically for Mathcad Prime.

 

1. With the DLL in place, restart Mathcad Prime and enter, CustomFunctions= .  If the DLL is the correct one, and properly installed, you will see the following list of functions available from the DLL:

JeffH1_0-1600951678499.png

If you do not see this list of functions, you do not have the correct DLL.

 

2. Also on SourceForge, where you got the DLL, is an example Mathcad Prime file called CoolPropFluidProperties.mcdx.  Once the DLL is installed properly, download and open this file in Mathcad Prime and press <Ctrl>-F5 to update all equations.  This document will show you how to use the functions.

 

Hope this helps.

Jeff

 

 

Jeff,

 

Thanks that all helped me lumber through this problem.

 

With your insights I continued searching until I found that the Mathcad Prime DLL for CoolProp revision 6.3.0 seems to work work well for me.  I can list the functions with CustomFunctions= and all of the functions I've tried so far return expected results.

 

None of the newer revision DLL files work at all for me and some of the earlier revisions crash when trying to execute the get_global_param_string.  Another note, an agent from PTC was able to get the most recent revision, 6.4.1, to work with his set up.

 

For now I can proceed with a complex MC 15 to Prime 6 thermodynamic analysis conversion and hopefully in the future get the newest revision to work.  

 

Thanks again for your much needed help!

 

Rob Mock

SPRstructur
15-Moonstone
(To:JeffH1)

Coolprop, may the software I never know,What important of coolprop for mathcad ?

I believe they are functions and tables that import standard thermodynamic properties into Mathcad.  There is also WatersteamPro.

JeffH1
14-Alexandrite
(To:SPRstructur)

Yes, @Fred_Kohlhepp is correct.  CoolProp is an open source library of functions that provide thermodynamic and thermo-physical properties of 120+ pure fluids, mixtures, over 35 incompressible fluids, and Humid Air properties (based on ASHRAE equations).  It also provides an easy to use interface to IF97 water/steam properties (built-in) and NIST REFPROP (if installed).  You can find out more at http://www.coolprop.org

JeffH1
14-Alexandrite
(To:JeffH1)

Note that CoolProp 6.6.0 is now released and the DLL for Mathcad Prime is autogenerated on SourceForge for this release (along with a sample worksheet).

Top Tags