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
3995483 to
2401333
Compare
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 |
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.