Skip to content

Add LINELET regression case for laminar NACA0012 - #2899

Open
Syphonicc wants to merge 3 commits into
su2code:developfrom
Syphonicc:linelet-regression-test
Open

Syphonicc wants to merge 3 commits into
su2code:developfrom
Syphonicc:linelet-regression-test

Conversation

@Syphonicc

Copy link
Copy Markdown

Addresses the regression-test part of #2877.

Adds a serial regression case for LINEAR_SOLVER_PREC= LINELET. There is currently no LINELET coverage in TestCases.

TestCases/navierstokes/naca0012/lam_NACA0012_LINELET.cfg is the laminar NACA0012 config with one added line, LINEAR_SOLVER_PREC= LINELET. The baseline uses the default ILU(0).

Note: it is based on the updated lam_NACA0012.cfg from #2866 (ITER instead of the deprecated EXT_ITER, CFL 30), so on current develop the two files differ in more than that one line until #2866 is merged. This PR does not depend on #2866; the new file parses on develop as-is. The registration is placed after cylinder_lowmach, away from the lam_naca0012 entry added in #2866, so the two PRs don't touch the same lines.

At test_iter = 20 the two cases already differ, so the test is sensitive to the preconditioner:

Preconditioner rms[Rho] rms[RhoU] rms[RhoV] rms[RhoE]
ILU(0) (lam_NACA0012) -5.522140 -3.127430 -3.286926 -0.109971
LINELET -5.282867 -2.845208 -2.852421 0.154542

test_vals are from a local serial clean build of current develop (8118ee0, GCC 15.2.1). The same procedure reproduces the #2866 lam_naca0012 values exactly. I'll update them if CI differs.

This does not address the segfault reports in #2877, and only covers the serial path.

Same as lam_NACA0012.cfg with LINEAR_SOLVER_PREC= LINELET, compared against the default ILU(0). See su2code#2877.
@bigfooted

Copy link
Copy Markdown
Contributor

can you check parallel?

@Syphonicc

Copy link
Copy Markdown
Author

Good catch LINELET segfaulted in parallel with ≥4 ranks (1 and 2 ranks ran fine, which is why it didn't show up before).

Cause

  • Partitions without wall markers have no linelets, so CSysMatrix::BuildLineletPreconditioner never allocated the per-thread working vectors but still indexed them → segfault (CSysMatrix.cpp, confirmed with gdb on the rank that had no walls).
  • CGeometry::GetLineletInfo used linelets.empty() as its "already computed" check. On ranks with no linelets it recomputed on every call, including the MPI_Allreduce/MPI_Allgather, while the other ranks returned early → mismatched collectives.

Fix

  • Always allocate the linelet working vectors (they're small, MAX_LINELET_POINTS per thread).
  • Added an explicit computed flag to CLineletInfo so every rank computes it exactly once.
  • Skip the "points in each line" message when there are no linelets globally (avoids a divide by zero).

Tests

  • Added lam_naca0012_linelet to parallel_regression.py with mpirun -n 4. The default 2 ranks doesn't trigger the bug, because both partitions touch the airfoil.
  • Merged develop and updated the serial test_vals.
  • Checked the case runs at 1, 2, 4 and 8 ranks.

Fixes #2877.

This branch has not been deployed

No deployments
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