Skip to content

Commit 4b04701

Browse files
authored
Change alpha particle momentum initialization (#5033)
* Change alpha particle momentum initialization Now alpha particles will be initializes with momentum calculated via the two step alpha_1 channel, which has a higher cross section than the alpha_0 channel currently used. * Fix: Corrected Be mass Corrected the mass of the Be to account for the mass defect due to being an excited state. The conservation of energy tests now pass. * Edit fusion and decay energy * Modified released in fusion and decay steps of pB reaction. Ensures the delta mc2 = energy released, at both the fusion and decay step * Modified tolerence in pB fusion test * Test one - abs. tol. in min energy of alpha2 and alpha3 is 20 keV * Test two - abs. tol. in min energy of alpha2 and alpha3 is 200 keV * Update checksum for tests * Updated alpha particle energy checks * Revert max/min energy check test In `check_initial_energy2` the max and min sim. values are above and below theoretical calculations. Tests now check variation is within an absolute tolerance. Note: Total energy is still conserved. * Increased atol for check_initial_energy2 * Changed max alpha particle energy check Now the maximum alpha particle energy from simulation is compared to the analytical value using relative tolerance, not abs tolerance. * Fixed type
1 parent 13fa090 commit 4b04701

File tree

4 files changed

+192
-182
lines changed

4 files changed

+192
-182
lines changed

Examples/Tests/nuclear_fusion/analysis_proton_boron_fusion.py

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868
m_p = 1.00782503223*scc.m_u # Proton mass
6969
m_b = 11.00930536*scc.m_u # Boron 11 mass
7070
m_reduced = m_p*m_b/(m_p+m_b)
71-
m_a = 4.00260325413*scc.m_u # Alpha mass
72-
m_be = 7.94748*scc.m_p # Beryllium 8 mass
71+
m_a = 4.00260325413*scc.m_u # Alpha (He4) mass
72+
m_be = (8.0053095729+0.00325283863)*scc.m_u # Be8* mass (3.03 MeV ex. state)
7373
Z_boron = 5.
7474
Z_proton = 1.
7575
E_Gamow = (Z_boron*Z_proton*np.pi*scc.fine_structure)**2*2.*m_reduced*scc.c**2
7676
E_Gamow_MeV = E_Gamow/MeV_to_Joule
7777
E_Gamow_keV = E_Gamow/keV_to_Joule
78-
E_fusion = 8.59009*MeV_to_Joule # Energy released during p + B -> alpha + Be
79-
E_decay = 0.0918984*MeV_to_Joule # Energy released during Be -> 2*alpha
78+
E_fusion = 5.55610759*MeV_to_Joule # Energy released during p + B -> alpha + Be*
79+
E_decay = 3.12600414*MeV_to_Joule # Energy released during Be* -> 2*alpha
8080
E_fusion_total = E_fusion + E_decay # Energy released during p + B -> 3*alpha
8181

8282
## Checks whether this is the 2D or the 3D test
@@ -493,10 +493,13 @@ def check_initial_energy1(data, E_com):
493493
energy_alpha3_simulation = energy_alpha_slice[4::6]
494494

495495
assert(np.all(is_close(energy_alpha1_simulation, energy_alpha1_theory, rtol=5.e-8)))
496-
assert(is_close(np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=1.e-2))
497-
assert(is_close(np.amin(energy_alpha2_simulation), min_energy_alpha23, rtol=1.e-2))
498-
assert(is_close(np.amax(energy_alpha3_simulation), max_energy_alpha23, rtol=1.e-2))
499-
assert(is_close(np.amin(energy_alpha3_simulation), min_energy_alpha23, rtol=1.e-2))
496+
## Check that the max / min value are comparable to the analytical value
497+
## The minimum value is checked to be within 20 keV of the analytical value
498+
## The maximum value is checked to be within 1% of the analytical value
499+
assert(is_close(np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=1.e-2 ))
500+
assert(is_close(np.amin(energy_alpha2_simulation), min_energy_alpha23, atol=3.218e-15 ))
501+
assert(is_close(np.amax(energy_alpha3_simulation), max_energy_alpha23, rtol=1.e-2 ))
502+
assert(is_close(np.amin(energy_alpha3_simulation), min_energy_alpha23, atol=3.218e-15 ))
500503

501504
def check_initial_energy2(data):
502505
## In WarpX, the initial momentum of the alphas is computed assuming that the fusion process
@@ -578,13 +581,16 @@ def check_initial_energy2(data):
578581

579582
assert(is_close(np.amax(energy_alpha1_simulation), max_energy_alpha1, rtol=1.e-2))
580583
assert(is_close(np.amin(energy_alpha1_simulation), min_energy_alpha1, rtol=1.e-2))
581-
## Tolerance is quite high below because we don't have a lot of alphas to produce good
584+
## Check that the max / min value are comparable to the analytical value
585+
## The minimum value is checked to be within 200 keV of the analytical value
586+
## The maximum value is checked to be within 5% of the analytical value
587+
## Tolerance is quite high because we don't have a lot of alphas to produce good
582588
## statistics and an event like alpha1 emitted exactly in direction of proton & alpha2
583589
## emitted exactly in direction opposite to Beryllium is somewhat rare.
584-
assert(is_close(np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=2.5e-1))
585-
assert(is_close(np.amin(energy_alpha2_simulation), min_energy_alpha23, rtol=2.5e-1))
586-
assert(is_close(np.amax(energy_alpha3_simulation), max_energy_alpha23, rtol=2.5e-1))
587-
assert(is_close(np.amin(energy_alpha3_simulation), min_energy_alpha23, rtol=2.5e-1))
590+
assert(is_close(np.amax(energy_alpha2_simulation), max_energy_alpha23, rtol=5e-2 ))
591+
assert(is_close(np.amin(energy_alpha2_simulation), min_energy_alpha23, atol=3.218e-14 ))
592+
assert(is_close(np.amax(energy_alpha3_simulation), max_energy_alpha23, rtol=5e-2 ))
593+
assert(is_close(np.amin(energy_alpha3_simulation), min_energy_alpha23, atol=3.218e-14 ))
588594

589595
def check_xy_isotropy(data):
590596
## Checks that the alpha particles are emitted isotropically in x and y

Regression/Checksum/benchmarks_json/Proton_Boron_Fusion_2D.json

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,6 @@
22
"lev=0": {
33
"rho": 0.0
44
},
5-
"alpha2": {
6-
"particle_momentum_x": 4.057984510682467e-15,
7-
"particle_momentum_y": 4.104188139725855e-15,
8-
"particle_momentum_z": 4.17858000090827e-15,
9-
"particle_position_x": 408793.7905852193,
10-
"particle_position_y": 861780.8020495367,
11-
"particle_weight": 5.078061191951185e+18
12-
},
13-
"alpha3": {
14-
"particle_momentum_x": 5.017656304003558e-16,
15-
"particle_momentum_y": 4.935595075276182e-16,
16-
"particle_momentum_z": 4.867133212376827e-16,
17-
"particle_position_x": 52678.192400911765,
18-
"particle_position_y": 105483.59950020742,
19-
"particle_weight": 1.5413633830148085e+27
20-
},
215
"boron1": {
226
"particle_momentum_x": 0.0,
237
"particle_momentum_y": 0.0,
@@ -26,6 +10,22 @@
2610
"particle_position_y": 81921136.14476715,
2711
"particle_weight": 128.00000000000261
2812
},
13+
"boron3": {
14+
"particle_momentum_x": 9.277692671587846e-15,
15+
"particle_momentum_y": 9.268409636965691e-15,
16+
"particle_momentum_z": 9.279446607709548e-15,
17+
"particle_position_x": 4096178.1664224654,
18+
"particle_position_y": 8192499.7060386725,
19+
"particle_weight": 6.399486212205656e+30
20+
},
21+
"alpha5": {
22+
"particle_momentum_x": 2.3827075626988002e-14,
23+
"particle_momentum_y": 2.388035811027714e-14,
24+
"particle_momentum_z": 2.4040151761604078e-14,
25+
"particle_position_x": 2457556.8571638423,
26+
"particle_position_y": 4914659.635379322,
27+
"particle_weight": 3.839999999999998e-19
28+
},
2929
"boron2": {
3030
"particle_momentum_x": 0.0,
3131
"particle_momentum_y": 0.0,
@@ -34,53 +34,37 @@
3434
"particle_position_y": 819270.9858143466,
3535
"particle_weight": 1.2799999998307316e+28
3636
},
37-
"boron5": {
38-
"particle_momentum_x": 0.0,
39-
"particle_momentum_y": 0.0,
40-
"particle_momentum_z": 0.0,
41-
"particle_position_x": 409547.3312927569,
42-
"particle_position_y": 819118.5558814355,
43-
"particle_weight": 127.99999999999999
44-
},
4537
"alpha1": {
46-
"particle_momentum_x": 4.691909092431811e-15,
47-
"particle_momentum_y": 4.6836958163275755e-15,
48-
"particle_momentum_z": 4.657203546376977e-15,
38+
"particle_momentum_x": 4.758865177822356e-15,
39+
"particle_momentum_y": 4.7625215232714745e-15,
40+
"particle_momentum_z": 4.734412976565431e-15,
4941
"particle_position_x": 463465.27131109464,
5042
"particle_position_y": 978207.6061359186,
5143
"particle_weight": 4.977661460251435e-28
5244
},
53-
"proton2": {
54-
"particle_momentum_x": 0.0,
55-
"particle_momentum_y": 0.0,
56-
"particle_momentum_z": 2.3723248133690294e-14,
57-
"particle_position_x": 4095630.6981353555,
58-
"particle_position_y": 8192073.551798361,
59-
"particle_weight": 1.2885512788807322e+28
60-
},
61-
"proton1": {
45+
"proton5": {
6246
"particle_momentum_x": 0.0,
6347
"particle_momentum_y": 0.0,
64-
"particle_momentum_z": 2.524872467113344e-13,
65-
"particle_position_x": 40960140.72983792,
66-
"particle_position_y": 81919772.69310114,
67-
"particle_weight": 128.00000000000261
48+
"particle_momentum_z": 1.7586062624930794e-15,
49+
"particle_position_x": 409638.2877618571,
50+
"particle_position_y": 819101.3225783394,
51+
"particle_weight": 1.2800000000000004e+37
6852
},
69-
"alpha5": {
70-
"particle_momentum_x": 2.3343485859070736e-14,
71-
"particle_momentum_y": 2.3451128753701046e-14,
72-
"particle_momentum_z": 2.3579462789062662e-14,
73-
"particle_position_x": 2457556.8571638423,
74-
"particle_position_y": 4914659.635379322,
75-
"particle_weight": 3.839999999999998e-19
53+
"proton3": {
54+
"particle_momentum_x": 1.6847290893972251e-15,
55+
"particle_momentum_y": 1.6827074502304075e-15,
56+
"particle_momentum_z": 1.6802489646490975e-15,
57+
"particle_position_x": 2457270.6999197667,
58+
"particle_position_y": 4914315.665267942,
59+
"particle_weight": 1.279486212205663e+30
7660
},
77-
"boron3": {
78-
"particle_momentum_x": 9.277692671587846e-15,
79-
"particle_momentum_y": 9.268409636965691e-15,
80-
"particle_momentum_z": 9.279446607709548e-15,
81-
"particle_position_x": 4096178.1664224654,
82-
"particle_position_y": 8192499.7060386725,
83-
"particle_weight": 6.399486212205656e+30
61+
"alpha2": {
62+
"particle_momentum_x": 4.140109871048478e-15,
63+
"particle_momentum_y": 4.159837925039718e-15,
64+
"particle_momentum_z": 4.251680389225861e-15,
65+
"particle_position_x": 408793.7905852193,
66+
"particle_position_y": 861780.8020495367,
67+
"particle_weight": 5.078061191951185e+18
8468
},
8569
"proton4": {
8670
"particle_momentum_x": 0.0,
@@ -90,28 +74,44 @@
9074
"particle_position_y": 819198.7077771134,
9175
"particle_weight": 1.2800000000000004e+37
9276
},
93-
"proton3": {
94-
"particle_momentum_x": 1.6847290893972251e-15,
95-
"particle_momentum_y": 1.6827074502304075e-15,
96-
"particle_momentum_z": 1.6802489646490975e-15,
97-
"particle_position_x": 2457270.6999197667,
98-
"particle_position_y": 4914315.665267942,
99-
"particle_weight": 1.279486212205663e+30
77+
"proton1": {
78+
"particle_momentum_x": 0.0,
79+
"particle_momentum_y": 0.0,
80+
"particle_momentum_z": 2.524872467113344e-13,
81+
"particle_position_x": 40960140.72983792,
82+
"particle_position_y": 81919772.69310114,
83+
"particle_weight": 128.00000000000261
84+
},
85+
"boron5": {
86+
"particle_momentum_x": 0.0,
87+
"particle_momentum_y": 0.0,
88+
"particle_momentum_z": 0.0,
89+
"particle_position_x": 409547.3312927569,
90+
"particle_position_y": 819118.5558814355,
91+
"particle_weight": 127.99999999999999
10092
},
10193
"alpha4": {
102-
"particle_momentum_x": 2.338084461204216e-14,
103-
"particle_momentum_y": 2.3436156778849828e-14,
104-
"particle_momentum_z": 2.35535708386288e-14,
94+
"particle_momentum_x": 2.3854178157605226e-14,
95+
"particle_momentum_y": 2.3882457581100904e-14,
96+
"particle_momentum_z": 2.403451456378969e-14,
10597
"particle_position_x": 2457367.4582781536,
10698
"particle_position_y": 4915112.044373056,
10799
"particle_weight": 384.0000000000002
108100
},
109-
"proton5": {
101+
"proton2": {
110102
"particle_momentum_x": 0.0,
111103
"particle_momentum_y": 0.0,
112-
"particle_momentum_z": 1.7586062624930794e-15,
113-
"particle_position_x": 409638.2877618571,
114-
"particle_position_y": 819101.3225783394,
115-
"particle_weight": 1.2800000000000004e+37
104+
"particle_momentum_z": 2.3723248133690294e-14,
105+
"particle_position_x": 4095630.6981353555,
106+
"particle_position_y": 8192073.551798361,
107+
"particle_weight": 1.2885512788807322e+28
108+
},
109+
"alpha3": {
110+
"particle_momentum_x": 5.079136896829917e-16,
111+
"particle_momentum_y": 5.075922501147803e-16,
112+
"particle_momentum_z": 4.962151258214859e-16,
113+
"particle_position_x": 52678.192400911765,
114+
"particle_position_y": 105483.59950020742,
115+
"particle_weight": 1.5413633830148085e+27
116116
}
117117
}

0 commit comments

Comments
 (0)