Skip to content

Commit

Permalink
Reset testing settings in magnetized_cooler
Browse files Browse the repository at this point in the history
readparticles now also collects particle weights to allow RZ analysis
  • Loading branch information
cchall committed Jun 4, 2018
1 parent a4abee1 commit 5b32d9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions examples/ionization/magnetized_cooler.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
# Switches
particle_diagnostic_switch = True # Record particle data periodically
field_diagnostic_switch = True # Record field/potential data periodically
user_injection = False # Switches injection type
user_injection = True # Switches injection type
space_charge = True # Controls field solve on/off
simulateIonization = True # Include ionization in simulation

Expand All @@ -48,8 +48,8 @@
cathode_temperature = 0.25 # eV

# Beam
beam_beta = 0.05 # 0.990813945176
beam_ke = 3.26e6 # eV
beam_beta = 0.990813945176
beam_ke = wp.emass / wp.jperev * wp.clight**2 * (1. / np.sqrt(1-beam_beta**2) - 1.) # eV
beam_current = 10e-3 # A
beam_radius = 0.01 # m

Expand Down Expand Up @@ -109,7 +109,7 @@

"""
A custom injector routine is used here to allow for a very relativistic beam to be injected directly into the simulation
because Warp's built in routine is not based on relativistic kinematics. Setting user_injection = False should work
because Warp's built in routine is not based on relativistic kinematics. Setting user_injection = False should work
well for lower energy beams.
"""

Expand Down Expand Up @@ -192,6 +192,7 @@

pipe_voltage = 0.0 # Set main pipe section to ground
electrode_voltage = +2e3 # electrodes held at several kV relative to main pipe
assert electrode_voltage < beam_ke, "Electrodes potential greater than beam KE."

pipe_radius = pipe_radius
electrode_length = 0.25
Expand Down
2 changes: 1 addition & 1 deletion rswarp/utilities/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def readparticles(filename):
parray = f['data/%s/particles/%s/position/x' % (step, species)]
for dim in dims:
parray = np.column_stack((parray, f['data/%s/particles/%s/' % (step, species) + dim]))

parray = np.column_stack((parray, f['data/%s/particles/%s/weighting' % (step, species)]))
particle_arrays[species] = parray
particle_arrays['time'] = time
particle_arrays['dt'] = dt
Expand Down

0 comments on commit 5b32d9f

Please sign in to comment.