-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTP_proj2.py
75 lines (67 loc) · 1.74 KB
/
TP_proj2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
output_every=10
n_part=100
velocity=0.1
amplitude=0.001
length = 1.68
Main(
geometry = "1Dcartesian",
interpolation_order = 2,
simulation_time = 10.0*2*math.pi,
timestep = 0.01,
grid_length = [length],
cell_length = [length/32],
number_of_patches = [ 1 ],
print_every = 100,
EM_boundary_conditions = [['periodic']]
)
Species(
name = 'ion',
number_density = 1.0,
position_initialization = 'regular',
momentum_initialization = 'cold',
particles_per_cell = n_part,
mass = 1836.0,
charge = 1.0,
time_frozen = 10000.0,
boundary_conditions = [['periodic']]
)
Species(
name = "eon1",
position_initialization = "regular",
momentum_initialization = "cold",
particles_per_cell = n_part/2,
mass = 1.0,
charge = -1.0,
number_density = cosine(0.5,xamplitude=amplitude,xnumber=1),
boundary_conditions = [['periodic']],
mean_velocity = [velocity, 0, 0]
)
Species(
name = "eon2",
position_initialization = "regular",
momentum_initialization = "cold",
particles_per_cell = n_part/2,
mass = 1.0,
charge = -1.0,
number_density = cosine(0.5,xamplitude=amplitude,xnumber=1),
boundary_conditions = [['periodic']],
mean_velocity = [-velocity, 0, 0]
)
DiagScalar (
precision = 3,
every=output_every,
vars = ['Utot', 'Ukin', 'Uelm', 'Ukin_eon1', 'Ukin_eon2', 'Uelm_Ex']
)
DiagParticleBinning(
deposited_quantity = "weight",
every = output_every,
species = ['eon1', 'eon2'],
axes = [
["x", 0., length, 100],
["px", -4*velocity, 4*velocity, 100]
]
)
DiagFields(
every = output_every,
fields = ['Jx', 'Rho_eon1', 'Rho_eon2']
)