Skip to content

Add singly degenerate Cahn-Hilliard mobility - #306

Draft
mcmehrtens wants to merge 4 commits into
developmentfrom
feature/sdch
Draft

mcmehrtens wants to merge 4 commits into
developmentfrom
feature/sdch

Conversation

@mcmehrtens

@mcmehrtens mcmehrtens commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Add opt-in singly degenerate mobility to the standalone Cahn–Hilliard integrator, so it can merge independently of agglomeration and Flame coupling.

Both SDCH methods use conservative face fluxes with arithmetic face mobility and a compatible discrete chemical-potential Laplacian. The spectral method applies an FFT-based discrete biharmonic stabilizer, including Nyquist modes. Constant mobility remains the default; its existing realspace and spectral update functions are unchanged.

Port the reusable Cahn–Hilliard additions from agglom-ddch-spectral:

  • Virtual inheritance, protected state, configurable input/field names, and a spatial mobility-mask hook for later derived integrators. Masks are filled on native AMR layouts before spectral assembly, and realspace mask ghosts are filled across coarse/fine boundaries.
  • Optional SDCH diagnostics: mobility, mask, cell-centered face-flux averages, conservative RHS, raw update, and actual field increment.
  • Optional clipping, disabled by default to preserve conservation, and the existing branch's opt-in realspace timestep switch.
  • Null-initialized owned pointers, expression initial conditions, mobility floors, and parameter validation.

Reduce the regression matrix from 38 sections to 12: 2D/3D analytic Fourier updates and checkerboard decay, mobility floor and stationary phases, strong-mobility dissipation, and partial spectral AMR coverage. Fold custom names and numerical diagnostic checks into an existing case. The checker reads native and HDF5 plotfiles; the test runner can select HDF5 binaries with --hdf5. Keep FFT CI coverage in both dimensions.

Validation:

  • Built 2D and 3D with --fft --hdf5 --offline in each of alamo-llvm, alamo-gcc, and alamo-apple-clang, using the fish helpers and separate compiler build trees.
  • In every environment, passed all 12 SDCH regressions (nine 2D and three 3D) plus the serial unit suite in both dimensions: 36 verified SDCH runs and six successful unit-suite invocations, with zero failures or skips.
  • Passed two-rank HDF5 constant-mobility CH smoke runs in both realspace and spectral modes in all three environments. The existing native-plotfile-only CH regression checker was excluded from these HDF5 runs.
  • Verified SDCH diagnostics and active clipping with HDF5 readback in Apple Clang and GCC: initial field 1.2, final field 1.0, raw update 1.2, increment -0.2, mobility zero, and mask one.
  • Passed a two-rank LLVM realspace SDCH partial-AMR run with diagnostics and finite field readback on both levels. The spectral AMR regression is included in each environment's suite.
  • Used uv with the latest installed Python, 3.15.1, for Python validation. Checked source equality across build trees, unchanged legacy constant-mobility kernels, and git diff --check.

SDCH requires periodic boundaries. Clipping can change the mean. Realspace AMR does not reflux coarse/fine fluxes. Spectral AMR assembles a full finest-level grid, with corresponding memory costs. These tests do not establish arbitrary-timestep energy dissipation, AMR convergence/restart accuracy, or MPI scaling. Flame/agglomeration equations, masks, restoration, and simulation inputs remain outside this PR.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant