Skip to content

Evaluate PENTRC collision rates from primitive profile queries - #318

Closed
krystophny wants to merge 8 commits into
PrincetonUniversity:developfrom
krystophny:fix/pentrc-pointwise-collisions-upstream-20261015
Closed

krystophny wants to merge 8 commits into
PrincetonUniversity:developfrom
krystophny:fix/pentrc-pointwise-collisions-upstream-20261015

Conversation

@krystophny

@krystophny krystophny commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

PENTRC can cubic-interpolate positive tabulated collision rates into negative off-grid values, reversing the collisional response despite positive density and temperature. Evaluate the existing Coulomb model from primitive-profile queries instead, using the same rates and derivatives in torque, diagnostics and exports. Primitive interpolation, constants and nfac/tfac collision semantics are preserved. Refs #52.

The independent native regression fails before and passes after: a positive analytic edge profile previously gives nu_i=-91.36 s^-1 where the physical model gives 284.41 s^-1. It checks knots/off-grid values, gradients, exported positivity and scaling semantics. The earlier TC24 native-library replay changes a negative rate at psi_n=0.984411 from -0.0674 to 720.013 s^-1, with bitwise unchanged primitives and maximum independent error 9.39e-8. This qualifies the rate repair, not torque convergence.

Current develop is merged, preserving upstream radial-export and energy-integration fixes. Full GNU/Intel CI exposed an invalid example extrapolation: kinetic data end at psi=.997995992, whereas the previous .99999 equilibrium cut extrapolates Te to .002934648 eV and logLambda to -2.56638. Rates are now reconstructed only at consumed queries, preserving direct primitive/Zeff consumers. Both examples explicitly use the supplied endpoint; physical guards remain unchanged and actual invalid extrapolated queries still fail.

The owning make -C install check-pentrc-collisions target passes 315 profile/query rows on GNU Fortran 16.1.0, maximum independent rate error 1.99166e-7, minimum example logLambda 5.37404. Six primitive values and gradients match independently compiled unmodified develop exactly. Darwin uses its native dead-strip flag; Linux retains GNU linker flags. Full GNU/Intel example replay runs in pushed CI.

Chris&AI

StuartBenjamin and others added 4 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>
@krystophny
krystophny force-pushed the fix/pentrc-pointwise-collisions-upstream-20261015 branch from 39abcf8 to e9f41a8 Compare October 16, 2026 08:45
@krystophny

Copy link
Copy Markdown
Collaborator Author

A separate collision-width defect found while preparing D/T/electron collisionality controls is now reported in #319 and fixed in #320. nutype="small" used signed electric precession as the damping width, producing anti-damping when precession was negative. The native energy-integral regression fails before and passes after the magnitude fix.

This is independent of the derived-rate profile spline repaired here. The scan will qualify this PR's current head (e9f41a8b) separately and use explicitly positive Krook rates for the main matched-model cases.

Chris&AI

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
@logan-nc

Copy link
Copy Markdown
Contributor

@krystophny thanks for digging into #321. I've gone with a smaller fix for v1.6 in #336 (+22/−5, all in read_kin):

  • ν, logΛ and ν_e get local pchip slopes on the 101-node grid, so a steep or cold edge node can no longer ring inward.
  • In the ν formula only, T is floored at 1 meV and logΛ at 1. The floors only kick in outside the supplied table, where ν ≳ 1e9 and the result no longer depends on ν.

This leaves n, T, ω_E and their derivatives bit-identical to develop. It needs no changes to torque.F90 or the examples, and the CI examples keep psihigh=0.99999.

The PR description links an artifact with before/after ν profiles and torques. Since we're freezing the Fortran test setup before the release, there's no new check target.

Are you OK with closing this one in favor of #336? If yes, please just go ahead and close it.

@krystophny

Copy link
Copy Markdown
Collaborator Author

Fine with #336, closing in favour of it. Thanks!

Chris&AI

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