<jupyter_start><jupyter_text>Tallies<jupyter_code># get flux energy spectrum in the fuel

# filter for the fuel cell
cell_filter = openmc.CellFilter(fuel_cell)

# set up energy bins
N = 1001
energy_bins = np.logspace(-3,7,num=N)
energy_filter = openmc.EnergyFilter(values=energy_bins)

# establish flux tally
flux = openmc.Tally(name='flux')
flux.scores = ['flux']
flux.filters = [cell_filter,energy_filter]

tallies = openmc.Tallies([flux])

tallies.export_to_xml()



settings = openmc.Settings();
settings.run_mode = 'eigenvalue';
settings.particles = 10000;
settings.batches = 100;
settings.inactive = 25

box = openmc.stats.Box(lower_left = (-r_fuel,-r_fuel,-h_fuel/2.),
                      upper_right = (r_fuel,r_fuel,h_fuel/2.),
                      only_fissionable=True);
src = openmc.Source(space=box);

settings.source = src;

#settings.temperature['method']='interpolation';

settings.export_to_xml();
root_univ.plot(width=(pitch,pitch));
openmc.run();
sp = openmc.StatePoint('statepoint.100.h5')
sp.tallies
flux_t = sp.get_tally(name='flux')
flux_df = flux_t.get_pandas_dataframe()
flux_vals = flux_df['mean'].to_numpy()

energy_x = 0.5*(energy_bins[0:-1]+energy_bins[1:])

plt.loglog(energy_x,flux_vals)
plt.grid()
plt.xlabel('Energy [eV]')
plt.ylabel('flux [n/cm**2-s]')
#operator = openmc.deplete.Operator(geometry,settings,"chain_casl_pwr.xml");
operator = openmc.deplete.Operator(geometry,settings,"chain_endfb71_pwr.xml");


power = 1e4;
days = 24*3600;
time_steps = [0.1*days,0.1*days,0.3*days,0.5*days,1.*days,30.*days,30.*days,100.*days, 360.*days, 360.*days, 360.*days,360.*days,720.*days,720.*days];
integrator = openmc.deplete.PredictorIntegrator(operator,time_steps,power=power);
integrator.integrate()
results = openmc.deplete.ResultsList.from_hdf5('./depletion_results.h5')
time,k = results.get_eigenvalue()
time /= (24*60*60);
from matplotlib import pyplot
pyplot.errorbar(time,k[:,0],yerr=k[:,1]);
pyplot.title('Burnup Result for Pincell')
pyplot.xlabel('Time [d]');
pyplot.ylabel('$k_{eff} \pm \sigma$');
pyplot.grid()
chain = openmc.deplete.Chain.from_xml("chain_endfb71_pwr.xml")
chain.nuclide_dict
time, xe135 = results.get_atoms("1","Xe135")
pyplot.plot(time,xe135,label="Xe135")
pyplot.xlabel("Time [d]")
pyplot.ylabel("Number of atoms - Xe135")
time, cs137 = results.get_atoms("1","Cs137")
pyplot.plot(time,cs137,label="Cs137");
pyplot.xlabel("Time [d]");
pyplot.ylabel("Number of atoms - Cs137");<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17423014586709887, 'fraction_numerical': 0.04700162074554295, 'mean_word_length': 6.370149253731343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '44565', 'license': 'MIT', 'n_tokens_mistral': 1066, 'n_tokens_neox': 956, 'n_words': 138, 'path': 'examples/finite_pincell_fast/.ipynb_checkpoints/finite_pincell-checkpoint.ipynb', 'repo_name': 'stu314159/er362_omc', 'size': '2468'}