-
Notifications
You must be signed in to change notification settings - Fork 36
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
Some tests fail at runtime with v.3.3.0 due to wrong error management #28
Comments
As @casella referred me, please have a look at #27; at least |
OK - here is the current status:
@casella, is this what you wanted to see? Can we close this issue? |
Hmm.. you (@jowr) said that "Test.CoolProp.CO2.TestStatesSatSubcritical fails". |
Uh-oh.. It's the version 6 (the latest one) with my update for REFPROP backend; the other part is the same. |
One more thing! The ExternalMedia library is also my updated one in PR #27. FYI! |
This is ok, I understand the implicit solver makes some attempts that call the property calculations outside their range, so if this is now handled correctly via calls to ModelicaError, that's the intended behaviour. |
This is a bit weird, I don't understand who is issuing this error message @jowr, is this a known error message of CoolProp? Then, there could be some issue with the solver that passes an invalid value to the CoolProp solver in the temperature field, e.g., NaN. No idea why, but we can investigate. Could this be related to #34 in some way? |
@jowr, in any case, any such remaining issue is beyond the scope of this ticket. Please let me check with the CI binaries as soon as they're available, then I'll close this myself. |
@casella did you check with the CI binaries? Can we close this issue? |
OK - I consider this closed. Should we release v3.3.0? |
@jowr, I ran some tests of v.3.3.0-dev using Dymola 2021 under Windows 10 and Visual Studio 2017 Community edition, here are the results:
Failing tests report this error message on the simulation runtime command window:
Press the Stop button in Dymola to end the simulation!
, which is called either here or here.This is very old and very crude code that aborted the simulation immediately in case any errors were reported from the called property computation functions - it was put there back in 2006 when Christoph Richter was experimenting with DLL libraries, which do not allow to call the ModelicaError function, because it was not visible from witin the DLL, but only if the library was statically linked with the generated code from the Modelica tool.
However, aborting the simulation as soon as an error is encountered is not a good idea in general. Many errors are caused by ODE solvers taking too bold steps, or by Newton solvers taking too large undamped steps, which cause the inputs of the setState_xx function to go beyond their range of validity. If the
ModelicaError
function is called in this cases, as done here, then the solver can retry with a smaller step, and in many cases it will eventually succeed.I understand the library is statically linked as of today, so I am not sure if the old code meant for the DLL is called on purpose, or because of some mistake in how the CMake scripts set up the macros.
The idea is that, in case we are using static linking, we should always call
ModelicaError
. If we want to compile the library into a DLL, we should change the structure of the functions that can fail so that they simpy return an error code, and then have the ModelicaError function called by a thin, statically linked layer that will in turn call the DLL functions.Can you please comment on this?
Thanks!
The text was updated successfully, but these errors were encountered: