Skip to content

Commit

Permalink
Make clearer that T_over_Tref is not normalised temperature
Browse files Browse the repository at this point in the history
...with the current normalisations used by the code, which normalise pressure by `mref*Nref*cref^2 = 2*Nref*Tref`.
  • Loading branch information
johnomotani authored Oct 30, 2023
1 parent 49e33d1 commit 1654f7c
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/krook_collisions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ function krook_collisions!(pdf_out, fvec_in, moments, composition, collisions, v
# through by vth, remembering pdf is already multiplied by vth
@loop_s_r_z is ir iz begin
n = fvec_in.density[iz,ir,is]
T = (moments.charged.vth[iz,ir,is])^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T^(-1.5) * cfac + (1.0 - cfac))
T_over_Tref = (moments.charged.vth[iz,ir,is])^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T_over_Tref^(-1.5) * cfac + (1.0 - cfac))
@loop_vperp_vpa ivperp ivpa begin
pdf_out[ivpa,ivperp,iz,ir,is] -= dt * nu_ii *
(fvec_in.pdf[ivpa,ivperp,iz,ir,is]
Expand All @@ -72,8 +72,8 @@ function krook_collisions!(pdf_out, fvec_in, moments, composition, collisions, v
@loop_s_r_z is ir iz begin
n = fvec_in.density[iz,ir,is]
vth = moments.charged.vth[iz,ir,is]
T = vth^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T^(-1.5) * cfac + (1.0 - cfac))
T_over_Tref = vth^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T_over_Tref^(-1.5) * cfac + (1.0 - cfac))
@loop_vperp_vpa ivperp ivpa begin
pdf_out[ivpa,ivperp,iz,ir,is] -= dt * nu_ii *
(fvec_in.pdf[ivpa,ivperp,iz,ir,is]
Expand All @@ -86,8 +86,8 @@ function krook_collisions!(pdf_out, fvec_in, moments, composition, collisions, v
@loop_s_r_z is ir iz begin
n = fvec_in.density[iz,ir,is]
vth = moments.charged.vth[iz,ir,is]
T = vth^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T^(-1.5) * cfac + (1.0 - cfac))
T_over_Tref = vth^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T_over_Tref^(-1.5) * cfac + (1.0 - cfac))
@loop_vperp_vpa ivperp ivpa begin
pdf_out[ivpa,ivperp,iz,ir,is] -= dt * nu_ii *
(fvec_in.pdf[ivpa,ivperp,iz,ir,is]
Expand All @@ -101,8 +101,8 @@ function krook_collisions!(pdf_out, fvec_in, moments, composition, collisions, v
@loop_s_r_z is ir iz begin
n = fvec_in.density[iz,ir,is]
vth = moments.charged.vth[iz,ir,is]
T = vth^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T^(-1.5) * cfac + (1.0 - cfac))
T_over_Tref = vth^2
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T_over_Tref^(-1.5) * cfac + (1.0 - cfac))
@loop_vperp_vpa ivperp ivpa begin
pdf_out[ivpa,ivperp,iz,ir,is] -= dt * nu_ii *
(fvec_in.pdf[ivpa,ivperp,iz,ir,is]
Expand All @@ -115,13 +115,13 @@ function krook_collisions!(pdf_out, fvec_in, moments, composition, collisions, v
@loop_s_r_z is ir iz begin
n = fvec_in.density[iz,ir,is]
vth = moments.charged.vth[iz,ir,is]
T = vth^2
T_over_Tref = vth^2
if vperp.n == 1
vth_prefactor = 1.0 / vth
else
vth_prefactor = 1.0 / vth^3
end
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T^(-1.5) * cfac + (1.0 - cfac))
nu_ii = collisions.krook_collision_frequency_prefactor * ( n * T_over_Tref^(-1.5) * cfac + (1.0 - cfac))
@loop_vperp_vpa ivperp ivpa begin
pdf_out[ivpa,ivperp,iz,ir,is] -= dt * nu_ii *
(fvec_in.pdf[ivpa,ivperp,iz,ir,is]
Expand Down

0 comments on commit 1654f7c

Please sign in to comment.