Repository navigation
PENTRC - NEW FEATURE - Optional supplied collision rates (kinetic_format="rates-v1") - #345
Merged
Merged
Conversation
…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 #322 on top of #336. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
Fortran does not guarantee short-circuit evaluation, so the combined present(format) .and. format /= "legacy" test could read an absent argument. Every caller passes it today; this nests the check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
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.
Reopens #338 against
develop. #338 was approved but merged into its stacked basepentrc-edge-collisionalityafter #336 had already merged, so its changes never reacheddevelop. This branch is the same content, plus 8b6f0d6, which nests thekinetic_formatcheck insideif(present(format))as suggested in the #338 review.This is a slim version of the supplied-rate feature from #322, rebuilt on #336's way of handling ν.
What it does
Setting
kinetic_format = "rates-v1"inPENT_INPUTreads a 9-columnkinetic_file:The last three columns replace PENTRC's internal Coulomb/impurity collision model. The format and keyword are the same as #322, so existing adapter files work unchanged.
Default:
"legacy"is the default and leaves behavior unchanged.Validation: the run stops with a clear
error stopmessage if:rates-v1gets a table without exactly 9 columns;logLambda,nu_iornu_eis non-positive;kinetic_formatis not one of the two values.Interpolation:
read_kin's 101 nodes. This keeps the nodes positive, even when extrapolating past the end of the table.torque.F90or the integrand.nfac/tfac: these scale n and T after ν is set, so they don't rescale supplied ν. This matches the behavior #322 documents.DCON:
kin_flagpasses the samekinetic_format(dcon/dcon.F), so DCON and PENTRC read the table the same way.Diff: +37/−10 in 4 files. There is no new build target, test harness or generated code, because the testing setup is frozen for this release.
How it differs from #322
kin_evalwrapperskingrid with pchip slopeswpfacVerification
These were throwaway runs on feynman of the
regression_solovev_kinetic_examplechain (DCON withkin_flag→ GPEC → PENTRC), built with gfortran. They compare this branch against #336.kinetic_formatrates-v1round trip**In the round trip, the legacy formula's logΛ, ν_i and ν_e were written into the example's own table as columns 7–9 and fed back in with
rates-v1.rates-v1extrapolates log ν smoothly, which puts ν ≈ 1e9 there.All PENTRC output files from the two legacy runs are bit-identical. The DCON outputs differ only in their CPU and wall-time stamps.
The three bad inputs (8 columns, a negative ν,
kinetic_format="rates_v1") each stop with their message.https://claude.ai/code/session_01VMDGyfQKRZQMdk3NJXsKQE
🤖 Generated with Claude Code