File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -642,6 +642,28 @@ function lump_ions_as_bulk_and_impurity(cp1d::IMAS.core_profiles__profiles_1d{T}
642
642
return ions2
643
643
end
644
644
645
+ """
646
+ zeff(cp1d::IMAS.core_profiles__profiles_1d; temperature_dependent_ionization_state::Bool=true)
647
+
648
+ Returns plasma effective charge
649
+
650
+ `temperature_dependent_ionization_state` evaluates Zeff with average ionization state of an ion at a given temperature
651
+ """
652
+ function zeff (cp1d:: IMAS.core_profiles__profiles_1d ; temperature_dependent_ionization_state:: Bool = true )
653
+ num = zero (cp1d. grid. rho_tor_norm)
654
+ den = zero (cp1d. grid. rho_tor_norm)
655
+ for ion in cp1d. ion
656
+ if temperature_dependent_ionization_state
657
+ Zi = avgZ (ion. element[1 ]. z_n, ion. temperature)
658
+ else
659
+ Zi = ion. element[1 ]. z_n
660
+ end
661
+ num .+ = ion. density .* Zi .^ 2
662
+ den .+ = ion. density .* Zi
663
+ end
664
+ return num ./ cp1d. electrons. density
665
+ end
666
+
645
667
"""
646
668
avgZ(Z::Float64,Ti::T)::T
647
669
You can’t perform that action at this time.
0 commit comments