Repository navigation
InnerLayer.CCC - FEATURE - Add the Cho, Choi and Choi drift-resistive linear MHD inner layer - #654
Open
matt-pharr wants to merge 3 commits into
Open
matt-pharr wants to merge 3 commits into
matt-pharr wants to merge 3 commits into
Conversation
… layer as a ToroidalLayer model CCCModel solves the drift-resistive layer equations of Cho, Choi & Choi, IEEE Trans. Plasma Sci. PS-15, 418 (1987), in the form of Kim, Cho & Choi, Phys. Fluids 31, 2659 (1988), Eqs. (1a)-(1c): the GGJ layer with the electron diamagnetic frequency Q* in Ohm's law and vorticity and the perpendicular-transport weight M⊥/M on the pressure equation. CCCParameters holds a GGJParameters plus Qstar and mperp and takes GGJ's scales, Mercier exponents and Δ normalization. Its equations, its Wasow basis (a block- diagonalizing T equal to GW2020's at Q* = 0, m = 1, with a general Sylvester splitting solve) and the rates of its two exponential families (Kim Eq. 2) run on the shared rotated-ray solver; only :ray is available. The library gains two optional hooks for models whose exponential pairs have different rates, parabolic_resolution_rate and ray_angle_admissible, whose defaults leave GGJ unchanged.
matt-pharr
force-pushed
the
feature/kaist-inner-layer
branch
from
November 5, 2026 16:27
b84b559 to
5931e72
Compare
Collaborator
|
Awesome! |
matt-pharr
marked this pull request as ready for review
November 9, 2026 16:16
matt-pharr
marked this pull request as draft
November 12, 2026 16:18
…aring, Match and the deck through the ToroidalLayer interface
…tes with the electrons as SLAYER's does With s = γ − iω, Kim's Ohm's law Q + iQ* vanishes at ω = Q*Q₀ in the E×B frame, so Q* = ω*ₑ/Q₀ with SLAYER's ω*ₑ = n·layer_omega_star_e. Q* from kinetic data had the opposite sign and put the CCC electron resonance at n·Ω_E − ω*ₑ instead of n·Ω_E + ω*ₑ. A test pins both layers' resonances at the same lab frequency, with and without E×B rotation. The SurfaceCoupling docstring now states s = γ − iω like the rest of the toroidal-layer path.
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.
Release note
Adds
CCCModel, the drift-resistive linear MHD inner layer of Cho, Choi & Choi (1987) in the form of Kim, Cho & Choi (1988): the GGJ layer with electron diamagnetic drift (Q*) and perpendicular transport (M⊥/M), solved with the rotated-ray backend.Wasow analysis was done in mathematica to obtain the asymptotic series using a wolframscript routine I have been using for my other derivation which essentially just re-implemented Zhirui's mathematica notebook from GW2020. This is essentially the same as the GGJ ray solver but with coefficients and asymptotic series for the Cho-Choi-Choi layer, so this is a small, drop-in change.
Regression report
Fan-out on ITER's SDCC cluster, all 28 cases, the base branch
refactor/toroidal-layer-library@ 89c4807 vs this branch @ 979f829: all 27 existing cases unchanged, every tracked quantity diff 0.0e+00 (385 compared quantities; checksums identical), including the GGJ inner-layer, GGJ tearing and SLAYER tearing cases. The new caseccc_ray_q5i(q = 4 surface, Q* = 0.5, M⊥/M = 1.4, Q = 5i) has no base-branch value, asCCCParametersdoes not exist there.The test files touched by this PR (innerlayer, dispersion ggj/coupled/coupled_full/residual/rotation, slayer_runner, matching_models, resist_eval, solve_api, deck_roundtrip, h5_schema) pass on ITER's SDCC cluster at 979f829.
Report: per-case summary, and the inner-layer and tearing cases in full
Validation and benchmarks
These runs used the prototype of this model (the same equations threaded through GGJ on an earlier branch);
CCCModelreproduces it to 1.5e-8 at the pinned point (q4 surface, Q* = 0.5, M⊥/M = 1.4, Q = 5i).Kim, Cho & Choi (1988) Figs. 1b and 2b. Their surface (E = −0.01, F = H = 0, G = K = 100, M⊥/M = 1), tearing (odd) parity, Q* = 0 (Fig. 1b) and Q* = 0.05 (Fig. 2b). Roots of Δ₋(Q) = Δ₀ found by secant continuation along Δ₀, overlaid on the published curves with the scan axes calibrated from their tick marks. Kim et al. plot their Fourier-space tearing quantity Δ_o, which their Eq. (10b) relates to the real-space Δ′_o we compute; we convert with that equation and fit nothing.
The Δ₀ = 0 roots, which do not depend on how Δ is normalized, land on the published curves:
Away from Δ₀ = 0, Kim's axis is Δ_o = C_o·Δ′_o with C_o = |Γ(1+p₊)/Γ(−p₊)·cot(πp₊/2)| and p₊ = −1/2 + √(−D_I) (Eq. 10b); for this surface C_o = 0.6293327. With that conversion our curves overlay all of Fig. 1b and all four Q* = 0.05 curves of Fig. 2b. C_o depends only on the Mercier exponent, so the same value serves both Q*. Our Δ uses the GGJ normalization cross-checked against Fortran
rmatch.Convergence to GGJ. On the q4 benchmark surface, Q* from 1e-7 to 1 and M⊥/M − 1 from 1e-7 to 1, at Q = 0.01, 0.1 + 0.1i, i, 3 + 3i, 10i and 100i:
Accuracy and cost.
delta_convergencespread (contour angle, mesh, series order and radius, march tolerance, BVP edge, decaying-pair separation) on the q4 surface with Q* = 0.5, M⊥/M = 1.4: ≤ 3.4e-7 at Q = 0.5 + 0.5i and ≤ 7.8e-8 at Q = 5i.Single-solve times on one laptop core:
The cost grows with K·|Q|·Q*², because the march resolves the faster exponential family across the slower one's whole band.
Tearing roots on GPEC examples (dispersion roots by continuation from the SLAYER root, Q* = −ω*ₑ/Q₀ from the kinetic profiles, M⊥/M = 1; not yet wired into
TearingProblem):examples/DIIID-like_SLAYER_example, Q* ≈ 1.2–1.5 at 2/1–4/1). The CCC roots rotate at SLAYER's lab frequency on 2/1 and 3/1 (within 3%) and near it on 4/1 (−3.6e3 against −2.8e3 rad/s). The damping on 3/1 and 4/1 comes out at −310 and −420 s⁻¹, against SLAYER's −145 and −450 s⁻¹, while plain GGJ gives −1230 and −1756 s⁻¹. 2/1 differs: SLAYER is unstable at +164 s⁻¹ (without its curvature offset), CCC damped at about −330 s⁻¹ (not converged to tolerance), GGJ −1004 s⁻¹.Notes for reviewers
ToroidalLayerlibrary); review only the commits above89c4807e1.CCCModel/CCCParameters(src/InnerLayer/CCC/) implement theToroidalLayerParametersinterface: Kim (1988) Eqs. (1a)–(1c) as rows and weak form, a Wasow basis from Kim's A₀–A₂ with a block-diagonalizing T that equals GW2020's at Q* = 0, M⊥/M = 1, a general Sylvester splitting solve, and the two exponential families of Kim Eq. (2) setting the ray angle and mesh.CCCParametersholds aGGJParametersplusQstar,mperp, and takes GGJ's scales and Δ normalization. Only:rayis available.parabolic_resolution_rateandray_angle_admissible, whose defaults leave GGJ unchanged.runtests_innerlayer.jl): the Wasow matrices reproduce the ODE matrix to 1e-16; the first-order Ξ series coefficient matches a closed form from a separate Mathematica derivation to 1e-8; Δ is independent of the contour angle to 1e-7;CCCModelat Q* = 0, M⊥/M = 1 reproduces GGJ to 3e-10; Kim Figs. 1b and 2b (tearing dispersion at Q* = 0 and 0.05) are reproduced with no fitted parameter once our real-space Δ′_o is converted to their Fourier-space Δ_o (Kim Eq. 10b; factor 0.6293 for this surface).ToroidalLayerModel: the library gainslayer_parameters,check_layer_inputs,mercier_di,growth_rate_scaleandlayer_parameter_columns, sosolve(TearingProblem, CCCModel()),solve(MatchProblem, CCCModel())and their HDF5 output (Q_star,M_perp_ratiobeside GGJ's columns) need no CCC-specific code there.CCCModel(; Qstar, mperp)carries the model's inputs, a number or one value per surface; withoutQstar, Q* = n·ωₑ/Q₀ comes from the kinetic profiles, with ωₑ per unit n fromlayer_omega_star_e, so that QQ₀ is SLAYER's ωₑ. In a deck,inner_model = "CCC"under[Tearing]or[Match], withQstar,mperpand the solver options in[CCC]; decks list their toroidal models inTOROIDAL_LAYER_MODELS.GGJModelis structurally unchanged.runtests_solve_api.jl) pins the two zeros to the same lab frequency at Ω_E = 0 and Ω_E ≠ 0, through the code's own Doppler and Q mappings.ccc_ray_q5i, and tests for CCC tearing and matching (Q* = 0 reproduces GGJ to 1e-6), Q* from kinetic profiles, and deck/API parity under[Match].🤖 (Partially :P) generated with Claude Code