From 1654f7ce23b75b3f11df5c78816f9749ece30d94 Mon Sep 17 00:00:00 2001 From: John Omotani Date: Mon, 30 Oct 2023 20:05:55 +0000 Subject: [PATCH] Make clearer that T_over_Tref is not normalised temperature ...with the current normalisations used by the code, which normalise pressure by `mref*Nref*cref^2 = 2*Nref*Tref`. --- src/krook_collisions.jl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/krook_collisions.jl b/src/krook_collisions.jl index f6ceec9c4..91a8e09a0 100644 --- a/src/krook_collisions.jl +++ b/src/krook_collisions.jl @@ -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] @@ -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] @@ -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] @@ -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] @@ -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]