-
Notifications
You must be signed in to change notification settings - Fork 915
FIX: Add safety check for zero reference area (Fixes #2435) #2687
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
base: develop
Are you sure you want to change the base?
Conversation
6869964 to
0a7fc93
Compare
|
Reference area is not necessary for all physics in SU2 |
|
Should I change this to a |
|
@pcarruscag can you please address this? |
|
Error would be better, try to find a good place for it. |
|
Done. I reverted the changes in This ensures we only flag the error when the solver actually needs the reference area, without blocking other physics. |
|
Still failing the tests and nota good place since that solver is not the only one that may use the reference area |
|
I think, this might be right, added the check to |
|
sure just iterate on it until all the tests pass and let me know once you're done |
Fixes #2435.
If
REF_AREAis set to 0.0 (auto-calculation) but the geometry projection fails (e.g. flat plate aligned with projection plane), the area remains 0.0. This causes immediate divergence/NaNs later in the solver.Added a check in
SetPositive_ZAreato catch this case and error out cleanly viaSU2_MPI::Errorinstead of crashing.Verified using the NACA0012 testcase:
REF_AREA=0.0still works correctly (calculates ~1.0), ensuring no regression for valid cases.