# How would I create a cylindrical source

**URL:** https://openmc.discourse.group/t/how-would-i-create-a-cylindrical-source/2713
**Category:** User Support
**Created:** [February 11, 2023, 3:33pm UTC](https://openmc.discourse.group/t/how-would-i-create-a-cylindrical-source/2713 "2023-02-11T15:33:40Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![srichr221](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/srichr221/32/2360_2.png) [@srichr221](https://openmc.discourse.group/u/srichr221)
#### Post date: [February 24, 2023, 5:38pm UTC](https://openmc.discourse.group/t/how-would-i-create-a-cylindrical-source/2713/3 "2023-02-24T17:38:37Z")

</div>

Thanks very much. sorry I didn’t reply sooner.  
Got it working (I think) with:

#initialises a new source object  
source = openmc.Source()  
radius=1.0  
pi=3.14159265359

r = openmc.stats.PowerLaw(0.0, radius, 1.0)  
phi = openmc.stats.Uniform(0.0, 2\*pi)  
z = openmc.stats.Uniform(a=0.0, b=5.0)  
spatial\_dist = openmc.stats.CylindricalIndependent(r, phi, z)

source.angle = openmc.stats.Isotropic()  
source.energy = openmc.stats.Discrete([14.08e6], [1.0])  
source.space=spatial\_dist

I adapted this from the example you gave.

---

_[View the full topic](https://openmc.discourse.group/t/how-would-i-create-a-cylindrical-source/2713)._
