Skip to content

Comments

Unfreeze density or density_thermal as needed#292

Open
bclyons12 wants to merge 3 commits intomasterfrom
unfreeze_density
Open

Unfreeze density or density_thermal as needed#292
bclyons12 wants to merge 3 commits intomasterfrom
unfreeze_density

Conversation

@bclyons12
Copy link
Member

Summary

  • Update enforce_quasi_neutrality! to set density or density_thermal as appropriate depending on whether density_fast is present, instead of blanket-unfreezing all density fields upfront
  • Raise an error when quasi-neutrality enforcement would result in negative ion thermal density
  • Add targeted unfreeze! calls in fast_particles_profiles!, bundle_DT!, new_impurity_fraction!, and scale_ion_densities_to_target_zeff! so that density expressions remain correct after density_thermal modifications

Test plan

  • Verify enforce_quasi_neutrality! correctly updates density vs density_thermal based on presence of density_fast
  • Confirm error is raised for negative density cases
  • Run existing IMAS test suite

🤖 Generated with Claude Code

- Sets `density` or `density_thermal` as appropriate
- Errors if ion density is negative
@nanshi1177
Copy link
Contributor

nanshi1177 commented Feb 21, 2026

image for any shot

@bclyons12
Copy link
Member Author

@nanshi1177 Give that a try

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.

2 participants