Skip to content

Support supplied physical collision profiles for common species adapters - #322

Closed
krystophny wants to merge 10 commits into
PrincetonUniversity:developfrom
krystophny:feat/pentrc-supplied-mixture-rates-20261017
Closed

krystophny wants to merge 10 commits into
PrincetonUniversity:developfrom
krystophny:feat/pentrc-supplied-mixture-rates-20261017

Conversation

@krystophny

@krystophny krystophny commented Oct 17, 2026 •

Copy link
Copy Markdown
Collaborator

A common D/T/e comparison needs the same declared physical collision rates and rotation in every native response. Add opt-in kinetic_format="rates-v1" profiles carrying selected ion/electron drives, common Coulomb logarithm and positive supplied rates in s^-1. Both query interfaces bypass the legacy impurity-rate reconstruction. Log interpolation and generated reconstruction preserve positive widths; exact zero rotation is retained and wpfac=1 is enforced. Native output records the consumed format and controls. The generated native dependency graph tracks the supplied-rate include, so edits rebuild its consuming input module.

Depends on the pointwise-query repair #318, included until it merges. Existing geometry, harmonic and energy factors remain. One call computes one population; the D/T/e adapter uses three calls with rates from one full background mixture. This is a diagonal scalar response; coupled Fokker–Planck physics is outside this interface.

The CI profile-domain repair from #318 is included: legacy rate reconstruction is lazy, direct Zeff consumers are preserved, and both examples stop at their supplied kinetic endpoint. Supplied-rate initialization and strict validation remain intact. No invalid Coulomb logarithm is floored or accepted.

Validation: make -C install check-pentrc-collisions passes on Apple arm64 with GNU Fortran. Supplied Debug and fast-math oracles each check 210 native query rows and derivatives (maximum relative error 2.88e-8); seven invalid inputs per build reject. Legacy/CI oracle checks 315 rows at maximum error 1.99166e-7, preserves six parent primitives/gradients exactly, and rejects an actual invalid extrapolated query. Full GNU/Intel solver replay passed all five CI checks at 99dfe12; the dependency-only update is undergoing current-head CI. The owning dependency generator/check fails before the missing include dependency and passes after it. Native NetCDF readback, field matching and cross-code torque scans remain pending, so this PR is draft.

Chris&AI

StuartBenjamin and others added 10 commits October 12, 2026 22:51
…bulated data without derivatives

Fritsch-Carlson interior slopes with scipy PchipInterpolator's end slopes, so
Python front ends (bouquet, TPS) can reproduce GPEC's interpolant exactly.
Unit test checks values and derivatives against scipy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…profile table

The tabulated Zeff (RDCON MRE terms) and the PENTRC kinetic input table carry
pedestal-scale gradients; a cubic spline rings there, pchip does not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pchip fits any table of 2 or more points, so the 4-point minimum of the
"extrap" spline goes. A scalar Zeff now becomes a flat profile on 2
nodes, the same table that tearing-physics-suite writes for a scalar
Zeff (psi_N_Zeff = 0, 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Preserve current primitive spline and solver fixes while retaining the pointwise Coulomb-rate repair. Native profile oracle passes with maximum relative error 1.4153e-7.

Chris&AI
Add opt-in rates-v1 profiles with positive log interpolation, exact zero rotation, native readback metadata and independent reader/query regressions. Preserve legacy model selection; this remains a diagonal one-population response.

Chris&AI
@logan-nc

Copy link
Copy Markdown
Contributor

@krystophny I've rebuilt the supplied-rates part of this on top of #336 as #338, and requested your review there. It's +37/−10 in 4 files:

Compared with this PR, it doesn't keep exactly-zero rotation (0 still goes to 1e-9), it doesn't require wpfac=1, and ν comes from the 101-node grid rather than being evaluated exactly at every query. There's also no FortSym-generated code or new check targets, since the testing setup is frozen for this release. The table in #338 lists the differences. Please say there if any of them breaks your D/T/e adapter.

Are you OK with closing this one (and #318, which this depends on) in favor of #338? If yes, please just go ahead and close it.

@krystophny

Copy link
Copy Markdown
Collaborator Author

Closing in favour of #338, which rebuilds this on top of #336.

Chris&AI

@krystophny krystophny closed this Oct 19, 2026
krystophny pushed a commit to krystophny/GPEC that referenced this pull request Oct 21, 2026
…format="rates-v1"

With kinetic_format="rates-v1" in PENT_INPUT, the kinetic_file carries three
extra columns (logLambda, nu_i, nu_e in s^-1) that replace the internal
collision model. They are interpolated in log on the table so nodes stay
positive, and they reuse the pchip nu slopes from the edge-collisionality fix.
The default "legacy" path is unchanged. DCON kin_flag passes the same format.

Slim replacement for the supplied-rates part of PrincetonUniversity#322 on top of PrincetonUniversity#336.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
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.

3 participants