Skip to content

Add passive_momentum option to neutral_mixed#592

Open
Vandoo wants to merge 1 commit into
boutproject:masterfrom
Vandoo:passive_momentum_v2
Open

Add passive_momentum option to neutral_mixed#592
Vandoo wants to merge 1 commit into
boutproject:masterfrom
Vandoo:passive_momentum_v2

Conversation

@Vandoo

@Vandoo Vandoo commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Re-applies the previously-proposed neutral_passive_momentum feature onto current master (the original branch had drifted ~600 commits behind).

New options:

  • passive_momentum: evolve only the neutral density; momentum and pressure are passive (pressure is not added to the solver).
  • temperature_from: take Tn from another species (e.g. the ion, Tn=Ti).
  • evolve_pressure: defaults to !passive_momentum.
  • anomalous_transport_momentum (AnomalousDiffusion): toggle anomalous transport of parallel momentum. (not nessesary).

In passive_momentum mode NVn is set from an ion-equilibrium relation NVn = Nn_eq * Vi, with Nn_eq built from cx/iz/rec collision frequencies, and nu_cx/nu_iz/nu_rec/Nn_eq exposed as diagnostics.

The preconditioner gains a density-only branch (I - gammaDiv_perp(DnnGrad_perp))*ddt(Nn) when pressure is not evolved. Pressure/momentum terms, sources, diagnostics, time-derivative scaling, freeze_low_density and CHECK blocks are gated on the new flags. Reading another species' temperature declares the required GuardedOptions read permission.

Tested on a 3D MAST-U CD case: builds clean, runs to completion with finite fields, reproduces the original branch's passive behaviour (Tn tracks Ti to ~0.1%, 7 evolved fields, consistent neutral diagnostics).

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 38.99371% with 97 lines in your changes missing coverage. Please review.
✅ Project coverage is 48.80%. Comparing base (d1b0b9a) to head (5aa5ae8).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
src/neutral_mixed.cxx 37.41% 85 Missing and 12 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #592      +/-   ##
==========================================
- Coverage   49.08%   48.80%   -0.29%     
==========================================
  Files          96       96              
  Lines       10038    10133      +95     
  Branches     1452     1484      +32     
==========================================
+ Hits         4927     4945      +18     
- Misses       4606     4675      +69     
- Partials      505      513       +8     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Re-applies the previously-proposed neutral_passive_momentum feature onto
current master (the original branch had drifted ~600 commits behind).

New options:
- passive_momentum: evolve only the neutral density; momentum and pressure
  are passive (pressure is not added to the solver).
- temperature_from: take Tn from another species (e.g. the ion, Tn=Ti).
- evolve_pressure: defaults to !passive_momentum.
- anomalous_transport_momentum (AnomalousDiffusion): toggle anomalous
  transport of parallel momentum.

In passive_momentum mode NVn is set from an ion-equilibrium relation
NVn = Nn_eq * Vi, with Nn_eq built from cx/iz/rec collision frequencies,
and nu_cx/nu_iz/nu_rec/Nn_eq exposed as diagnostics. The preconditioner
gains a density-only branch (I - gamma*Div_perp(Dnn*Grad_perp))*ddt(Nn)
when pressure is not evolved. Pressure/momentum terms, sources, diagnostics,
time-derivative scaling, freeze_low_density and CHECK blocks are gated on
the new flags. Reading another species' temperature declares the required
GuardedOptions read permission.

Tested on a 3D MAST-U Super-X case: builds clean, runs to completion with
finite fields, reproduces the original branch's passive behaviour
(Tn tracks Ti to ~0.1%, 7 evolved fields, consistent neutral diagnostics).
@Vandoo Vandoo force-pushed the passive_momentum_v2 branch from 29f1eb4 to 5aa5ae8 Compare June 29, 2026 14:51
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.

1 participant