# Best way to define distributed source

**URL:** <https://openmc.discourse.group/t/best-way-to-define-distributed-source/3174>\
**Category:** User Support\
**Created:** [July 4, 2023, 4:32pm UTC](https://openmc.discourse.group/t/best-way-to-define-distributed-source/3174 "2023-07-04T16:32:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcollins](https://avatars.discourse-cdn.com/v4/letter/b/97f17d/32.png) [@bcollins](https://openmc.discourse.group/u/bcollins)\
**Post date:** [July 4, 2023, 4:32pm UTC](https://openmc.discourse.group/t/best-way-to-define-distributed-source/3174/1 "2023-07-04T16:32:47Z")

</div>

I’m trying to run a fixed source problem for a PWR where the source is defined for every pin at various axial levels. My original attempt was to use a MeshSpatial distribution using a RectilinearMesh but it seems that MeshSpatial is only implemented for unstructured mesh.

What would be the best way to define this? I could make an unstructured mesh that is rectilinear but it seems fairly time consuming. I could also define a Box source for every pin and axial mesh but I’m afraid this might not be very performant.

Thanks,  
Ben

---

<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:** [July 15, 2023, 4:40pm UTC](https://openmc.discourse.group/t/best-way-to-define-distributed-source/3174/2 "2023-07-15T16:40:37Z")

</div>

Hi Ben! I think @pshriwise may have plans for extending `MeshSpatial` to cover the other mesh types. Not sure what the ETA is on that but hopefully he can chime in. In the meantime, the other options would be a bit painful – like you said you could define a box source for each region. Right now I think that’s going to be O(n) in the number of sources. Depending on the problem though, maybe it’s not a big deal.

---

<div class="post-metadata">

**Author:** ![pshriwise](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/pshriwise/32/3863_2.png) [@pshriwise](https://openmc.discourse.group/u/pshriwise)\
**Post date:** [July 18, 2023, 3:13pm UTC](https://openmc.discourse.group/t/best-way-to-define-distributed-source/3174/3 "2023-07-18T15:13:25Z")

</div>

I can confirm that I’m working on a mesh source class that will enable additional mesh types for `MeshSpatial` and add a `MeshSource` class that will allow for unique angle/energy distributions for each element if desired. I’m currently on leave for the next couple of weeks, but once I return I’d like to submit that feature asap.

---

<div class="post-metadata">

**Author:** ![xahc\_wty](https://avatars.discourse-cdn.com/v4/letter/x/7bcc69/32.png) [@xahc\_wty](https://openmc.discourse.group/u/xahc_wty)\
**Post date:** [July 6, 2024, 1:03pm UTC](https://openmc.discourse.group/t/best-way-to-define-distributed-source/3174/4 "2024-07-06T13:03:25Z")

</div>

Hi, I’m a beginner with OpenMC. I want to create a core source with pins having different axial and radial power profiles, as shown in the diagram. Is it correct to set the yellow boxes in the figure as mesh, where the source strength of the two smaller areas inside mesh is defined as 0?Could you please provide me with a simple demonstration?

 ![8bb4446a1dcbeda9eaa0ed7ad29e5ae](https://global.discourse-cdn.com/free1/uploads/openmc/original/2X/b/bcecc6deb136fdbd8285615f1e7df126aaa45eb3.png)
