Skip to content

Take the symmetric first derivative in the curl - #509

Open
ia267 wants to merge 1 commit into
mainfrom
507_curl_free_slip
Open

ia267 wants to merge 1 commit into
mainfrom
507_curl_free_slip

Conversation

@ia267

@ia267 ia267 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

Closes #507. The curl now takes der1st_sym in all three directions instead of der1st. Every derivative in the curl is of a tangential component (dw/dy, dv/dz, ...), which is even across a free-slip boundary. symonly changes the Neumann boundary stencil, so periodic and Dirichlet directions are unchanged.

The curl only feeds the monitoring enstrophy, so the simulation itself is unaffected. The cylinder_110_smoke goldens are blessed again: with the uniform inflow the enstrophy at t = 0 drops from 1.09 to zero, and later values sit close to the all-periodic-y case. Kinetic energy and divergence are unchanged.

Tested locally on OpenMP (GNU) and CUDA (NVHPC 25.3), double and single precision: all regression tests and test_output_scalars pass. The OpenMP and CUDA enstrophies agree to all printed digits. The other regressioninputs have no Neumann boundaries.

Merge order with #508: whichever merges second needs the cylinder goldens blessed again. If #508 merges first, this PR also has to update cylinder_111_smoke; if this one merges first, #508 needs its 111 goldens regenerated.

Closes #507. Every derivative in the curl is of a velocity component along
another direction, which is even across a free-slip boundary, so the curl
takes der1st_sym rather than der1st. With der1st the curl of a uniform
field was not zero at Neumann boundaries, which put a spurious enstrophy
in the monitoring output. sym only changes the stencil at Neumann
boundaries, so periodic and Dirichlet directions are unchanged.

The cylinder 110 goldens are blessed again: their enstrophy at t = 0 is
now zero for the uniform inflow. Kinetic energy and divergence are
unchanged.
@ia267 ia267 added this to the Version 0.1.0 milestone Nov 26, 2026
@ia267
ia267 requested a review from kaanolgu November 26, 2026 16:28
@ia267 ia267 self-assigned this Nov 26, 2026
@ia267 ia267 added the bug Something isn't working label Nov 26, 2026
@ia267
ia267 marked this pull request as ready for review November 26, 2026 16:29

@kaanolgu kaanolgu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I built the PR head on OMP (GCC 14.2, 2 MPI ranks) and CUDA (NVHPC 25.3, 1 and 2 GPUs). I ran the full ctest and ctest -L regression on both backends, and all tests passed. The cylinder_110_smoke run gives an enstrophy of 4.4e-33 at t=0 on both backends, with no NaN

Comment thread src/solver.f90
call self%vector_calculus%curl( &
o_i_hat, o_j_hat, o_k_hat, u, v, w, &
self%xdirps%der1st, self%ydirps%der1st, self%zdirps%der1st &
self%xdirps%der1st_sym, self%ydirps%der1st_sym, &

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

postprocess.f90 still uses der1st for the tangential derivatives in the vorticity and Q-criterion snapshots. Do you want to change them in this PR, or in a separate PR?

1.500000000000E-01, 5.100758768855E-01, 1.205730926530E+00, 8.159702077255E-08, 2.940744464250E-08
1.875000000000E-01, 5.102450152863E-01, 1.206456871490E+00, 8.850414614546E-08, 3.798291909789E-08
2.250000000000E-01, 5.103916803430E-01, 1.206771861059E+00, 9.532411805685E-08, 4.647251235975E-08
0.000000000000E+00, 5.000000000000E-01, 4.386621712415E-33, 5.035047578031E-17, 4.254838874198E-17

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#508 adds cylinder_111 goldens from the old curl. Git does not show a conflict between the two PRs. Should the PR that merges second re-bless them?

1.875000000000E-01, 5.102450152863E-01, 1.206456871490E+00, 8.850414614546E-08, 3.798291909789E-08
2.250000000000E-01, 5.103916803430E-01, 1.206771861059E+00, 9.532411805685E-08, 4.647251235975E-08
0.000000000000E+00, 5.000000000000E-01, 4.386621712415E-33, 5.035047578031E-17, 4.254838874198E-17
3.750000000000E-02, 5.077402977195E-01, 5.499143208555E-02, 2.241800042193E-07, 3.929887241527E-09

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The div_u columns change at about 1e-16 here, but the curl does not feed the divergence. Is this acceptable?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Curl (monitoring enstrophy) uses the odd first derivative at free-slip walls

2 participants