# Question about how to use source

**URL:** <https://openmc.discourse.group/t/question-about-how-to-use-source/177>\
**Category:** User Support\
**Created:** [November 3, 2015, 2:51pm UTC](https://openmc.discourse.group/t/question-about-how-to-use-source/177 "2015-11-03T14:51:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 3, 2015, 2:51pm UTC](https://openmc.discourse.group/t/question-about-how-to-use-source/177/1 "2015-11-03T14:51:04Z")

</div>

I’m unfortunately not familiar with the neutron tally files from FLUKA, so it’s difficult for me to give specific advice on this issue. Are you suggesting that you want a source of different intensity in each of the cylindrical sub-volumes? If you could be more specific with what you’re trying to do, perhaps I can advise further.

Beyond the rudimentary source options (source uniformly distributed in a box, point source), there is also an option to use a source file which contains the positions, directions, and energies of source sites. However, normally this file is generated directly from an OpenMC run. It would be possible to have a script create a source file though.

Best,  
Paul

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 3, 2015, 3:56pm UTC](https://openmc.discourse.group/t/question-about-how-to-use-source/177/2 "2015-11-03T15:56:37Z")

</div>

Hi NiuOBA,

I’ve attached a Python script that shows an example of creating a source file. The documentation for the upcoming release of OpenMC has a detailed file specification for the source file, but you can see from the script what goes into it. The source sites are stored in a numpy array with a compound datatype. Note that if you are using OpenMC 0.7.0 (as opposed to the current developmental branch), you should remove the ‘delayed\_group’ field (just get rid of the last tuple in the source\_dtype list). Hopefully the example is self-explanatory, but let me know if you have any questions.

Best,  
Paul

[make\_source.py](https://openmc.discourse.group/uploads/short-url/eFP9gyeAz2MdXeJMSBvPl26ygd.py) (927 Bytes)

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [November 4, 2015, 4:11pm UTC](https://openmc.discourse.group/t/question-about-how-to-use-source/177/3 "2015-11-04T16:11:06Z")

</div>

You can find the source for the documentation on output file formats here:  
[https://github.com/mit-crpg/openmc/tree/develop/docs/source/usersguide/output](https://github.com/mit-crpg/openmc/tree/develop/docs/source/usersguide/output)

Best,  
Paul
