Anchored Dual-pass HLLD for Hypoelasticity (+ HLLC and interface-consistent HLL) - #1414
Anchored Dual-pass HLLD for Hypoelasticity (+ HLLC and interface-consistent HLL)#1414ChrisZYJ wants to merge 123 commits into
Conversation
|
Addresses Copilot review on #1630, plus a live recurrence caught on this PR's own CI run (job 85133634699, "Frontier (AMD) cpu [1/2]"): - UV_LOCK_DIR's guard only checked -w, so a writable non-directory TMPDIR would pass and then get used as a directory prefix, breaking flock. Add a -d check alongside -w, per Copilot's suggestion. - That same CI run hit a *new* corruption symptom ("The wheel is invalid: Missing .dist-info directory" for pandas) on the same physical login node (login05) as the original incident on #1414, even with the new lock in place. Root cause: a cache entry corrupted before the lock existed (or by any other cause) just fails forever until someone manually clears it -- which is exactly what had happened here; login05's ~1.2GiB cache had never actually been cleared (an earlier `uv cache clean` in this investigation was run from a different login node's session and never touched login05). Since self-hosted runners are spread across login nodes we can't all individually SSH into and inspect every time this happens, make the script self-heal instead: on install failure, clear the uv cache and retry once before giving up.
# Conflicts: # toolchain/mfc/test/cases.py
# Conflicts: # src/simulation/m_riemann_solver_hll.fpp # src/simulation/m_riemann_solver_hllc.fpp # src/simulation/m_riemann_solver_lf.fpp # src/simulation/m_riemann_state.fpp
|
Hi @ChrisZYJ — #1572 (Phase-3 Riemann hot-path decomposition) restructured/removed the exact solver code this PR builds on, which is what put I resolved the merge of current
Its first parent is your current head ( git fetch https://github.com/sbryngelson/MFC.git pr1414-hypo-hlld-master-merge
git checkout hypo_hlld
git merge --ff-only FETCH_HEAD
git push(Or just The core tension#1572 deleted the HLLC/LF hypoelastic-energy blocks as dead code, justified by Choices made (10 conflict hunks)
Two things worth your eyes
Happy to adjust any of these if you'd prefer a different call. cc @sbryngelson |
…er (drop dead six-eqn block, unused Re_max); fix HLL right-state damage index
…n hypo feature constraints with validator parity, constraint tests, and damage/three-fluid regressions
…near-zero-G elastic energy guards; regenerate the 12 affected hypo goldens
Mirror the Python validator's model and solver restrictions with Fortran PROHIBIT checks, use named solver constants in the touched checker logic, and remove the one-off parameter pytest.
|
@sbryngelson Thanks again for preparing the master merge. I reviewed and adopted the resolution, retained the requested refactor and cleanup, and addressed the remaining energy and validation consistency items, including the permanent per-side near-zero-G guard and thermal/kinetic enthalpy for the base acoustic sound speed. All CI tests have passed. Could you please take a final look and approve/merge if satisfied? Thanks! |
|
bumping this so I get to it sooner than later. |
|
Three small robustness items in the anchored HLLD path, from working through the 1. The inner wave speeds are not clipped into the outer fan. In sqrtC_NC = sqrt(C_NC)
S_Lstar = S_M - sqrtC_NC/rhoL_star
S_Rstar = S_M + sqrtC_NC/rhoR_starand the only degeneracy test beforehand is degenerate = (abs(denomA) < verysmall .or. &
.not. (S_L - verysmall <= S_M .and. S_M <= S_R + verysmall))which checks the contact against the outer fan but never the inner waves against The failure is quiet rather than loud. None of the material pairs in the current example cases trigger this, so it is 2. The degenerate-shear guard is dimensional. C_NC = rho_hat*(G_hat + tau_nn_hat)
if (C_NC < verysmall) then
3. A regression test with a sharp criterion. The reason HLLD beats HLLC at a shear-bearing contact is that its momentum and That gives a test with a much sharper pass criterion than an eyeball comparison: Related, for the docs: since the advantage is this pairing, |
# Conflicts: # docs/documentation/case.md # src/common/m_global_parameters_common.fpp # src/simulation/m_checker.fpp # src/simulation/m_global_parameters.fpp # src/simulation/m_rhs.fpp # src/simulation/m_riemann_solver_hll.fpp # src/simulation/m_riemann_solver_hllc.fpp # src/simulation/m_riemann_state.fpp # toolchain/mfc/params/definitions.py # toolchain/mfc/params/descriptions.py # toolchain/mfc/test/cases.py
|
I've made the changes as requested: 1. Inner-fan orderingThe raw If the five-wave ordering is invalid, the complete anchored contribution now uses the existing HLL fallback, or the corresponding one-sided physical flux when the outer fan does not straddle zero. The exported face state and NC interface velocity use the same fallback-safe wave zone, so they cannot sample the invalid five-wave fan. The valid HLLD path is unchanged, while the exact or cancellation-level zero-shear case remains a separate finite HLLC-like collapse. Added regression test 2. Dimensionless shear-degeneracy guardI replaced the former absolute When the scale is nonzero, this is equivalent to testing the dimensionless signed cancellation ratio The solver classifies the state as follows:
The factor four is a small conservative allowance for the two mixture products, their accumulation into I did not use an acoustic-relative cutoff. This guard is intended to detect cancellation and loss of floating-point representability, not to classify the material. Scaling by the acoustic modulus would eventually classify every sufficiently soft but physically valid solid as fluid-like and suppress a resolved shear subfan, even though a small positive shear stiffness is not singular. Volume-fraction admissibility also remains separate. MFC already handles reconstructed-state admissibility through Added 2 regression tests to cover the changed outcomes:
3. Shear-contact regressionI added The fitted orders are:
The HLLC leg is intentionally asserted as a control. If the uniform tangential velocity were accidentally removed, both solvers would appear quadratic and the HLLD-only test would lose its discriminating power. 4. ADC documentationThe documentation now states explicitly that ADC trades contact and shear resolution for HLL robustness and is default-off/recommended-off. I also corrected the documented |
|
The one failed documentations CI is unrelated to this PR - it's Lychee link checking for a file unchanged during this PR |
Description
Adds:
Key Design Choices
Separate HLLD Riemann Solvers
At a glance it might be tempting to combine HLLD MHD with dual-pass hypoelasticity HLLD, but keeping them separate makes the code cleaner and much easier to maintain because:
Riemann Source Terms
For the non-conservative terms, unlike the usual governing equations that only need div U i.e. du/dx, dv/dy, dw/dz (alpha div U, K div U, etc.), Hypoelasticity has cross terms like du/dy, so we must also pass those Riemann-consistent traces from Riemann solver to the rhs. (The old Hypoelasticity code with the HLL Riemann solver uses finite difference for non-conservative rhs, which provides enough stability given that HLL smears the interface immediately, so there wasn't a need to pass the du/dy traces before this PR. But that does not work for HLLC/HLLD for Hypoelasticity.)
Also grouped/named the condition branches (with lots of comments within the code):
adv_src_alpha_ifaceflux_src_n(dir)%vf(j_adv)= per-fluidnc_iface_vel_n(dir)%vf(1)adv_src_vel_ifaceflux_src_n(dir)%vf(adv\%beg)= sharedflux_src_nslot (alreadyadv_src_noneThe derivations, meanings, and usage of the Riemann source variables are not straightforward. I've added some hopefully very helpful notes in
misc/dev_notesfor future developers (or AI agents; directing them to my notes should help them make fewer mistakes with the source terms) in terms of the understanding and derivations for the HLL/HLLC non-conservative fluxes, and their variable mapping for Riemann solvers and RHS.Backwards Compatibiilty
Type of change
Testing
All tests passed locally on CPU and Nvidia GPU, and on Frontier.
Smooth Eigenmode Convergence
Checklist
AI code reviews
Reviews are not triggered automatically. To request a review, comment on the PR:
@coderabbitai review— incremental review (new changes only)@coderabbitai full review— full review from scratch/review— Qodo review/improve— Qodo code suggestions@claude full review— Claude full review (also triggers on PR open/reopen/ready)claude-full-review— Claude full review via label