usnistgov / REFPROP-wrappers

Wrappers around NIST REFPROP for languages such as Python, MATLAB, etc.
193 stars 127 forks source link

Issue#|LabVIEW| Some mixture encouter error when use T or P function #625

Closed RalphPang closed 1 month ago

RalphPang commented 1 month ago

Dears, Firstly I'm using 64bit LabVIEW 2018, I downgrade the package using LabVIEW 2023. Since I'm using 64bit LabVIEW I invoked "REFPRP64.DLL" All fluids didn't encouter any issue but most of the mixtures encoutered couldn't convert from temperature to pressure vice versa as below: image In the picture we could see there is an error message "[ROOTFIND error 151] Iteration failed to converge." I want to use R404A convert only from T to P or P to T. Could you advise how to do it? image

ianhbell commented 1 month ago

Have you turned on the saturation splines? That is about the only advice we can offer for problems such as these

ianhbell commented 1 month ago

I would recommend to check the calculations outside of Labview in something like Python to ensure you know how things should work. Labview is a bit tricky due to the order of evaluation of things.

RalphPang commented 1 month ago

I have discovered more symptom by downloading the Refpropmini version 10. After installation of Refprop mini I substituted "Fluids" and "Mixture" folders since the default folder doesn't contains the mixture I want to use, then I follow the procedure below: Fisrtly,I opened Refprop mini and go to Substance -> Predefined mixture as below figure: image After that I opened any fluids in the list but it pops up an error as below: image I looked at the folder fluids and I'm pretty sure the R125.FLD is exist, then I copied the Fluids folder and all fluids under Mixture folder but no help. Can you advise based on my findings? Thank you so much

RalphPang commented 1 month ago

I would recommend to check the calculations outside of Labview in something like Python to ensure you know how things should work. Labview is a bit tricky due to the order of evaluation of things.

I've tried Python but my skill set is quiet low, didn't figure out any of the folders under wrapper, sorry

RalphPang commented 1 month ago

I have discovered more symptom by downloading the Refpropmini version 10. After installation of Refprop mini I substituted "Fluids" and "Mixture" folders since the default folder doesn't contains the mixture I want to use, then I follow the procedure below: Fisrtly,I opened Refprop mini and go to Substance -> Predefined mixture as below figure: image After that I opened any fluids in the list but it pops up an error as below: image I looked at the folder fluids and I'm pretty sure the R125.FLD is exist, then I copied the Fluids folder and all fluids under Mixture folder but no help. Can you advise based on my findings? Thank you so much

Sorry I discovered in the link I downloaded Refprop10 mini there is a link to download the exe file to replace the original exe file, after replacement the original error disappeared and after I goto Calculate -> Saturation tables -> follow default setup click OK twice the error message pops up as below: image If I click yes or yes to all the table appears, is this error considered an issue for LabVIEW?

nist-aharvey commented 1 month ago

By "Convert from P to T" I assume you are trying to find the saturation temperature associated with a pressure, or vice versa? That is not a unique answer for a mixture like it is for a pure fluid, so talking about "converting" in that way is not meaningful. You get a different answer depending on whether you ask for the bubble point (boiling point of saturated liquid) or the dew point (condensation point of saturated vapor). Depending on what functions you are trying to call in LabView (I don't know anything about LabView), that may be part of your problem with mixtures.

But I also note that the two sample calculations in your original example do not make sense. You are asking for calculations in SI units. The first example, you have set the pressure to 40, which means 40 MPa. This is far above the mixture critical pressure, so there is no corresponding saturation temperature. Then in the second one you have set the temperature to 55 K, which is far below freezing (probably why you get an error about a melting equation). So you might try these again with reasonable inputs, like a pressure of 1 MPa or a temperature of 250 K.