FIX: Add safety check for zero reference area (Fixes #2435)#2687
FIX: Add safety check for zero reference area (Fixes #2435)#2687ayush4874 wants to merge 1 commit intosu2code:developfrom
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 |
|
@pcarruscag can you have a look now? |
|
Doesn't do what I asked before |
|
@pcarruscag is it alright now? |
pcarruscag
left a comment
There was a problem hiding this comment.
Error if something tries to do an invalid operation due to 0 ref area was the requirement
2401333 to
e7e9eba
Compare
|
@pcarruscag can you have a look again? |
|
It still doesn't look like it does what we want. |
|
I switched Do you want me to keep this (maybe add a Warning?), or should I revert to the hard Error and just add a dummy |
e7e9eba to
d6771cb
Compare
|
@pcarruscag I agree that Error is the right way, but it breaks the MMS regression tests. I tried to fix the test configs, but I found that To unblock the CI, I’ve switched Once this is merged, I will open a PR to |
53b23d7 to
05e8842
Compare
05e8842 to
d4625fe
Compare
|
@pcarruscag I tried switching this to a print/warning, but it caused the Since I can't update the I've reverted to the silent return for now just to get the CI green. Once this is merged, I can open a PR to |
|
thanks. |
|
Understood. Thanks for your time in reviewing this. I didn't realize initially how much the legacy test dependencies would complicate what should have been a simple check. I'll look for a more self-contained issue to tackle next. |
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.