Fix IncNavierStokesSolver pressure restart

Issue/feature addressed

  • Restarting mixed tet/prism meshes at large scale with the IncNavierStokesSolver intermittently let to NaNs in the first pressure solve.
  • Three bugs combined:
    1. With Taylor-Hood expansions (P_{pressure} = P_{velocity} - 1) wrote pressure using u-velocity field's sizes, reading past the end of the pressure array.
    2. With continuous projection, boundary triangles use GLL points with Q+1 points in direction 1, while element trace normals use Gauss-Radau with Q points. NormVectorIProductWRTBase therefore read past the end of the normal array. The extra values land on the collapsed vertex, which has zero weight, so the result only breaks when that garbage is NaN or Inf (hence intermittent). Trace normals were also never reoriented to the face geometry's frame.
    3. FilterAeroForces had the same mismatch, and its partial fix overwrote the element's cached normals.

Proposed solution

    1. Convert checkpoint fields whose coefficient count differs into the first field's (u-velocity) before writing, following EquationSystem::WriteFld.
    1. Add Expansion::GetAlignedTraceNormal(trace, traceExp). It returns trace normals at the boundary expansion's points, in the face geometry's frame: interpolate in the element's local frame, then reorient, as GetTracePhysVals does.
    1. Use it in TriExp/QuadExp::NormVectorIProductWRTBase and both FilterAeroForces paths.

Implementation

see above

Tests

  • IncNavierStokesSolver_MixedOrderFilterRegression: curved continuous tets, Taylor-Hood pressure, high-order pressure BCs, Checkpoint and AeroForces filters. It checks the checkpoint norms, which come out as NaN with the old code.
  • LocalRegionsUnitTests: aligned normals on curved tet and hex faces across all face orientations, including transposed ones.

Suggested reviewers

@CFD-Xing @ssherw

Notes

Please add any other information that could be useful for reviewers.

Checklist

  • Functions and classes, or changes to them, are documented.
  • User guide/documentation is updated.
  • Changelog is updated.
  • Suitable tests added for new functionality.
  • Contributed code is correctly formatted. (See the contributing guidelines).
  • License added to any new files.
  • No extraneous files have been added (e.g. compiler output or test data files).
Edited by Henrik Wustenberg

Merge request reports

Loading
Loading