Code Monkey home page Code Monkey logo

librefprop.so's Introduction

#Welcome to librefprop.so! These files allow you to compile the REFPROP fluid property database as a shared library for Linux and MacOS systems. This enables you to use the Fortran sources developed by NIST providing an alternative to the REFPROP.dll for Windows.

Installation Instructions

For installation on a Linux or OSX machine, please follow the steps described below. By default, the library and the header file are placed in system directories. Please change the paths if you do not have write access to this part of your file system.

  1. Make sure that you have gcc and gfortran, for OSX use either HPC or Homebrew and install the OSX command line tools. On a Linux machine, something like apt-get install gcc might do the job.
  2. Get a copy of this repository, either by downloading the latest release or the current development version as zip file or simply clone the repository with git.
  3. Change the paths in the Makefile, if needed.
  4. Copy the REFPROP Fortran code to the fortran directory.
  5. Put the fluids and mixtures folders from REFPROP into the files folder.
  6. Call make to prepare the files.
  7. Use make install (as root user) to copy the files to the destination directories.

You can remove the files again by calling make uninstall (as root user).

Testing the Installation

There is a simple Fortran file to test the library. You can call make fortest and run the executable with ./bin/ex_mix_for to display some R410 two-phase properties:

Temperature Pressure Density, liquid Density, vapour
300.0000 1740.5894 14.4550 0.9628
300.0000 1735.1589 14.2345 0.9603

Python Integration

There is a basic python package based on the examples from NIST in the pyrp folder.

Please note that there is a much more mature Python interface available at https://github.com/BenThelen/python-refprop. Thank you Ben for sharing it!

Matlab Integration

There is a Matlab prototype file available from NIST. Unfortunately, you have to change a few things in order to use the library on MacOS and GNU/Linux.

There is a makefile section and a shell script that help you with this. After installing the library as described above, you can run make matlab in order to use REFPROP with Matlab. Then run `make matlab-install’ as root user for a system-wide installation.

The test.m is a simple code you can use to check if the intergration works.

Summary for the impatient:

  • Go to the directory with the downloaded files and open a command prompt.
  • Run make and then sudo make install to install the shared library (Skip this if your administrator already installed REFPROP for you).
  • Run make matlab to download files and edit them as written in the terminal.
  • Run sudo make matlab-install to copy the matlab file to /opt/refprop.

MATLAB 64 bit Integration

This part was contributed partly by nkampy and speredenn and is still experimental. Please open new issues if you encounter any problems. Problems are likely to be encountered in setting up matlab with gcc, needed to use the builtin MEX functionality, which is required for the load library command in the thunk.m file. We hope that the user community and nkampy's comments, left at the mathworks website (here and here), will help figuring out a good solution.

No root user access

It is possible to use the shared libraries without root access. However, you need to make sure that the libraries get found and it is recommended to add something like export LD_LIBRARY_PATH=/home/USERNAME/lib:/home/USERNAME/refprop:$LD_LIBRARY_PATH to the calls to executables that need REFPROP. The makefile will print more instructions when running make install as a non-root user.

Known Problems

  • Older compilers might not work properly with the OpenMP directives used in the original Fortran code. If you experience any problems related to OpenMP, try removing OpenMP support by setting USEOPENMP :=FALSE in line 51 of the Makefile.

General Remarks

Please note that you need a working and licensed copy of REFPROP in order to use the software provided here. This is not a replacement for REFPROP. You can purchase REFPROP at http://www.nist.gov/srd/nist23.cfm

If you are interested in fluid property modelling, you might also be interested in CoolProp, an open-source thermodynamic fluid property package with over 100 compressible and over 50 incompressible fluids.

librefprop.so's People

Contributors

heineken avatar nkampy avatar ibell avatar jowr avatar

Watchers

James Cloos avatar Ammar Bahman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.