Computing/plotting Bosch-Hale Volumetric Reaction Rates

name: BH_ReactionRates.ipynb
date: 11 Jan 14
auth: Zach Hartwig hartwig@psfc.mit.edu

This IPython notebook plots the Bosch-Hale volumetric reaction rate parameterizations found in H.-S. and G.M. Hale, Nuclear Fusion 32 (1992) p611. Reaction energies are in [keV]; cross sections are in [m$^2$]. The B-H parameterizations have been computed for four reactions: $\mathrm{^{2}H(d,n)^{3}He}$; $\mathrm{^{2}H(d,p)^{3}H}$; $\mathrm{^{3}H(d,n)^{4}He}$; and $\mathrm{^{3}He(d,p)^{4}He}$. Each of these reactions is treated here.

The final figure produced is used in Chapter 9 of the MFE Formulary. Additionally, the code used in this notebook can easily be extended or adapted for your own calculations since the B-H coefficients and parameters are alreadyentered correctly.


In [2]:
import numpy as np
import matplotlib.pyplot  as plt

In [3]:
# Assign indices for each of the four reactions
i_2Hdn  = 0 #  2H(d,n)3He "D-D"
i_2Hdp  = 1 #  2H(d,p)3H  "D-D"
i_3Hdn  = 2 #  3H(d,n)4He "D-T"
i_3Hedp = 3 # 3He(d,p)4He "D-He3"
reactions = (i_2Hdn, i_2Hdp, i_3Hdn, i_3Hedp)

# Assign numerial values for all the B-H parameters. Notation 
# ("A","B","B_G") corresponds exactly as found in the original
# B-H reference for clarity.

# Allocate the Bosch-Hale coefficients for each fusion reaction
B_G_2Hdn  = 31.3970
B_G_2Hdp  = 31.3970
B_G_3Hdn  = 34.3827
B_G_3Hedp = 68.7508
B_G = (B_G_2Hdn, B_G_2Hdp, B_G_3Hdn, B_G_3Hedp)

muc2_2Hdn  = 937814
muc2_2Hdp  = 937814
muc2_3Hdn  = 1124656
muc2_3Hedp = 1124572
muc2 = (muc2_2Hdn, muc2_2Hdp, muc2_3Hdn, muc2_3Hedp)

#                    C_1          C_2          C_3          C_4          C_5          C_6         C_7
C_2Hdn  = np.array([5.43360e-12, 5.85778e-3,  7.68222e-3,  0.0       , -2.96400e-6,  0.0       , 0.0])
C_2Hdp  = np.array([5.65718e-12, 3.41267e-3,  1.99167e-3,  0.0       ,  1.05060e-5,  0.0       , 0.0])
C_3Hdn  = np.array([1.17302e-9 , 1.51361e-2,  7.51886e-2,  4.60643e-3,  1.35000e-2, -1.06750e-4, 1.36600e-5])
C_3Hedp = np.array([5.51036e-10, 6.41918e-3, -2.02896e-3, -1.91080e-5,  1.35776e-4,  0.0       ,  0.0])
C = (C_2Hdn, C_2Hdp, C_3Hdn, C_3Hedp)

# Assign temperature ranges for each reaction [E_min, E_max] [keV]
Tmp_2Hdn = np.array([0.5, 4900]) # 
Tmp_2Hdp = np.array([0.5, 5000])
Tmp_3Hdn = np.array([0.5, 550])
Tmp_3Hedp = np.array([0.3, 900])
Tmp = (Tmp_2Hdn, Tmp_2Hdp, Tmp_3Hdn, Tmp_3Hedp)

In [4]:
# Compute the B-H volumetric reaction rates. The rates  will be arrays
# corresponding to rate [1 / m3 / s] as functions of temperature [keV]

# List to hold the reaction rate arrays for each reaction
sigma_v = []

# Iterate over each of the four reactions
for r in reactions:
    T = np.logspace(-1, 2, 200) # [keV]
    #T = np.arange(1,20,1.0)

    theta_p0 = T * (C[r][1] + T * (C[r][3] + T * C[r][5]))
    theta_p1 = 1 + T * (C[r][2] + T * (C[r][4] + T * C[r][6]))
    theta = T /  (1 - theta_p0 / theta_p1)

    xi = (B_G[r]**2 / 4 / theta)**(1.0 / 3)

    sv_p0 = sqrt(xi / (muc2[r] * T**3))
    sv_p1 = exp(-3 * xi)

    sv = C[r][0] * theta * sv_p0 * sv_p1 # [cm^-3 s^-1]

    # Transform units from [cm^-3 s^-1] to [m^-3 s^-1]
    cm3_2_m3 = 1e-6
    sv = sv * cm3_2_m3 # [cm^-3 s^-1]

    # Append this reaction cross section to container
    sigma_v.append(sv) # [m2]

In [5]:
# Draw all four reaction rates on the same log-log plot over
# reasonably useful temperature ranges

fig, ax = plt.subplots()

plt.hold(True)
ax.loglog(T, sigma_v[0], '-bo', linewidth=2, markersize=14, markevery=30, label='$\mathrm{^2\!H(d,n)^3\!He}$')
ax.loglog(T, sigma_v[1], '-k^', linewidth=2, markersize=12, markevery=30, label='$\mathrm{^2\!H(d,p)^3\!H}$')
ax.loglog(T, sigma_v[2], '-rs', linewidth=2, markersize=11, markevery=30, label='$\mathrm{^3\!H(d,n)^4\!He}$')
ax.loglog(T, sigma_v[3], '-g*', linewidth=2, markersize=15, markevery=30, label= '$\mathrm{^3\!He(d,p)^4\!He}$')
ax.hold(False)

ax.legend(loc='lower right', fontsize=24, numpoints=1)

font = {'family' : 'sans-serif',
        'style'  : 'normal',
        'weight' : 'normal',
        'size'   : 28}
matplotlib.rc('font', **font)

ax.grid(axis='both')
plt.title('Bosch-Hale Volumetric Reaction Rates', fontsize=24)
plt.xlabel('Temperature [keV]')
ax.xaxis.set_tick_params(which='major', width=1, length=10)
ax.xaxis.set_tick_params(which='minor', width=1, length=5)
ax.yaxis.set_tick_params(which='major', width=1, length=10)
ax.yaxis.set_tick_params(which='minor', width=1, length=5)

plt.ylabel('Volumetric reaction rate [ m$^{-3}$ s$^{-1}$]')
plt.yticks([1e-32, 1e-30, 1e-28, 1e-26, 1e-24, 1e-22, 1e-20])

pylab.xlim([0.3, 100])
pylab.ylim([1e-32,1e-20])

gcf().subplots_adjust(top=0.92, bottom=0.2, left=0.2, right=0.95)

fig.set_size_inches(10,8)

plt.show()


/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXGeneral'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1246: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=28.0. Returning /usr/share/fonts/lyx/cmr10.ttf
  UserWarning)
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXSizeOneSym'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1246: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=bold:stretch=normal:size=28.0. Returning /usr/share/fonts/lyx/cmr10.ttf
  UserWarning)
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXSizeThreeSym'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXSizeFourSym'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXSizeFiveSym'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXSizeTwoSym'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1246: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=italic:variant=normal:weight=normal:stretch=normal:size=28.0. Returning /usr/share/fonts/lyx/cmr10.ttf
  UserWarning)
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['STIXNonUnicode'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))
/usr/lib/python2.7/site-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))

In [6]:
# Save the figure as a vector-graphic EPS file
fig.savefig('BH_ReactionRates.eps')

In [7]:
sigma_v[0]


Out[7]:
array([  1.65721857e-37,   2.58150585e-37,   3.99981134e-37,
         6.16461300e-37,   9.45145313e-37,   1.44159758e-36,
         2.18760112e-36,   3.30290816e-36,   4.96197393e-36,
         7.41766362e-36,   1.10346672e-35,   1.63363596e-35,
         2.40701878e-35,   3.52984598e-35,   5.15237872e-35,
         7.48615708e-35,   1.08276038e-34,   1.55901717e-34,
         2.23479230e-34,   3.18943315e-34,   4.53212627e-34,
         6.41245748e-34,   9.03446804e-34,   1.26752814e-33,
         1.77096783e-33,   2.46423793e-33,   3.41502696e-33,
         4.71373928e-33,   6.48062760e-33,   8.87500477e-33,
         1.21070923e-32,   1.64531981e-32,   2.22750805e-32,
         3.00445542e-32,   4.03746348e-32,   5.40588039e-32,
         7.21203207e-32,   9.58739148e-32,   1.27002675e-31,
         1.67653515e-31,   2.20555272e-31,   2.89164255e-31,
         3.77842981e-31,   4.92078862e-31,   6.38750831e-31,
         8.26453260e-31,   1.06588810e-30,   1.37033796e-30,
         1.75623492e-30,   2.24384198e-30,   2.85806697e-30,
         3.62943108e-30,   4.59521787e-30,   5.80083175e-30,
         7.30139896e-30,   9.16364830e-30,   1.14681134e-29,
         1.43117034e-29,   1.78106940e-29,   2.21041978e-29,
         2.73581766e-29,   3.37700679e-29,   4.15741024e-29,
         5.10473981e-29,   6.25169227e-29,   7.63674254e-29,
         9.30504468e-29,   1.13094522e-28,   1.37116705e-28,
         1.65835541e-28,   2.00085644e-28,   2.40834000e-28,
         2.89198196e-28,   3.46466691e-28,   4.14121346e-28,
         4.93862364e-28,   5.87635825e-28,   6.97664027e-28,
         8.26478801e-28,   9.76958004e-28,   1.15236540e-27,
         1.35639409e-27,   1.59321377e-27,   1.86752184e-27,
         2.18459881e-27,   2.55036790e-27,   2.97145922e-27,
         3.45527861e-27,   4.01008124e-27,   4.64505025e-27,
         5.37038034e-27,   6.19736664e-27,   7.13849875e-27,
         8.20756011e-27,   9.41973269e-27,   1.07917070e-26,
         1.23417975e-26,   1.40900633e-26,   1.60584335e-26,
         1.82708388e-26,   2.07533467e-26,   2.35343025e-26,
         2.66444740e-26,   3.01172015e-26,   3.39885505e-26,
         3.82974699e-26,   4.30859516e-26,   4.83991953e-26,
         5.42857737e-26,   6.07978023e-26,   6.79911088e-26,
         7.59254059e-26,   8.46644634e-26,   9.42762816e-26,
         1.04833265e-25,   1.16412394e-25,   1.29095396e-25,
         1.42968919e-25,   1.58124695e-25,   1.74659708e-25,
         1.92676356e-25,   2.12282609e-25,   2.33592168e-25,
         2.56724611e-25,   2.81805540e-25,   3.08966727e-25,
         3.38346242e-25,   3.70088591e-25,   4.04344832e-25,
         4.41272700e-25,   4.81036713e-25,   5.23808281e-25,
         5.69765801e-25,   6.19094748e-25,   6.71987765e-25,
         7.28644734e-25,   7.89272850e-25,   8.54086684e-25,
         9.23308242e-25,   9.97167014e-25,   1.07590002e-24,
         1.15975183e-24,   1.24897464e-24,   1.34382823e-24,
         1.44458006e-24,   1.55150521e-24,   1.66488641e-24,
         1.78501409e-24,   1.91218628e-24,   2.04670868e-24,
         2.18889460e-24,   2.33906494e-24,   2.49754815e-24,
         2.66468024e-24,   2.84080465e-24,   3.02627227e-24,
         3.22144135e-24,   3.42667741e-24,   3.64235319e-24,
         3.86884855e-24,   4.10655035e-24,   4.35585238e-24,
         4.61715516e-24,   4.89086590e-24,   5.17739823e-24,
         5.47717214e-24,   5.79061372e-24,   6.11815496e-24,
         6.46023357e-24,   6.81729269e-24,   7.18978064e-24,
         7.57815065e-24,   7.98286052e-24,   8.40437232e-24,
         8.84315201e-24,   9.29966910e-24,   9.77439621e-24,
         1.02678087e-23,   1.07803841e-23,   1.13126020e-23,
         1.18649431e-23,   1.24378890e-23,   1.30319218e-23,
         1.36475235e-23,   1.42851753e-23,   1.49453574e-23,
         1.56285485e-23,   1.63352253e-23,   1.70658620e-23,
         1.78209301e-23,   1.86008980e-23,   1.94062307e-23,
         2.02373899e-23,   2.10948336e-23,   2.19790167e-23,
         2.28903907e-23,   2.38294042e-23,   2.47965038e-23,
         2.57921348e-23,   2.68167420e-23])

In [ ]: