Authoritative agent guidance for comphy-lab/Contact-line-subgrid-modeling: a
multiscale contact-line solver where a Generalized Lubrication Equation (GLE)
subgrid model resolves the interface from the slip length to the DNS grid scale
and couples to a Basilisk two-phase DNS above it.
The
CLAUDE.mdshim in this repo is a local, gitignored@AGENTS.mdpointer. Do not commitCLAUDE.md. Edit this file instead.
src-local/— header-only C99 solver stack, no external dependencies. Physics ingle-model.h; adaptive Cash–Karp integrator ingle-integrate.h; shooting BVP ingle-shoot.h; fold-free collocation branch tracer ingle-collocate.h; legacy shooting continuation ingle-continuation.h; the GLE ↔ DNS seam ingle-basilisk.h; thekey=valueloader ingle-params.h.gle-ode/— standalone drivers (gle-cutoff.c,gle-solve.c,gle-continuation.c), the calibratedfig4b.params, and a self-containedMakefile;reference-generator/contains the open-source Scott--Hocking one-phase integral solver and two-phase inner-Stokes FEM generator, with their convergence evidence.simulationCases/— Basilisk DNS cases;contactline-gle.cis the GLE-coupled case,contactline.cthe fixed-angle baseline.postProcess/—uv-runnable plotting (plot-fig4b.py,plot-finite-m-closure-comparison.py) and cross-validation (compare-c-python.py); each script carries inline PEP 723 dependencies.python/— the historicalsolve_bvpreference (GLE_solver.py) and the linearized-GLE fixture (validate-linearized-gle.py+reference-data/).data/fig4b-digitized/— vector-digitized reference data. Do not modify; the calibration is documented inCALIBRATION.md._Archive/— superseded code kept for provenance only. Do not resurrect. The old C mobility (gle_physics.h) carries a sign error in the Huh–Scriven denominator (flagged on PRs #9/#10/#13, never fixed there).
make # build gle-cutoff, gle-solve and gle-continuation
make test # smoke solve; compiles the Basilisk case when qcc exists
sh tests/verify-reference-table.sh # independently check frozen table evidence
./reproduce-fig4b.sh # trace the branch and regenerate the Fig. 4b figure
# Basilisk DNS case, serial:
cd simulationCases && qcc -O2 -disable-dimensions -I../src-local \
contactline-gle.c -o run -lm- Documentation is literate Markdown inside
/** ... */docstrings, rendered by the.githubdocs pipeline; LaTeX via MathJax ($...$,$$...$$). - British English, mechanism-first, concise, zero hype.
- No
f,p, orhas global identifiers — they collide with Basilisk's VoF field, pressure, and height function (issue #4). Solver functions are static inline in headers. - No external dependencies in
src-local/. Adding GSL, SUNDIALS, or CMake is off the table — that path was tried and closed (PRs #9/#3). Any C99 compiler withlibm, or Basilisk'sqcc, must build the whole stack. - Parameter files are
key = valuelines with#comments; a bare CLI argument is a parameter file, andkey=valueCLI arguments override, left to right. Angles are given astheta_mic_deg(degrees) in parameter files.
Run all of the following before committing a change that touches the model or either solver:
-
make test— smoke solve plus theqcccompile check. -
sh tests/verify-reference-table.sh— the frozen one- and two-phase reference data, independent checkpoints, interpolation audit, and emitted C headers must reproduce from their public generators. -
./reproduce-fig4b.sh— every branch must reach its requested upper height; the legacy fold must lie within the digitisation uncertainty of $\mathrm{Ca}^{} = 1.053717\times10^{-2}$ and $\Delta^{}=1.44617$; and the 421-height external theory-curve comparison must satisfy maximum$|\Delta\mathrm{Ca}|<2.2\times10^{-4}$ and RMS$<1.1\times10^{-4}$ . -
uv run postProcess/compare-c-python.py --quick— C vs Python mobility to machine precision; maximum angle and thickness errors below$2.3\times10^{-4}$ and$5\times10^{-4}$ in the well-conditioned window; apparent-angle difference below$10^{-3}$ degrees. - Gravity-rescaling invariance:
cd gle-ode ./gle-continuation fig4b.params slip=3.73e-6 grav=4.0 Delta_max=1.8fold_Camust stay invariant to$\sim 10^{-3}$ ;fold_Deltahalves to$\sim 0.720$ (both lengths rescale with$\sqrt{g^{*}}$ ).
Imperative mood, ~50-character subject, focused body explaining what and why. No AI signatures, no co-authored-by tags, no tool advertisements.