Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

check NaNs for calculate_dt #2043

Open
jiahe23 opened this issue Feb 18, 2021 · 3 comments
Open

check NaNs for calculate_dt #2043

jiahe23 opened this issue Feb 18, 2021 · 3 comments
Assignees
Labels
debugging Different tools to debug enhancement New feature or request

Comments

@jiahe23
Copy link
Contributor

jiahe23 commented Feb 18, 2021

Description

It will be helpful to check if calculate_dt gives NaNs during the initialization, and where the NaNs comes from.

@jiahe23 jiahe23 added enhancement New feature or request debugging Different tools to debug labels Feb 18, 2021
@kpamnany
Copy link
Contributor

calculate_dt uses nondiffusive_courant to compute the CFL, as you've observed. We can add a more informative error message, but can you clarify what you mean by "where the NaNs come from"?

@slifer50
Copy link
Contributor

slifer50 commented Feb 18, 2021

@jiahe23 can you specify how you get the NaNs? I've observed NaNs in dt when using --adapt-timestep but I always figured this meant the problem had gone unstable leading to a NaN dt. Is this similar to what you're seeing?

@charleskawczynski
Copy link
Member

calculate_dt uses nondiffusive_courant to compute the CFL, as you've observed. We can add a more informative error message, but can you clarify what you mean by "where the NaNs come from"?

My first impression was to print an error inside nondiffusive_courant, which could say what the cause of NaNs (e.g., u, soundspeed_air), but now I'm remembering that nondiffusive_courant is called at runtime when CFLs are monitored, so that might not be the best place to throw the error. I suppose we could just print an error inside calculate_dt and say something like:

dt is NaN. This can happen for two reasons:
 - A poorly constructed mesh (e.g., min nodal distance is zero / NaN).
 - Improperly constructed initial conditions (e.g., zero velocity, or zero diffusion).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debugging Different tools to debug enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants