Repository navigation
Conversation
2D axisymmetric surface tension was missing two terms of div(Omega): the azimuthal stress -Omega_thetatheta/r = -sigma|grad c|/r, and the capillary flux of the axis row, which m_rhs reads from tau_Re_vf instead of the face fluxes but which only the viscous and conduction axis sources filled. A static axisymmetric drop reached at most half its Laplace pressure and aborted within a third of a capillary time. s_compute_capillary_hoop_source adds the hoop term face-averaged to pair with the -F/r geometric source; s_compute_capillary_axis_source fills the axis rows of tau_Re_vf after the viscous and conduction axis sources. New golden AC1AA22C covers an interface crossing the axis and one carrying the hoop stress. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VtsGVvCfsDJz5dmtSk9dKt
Lines of Code
|
|
Claude Code Review Head SHA: aad40cc Files changed:
Findings:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2103 +/- ##
==========================================
+ Coverage 61.89% 61.92% +0.03%
==========================================
Files 86 86
Lines 22888 22922 +34
Branches 3372 3380 +8
==========================================
+ Hits 14166 14195 +29
Misses 6220 6220
- Partials 2502 2507 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
sbryngelson
marked this pull request as draft
October 24, 2026 02:53
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two missing terms in 2D axisymmetric (
cyl_coord,grid_geometry == 2) surface tension: the azimuthal (hoop) capillary stress, and the capillary flux divergence on the axis row. Without them a static axisymmetric drop reaches at most half its Laplace pressure (0.052 of 0.1), develops 6.6× capillary-velocity currents where the interface meets the axis, and aborts within a third of a capillary time.The capillary stress$\boldsymbol\Omega = -\sigma\left(|\nabla c|,\mathbf I - \frac{\nabla c\otimes\nabla c}{|\nabla c|}\right)$ enters the momentum flux. In axisymmetric coordinates its radial divergence is
since$\nabla c$ has no azimuthal component. Upstream supplies the first two terms through the face fluxes and the generic $-F/r$ geometric source, but never $-\Omega_{\theta\theta}/r$ — the second principal curvature of an axisymmetric interface. Separately, the axis branch of
m_rhsskips the face-flux divergence of the axis cell (k = 0) and readstau_Re_vfthere instead, which only the viscous and conduction axis sources fill; the capillary contribution in that row was dropped.Approach
Two kernels in
m_surface_tension.fpp, both gated onsurface_tension .and. grid_geometry == 2:s_compute_capillary_hoop_sourceaddsk >= 1(ork >= 0off-axis).capillary_cutoff, as thes_compute_capillary_axis_sourcefillstau_Re_vf(mom%beg:E)atk = -1, 0, 1with the cell-centered radial row ofs_compute_conduction_axis_source. The axis cell's hoop term (tau_Re_vf(mom%beg+1)atk = 0only, becausem_rhsuses that single value in itsm_rhs.fppallocatestau_Re_vf(mom%beg:E)for axisymmetric surface tension (previously viscous or conduction only), calls the axis kernel after the conduction one, and widens the two existing axis-rowk = 0loops to include it. The energy equation needs no hoop term:Cartesian and 3D cylindrical code paths are unchanged.
Verification
Static-sphere Laplace gate.$R=1$ drop centered on the axis in the quarter domain $[0,2.5]^2$ (symmetry at $x=0$ ), $\sigma=0.05$ , $\rho_l/\rho_g = 10$ , 6-equation model, HLLC, WENO5, $\Delta t = 0.125/N$ , 4 ranks (2×2, so both axis and off-axis ranks run the new code). Target $\Delta p = 2\sigma/R = 0.1$ ; $t_c=\sqrt{\rho_l R^3/\sigma}=4.47$ , $U_c=\sqrt{\sigma/(\rho_l R)}=0.224$ .
Flat interface crossing the axis. A planar$x=0.5$ interface has zero curvature and must stay at rest. Max $|v_r|$ near the axis after 50 steps: Cartesian 1.6e-12, master axisymmetric 0.293, this PR 7.2e-12. This is the dropped axis-row flux in isolation.
Cartesian inertness. The Cartesian N=50 gate run is bit-identical to master across all 4212 output files.
New golden$r=0.8$ interface that carries the hoop stress, $\sigma=0.01$ . It fails on master (max error 2.27e-1) and passes here bitwise. The existing capillary goldens
AC1AA22C(2D -> Axisymmetric -> model_eqns=3 -> capillary=T): the flat axis-crossing interface above plus an3859AF63andAA9C637Fare unchanged; no existing golden file changed.Full suite (gfortran 15, MPI, CPU): 723 passed, 0 failed, 39 skipped. Run without
-a, becauseh5dumpis not installed on the development host, so the post-process NaN/Inf check was not exercised locally../mfc.sh precheck: all checks pass.GPU: compiles under NVHPC 25.5 (the
nvcr.io/nvidia/nvhpc:25.5-devel-cuda12.9container,MFC_CUDA_CC=70,75,80,89,90) for--gpu accand--gpu mp, and with--case-optimization --gpu acconbenchmarks/5eq_rk3_weno3_hllc. Not run on a GPU.Notes for reviewers
tau_Re_vfis now allocated for axisymmetric surface tension withoutviscousor conduction, under the same condition as its deallocation. Onlytau_Re_vf(mom%beg:E)is used, as for conduction.s_compute_capillary_axis_sourceaccumulates intotau_Re_vf, so it must follow the viscous and conduction axis sources, which assign. When neither is active it zeroes the fields itself.k_begin the hoop kernel testsbc_y%beg == BC_REFLECTIVEto mirrorm_rhs'sbc_y%beg == -2 .or. -14axis branch; for 2D axisymmetric runs the validator already forces-2at the axis, and off-axis MPI ranks see a processor boundary and start atk = 0.m_surface_tension.fpp, +6 inm_rhs.fpp), plus a 26-line test case.Known limitations
m_rhsaxis branch drops its axis-row capillary flux the same way; not run.sigma = 1) blows up in Cartesian coordinates too, which is why the new test setsPre-existing issues found (not addressed here)
s_finalize_surface_tension_moduledeallocatesc_divs(1:num_dims)%sfbut allocatesc_divs(1:num_dims+1)%sf, so theContribution Policy
Written with Claude Code. Reimplemented from fixes developed and exercised in my fork's axisymmetric droplet runs, with the signs re-derived and every claim above re-measured on this branch except where marked.
Acknowledgement
🤖 Generated with Claude Code
https://claude.ai/code/session_01VtsGVvCfsDJz5dmtSk9dKt