Refprop In Matlab

7 views
Skip to first unread message

Gaby Zenz

unread,
Aug 4, 2024, 9:22:58 PM8/4/24
to tyorarogma
Iam trying to generate enthalpy values in labview using refprop based on a temperature and pressure input. I have been working off the examples posted on this fourm however, am unable to get them working. I believe it has something do with my directory but I believe i have them set correctly. I am recieveing and error out 8 : Open File. With a possible cause relating to not having permission to open the file. Anyone know what I am doing wrong? Thanks

maybe you need administrator rights?

Attached you find your VI and a manual.txt for using RefProp with other programs.

Here's what I did (since I'm using the german version, I had to translate the commands. So maybe the terms are wrong):

Open "Example for phflsh.llb" --> open Test.vi --> enter block diagram --> double content of right frame --> change caption and input values --> enter "Two phase ph-flash.vi" --> Save as new copy "Two phase tp-flash.vi" in "Example for phflsh.llb" --> close "Two phase ph-flash.vi" --> edit vi symbol --> enter block diagram --> double click "Call Libary Function Node" --> since "enter path in block diagram" is checked, you cannot change the dll function. Uncheck it and browse the path to RefProp.dll --> Look for TPFLSHdll in the drop down menu --> check "enter path in block diagram" --> go to parameters. Here you can see the input and output values --> change the order as you can find it in the manual.txt (subroutine TPFLSH (t,p,z,D,Dl,Dv,x,y,q,e,h,s,cv,cp,w,ierr,herr)) --> OK --> from "Initialize Array" delete the lower cable and make a new connection with the slot above the upper one --> enter front panel --> right click the output cluster --> "Rearrange elements in cluster..." --> choose the same order as in manual.txt --> in Test.vi block diagram replace the "2 phase ph-flash" with the new "2 phase tp-flash" delete the indicator and copy/paste it from "Two phase tp-flash.vi" --> start the VI --> all calculated values (density...) should be identical.



Hope that helps



Philipp






Are these vis that you attached at the previous thread just for mixtures? I want to calculate isobutane properties for given specific state points. Can I do this with this ones? If I could not, how can I do this? I read and find a series of vis from NIST web site but I really do not how to prepare a vi with them. I will appreciate if you answer to me.


attached you find a llb for several calculations. Just enter your path to RefProp in the "Init and Calc RefProp.vi". That should work. You can also use the VIs for pure refrigerants (e.g. R134a without file extension but R407C.mix with file extension). For comparisons with the RefProp GUI note that the output clusters are in mol.


I a beginer in Labview. Currently I am using NI USB 6001 to read pressure and temperature from my instrument. I am interested to calculate the viscosity of Nitrogen gas based on the pressure and temperatrue (real time calculations) .


Problem: As you can view from the front panel. png that this program is calculating properties of nitrogen gas, but not calculating the dynamic viscosity (Pa.s). Could you please let me know how can I calculate dynamic viscosity ? which files I need to change ? I am using the same files that are available in link that I mentioned above.


Can anyone tell me how to add a variable to the Labview VI that was posted earlier in this thread ? For example if I do a P,T flash using the Labview VIs posted here I can get the pressure, temperature, enthalpy, density liquid, density vapor, entropy, internal energy, quality, speed of sound, Cv, and Cp.


4) Afterward, call the matlab script in labView. Function>Mathematics>script and formulas>script nodes> Matlab script. Or simply search in funtion "Matlab. By doing this you will be able to do what ever you can do in Matlab.


Excel spreadsheets: A sample spreadsheet is included that demonstrates how the REFPROP DLL can be linked to Excel. Most properties that are available in the graphical interface can also be calculated in the spreadsheet.


Additionally, users should cite the reference for either the equation of state or the transport equations used in their work, for example, if you used calculations for CO2, you will find the reference for the equation of state under the Options/Fluid Information option in Refprop and you should cite the reference given under that option, like this:


For all issues related to ordering the program contact data [at] nist.gov



For questions concerning the installation and running the program, with linking the program with other applications, or with issues concerning the fluid properties, please visit the FAQ site first: -docs/.


Further answers can be found at GitHub: -issues/issues . Please use this site to post new questions as well so that all REFPROP users may learn from the correspondence. If you still need assistance, or have other matters that that you need to discuss, email refprop [at] nist.gov


In addition to this page, further answers can be found at GitHub: REFPROP-issues. Please use the GitHub site to post new bugs or questions so that all REFPROP users may learn from the correspondence. If you still need assistance, or have other matters that you need to discuss, email ref...@nist.gov and we will get back to you as soon as we can.


There are three ways to purchase REFPROP: For your use only, for company wide use, or for use in distribution in your code. These are all explained at If you purchase the program for your use only, the copy you will receive can be installed on all machines that you use (not including servers where others can also access the program). You do not need to purchase a copy for each machine you own.


In some applications where calculations fail after installing versions 9.0 or 9.1, the oldDLL from version 7.0 or 8.0 may be hiding in your Windows\System32 directory. Open up this directory and search for Refprop.dll. If you find it, delete it (it should never be stored in the Windows directory). The new one belongs in the Refprop directory along with the executable.


check to see if you have a firewall or antivirus software that can be turned off. Deactivating these will often allow successful installs, especially on Vista machines. If this fails or is not an option, then >download the corresponding file from the link below and save it in your Windows\System32 directory on 32 bit machines or to your Windows\SysWOW64 directory on 64 bit machines.


In some cases where you are not allowed to be the administrator on a machine, this message will appear because it cannot access the System32 directory. Try placing the file in your Windows directory to get the program to work.


If you are feeling brave, you can also try to install REFPROP into the wine environment (a windows-emulation environment). Once you have installed wine (via homebrew on OSX, or via package manager of your linux distribution, google for more information), you can install REFPROP (along with its GUI) into wine with (for instance with REFPROP 10):


Lemmon, E.W., Bell, I.H., Huber, M.L., McLinden, M.O. NIST Standard Reference Database 23: Reference Fluid Thermodynamic and Transport Properties-REFPROP, Version 10.0, National Institute of Standards and Technology, Standard Reference Data Program, Gaithersburg, 2018.


Additionally, users should cite the reference for either the equation of stateor the transport equations used in their work, for example, if you usedcalculations for CO2, you will find the reference for the equationof state under the Options/Fluid Information option in Refprop and you shouldcite the reference given under that option, like this:


Enhancements have been made to most areas of the NIST REFPROP program, including the equations of state for many of the pure fluids and mixtures, the transport equations, the graphical interface, the Excel spreadsheet, the Fortran files (i.e., core property routines), the sample programs in Python, C++, MATLAB, VB, etc. Some of the more important improvements are listed below:


Several problems in version 9.0 (listed below) were found after its release, and these have all been corrected in 9.1. There are also a few issues with 9.1. If these affect you, please let us know and we will send you the update.


The most recent help file from Refprop is available below. You should download it to yourmachine before launching it, otherwise the help file will appear blank. The PDF is an alternative form of the documentation that may be more convenient for you. The most up-to-date version of the documentation is at -docs.readthedocs.io/en/latest/


The following predefined mixtures are included in the ASHRAE 34 Standard and are supported by REFPROP. In REFPROP 10, many of the predefined mixture files are already included, and additional ones can be generated with the script at -issues/issues/358#issuecomment-872394368


Warning: if interaction parameters are estimated, you should be somewhat skeptical of the model results, and confirm model accuracy against experimental measurements. A good place to start to figure out whether the model might be adequate for your use case, is the survey of measurements and models in


For differences in enthalpy and entropy between the Refprop graphical interface and the Refprop Excel sample spreadsheet, or for differences in enthalpy and entropy between Refprop and tables of properties given in handbooks:


The absolute values of enthalpy, entropy, and energy at a single state point are meaningless. It is only the difference between two different state points that matter. Thus, the value for a single state point can be set to any arbitrary value. Many handbooks set the arbitrary state point so that the values of these properties are positive for most liquid or gas states. The user can change the values of the arbitrary state points by going to the Options/Reference State menu.


For mixtures, there are additional options that can be set to affect the manner in which these properties are calculated. In the Options/Reference State menu, there are two choices at the bottom of the menu on the far right. By changing this option, the two programs will then return the same values. This option can be permanently saved in the graphical interface by selecting Options/Save Options, and the saving the options under the file name defaults.prf. To change the default in the Excel file, press Alt-F11 to bring up the VB code. If the code does not appear, make sure the project explorer is visible (View/Project Explorer), and then click on modules and then on module1. Search for the call to SETREF, and change the second input from 2& to 1&. More information on this can be found in your Refprop\Fortran directory in the file SETUP.FOR under the SETREF subroutine.

3a8082e126
Reply all
Reply to author
Forward
0 new messages