feat: Add 3D Poiseuille flow validation test and complete v0.2.0 mile…#174
Conversation
…stones (#174) Add periodic-in-z Poiseuille channel flow test validating 3D solver code paths against the 2D analytical parabola u(y) = 4*U_max*(y/H)*(1-y/H). Tests verify: velocity profile accuracy (RMS 0.081), transverse velocities, mass conservation, pressure gradient (dp/dx = -1.235 vs expected -1.6), inlet BC exactness, and z-uniformity across planes (6.5e-5). Key finding: bc_apply_scalar_3d(BC_TYPE_PERIODIC) applies periodic BCs on ALL 6 faces, destroying wall/inlet/outlet BCs. Fix: apply z-periodic manually via memcpy of boundary z-planes only. Also marks v0.2.0 3D milestones complete in ROADMAP and adds TaylorGreen3D, Quiescent3D to validation test labels in CMake.
There was a problem hiding this comment.
Pull request overview
Adds a new 3D Poiseuille channel-flow validation test to exercise 3D solver code paths (with z-periodicity) and updates build/test metadata to include it as part of the validation suite and mark the related roadmap milestone complete.
Changes:
- Introduces a 3D Poiseuille validation executable that runs one simulation and asserts multiple accuracy/conservation metrics.
- Adds supporting 3D Poiseuille reference utilities (analytical solution + simulation runner + measurement helpers).
- Registers the new test in CMake/CTest validation labels and marks v0.2.0 3D milestones complete in
ROADMAP.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/validation/test_poiseuille_3d.c | New Unity test executable that validates multiple 3D Poiseuille metrics from a cached simulation run. |
| tests/validation/poiseuille_3d_reference.h | New 3D Poiseuille setup + runner + measurement utilities with z-periodic handling. |
| ROADMAP.md | Marks v0.2.0 3D milestone phases as completed. |
| CMakeLists.txt | Builds/links the new test, registers it with CTest, and includes 3D validation tests under the validation label set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
…iseuille test The test only clamped w=0 on the y-walls (top/bottom) but left w unconstrained on x-faces. The projection solver preserves caller-set boundary values via copy_boundary_velocities_3d, so unset w values on inlet/outlet faces could introduce spurious fixed BCs. Now explicitly sets w=0 at the inlet and applies zero-gradient (w(nx-1)=w(nx-2)) at the outlet for each z-plane.
…NX*NY Avoids duplicating the assumption that stride_z == NX*NY, making this code more robust if the memory layout ever changes.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
* feat: Add 3D Poiseuille flow validation test and complete v0.2.0 milestones (#174) Add periodic-in-z Poiseuille channel flow test validating 3D solver code paths against the 2D analytical parabola u(y) = 4*U_max*(y/H)*(1-y/H). Tests verify: velocity profile accuracy (RMS 0.081), transverse velocities, mass conservation, pressure gradient (dp/dx = -1.235 vs expected -1.6), inlet BC exactness, and z-uniformity across planes (6.5e-5). Key finding: bc_apply_scalar_3d(BC_TYPE_PERIODIC) applies periodic BCs on ALL 6 faces, destroying wall/inlet/outlet BCs. Fix: apply z-periodic manually via memcpy of boundary z-planes only. Also marks v0.2.0 3D milestones complete in ROADMAP and adds TaylorGreen3D, Quiescent3D to validation test labels in CMake. * fix: Enforce w boundary conditions on x-inlet/x-outlet faces in 3D Poiseuille test The test only clamped w=0 on the y-walls (top/bottom) but left w unconstrained on x-faces. The projection solver preserves caller-set boundary values via copy_boundary_velocities_3d, so unset w values on inlet/outlet faces could introduce spurious fixed BCs. Now explicitly sets w=0 at the inlet and applies zero-gradient (w(nx-1)=w(nx-2)) at the outlet for each z-plane. * fix: Use stride_z for periodic BC plane_bytes instead of duplicating NX*NY Avoids duplicating the assumption that stride_z == NX*NY, making this code more robust if the memory layout ever changes. * docs: Mark 3D validation benchmarks as complete in ROADMAP Taylor-Green 3D and Poiseuille 3D validations are now implemented.
…stones (#174)
Add periodic-in-z Poiseuille channel flow test validating 3D solver code paths against the 2D analytical parabola u(y) = 4U_max(y/H)*(1-y/H).
Tests verify: velocity profile accuracy (RMS 0.081), transverse velocities, mass conservation, pressure gradient (dp/dx = -1.235 vs expected -1.6), inlet BC exactness, and z-uniformity across planes (6.5e-5).
Key finding: bc_apply_scalar_3d(BC_TYPE_PERIODIC) applies periodic BCs on ALL 6 faces, destroying wall/inlet/outlet BCs. Fix: apply z-periodic manually via memcpy of boundary z-planes only.
Also marks v0.2.0 3D milestones complete in ROADMAP and adds TaylorGreen3D, Quiescent3D to validation test labels in CMake.