# Cylindrical Source: X-Axis

**URL:** <https://openmc.discourse.group/t/cylindrical-source-x-axis/1697>\
**Category:** User Support\
**Created:** [February 10, 2022, 6:07pm UTC](https://openmc.discourse.group/t/cylindrical-source-x-axis/1697 "2022-02-10T18:07:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yrrepy](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yrrepy/32/2365_2.png) [@yrrepy](https://openmc.discourse.group/u/yrrepy)\
**Post date:** [February 10, 2022, 6:07pm UTC](https://openmc.discourse.group/t/cylindrical-source-x-axis/1697/1 "2022-02-10T18:07:11Z")

</div>

Hello,

is there a way to orient a cylindrical source such that it is facing in the direction of the X-axis? (R sweeps through Y-Z and X is the axial direction of the cylinder).  
I can’t seem to find a way to do this.

(I am referring to the positioning of the cylinder-circle for sampling locations, not the uvw angle of the created particles).

As an ad-hoc solution, I rotate my entire geometry such that X and Z are flipped, but that’s less than ideal.

Regards,  
John

---

<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:** [February 11, 2022, 3:52pm UTC](https://openmc.discourse.group/t/cylindrical-source-x-axis/1697/2 "2022-02-11T15:52:17Z")

</div>

Hi @yrrepy and welcome to the community! If you are talking about the `CylindricalIndependent` class, unfortunately there is no way to orient that in the direction of the x-axis at present other than the hacky solution you mentioned of rotating the entire geometry. One alternative is to write your own [custom source routine](https://docs.openmc.org/en/latest/usersguide/settings.html#custom-sources) that samples spatial positions as you desire.

---

<div class="post-metadata">

**Author:** ![yrrepy](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/yrrepy/32/2365_2.png) [@yrrepy](https://openmc.discourse.group/u/yrrepy)\
**Post date:** [April 23, 2026, 5:43pm UTC](https://openmc.discourse.group/t/cylindrical-source-x-axis/1697/3 "2026-04-23T17:43:59Z")

</div>

Solved!

> **[openmc.stats.cylindrical\_uniform - openmc.stats.cylindrical\_uniform — OpenMC...](https://docs.openmc.org/en/latest/pythonapi/generated/openmc.stats.cylindrical_uniform.html#openmc.stats.cylindrical_uniform)**
>
> Return a uniform spatial distribution over a cylindrical shell.

> <https://github.com/openmc-dev/openmc/pull/3474>
>
> \# Description
> 
> This PR generalize CylindricalIndependent to support symmetry a…xis in every direction and not only in z direction.
> 
> This PR also implement cylindrical\_uniform and ring\_uniform to generate uniform spatial distributions over cylinders and rings in a similar way to spherical\_uniform.
> 
> 
> \# Checklist
> 
> \- \[x\] I have performed a self-review of my own code
> \- \[x\] I have run \[clang-format\](https://docs.openmc.org/en/latest/devguide/styleguide.html#automatic-formatting) (version 15) on any C++ source files (if applicable)
> \- \[x\] I have followed the \[style guidelines\](https://docs.openmc.org/en/latest/devguide/styleguide.html#python) for Python source files (if applicable)
> \- \[x\] I have made corresponding changes to the documentation (if applicable)
> \- \[x\] I have added tests that prove my fix is effective or that my feature works (if applicable)
