Repository navigation
Repo - API! - Read kinetic profiles once into the equilibrium and derive every kinetic view from them - #581
matt-pharr wants to merge 9 commits into
Conversation
…netic profiles and delete [KineticForces] kinetic_file
…iter from one dataset table
…quilibrium's kinetic profiles
… on an equilibrium with kinetic profiles
… into feature/kinetic-profiles-on-layout
logan-nc
left a comment
There was a problem hiding this comment.
Collision map now that #463 (its base) merged: against today's develop a three-way merge shows no conflicting hunks but 20 files changed on both sides, of which the src/ ones are Equilibrium.jl, EquilibriumTypes.jl, ForceFreeStates/CoreTypes.jl, GeneralizedPerturbedEquilibrium.jl, KineticForces/CalculatedKineticMatrices.jl, KineticForces/KineticForcesStructs.jl, plus regression-harness/src/runner.jl. Three things cross it: #551 moves the two Equilibrium files; #580 changes the efc_couplings/run_error_fields signatures that this PR also changes (species list in, profiles arg out); and the rates-v1 kinetic format from the parity plan (#591, A9) needs the [Equilibrium] kinetic_file home this creates, so I will build that on this branch once it is out of draft.
Release note
[KineticForces] kinetic_fileand[SLAYER] profile_fileare removed. Name the kinetic-profile file once, askinetic_filein[Equilibrium].[SLAYER] profile_groupbecomeskinetic_groupin[Equilibrium]. There is no defaultkinetic.datany more.Equilibrium.load_kinetic_profiles(path; …)is nowkinetic_profile_splines(read_kinetic_file(path); …).resolve_ntv_speciestakesKineticProfileDatainstead of a path.TearingProblem(ffs)takes its profiles from the equilibrium (noprofile_filekeyword).efc_couplingsdrops its kinetic-profiles argument.The kinetic-profile file is now read once into the equilibrium (
equil.kinetic), set by the new[Equilibrium] kinetic_filekey orPlasmaEquilibrium(…; kinetic_file=…), or attached withattach_kinetic_profiles!. NTV, the calculated kinetic matrices, SLAYER, the layer-overlap scan, error-field couplings and grid refinement each derive their own view from it, instead of up to four separate reads.solve()can now run the calculated kinetic source.Regression report
Notes for reviewers
[KineticForces]section loaded them.[KineticForces]are bit-identical.PlasmaEquilibrium.kineticholds the rawKineticProfileDataon the file's own ψ grid: densities, eV temperatures,omega_E,chi_e/chi_i/chi_phi,zeffand per-species densities. Consumers build their views from it:KineticForces.ntv_profiles/ntv_species: the 101-point NTV splines and species, with the[KineticForces]charges, masses and scale factors (unchanged maths);Runner._slayer_profiles): the table plus the χ⊥,e/χ⊥,i/χ_φ and Z_eff splines, then_slayer_chi_inputsfor the scalar fallbacks;efc_couplings.Equilibrium.reformcarries it through the two-pass re-form rather than re-reading it.nothing, never zero-filled, in the data. A missingomega_Estays optional for SLAYER as on develop: the view records it (has_omega_E) andTearingProblemwarns that those surfaces assume Ω_E = 0 unlessomega_E_kHzoverrides them.[SLAYER]section with no kinetic profiles errors before the force-free-states solve; a disabled one only skips the overlap scan. Profiles that lack a χ theP_perp_modelneeds skip the scan with a warning, as on develop.chi_icame in this way). A test keeps the table and the struct in step.[KineticForces]knobs applied only to the NTV view, as before.solve()has no[KineticForces]section, so it uses the defaults.solve(). It now runskinetic_source = "calculated"when the equilibrium carries profiles. A parity test checks it against the TOML-driven run. TheRiccati()/Galerkin()kinetic guard from develop is kept.chi_perp_e/chi_perp_i;omega_Ecarries zero rotation and says so;P_perp_model, now on attached data;mainandsolve()share;chi_perp_e/chi_torkeep their scalar 1.0 fallbacks), charge-constant, Z_eff and μᵢ unification, and the resistivity default (later PRs).MatchProblemdefaults from the profiles are a small follow-up.🤖 Generated with Claude Code