-
Notifications
You must be signed in to change notification settings - Fork 299
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible NaN in successive_substitution #1270
Comments
Yes, if df is zero (or very very small), we should stop the iteration. Can you file a PR? |
Seems the case with df < 1e-12 < f can happen:
(And I notice the "<" is not correct, should be a ">") I'll look tomorrow which entries gives this (I suspect it's the same point, triggering this kind of effect on the 3 EOS: HEOS, PR & VTPR). |
Setting a lower threshold for df (like 3e-16) did not seem to help much |
Seeing the temperatures, I suspect it's something happening near the critical point: PropsSI("P", "Q", 0, "T", 405.16, "PR::n-Butane[0.407]&DME[0.593]")
PropsSI("P", "Q", 0, "T", 356.63, "PR::R125[0.4974]&R134A[0.5026]")
PropsSI("P", "Q", 0, "T", 345.47, "PR::R125[0.2491]&R32[0.7509]")
PropsSI("P", "Q", 0, "T", 363.15, "PR::R32[0.368]&R134A[0.632]") So it may be interesting to see if there could be something to do in that area to be still able to compute the points, but for now I'll just correct the sign. |
Also lower a bit the threshold for `df` and add some comments.
I just chuck out the values for the pures when I fit mixtures. You might On Fri, Oct 21, 2016 at 3:47 PM, JonWel notifications@github.com wrote:
|
You are right that a part of the values concerning pure fluids may not giving any useful information when considering mixtures. To what I saw, the cases with the pure fluids seems to have been solved for me ( What remains out are points I think are near the critical point, which is an area where there is usually less outputs from CoolProp. |
Yes, I am running into a lot of problems now with failures of the flash On Tue, Oct 25, 2016 at 1:14 PM, JonWel notifications@github.com wrote:
|
We can also just when I'm looking right now for the analytical derivative. While I'm at it, I may also have a look at saving some intermediary steps that are sometimes computed more than needed. |
This line has a division by
df
.I felt on a specific case where this
df
is0
, thuschange
becomesNaN
, and a bit later is added top
(orT
), which is of course not an ideal output value (in my case,f
is also null, thus it goes out of the loop as converged).The specific case where this happened to me is in fact a pure fluid case (molar fraction = [0,1]), thus maybe this issue can only happen in that case.
If
df
can only happen to be null when it's a pure fluid, maybe this could be interesting to set a switch to use the pure fluid routine in that case (should be faster than the mixture routine and avoid the issue).The text was updated successfully, but these errors were encountered: