diff --git a/src/hirshman_sigmar.jl b/src/hirshman_sigmar.jl index c903714..a52e65f 100644 --- a/src/hirshman_sigmar.jl +++ b/src/hirshman_sigmar.jl @@ -84,7 +84,6 @@ function get_ion_electron_parameters(dd::IMAS.dd) loglam = 24.0 .- log.(sqrt.(ne) ./ Te) n_norm = ne - m_norm = md t_norm = Te nu_norm = sqrt.(k .* Te ./ md) ./ a @@ -99,7 +98,7 @@ function get_ion_electron_parameters(dd::IMAS.dd) for i in 1:num_ions T1 = cp1d.ion[i].temperature[Int(ceil(end / 2))] Z[i] = IMAS.avgZ(cp1d.ion[i].element[1].z_n, T1) - mass[i] = cp1d.ion[i].element[1].a * mp / m_norm + mass[i] = cp1d.ion[i].element[1].a * mp / md dens[:, i] = cp1d.ion[i].density ./ m³_to_cm³ ./ n_norm temp[:, i] = cp1d.ion[i].temperature ./ t_norm @@ -110,7 +109,7 @@ function get_ion_electron_parameters(dd::IMAS.dd) dlnndr[:, i] = -IMAS.calc_z(rmin / a, cp1d.ion[i].density, :backward) dlntdr[:, i] = -IMAS.calc_z(rmin / a, cp1d.ion[i].temperature, :backward) - vth[:, i] = sqrt.((cp1d.ion[i].temperature ./ t_norm) ./ (cp1d.ion[i].element[1].a * mp / m_norm)) + vth[:, i] = sqrt.((cp1d.ion[i].temperature ./ t_norm) ./ (cp1d.ion[i].element[1].a * mp / md)) end # tacking on electron parameters at the end diff --git a/src/input_neo.jl b/src/input_neo.jl index 5d6341e..1a106fe 100644 --- a/src/input_neo.jl +++ b/src/input_neo.jl @@ -257,9 +257,8 @@ function InputNEO(dd::IMAS.dd, gridpoint_cp) dlntedr = dlntedr[gridpoint_cp] n_norm = ne - m_norm = md t_norm = Te - v_norm = sqrt(k .* t_norm ./ m_norm) + v_norm = sqrt(k .* t_norm ./ md) input_neo.RMIN_OVER_A = rmin[gridpoint_cp] / a @@ -322,7 +321,7 @@ function InputNEO(dd::IMAS.dd, gridpoint_cp) for iion in eachindex(ions) species = iion setfield!(input_neo, Symbol("ANISO_MODEL_$species"), 1) - setfield!(input_neo, Symbol("MASS_$species"), ions[iion].element[1].a .* mp / m_norm) + setfield!(input_neo, Symbol("MASS_$species"), ions[iion].element[1].a .* mp / md) setfield!(input_neo, Symbol("Z_$species"), Int(ions[iion].element[1].z_n / ions[1].element[1].z_n)) Ti = ions[iion].temperature ./ t_norm @@ -347,7 +346,7 @@ function InputNEO(dd::IMAS.dd, gridpoint_cp) setfield!(input_neo, Symbol("DENS_$i"), ne / n_norm) setfield!(input_neo, Symbol("TEMP_$i"), Te / t_norm) setfield!(input_neo, Symbol("ANISO_MODEL_$i"), 1) - setfield!(input_neo, Symbol("MASS_$i"), me / m_norm) + setfield!(input_neo, Symbol("MASS_$i"), me / md) setfield!(input_neo, Symbol("Z_$i"), -1) setfield!(input_neo, Symbol("DLNNDR_$i"), dlnnedr) setfield!(input_neo, Symbol("DLNTDR_$i"), dlntedr)