Add normalized collisionality nu_star to outputs#2203
Open
r1cksync wants to merge 1 commit into
Open
Conversation
Exposes the electron-ion normalized collisionality nu_star as a face-grid simulation output, as requested in google-deepmind#2094. The quantity is already computed by collisions.calc_nu_star; this plumbs it through PostProcessedOutputs following the existing pattern (e.g. FFprime, psi_norm), so it flows automatically into the netCDF `profiles` output group. A collisionality multiplier of 1.0 is used so the reported value is the physical collisionality (the multiplier is a QLKNN sensitivity-testing knob and is intentionally not applied to this diagnostic). Adds unit tests for calc_nu_star (previously untested) covering shape, positivity/finiteness, and linear scaling with the collisionality multiplier, plus an output test asserting nu_star is exposed on the face grid.
jcitrin
approved these changes
Jul 13, 2026
jcitrin
left a comment
Collaborator
There was a problem hiding this comment.
Sorry for the delayed review! This LGTM. Preemptively approving it although please remove the redundant test in output_tools.
Also, please resync with head and solve the merge conflict, then we can bring this in.
Note that in principle it's necessary to regenerate the test nc files since they'll have the new post processed outputs. However we can do that on our end, so no action needed.
| rtol=1e-5, | ||
| ) | ||
|
|
||
| def test_nu_star_output(self): |
Collaborator
There was a problem hiding this comment.
this test can be removed. It's redundant with the new unit tests in collisions_test
This was referenced Jul 14, 2026
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.
What
Adds the electron–ion normalized collisionality
nu_startoPostProcessedOutputs, exposing it as a face-grid simulation output. Resolves #2094.nu_staris already computed bycollisions.calc_nu_star(and used internally by the QuaLiKiz-based transport model). This change plumbs it throughPostProcessedOutputsfollowing the existing pattern (e.g.FFprime,psi_norm), so it flows automatically into the netCDFprofilesgroup viaoutput.py— no output-serialization changes needed.A collisionality multiplier of
1.0is used, so the reported value is the physical collisionality. (The multiplier is a QLKNN sensitivity-testing knob; happy to expose a configurable value instead if you'd prefer.)Changes
post_processing.py: newnu_starfield + docstring,zeros()initializer entry, and computation inmake_post_processed_outputs.collisions_test.py: unit tests forcalc_nu_star(previously untested) — shape, positivity/finiteness, and linear scaling with the collisionality multiplier.post_processing_test.py: assertsnu_staris exposed on the face grid.Testing
Ran locally with
TORAX_JAXTYPING=True TORAX_ERRORS_ENABLED=True:collisions_test.py— 17/17 passpost_processing_test.py::PostProcessingTest— pass (incl. newtest_nu_star_output)output_test.pyprofile/scalar shape tests — pass (confirmsnu_starserializes correctly)