Repository navigation
Conversation
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.
kaanolgu
left a comment
There was a problem hiding this comment.
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
| 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, & |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
#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 |
There was a problem hiding this comment.
The div_u columns change at about 1e-16 here, but the curl does not feed the divergence. Is this acceptable?
Closes #507. The curl now takes
der1st_symin all three directions instead ofder1st. 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_smokegoldens 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_scalarspass. 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.