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 should be more automatic #13

Closed RemDelaporteMathurin closed 2 years ago

RemDelaporteMathurin commented 2 years ago

Currently users need to create the TokamakSource instance, then call .sample_sources() then call .make_openmc_sources()

Since this package is now heading towards an openmc-fusion subpackage, these steps should be performed all in one go in the __init__() method.

    def __init__(
        self,
        major_radius,
        minor_radius,
        elongation,
        triangularity,
        mode,
        ion_density_centre,
        ion_density_peaking_factor,
        ion_density_pedestal,
        ion_density_separatrix,
        ion_temperature_centre,
        ion_temperature_peaking_factor,
        ion_temperature_beta,
        ion_temperature_pedestal,
        ion_temperature_separatrix,
        pedestal_radius,
        shafranov_factor,
        sample_size=1000
    ) -> None:
        self.major_radius = major_radius
        self.minor_radius = minor_radius
        self.elongation = elongation
        self.triangularity = triangularity
        self.ion_density_centre = ion_density_centre
        self.mode = mode
        self.ion_density_peaking_factor = ion_density_peaking_factor
        self.pedestal_radius = pedestal_radius
        self.ion_density_pedestal = ion_density_pedestal
        self.ion_density_separatrix = ion_density_separatrix

        self.ion_temperature_centre = ion_temperature_centre
        self.ion_temperature_peaking_factor = ion_temperature_peaking_factor
        self.ion_temperature_pedestal = ion_temperature_pedestal
        self.ion_temperature_separatrix = ion_temperature_separatrix
        self.ion_temperature_beta = ion_temperature_beta

        self.shafranov_factor = shafranov_factor

        self.sample_size = sample_size

        # addition that need to be made
        self.sample_sources()
        self.sources = self.make_openmc_sources()
RemDelaporteMathurin commented 2 years ago

@mdfaisal98 if you are still interested in contributing to this package, there are 3 issues that are fairly easy to solve :-)

Let me know if you're up to it

mdfaisal98 commented 2 years ago

Hi @RemDelaporteMathurin , Thanks for the opportunity, I'm interested in tackling this issue. Could you assign it to me ?