# Gamma source-dose rate

**URL:** <https://openmc.discourse.group/t/gamma-source-dose-rate/1758>\
**Category:** User Support\
**Created:** [March 4, 2022, 2:46pm UTC](https://openmc.discourse.group/t/gamma-source-dose-rate/1758 "2022-03-04T14:46:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gk61](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/gk61/32/1672_2.png) [@gk61](https://openmc.discourse.group/u/gk61)\
**Post date:** [March 4, 2022, 2:46pm UTC](https://openmc.discourse.group/t/gamma-source-dose-rate/1758/1 "2022-03-04T14:46:21Z")

</div>

I have a rectangular prism shaped detector like this (Radiation detection moduleC12137). I made a design like this, I’m not sure about its accuracy. Then I want to calculate the distance dependent dose by putting the source at different distances. I couldn’t find an example like this can you help me?

import numpy as np  
import matplotlib.pyplot as plt  
import openmc  
import pandas as pd  
import os

cesium\_iodide = openmc.Material()  
cesium\_iodide.add\_element(‘Cs’, 1)  
cesium\_iodide.add\_element(‘I’, 1)  
cesium\_iodide.set\_density(‘g/cm3’, 4.51)  
materials = openmc.Materials([cesium\_iodide])  
materials.cross\_section=‘C:/Users/Gokcenur/endfb71\_hdf5/cross\_sections.xml’  
materials.export\_to\_xml()  
materials = openmc.Materials()  
materials +=[cesium\_iodide]  
isinstance(materials, list)

xmin=openmc.XPlane(x0=11,boundary\_type=“periodic”)

xmax = openmc.XPlane(x0=-11,boundary\_type=“periodic”)

ymin = openmc.YPlane(y0=5,boundary\_type=“periodic”)

ymax = openmc.YPlane (y0=-5,boundary\_type=“periodic”)  
xmax.periodic\_surface = xmin  
ymin.periodic\_surface = ymax

zmin = openmc.ZPlane(z0=2,boundary\_type=“periodic”)

zmax = openmc.ZPlane(z0=-2,boundary\_type=“periodic”)  
zmax.periodic\_surface=zmin  
mats = openmc.Materials((cesium\_iodide,))  
region = +xmax &- xmin & +ymax &-ymin & +zmax &-zmin  
cube = openmc.Cell(region=region)  
cube.fill = cesium\_iodide

universe = openmc.Universe(  
cells=[cube])  
universe.plot(width = (30.0,30.0),basis = ‘xz’)

geometry = openmc.Geometry(universe)  
geometry.export\_to\_xml()  
universe = openmc.Universe(cells=[cube])

settings = openmc.Settings()  
settings.run\_mode = ‘fixed source’  
settings.source = source  
settings.batches = 6  
settings.particles = 100000  
settings.export\_to\_xml()  
number\_bins = 101  
bins\_both = np.linspace(0, 1e6, number\_bins)

tallies = openmc.Tallies()

cell\_filter = openmc.CellFilter(cube)  
energy\_filter = openmc.EnergyFilter(bins\_both)

tally = openmc.Tally(name=‘flux’)  
tally.filters = [cell\_filter, energy\_filter]  
tally.scores = [‘flux’]  
tallies.append(tally)

model = openmc.model.Model(geometry, materials, settings, tallies)

results\_filename = model.run()
