Dear @paulromano,
I wish to investigate the effect of applying the S(a,b) thermal scattering table for hydrogen in mesitylene to the material characteristics of mesitylene on the macroscopic (i) elastic (ii) inelastic and (ii) total cross sections.
To do this, I created the material, mesitylene, at 20K, using the openmc.Material() function. Below is the code which I used to plot the cross sections below 10eV. It did not work. It only works for the case where I did not attempt to apply the S(a,b) cross section. That plot is shown at the bottom of the e-mail. I have some questions which will help guide me while I fix this.
-
If I’ve read the documentation correctly, sab_name only applies the S(a,b) cross section to MT2, which corresponds to the elastic cross section. Is there not any way to look at the influence of S(a,b) on the total and inelastic cross sections?
-
The plot of the inelastic cross section does not appear in my plots, as you can see in my graph below. I’m not sure why this is the case. Do you have any idea why it does not appear?
-
In the documentation, it says that sab_name is only used for items which are instances of openmc.Element or openmc.Nuclide. I haven’t used either. Do I need to change how I define the compound, mesitylene?
-
I would like to compare the elastic cross sections for two different materials. How might I be able to plot the two cross sections on the same graph?
-
FYI, the line mesiTh.add_s_alpha_beta(…) generates this error on my end.
Thanks in advance for any insights, and I apologize in advance, if I’ve made any catastrophic errors.
Best wishes and happy holidays,
Dalini
import os
from pprint import pprint
import shutil
import subprocess
import urllib.request
import h5py
import os
import numpy as np
import matplotlib.pyplot as plt
import openmc.data
from matplotlib.patches import Rectangle
import matplotlib.cm
mesi = openmc.Material()
mesi.add_nuclide('H1', 4.0,'ao')
mesi.add_nuclide('C0', 3.0,'ao')
mesi.set_density('g/cm3', 0.865)
openmc.plot_xs(mesi,['total','inelastic','elastic'],temperature=20)
plt.xlim([0.0001,10])
plt.ylim([1,30])
plt.title('Cross Section for Mesitylene at 20K')
plt.show()
mesiTh = openmc.Material()
mesiTh.add_nuclide('H1', 4.0,'ao')
mesiTh.add_nuclide('C0', 3.0,'ao')
mesiTh.add_s_alpha_beta('c_H_in_Mesitylene')
mesiTh.set_density('g/cm3', 0.865)
openmc.plot_xs(mesiTh,['total','inelastic','elastic'],temperature=20,sab_name='c_H_in_Mesitylene')
plt.xlim([0.0001,10])
plt.ylim([1,30])
plt.title('Cross Section for Mesitylene at 20K (w/ S(a,b))')
plt.show()
