Closed William-Scharmach closed 6 months ago
Can you reproduce this error in C++ or Python? That would help to pin down what is going on. Also, you might want to try with the beta to see if it has fixed this. Email me (ian.bell@nist.gov) for access.
Hello, I am trying to convert Ian Spanswick's code from VB.net to C# instead of using the MillCreek code.
While the MillCreek code is fine, the VB code so much simpler to deal with.
I have the code functioning, but I get a weird error if the code is executed twice in a row. So, for example, let's say I calculate density. The first instance correctly determines the density, while the second gives me a [TPFLSH error 213]. It seems to be related to the fluid code. It only occurs for mixtures and executing the code twice in a row. If the mixture is changed between executions, the error does not occur. Changing any other parameter (unit, property, etc.) after the first execution will still result in the error after the second execution.
I am currently getting around this by detecting the error, re-running the refpropdll with a different fluid, and then re-running it again with the desired input fluid. So.... if (ierr > 0L & Math.Abs(ierr) < 10000L) { REFPROPdll(ref arhFld, ref hIn, ref hOut, ref iUnitNumb, ref iMass, ref iFlag, ref a, ref b, ref z[1], ref Output[1], ref hUnits, ref iUnits, ref x[1], ref y[1], ref x3[1], ref q, ref ierr, ref herr, ref argln15, ref argln25, ref argln35, ref argln45, ref argln55); //REFPROPdll(ref arhFld, ref arhIn, ref arhOut, ref ariUnitNumb, ref argiMass5, ref argiFlag5, ref a, ref b, ref z[1], ref Output[1], ref arhUnit, ref iUnits, ref x[1], ref y[1], ref x3[1], ref q, ref arierr, ref herr, ref argln15, ref argln25, ref argln35, ref argln45, ref argln55); REFPROPdll(ref hFld, ref hIn, ref hOut, ref iUnitNumb, ref iMass, ref iFlag, ref a, ref b, ref z[1], ref Output[1], ref hUnits, ref iUnits, ref x[1], ref y[1], ref x3[1], ref q, ref ierr, ref herr, ref argln15, ref argln25, ref argln35, ref argln45, ref argln55); } Where arhFld is just a random fluid. Any thoughts on what is going on? Thanks!