However applying cell constraint raise 95% rejection error and source is not plotted.
In settings, cell constarints are included.
Source can be plotted only when above constraint option is switched off.
On the other hand Problem runs with constraints by commenting above plotting.
Additionally how to make fixed source photon
distribution in repeated structure like pins in lattice.
I have had constraints fail like this before, with my case it was the fissionable constraint, even when the box was covering my entire fissionable core. I think OpenMC uses it as a method of rejecting a source site after one has already been chosen randomly, so if there are too many source sites possible outside of your constraint and 95% of your sites are rejected it’ll give you this warning. I would suggest trying to limit it directly to the shape of the cell, or as close as possible, and not having the constraint. As for the fixed source photon distribution in repeated structures I would use the python api to construct multiple cells at once, similar to how I do it here for different fuel materials here,
#Making Fuel cells
for i, code in enumerate(fuel_array):
exec(f"fuel_cell_{code} = openmc.Cell(fill=Fuel_{code}, region=-surf_fuel & +back_surf_fuel & -front_surf_fuel)")
exec(f"fuel_cell_{code}.temperature = fuel_temp")
# Create clad side cell for each material
exec(f"clad_side_cell_{code} = openmc.Cell(fill=Sheath, region= +surf_fuel & -clad_outside_surface & +back_surf_fuel & -front_surf_fuel)")
exec(f"clad_side_cell_{code}.temperature = clad_temp")
# Create clad back cell for each material
exec(f"clad_back_cell_{code} = openmc.Cell(fill=Sheath, region=-clad_outside_surface & -back_surf_fuel & +back_surf_clad)")
exec(f"clad_back_cell_{code}.temperature = clad_temp")
# Create clad front cell for each material
exec(f"clad_front_cell_{code} = openmc.Cell(fill=Sheath, region=-clad_outside_surface & +front_surf_fuel & -front_surf_clad)")
exec(f"clad_front_cell_{code}.temperature = clad_temp")
exec(f"coolant_cell_inner_{code} = openmc.Cell(fill=Coolant, region=-coolant_inner_surf & +back_surf_clad & -front_surf_clad)")
exec(f"coolant_cell_inner_{code}.temperature = coolant_temp")
exec(f"coolant_cell_outer_{code} = openmc.Cell(fill=Coolant, region=+coolant_inner_surf & -pt_inner & +back_surf_clad & -front_surf_clad)")
exec(f"coolant_cell_outer_{code}.temperature = coolant_temp")
exec(f"bundle_universe_{code} = openmc.Universe(cells=(coolant_cell_inner_{code}, coolant_cell_outer_{code}))")
exec(f"pin_universe_{code} = openmc.Universe(cells=(fuel_cell_{code}, clad_side_cell_{code}, clad_back_cell_{code}, clad_front_cell_{code}))")
But instead within your source definition, have it create individual source names using codes within an array similar to how I made cell names, and have the properties that are different between them assigned using the same code. Since you have everything in a lattice, you could make the location of the source calculated using your pitch as well to speed things up.