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
Add interface for fluid properties to choose between quiet and loud NaNs #12234
Comments
There is another option you may be aware of, but I feel like I should mention it here just to make sure. When running in debug mode you can always use |
As we observed, quiet NaNs were not trapped in debug mode where trapping is on by default. We want to be able to make the quiet NaNs loud, so they get trapped when debugging problems. |
Right, we discussed and decided we wanted to avoid the "globalness" because the generation of NaNs can sometimes be normal/desired transient behavior (cutting time step size), and we may want to see other NaNs in this case. For example, we're about to boil, but the large time step size times the heating rate to the liquid put it into a non-physical state for liquid, but smaller time step sizes would be fine. There might be some other NaN in this run we want to investigate. |
Great! I honestly didn't know. Glad you guys have figured all of this out. |
Rationale
There are currently some fluid properties classes, such as some in IAPWS95, that emit quiet NaNs. The intention is that evaluation of fluid properties in invalid states should not necessarily terminate a simulation, just allow time step size to be cut, even when trapping NaNs in debug mode, as other NaNs might be the objective of such traps. However, there are also cases when it is desired to terminate with these NaNs as well. Therefore, it would be useful to have an option for this. Note that there might also be other cases (not just fluid properties) where this option would be useful.
Description
The current idea to solve this issue is to create an interface class, for example,
NaNInterface
that has a boolean parameteremit_trappable_nans
and a functiongetNaN()
, which returns either a loud (and trappable) NaN or a quite NaN, based on the value ofemit_trappable_nans
.Impact
New interface class that fluid properties classes could use, for example.
The text was updated successfully, but these errors were encountered: