-
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
Division by zero when building CO2 tables #879
Comments
Ok, this is the old fpu error flags clearing beast again on windows. Which exact calls cause this problem? I can guess, but I suspect that we need to add Relatedly, it is necessary that we allow for calculations AT the critical point for CO2 and water, for which I have a solution, though I don't like it all that much |
There is no special call involved, it is the table generation. More specifically, it is the last point - the (in many ways) critical point. |
Yup, I know how to fix this problem. Annoyingly, since we made tau and
|
Fine, but I still do not understand why the code works with statically linked files and does not work with a shared library. Is this really just the floating point error stack that screws things up on Windows? |
Yup, what are calling the dll from? Clearly its something that checks the
|
Fine. I built a new interface that stores a certain number of abstract state objects with tables and uses a std::string map to switch between them. This DLL then gets called from a Delphi GUI. I have tried to reset the fpu in the library, but had no luck with that. I might give it another try in the abstract state functions. Good luck with the non-analytic terms. I started to work on that as well, but it ended up being a mess made of Am I right that it is the power function from the math library that causes the problems? |
I think the issue is that if the floating point processor ever realizes that it did a division by zero anywhere (pow(0.0,-1.0) or 2.0/0.0 sorts of calculations), it sets the division by zero bit. If you don't reset that flag using the The solution is to fix the non-analytic terms at the critical point. I know how to do that, but it's annoying since we make |
Ok, I think this should fix it once and for all. Lemme know. |
I think there is a problem with the critical inputs for CO2. This code from the tabular backend causes a division by zero error that gets past all error handling:
I do not have the time to dig deeper at the moment, but it seems like the issue appears for CO2 but not for R134a. Furthermore, the problem does not show up with the statically linked code. It only occurs in a Windows DLL.
The text was updated successfully, but these errors were encountered: