Skip to content

feat: Add 3D Poiseuille flow validation test and complete v0.2.0 mile…#174

Merged
shaia merged 3 commits into
masterfrom
feat/poiseuille-3d-validation
Mar 7, 2026
Merged

feat: Add 3D Poiseuille flow validation test and complete v0.2.0 mile…#174
shaia merged 3 commits into
masterfrom
feat/poiseuille-3d-validation

Conversation

@shaia
Copy link
Copy Markdown
Owner

@shaia shaia commented Mar 7, 2026

…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.

…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.
@shaia shaia requested a review from Copilot March 7, 2026 13:25
@shaia shaia self-assigned this Mar 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/validation/poiseuille_3d_reference.h Outdated
Comment thread tests/validation/poiseuille_3d_reference.h
shaia added 2 commits March 7, 2026 16:20
…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.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@shaia shaia merged commit b24262c into master Mar 7, 2026
22 checks passed
shaia added a commit that referenced this pull request Mar 7, 2026
* 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.
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