Skip to content
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

Closed
joshuahansel opened this issue Oct 2, 2018 · 7 comments
Closed
Labels
C: Modules P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.

Comments

@joshuahansel
Copy link
Contributor

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 parameter emit_trappable_nans and a function getNaN(), which returns either a loud (and trappable) NaN or a quite NaN, based on the value of emit_trappable_nans.

Impact

New interface class that fluid properties classes could use, for example.

@joshuahansel
Copy link
Contributor Author

@andrsd

@andrsd
Copy link
Contributor

andrsd commented Oct 2, 2018

@permcody permcody added T: task An enhancement to the software. P: normal A defect affecting operation with a low possibility of significantly affects. C: Modules labels Oct 2, 2018
joshuahansel added a commit to joshuahansel/moose that referenced this issue Oct 3, 2018
joshuahansel added a commit to joshuahansel/moose that referenced this issue Oct 3, 2018
joshuahansel added a commit to joshuahansel/moose that referenced this issue Oct 3, 2018
joshuahansel added a commit to joshuahansel/moose that referenced this issue Oct 3, 2018
@permcody
Copy link
Member

permcody commented Oct 3, 2018

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 --no-trap-fpe, but that is indeed a global option. It won't trap any FP exceptions of any kind.

@andrsd
Copy link
Contributor

andrsd commented Oct 4, 2018

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.

@joshuahansel
Copy link
Contributor Author

you can always use --no-trap-fpe, but that is indeed a global option

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.

@permcody
Copy link
Member

permcody commented Oct 4, 2018

Great! I honestly didn't know. Glad you guys have figured all of this out.

@permcody
Copy link
Member

Note: #12335 referenced this issue in error, it should be #12334.

joshuahansel added a commit to joshuahansel/moose that referenced this issue Apr 23, 2020
joshuahansel added a commit to joshuahansel/moose that referenced this issue Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Modules P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.
Projects
None yet
Development

No branches or pull requests

3 participants