Problem in tally the radial power distributions of some repetitive cells in an SMR core

hello,
I need to calculate the radial power distribution of some hexagonal repeating cells in an SMR core. Here is my idea: Use a larger mesh to wrap the entire fuel area to calculate the radial power distribution, and meanwhile use cellFilter to limit the tally on a specific cell.
The preliminary code is as follows, but run failed.

heatpipe_fuel_cell_list = [l300(0,0), l300(1,0)]  # u0->c201->u5->c90->l300(1,0)->u1->c4
tally_mesh_heat_z_list = []

for i in range(len(heatpipe_fuel_cell_list)):
    # Instantiate a tally Mesh -HEAT
    mesh_heat_z = openmc.RegularMesh(mesh_id=51)
    mesh_heat_z.dimension = [1, 1, 10]
    mesh_heat_z.lower_left =  [0, -6, 0]
    mesh_heat_z.upper_right = [12, 6, 20] 
    # Instantiate tally Filter
    mesh_filter_z = openmc.MeshFilter(mesh_heat_z)
    mesh_cell_filter = openmc.CellFilter(heatpipe_fuel_cell_list[i])
    # Instantiate the Tally
    tally_mesh_heat_z[i] = openmc.Tally(name='tally_mesh_heat_z')
    tally_mesh_heat_z[i].filters = [mesh_cell_filter, mesh_filter_z]
    tally_mesh_heat_z[i].scores = ['fission-q-recoverable']
    tally_mesh_heat_z[i].append(tally_mesh_heat_z_list)

and

tallies = openmc.Tallies([tally_heat_deposited, tally_distribcell, tally_mesh_heat_z_list])
tallies.export_to_xml()

It gives “NameError: name ‘l300’ is not defined”, while (l300 (0,0) is the cell ID obtained from the tallies.out file by DistribCellFilter. I want to know whether this method works and how to correct it.

That error is a basic error from Python telling you that you don’t have a variable named l300 that is defined at the time you tried to use it. That is, you need to have some line above there like

l300 = ...