fusion-energy / openmc-plasma-source

Creates a plasma source as an openmc.source object from input parameters that describe the plasma
MIT License
28 stars 11 forks source link

FusionRingSource z placement should be controllable by users #11

Closed RemDelaporteMathurin closed 3 years ago

RemDelaporteMathurin commented 3 years ago

Currently, users can control the radius and the coverage of the FusionRingSource.

The z placement is assumed to be zero.

However, users should be able to control this z placement:

class FusionRingSource(openmc.Source):
    """An openmc.Source object with some presets to make it more convenient
    for fusion simulations using a ring source. All attributes can be changed
    after initialization if required. Default isotropic ring source with a Muir
    energy distribution.
    Args:
        radius: the inner radius of the ring source
        start_angle: the start angle of the ring in radians,
        stop_angle: the end angle of the ring in radians,
        temperature: the temperature to use in the Muir distribution in eV,
    """
    def __init__(
        self,
        radius,
        start_angle: float =0.,
        stop_angle: float = 6.28318530718,
        z_placement=0,
        temperature: float = 20000.,
        fuel='DT'
    ):
shimwell commented 3 years ago

Yep this would be a nice feature. one of the parts that would need changing is the [0[ in this line

https://github.com/fusion-energy/openmc-plasma-source/blob/fce6e922fb348168d5bc0ab05100e218a1789b88/openmc_plasma_source/ring_source.py#L30