diff --git a/wrapper/Mathcad/README.rst b/wrapper/Mathcad/README.md similarity index 54% rename from wrapper/Mathcad/README.rst rename to wrapper/Mathcad/README.md index f8f9f6f..6cbb898 100644 --- a/wrapper/Mathcad/README.rst +++ b/wrapper/Mathcad/README.md @@ -1,16 +1,16 @@ -Wrapper of IF97 for PTC Mathcad Prime (and Legacy Mathcad) -================================================ +Wrapper of IF97 for PTC Mathcad Prime +===================================== -This wrapper will provide Custom Functions (User Defined) in Mathcad Prime (or Legacy Mathcad) that provide thermodynamic and transport properties for water/steam at specified state points based on the 1997 IAPWS Industrial Formulation for the Properties of Water and Steam. While these properties can also be accessed through the CoolProp add-in, this wrapper provides **_only_** these steam/water properties without the overhead of CoolProp. +This wrapper will provide Custom Functions (user defined) in Mathcad Prime that provide the thermodynamic and transport properties for water/steam at specified state points based on the [IAPWS Industrial Formulation 1997 for the Properties of Water and Steam (IF97)](http://www.iapws.org/relguide/IF97-Rev.html). While these properties can also be accessed through the [CoolProp add-in](https://github.com/CoolProp/CoolProp/tree/master/wrappers/MathCAD), this wrapper provides **_only_** these steam/water properties without the overhead of CoolProp. -This wrapper been developed and tested on Mathcad Prime 3.0 through 7.0 and Legacy Mathcad 15.0 (any maintenance release). It **_may_** work on earlier versions of Mathcad and Mathcad Prime, but it has not been tested there. +> This wrapper been developed and tested on Mathcad Prime 3.0 through 10.0, although only 7.0 through 10.0 are supported at this time. It **_may_** work on earlier versions of **_Legacy Mathcad (15.0+)_**, but it has not been tested there since Legacy Mathcad was discontinued. ------ To Use (Overview) -====== +================= -* Build the Add-in DLL in VS2008 or later using the build instructions below. +* Build the Add-in DLL in VS2015 or later using the build instructions below. * Install the Add-in files by copying them to the appropriate Mathcad Prime (or Legacy Mathcad) Installation directories as indicated below. @@ -26,7 +26,7 @@ Follow the build procedures below to ceate the IF97 add-in DLL files for either Pre-Requisites -------------- -* You will need to have at least Visual Studio 2008 installed (Express version is fine). Alternatively newer versions of Microsoft Visual Studio C++ should be fine; Builds have be tested on Visual Studio 2010, 2015, 2017, and 2019. +* You will need to have at least Visual Studio 2015 or later installed (Express or Community versions work fine). Builds have be tested on Visual Studio 2010 through 2022. * You will need CMake version 2.8.12 or later from https://cmake.org/download/ * You will need to install Git-SCM for Windows. You can install this from https://git-for-windows.github.io @@ -44,28 +44,28 @@ Download the IF97 Repository cd IF97 Make the Build for Mathcad Prime (any version above 3.0) --------------------------------- +-------------------------------------------------------- -* Go to the top level IF97 directory and make a build directory (something like \buildPrime):: +* Go to the top level IF97 directory and make a build directory (something like \build or \buildPrime): mkdir buildPrime cd buildPrime -* Build the makefile using CMake (Note: Mathcad Prime is 64-bit):: +* Build the makefile using CMake (Note: Mathcad Prime is 64-bit): cmake .. -DIF97_PRIME_MODULE=ON -DIF97_PRIME_ROOT="C:/Program Files/PTC/Mathcad 7.0.0.0" -G "Visual Studio 17 2022" -A x64 -DCMAKE_VERBOSE_MAKEFILE=ON - (Insert your version of Visual Studio for the -G option.) - (Prior to VS 2017, use something like -G "Visual Studio 14 2015 Win64) - (Note that Prime is 64-bit and requires the Win64 switch on this command) + > Insert your version of Visual Studio for the -G option. + > Note that Mathcad Prime is 64-bit and requires the `-A x64` switch on this command + > Prior to VS 2017, use something like: `-G "Visual Studio 14 2015 Win64` Make the Build for Legacy Mathcad 15 (Discontinued by PTC) ------------------------------ +---------------------------------------------------------- -* Go to the top level IF97 directory and make a build directory (something like \build15):: +* Go to the top level IF97 directory and make a build directory (something like \build15): mkdir build15 cd build15 @@ -74,10 +74,12 @@ Make the Build for Legacy Mathcad 15 (Discontinued by PTC) cmake .. -DIF97_MATHCAD15_MODULE=ON -DIF97_MATHCAD15_ROOT="C:/Program Files (x86)/Mathcad/Mathcad 15" - -G "Visual Studio 14 2015" + -G "Visual Studio 17 2022" -A Win32 -DCMAKE_VERBOSE_MAKEFILE=ON - (Insert your version of Visual Studio for the -G option.) + > Insert your version of Visual Studio for the -G option. + > Legacy Mathcad was 32-bit and requires a 32-bit add-in DLL. + > Prior to VS2017, use something like `-G "Visual Studio 14 2015` as 32-bit was the default. Build the Project ----------------- @@ -95,7 +97,12 @@ Installing Mathcad Prime (v3.0 or higher) ---------- -* Copy the ``Release\IF97.dll`` file to ``C:\Program Files\PTC\Mathcad Prime 7.0.0.0\Custom Functions`` or equivalent for your version of Mathcad Prime. +* Copy the ``Release\IF97.dll`` file to ``C:\Program Files\PTC\Mathcad Prime 7.0.0.0\Custom Functions`` or equivalent for your version of Mathcad Prime. + +Optional: + +* For legacty **_Insert Custom Function_** capability in Mathcad Prime, download and install the [CustFunc add-in DLL](https://github.com/henningjp/CustFunc), which will provide a pop-up panel for inserting the custom functions into your worksheet at the cursor location. +* For CustFunc to work, copy the ``IF97_EN.xml`` to ``C:\Program Files\PTC\Mathcad Prime 10.0.0.0\Custom Functions\docs``; switch out `10.0.0.0` for your working version of Mathcad Prime. Functions and descriptions will then be available in the Mathcad Mathcad interface via **_hot-key_** ``. See the README for the [CustFunc add-in DLL](https://github.com/henningjp/CustFunc) for further installation and usage instructions. Legacy Mathcad 15 (Discontinued) ---------- @@ -106,4 +113,6 @@ Legacy Mathcad 15 (Discontinued) Compiler Flags ============== -The Mathcad wrapper code uses the ``REGION3_ITERATE`` flag to provide more accurate (but slightly slower) calculation of density in Region 3 (mostly super-critical), but does **_not_** use the ``IAPWS_UNITS`` flag, leaving all input/output values in SI units. \ No newline at end of file +The Mathcad wrapper code uses the ``REGION3_ITERATE`` flag to provide more accurate (but slightly slower) calculation of density in Region 3 (mostly super-critical), but does **_not_** use the ``IAPWS_UNITS`` flag by default, leaving all input/output values in SI units. + +The `IAPWS_UNITS` flag can be set (uncommented) in the top of the IF97.cpp file to input and output IAPWS units (Pressures in MPa and energy in kJ) for easy comparison with IAPWS release documents. \ No newline at end of file