Loading
Fix IncNavierStokesSolver pressure restart
Issue/feature addressed
- Restarting mixed tet/prism meshes at large scale with the
IncNavierStokesSolverintermittently let to NaNs in the first pressure solve. - Three bugs combined:
- 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.
- 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.
NormVectorIProductWRTBasetherefore 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. FilterAeroForceshad the same mismatch, and its partial fix overwrote the element's cached normals.
Proposed solution
-
- Convert checkpoint fields whose coefficient count differs into the first field's (u-velocity) before writing, following EquationSystem::WriteFld.
-
- 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, asGetTracePhysValsdoes.
- Add
-
- Use it in
TriExp/QuadExp::NormVectorIProductWRTBaseand bothFilterAeroForcespaths.
- Use it in
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
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