Skip to content

Commit

Permalink
Change the specification of the magnetic geometry to add a finite bze…
Browse files Browse the repository at this point in the history
…ta to the 1D mirror option to allow a nonzero ExB drift to emerge in 2D simulations.
  • Loading branch information
Michael Hardman committed Feb 6, 2024
1 parent 5abac5e commit 9330f25
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 14 deletions.
6 changes: 3 additions & 3 deletions moment_kinetics/ext/manufactured_solns_ext.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ using IfElse
# compute symbolic geometry functions
option = geometry_input_data.option
rhostar = geometry_input_data.rhostar
pitch = geometry_input_data.pitch
if option == "constant-helical" || option == "default"
pitch = geometry_input_data.pitch
bzed = pitch
bzeta = sqrt(1 - bzed^2)
Bmag = 1.0
Expand All @@ -73,8 +73,8 @@ using IfElse
jacobian = 1.0
elseif option == "1D-mirror"
DeltaB = geometry_input_data.DeltaB
bzed = 1.0
bzeta = 0.0
bzed = pitch
bzeta = sqrt(1 - bzed^2)
# B(z)/Bref = 1 + DeltaB*( 2(2z/L)^2 - (2z/L)^4)
# chosen so that
# B(z)/Bref = 1 + DeltaB at 2z/L = +- 1
Expand Down
5 changes: 3 additions & 2 deletions moment_kinetics/src/geo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,11 @@ function init_magnetic_geometry(geometry_input_data::geometry_input,z,r)
if DeltaB < -0.99999999
input_option_error("$option: You have specified DeltaB < -1 -> set DeltaB > -1", option)
end
pitch = geometry_input_data.pitch
for ir in 1:nr
for iz in 1:nz
bzed[iz,ir] = 1.0
bzeta[iz,ir] = 0.0
bzed[iz,ir] = pitch
bzeta[iz,ir] = sqrt(1 - bzed[iz,ir]^2)
# B(z)/Bref = 1 + DeltaB*( 2(2z/L)^2 - (2z/L)^4)
# chosen so that
# B(z)/Bref = 1 + DeltaB at 2z/L = +- 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=1.0
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=1.0
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=1.0
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=1.0
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=1.0
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=0.5
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=0.5
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=0.5
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ force_Er_zero_at_wall = false #true
geometry_option="1D-mirror"
DeltaB=0.5
#geometry_option="constant-helical"
#pitch=1.0
pitch=0.5
Er_constant = 0.0
T_e = 1.0
T_wall = 1.0
Expand Down

0 comments on commit 9330f25

Please sign in to comment.