Skip to content

Commit

Permalink
Set electron temperature to constant when using Boltzmann response
Browse files Browse the repository at this point in the history
Previously the electron temperature (and corresponding thermal speed)
variables were unused, but set equal to the ion temperature, which has
the potential to be confusing.
  • Loading branch information
johnomotani committed Sep 15, 2024
1 parent 3038940 commit 46265a2
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions moment_kinetics/src/initial_conditions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function initialize_electrons!(pdf, moments, fields, geometry, composition, r, z
# Not restarting, so create initial profiles

# initialise the electron thermal speed profile
init_electron_vth!(moments.electron.vth, moments.ion.vth, composition.T_e, composition.me_over_mi, z.grid)
init_electron_vth!(moments.electron.vth, moments.ion.vth, composition, z.grid)
begin_r_z_region()
# calculate the electron temperature from the thermal speed
@loop_r_z ir iz begin
Expand Down Expand Up @@ -1063,14 +1063,19 @@ initialise the electron thermal speed profile.
for now the only initialisation option for the temperature is constant in z.
returns vth0 = sqrt(2*Ts/Te)
"""
function init_electron_vth!(vth_e, vth_i, T_e, me_over_mi, z)
function init_electron_vth!(vth_e, vth_i, composition, z)
begin_r_z_region()
# @loop_r_z ir iz begin
# vth_e[iz,ir] = sqrt(T_e)
# end
@loop_r_z ir iz begin
vth_e[iz,ir] = vth_i[iz,ir,1] / sqrt(me_over_mi)
#vth_e[iz,ir] = exp(-5*(z[iz]/z[end])^2)/sqrt(me_over_mi)
if composition.electron_physics (boltzmann_electron_response,
boltzmann_electron_response_with_simple_sheath)
println("doing boltzmann init")
@loop_r_z ir iz begin
vth_e[iz,ir] = sqrt(composition.T_e / composition.me_over_mi)
end
else
@loop_r_z ir iz begin
vth_e[iz,ir] = vth_i[iz,ir,1] / sqrt(composition.me_over_mi)
#vth_e[iz,ir] = exp(-5*(z[iz]/z[end])^2)/sqrt(composition.me_over_mi)
end
end
end

Expand Down

0 comments on commit 46265a2

Please sign in to comment.