Skip to content

Add normalized collisionality nu_star to outputs#2203

Open
r1cksync wants to merge 1 commit into
google-deepmind:mainfrom
r1cksync:nu-star-output
Open

Add normalized collisionality nu_star to outputs#2203
r1cksync wants to merge 1 commit into
google-deepmind:mainfrom
r1cksync:nu-star-output

Conversation

@r1cksync

@r1cksync r1cksync commented Jun 9, 2026

Copy link
Copy Markdown

What

Adds the electron–ion normalized collisionality nu_star to PostProcessedOutputs, exposing it as a face-grid simulation output. Resolves #2094.

nu_star is already computed by collisions.calc_nu_star (and used internally by the QuaLiKiz-based transport model). This change plumbs it through PostProcessedOutputs following the existing pattern (e.g. FFprime, psi_norm), so it flows automatically into the netCDF profiles group via output.py — no output-serialization changes needed.

A collisionality multiplier of 1.0 is 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: new nu_star field + docstring, zeros() initializer entry, and computation in make_post_processed_outputs.
  • collisions_test.py: unit tests for calc_nu_star (previously untested) — shape, positivity/finiteness, and linear scaling with the collisionality multiplier.
  • post_processing_test.py: asserts nu_star is exposed on the face grid.

Testing

Ran locally with TORAX_JAXTYPING=True TORAX_ERRORS_ENABLED=True:

  • collisions_test.py — 17/17 pass
  • post_processing_test.py::PostProcessingTest — pass (incl. new test_nu_star_output)
  • output_test.py profile/scalar shape tests — pass (confirms nu_star serializes correctly)

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 jcitrin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test can be removed. It's redundant with the new unit tests in collisions_test

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.

Add the collisionallity nu_star to the outputs

2 participants