JSteam C++ Interface
There has never been much interest in a C++ interface for JSteam, however one does exist, and is included in the JSteam Tolbox Download. If you clone the JSteam Toolbox repository from GitHub, you will get access to the four required files:
Source/include/JSteam.h
: The main header file for JSteam which covers all classes and methods that are publicly accessible.Source/lib/Win64/JSteam.lib
: The exports library required to add to your linker. Compiled with VC++ 2019 x64.Source/MEX/Win64/JSteam.dll
: The dynamically linked library containing the compiled JSteam source code. Compiled with VC++ 2019 x64.Source/MEX/Win64/libiomp5md.dll
: A required dependency of JSteam that is sourced from Intel Fortran XE 2019 compiler redistributables.
Using these four files you can create your own application to leverage JSteam! A very simple example below:
#include <iostream>
#include "JSteam.h"
using namespace JSteamDLL;
int main(void)
{
// Create a JSteam Object
JSteam* JStm = new JSteam();
// Attempt to license it (looks for JSteam.lic in the current directory)
// Also initializes REFPROP (takes a few seconds)
JStm->LicenseValidate();
// Set your units (note units are static)
JSteamUnits::SetDefaultUnits();
// Do some thermo and print it
std::cout << JStm->HPT(1.0, 100.0) << std::endl;
// Clean up and exit!
delete JStm; JStm = nullptr;
return 0;
}
#include "JSteam.h"
using namespace JSteamDLL;
int main(void)
{
// Create a JSteam Object
JSteam* JStm = new JSteam();
// Attempt to license it (looks for JSteam.lic in the current directory)
// Also initializes REFPROP (takes a few seconds)
JStm->LicenseValidate();
// Set your units (note units are static)
JSteamUnits::SetDefaultUnits();
// Do some thermo and print it
std::cout << JStm->HPT(1.0, 100.0) << std::endl;
// Clean up and exit!
delete JStm; JStm = nullptr;
return 0;
}
Have a look through the JSteam Header File which is "approximately" documented to determine how to perform other thermodynamic and system modelling functions! You can also view the JSteam MEX Interface source files for more ideas.