Skip to content

Fix pressure grad#185

Merged
chengcli merged 2 commits into
mainfrom
cli/fix_pressure_grad
Jul 16, 2026
Merged

Fix pressure grad#185
chengcli merged 2 commits into
mainfrom
cli/fix_pressure_grad

Conversation

@chengcli

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 15, 2026 23:37

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the radial pressure-gradient handling in curvilinear coordinate source terms so that providing a face-pressure field does not inadvertently cancel the physical pressure gradient in the x1-momentum equation.

Changes:

  • Adjust radial momentum source terms in gnomonic-equiangle and spherical-polar coordinates to preserve the face-pressure gradient.
  • Add regression tests to ensure x1-momentum preserves a prescribed face-pressure gradient in both coordinate systems.
  • Apply minor C++ pointer-style formatting updates in the coordinate test file.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/test_coordinate.cpp Adds regression tests validating that face-pressure gradients are preserved in radial momentum updates (gnomonic-equiangle and spherical-polar).
src/coord/spherical_polar.cpp Subtracts the explicit face-pressure gradient from the geometric pressure source term to avoid canceling the gradient already present in flux divergence.
src/coord/gnomonic_equiangle.cpp Mirrors the spherical-polar fix for gnomonic-equiangle by subtracting the explicit face-pressure gradient from the radial source term.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chengcli chengcli merged commit 759f03b into main Jul 16, 2026
1 of 3 checks passed
@chengcli chengcli deleted the cli/fix_pressure_grad branch July 16, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants