Skip to content

Conversation

@ayush4874
Copy link
Contributor

Fixes #2435.

If REF_AREA is 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_ZArea to catch this case and error out cleanly via SU2_MPI::Error instead of crashing.

Verified using the NACA0012 testcase:

  • Validated that a standard run with REF_AREA=0.0 still works correctly (calculates ~1.0), ensuring no regression for valid cases.

@ayush4874 ayush4874 force-pushed the fix/ref-area-zero-check branch from 6869964 to 0a7fc93 Compare January 8, 2026 17:36
@pcarruscag
Copy link
Member

Reference area is not necessary for all physics in SU2

@ayush4874
Copy link
Contributor Author

ayush4874 commented Jan 8, 2026

Should I change this to a SU2_MPI::Warning, or should I move the check to where the coefficients are actually calculated?

@ayush4874
Copy link
Contributor Author

@pcarruscag can you please address this?

@pcarruscag
Copy link
Member

Error would be better, try to find a good place for it.

@ayush4874
Copy link
Contributor Author

Done. I reverted the changes in CPhysicalGeometry and moved the check to CEulerSolver::SetReferenceValues .

This ensures we only flag the error when the solver actually needs the reference area, without blocking other physics.

@pcarruscag
Copy link
Member

Still failing the tests and nota good place since that solver is not the only one that may use the reference area

@ayush4874
Copy link
Contributor Author

I think, this might be right, added the check to CIncEulerSolver (Incompressible) also. This will cover all aero solvers without blocking other physics.

@pcarruscag
Copy link
Member

sure just iterate on it until all the tests pass and let me know once you're done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants