Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement average charge state equilibria. #659

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

copybara-service[bot]
Copy link

Implement average charge state equilibria.

Electron temperature dependent. Uses a polynomial fit for a selection of common impurities based on Mavrin 2018, including heavy impurities.

  • Adds a new routine to calculate average impurity charge state for an IonMixture.

  • Modifies the DynamicIonMixture dataclass to hold a separate Z_override attribute instead of calculating the average itself. This is used in the charge state calculation function.

  • Updates core_profile_setters to calculate and return the Zimp/Zi profiles according to the new routines

  • Better separation of ne and ion density + charge state setting

  • Updates Qualikiz to use the new Zimp/Zi arrays

  • Adds average Zimp to default output plots

  • Updates boundary condition calculations to calculate boundary Zimp according to the boundary temperature.

  • New sim integration test with tungsten added.

  • Some sim tests which did not have a Z_override now have spatially varying Zimp, which leads to small O(1e-4) changes. The small impact is because the default impurity is Neon.

Small <5% runtime increase. This was ascertained to not be due to the (jitted) charge state calculations themselves, but due to surrounding code in non-jitted functions in the sim loop which call the charge state calculations. This will be rectified in an upcoming PR.

~10% compilation time increase due to added dependency of nimp and zimp on electron temperature.

@copybara-service copybara-service bot force-pushed the test_715335274 branch 3 times, most recently from 8c2a628 to d13fc15 Compare January 17, 2025 20:16
Electron temperature dependent. Uses a polynomial fit for a selection of common impurities based on Mavrin 2018, including heavy impurities.

* Adds a new routine to calculate average impurity charge state for an IonMixture.

* Modifies the DynamicIonMixture dataclass to hold a separate Z_override attribute instead of calculating the average itself. This is used in the charge state calculation function.

* Updates core_profile_setters to calculate and return the Zimp/Zi profiles according to the new routines

* Better separation of ne and ion density + charge state setting

* Updates Qualikiz to use the new Zimp/Zi arrays

* Adds average Zimp to default output plots

* Updates boundary condition calculations to calculate boundary Zimp according to the boundary temperature.

* New sim integration test with tungsten added.

* Some sim tests which did not have a Z_override now have spatially varying Zimp, which leads to small O(1e-4) changes. The small impact is because the default impurity is Neon.

Small <5% runtime increase. This was ascertained to not be due to the (jitted) charge state calculations themselves, but due to surrounding code in non-jitted functions in the sim loop which call the charge state calculations. This will be rectified in an upcoming PR.

~10% compilation time increase due to added dependency of nimp and zimp on electron temperature.

PiperOrigin-RevId: 715335274
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