fusion-energy / openmc-plasma-source

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

TokamakSource angles should be defined at construction #22

Closed RemDelaporteMathurin closed 2 years ago

RemDelaporteMathurin commented 2 years ago

Currently, the default angles (full 360) are used when creating a TokamakSource object https://github.com/fusion-energy/openmc-plasma-source/blob/a03cc9ba4bc96ef6508bf8189d1363b5d786b237/openmc_plasma_source/tokamak_source.py#L88

However, this should be user-defined.

my_source = ops.TokamakSource(
    elongation=1.557,
    ion_density_centre=1.09e20,
    ion_density_peaking_factor=1,
    ion_density_pedestal=1.09e20,
    ion_density_separatrix=3e19,
    ion_temperature_centre=45.9,
    ion_temperature_peaking_factor=8.06,
    ion_temperature_pedestal=6.09,
    ion_temperature_separatrix=0.1,
    major_radius=9.06,
    minor_radius=2.92258,
    pedestal_radius=0.8 * 2.92258,
    mode="H",
    shafranov_factor=0.44789,
    triangularity=0.270,
    ion_temperature_beta=6,
# new parameter!!!
    angles=(0, 3.14/2)
  )
shimwell commented 2 years ago

Perhaps the arg names could be start_angle and stop_angle to be consistent with the ring source class FusionRingSource

RemDelaporteMathurin commented 2 years ago

Yeah why not. It's just two arguments instead of one