Cross-section prepration

I am a PhD student. I was using openMC to generate a cross-section library for a light water reactor pincell and wanted to generate cross-sections for different regions (fuel, clad, moderator). I used the HFP condition where the fuel temperature was 900k, clad - 600K, and moderator - 562k. Upon running the input file, it gave me an xslib.h5 file, and when I tried to read it, it gave me values on 294K, whereas I was expecting it to give me values on 900k for the fuel region. Below, I am adding my input file. I am also adding my content of .h5 file. Could anyone please help me out with this.

import openmc
import openmc.mgxs
import numpy as np

-------------------------

Materials

-------------------------

uo2 = openmc.Material(name=‘UO2’)
uo2.add_nuclide(‘U235’, 0.0491)
uo2.add_nuclide(‘U234’, 0.0005)
uo2.add_nuclide(‘U238’, 0.9504)
uo2.add_nuclide(‘O16’, 2.0)
uo2.set_density(‘g/cm3’, 10.283)
uo2.temperature=900

zircaloy = openmc.Material(name=‘Zircaloy’)
zircaloy.set_density(‘g/cm3’, 6.56)
zircaloy.add_element(‘Zr’, 98.23, percent_type=‘wo’)
zircaloy.add_element(‘Sn’, 1.45, percent_type=‘wo’)
zircaloy.add_element(‘Cr’, 0.1, percent_type=‘wo’)
zircaloy.add_element(‘Fe’, 0.21, percent_type=‘wo’)
zircaloy.add_element(‘Hf’, 0.01, percent_type=‘wo’)
zircaloy.temperature=600

water = openmc.Material(name=‘Water’)
water.set_density(‘g/cm3’, 0.7484)
water.add_element(‘H’, 2)
water.add_element(‘O’, 1)
water.add_s_alpha_beta(‘c_H_in_H2O’)
water.temperature=562

materials_file = openmc.Materials([uo2, zircaloy, water])
materials_file.cross_sections = ‘/users/rrungta7/scratch/openmc_libraries/endfb81/endfb-viii.1-hdf5/cross_sections.xml’
materials_file.export_to_xml()

-------------------------

Geometry parameters

-------------------------

pitch = 1.4427
pin_cell_box = openmc.model.RectangularPrism(width=pitch, height=pitch,boundary_type=‘reflective’)

fuel_or = openmc.ZCylinder(r=0.469550)
clad_or = openmc.ZCylinder(r=0.546400)

fuel_region = -fuel_or
clad_region = +fuel_or & -clad_or
water_region = -pin_cell_box & +clad_or

fuel_cell = openmc.Cell(fill=uo2, region=fuel_region)
clad_cell = openmc.Cell(fill=zircaloy, region=clad_region)
water_cell = openmc.Cell(fill=water, region=water_region)

fuel_pin_universe = openmc.Universe(cells=[fuel_cell, clad_cell, water_cell])

geometry = openmc.Geometry(fuel_pin_universe)
geometry.export_to_xml()

-------------------------

Source definition

-------------------------

uniform_dist = openmc.stats.Box(
[-0.72135, -0.72135, -0.72135],
[ 0.72135, 0.72135, 0.72135],
only_fissionable=True
)

-------------------------

Settings

-------------------------

settings = openmc.Settings()
settings.temperature = {‘method’: ‘interpolation’}
settings.source = openmc.IndependentSource(space=uniform_dist)
settings.batches = 200
settings.inactive = 20
settings.particles = 100000
settings.export_to_xml()

=====================================================

MULTIGROUP STRUCTURE

=====================================================

2-group example

Units: eV

xmas_bounds = openmc.mgxs.GROUP_STRUCTURES[“CASMO-70”]
fine_groups = openmc.mgxs.EnergyGroups(xmas_bounds)

coarse_groups = openmc.mgxs.EnergyGroups([
fine_groups.group_edges[0], # highest energy
0.625, # thermal cut
fine_groups.group_edges[-1] # lowest energy
])

=====================================================

CREATE INDIVIDUAL MGXS OBJECTS

=====================================================

total_xs = openmc.mgxs.TotalXS(
domain=uo2,
domain_type=‘material’,
energy_groups=fine_groups
)

absorption_xs = openmc.mgxs.AbsorptionXS(
domain=uo2,
domain_type=‘material’,
energy_groups=fine_groups
)

scatter_xs = openmc.mgxs.ScatterMatrixXS(
domain=uo2,
domain_type=‘material’,
energy_groups=fine_groups
)

nu_fission_xs = openmc.mgxs.FissionXS(
domain=uo2,
domain_type=‘material’,
energy_groups=fine_groups,
nu=True
)

fission_xs = openmc.mgxs.FissionXS(
domain=uo2,
domain_type=‘material’,
energy_groups=fine_groups
)

chi_xs = openmc.mgxs.Chi(
domain=uo2,
domain_type=‘material’,
energy_groups=fine_groups
)

=====================================================

BUILD MGXS TALLIES

=====================================================

mgxs_list = [
total_xs,
absorption_xs,
scatter_xs,
fission_xs,
nu_fission_xs,
chi_xs
]

tallies = openmc.Tallies()

for mgxs in mgxs_list:
for tally in mgxs.tallies.values():
tallies.append(tally)

tallies.export_to_xml()

openmc.run()

=====================================================

LOAD MGXS RESULTS

=====================================================

sp = openmc.StatePoint(‘statepoint.200.h5’)
for mgxs in mgxs_list:
mgxs.load_from_statepoint(sp)

-------------------------

CONDENSE TO 2 GROUPS

-------------------------

total_2g = mgxs_list[0].get_condensed_xs(coarse_groups)
abs_2g = mgxs_list[1].get_condensed_xs(coarse_groups)
scatter_2g = mgxs_list[2].get_condensed_xs(coarse_groups)
fission_2g = mgxs_list[3].get_condensed_xs(coarse_groups)
nu_fiss_2g = mgxs_list[4].get_condensed_xs(coarse_groups)
chi_2g = mgxs_list[5].get_condensed_xs(coarse_groups)

=========================================================

PRINT RESULTS

=========================================================

print(“\nTOTAL XS (2-group)”)
print(total_2g.get_xs())

print(“\nABSORPTION XS (2-group)”)
print(abs_2g.get_xs())

print(“\nSCATTER MATRIX (2-group)”)
print(scatter_2g.get_xs())

print(“\nFISSION XS (2-group)”)
print(fission_2g.get_xs())

print(“\nNU-FISSION XS (2-group)”)
print(nu_fiss_2g.get_xs())

print(“\nCHI (2-group)”)
print(chi_2g.get_xs())

=====================================================

XSdata CONSTRUCTION (SYSTEM CODE STEP)

=====================================================

xs_uo2 = openmc.XSdata(‘uo2’, coarse_groups)
xs_uo2.order = 0

xs_uo2.set_total(total_2g.get_xs())
xs_uo2.set_absorption(abs_2g.get_xs())
scatter = np.asarray(scatter_2g.get_xs())[…, None]
xs_uo2.set_scatter_matrix(scatter)
xs_uo2.set_fission(fission_2g.get_xs())
xs_uo2.set_nu_fission(nu_fiss_2g.get_xs())
xs_uo2.set_chi(chi_2g.get_xs())

print(xs_uo2.total)
print(xs_uo2.absorption)
print(xs_uo2.fission)
print(xs_uo2.nu_fission)
print(xs_uo2.chi)
print(xs_uo2.scatter_matrix)

-------------------------

Create library

-------------------------

mgxs_lib = openmc.MGXSLibrary(coarse_groups)
mgxs_lib.add_xsdata(xs_uo2)

mgxs_lib.domains = [uo2]
mgxs_lib.domain_type = ‘material’
mgxs_lib.temperatures = [900.0]

-------------------------

Export

-------------------------

mgxs_lib.export_to_hdf5(‘mgxs_library.h5’)

uo2 <class ‘h5py._hl.group.Group’>
uo2/294K <class ‘h5py._hl.group.Group’>
uo2/294K/absorption <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/chi <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/fission <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/nu-fission <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/scatter_data <class ‘h5py._hl.group.Group’>
uo2/294K/scatter_data/g_max <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/scatter_data/g_min <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/scatter_data/scatter_matrix <class ‘h5py._hl.dataset.Dataset’>
uo2/294K/total <class ‘h5py._hl.dataset.Dataset’>
uo2/kTs <class ‘h5py._hl.group.Group’>
uo2/kTs/294K <class ‘h5py._hl.dataset.Dataset’>

In the output of .h5 file you can see it gives me 294K.