Implement average charge state equilibria. #659
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.
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.