Hello! I’m a new openmc scholar.
I use lattiece to build 3D models, but I need to calculate the neutron flux of each lattiece universe (corresponding cell)
Like mcnp’s input card:
99999 0 -52 51 -62 61 -72 71 u=99999 lat=1 fill=0:35 0:35 0:35
…
100000 0 -53 51 -63 61 -73 71 fill=99999
…
F14:n (99999 < 99999[0:35 0:35 0:35] < 100000)
Such as:
I use lattiece to build 3D models:
#
cell1001 = openmc.Cell(cell_id=1001,fill =m6,region= -sphere100)
cell2001 = openmc.Cell(cell_id=2001,fill =m4,region= -sphere100)
cell3001 = openmc.Cell(cell_id=3001,fill =m5,region= -sphere100)
# universe
u1001 = openmc.Universe()
u1001.add_cell(cell1001)
u2001 = openmc.Universe()
u2001.add_cell(cell2001)
u3001 = openmc.Universe()
u3001.add_cell(cell3001)
# 36*36*36
target_shape=(36,36,36)
array_water = np.zeros(target_shape, dtype=object)
array_water = np.transpose(array_water , (2, 1, 0))
array_water[:] = u2001
array_water[0,:,:] = u1001
array_water[:,0,:] = u2001
array_water[...,0] = u3001
lat3d = openmc.RectLattice(name='Head univ') #
lat3d.pitch = (space_x, space_y, space_z)
lat3d.lower_left = (-5, -5, 3.5)
lat3d.universes=array_water
thanks very much !
I use CellInstanceFilter to do that:
cell_instances = ([lat3d])
cell_instances = [(lat3d, i) for i in range(0, 36*36*36, 1)]
cellinst_filter = openmc.CellInstanceFilter(cell_instances,filter_id =1)
particle_filter = openmc.ParticleFilter(['neutron'])
energy_filter = openmc.EnergyFilter([ 0, 0.5,10E+03,10E+06])
# Instantiate flux tally Filter
flux_cell_tally = openmc.Tally(name="neutron_flux_on_mesh")
multiplier = openmc.EnergyFunctionFilter([0.0, 2e7], [1/C100, 1/C100])
flux_cell_tally.filters = [cellinst_filter, particle_filter,energy_filter,multiplier]
f
![image|690x278](upload://buTecpFhH9jvaTlEiDHoM9fAOIx.png)
lux_cell_tally.scores = ['flux']
But
What am I supposed to do?