In [ ]:
Copied!
# SPDX-FileCopyrightText: 2024-present Tokamak Neutron Source Maintainers
#
# SPDX-License-Identifier: LGPL-2.1-or-later
"""Example Reading from JETTO files"""
# SPDX-FileCopyrightText: 2024-present Tokamak Neutron Source Maintainers
#
# SPDX-License-Identifier: LGPL-2.1-or-later
"""Example Reading from JETTO files"""
In [ ]:
Copied!
from tokamak_neutron_source import (
FluxConvention,
FluxMap,
TokamakNeutronSource,
TransportInformation,
)
from tokamak_neutron_source.reactions import Reactions
from tokamak_neutron_source import (
FluxConvention,
FluxMap,
TokamakNeutronSource,
TransportInformation,
)
from tokamak_neutron_source.reactions import Reactions
JETTO Source¶
These JETTO data files are available here: https://github.com/ukaea/openstep
A copy is available in the tests/test_data folder
In [ ]:
Copied!
source = TokamakNeutronSource(
transport=TransportInformation.from_jetto("tests/test_data/STEP_jetto.jsp"),
flux_map=FluxMap.from_eqdsk(
"tests/test_data/STEP_jetto.eqdsk_out", flux_convention=FluxConvention.SQRT
),
source_type=[Reactions.D_T, Reactions.D_D],
cell_side_length=0.05,
)
# Print the calculated total neutron rate from the ion density and temperature profiles
print("Total D-D source neutrons:", sum(source.strength[Reactions.D_D]))
print("Calculated total source fusion power: ", source.calculate_total_fusion_power())
source.plot()
source = TokamakNeutronSource(
transport=TransportInformation.from_jetto("tests/test_data/STEP_jetto.jsp"),
flux_map=FluxMap.from_eqdsk(
"tests/test_data/STEP_jetto.eqdsk_out", flux_convention=FluxConvention.SQRT
),
source_type=[Reactions.D_T, Reactions.D_D],
cell_side_length=0.05,
)
# Print the calculated total neutron rate from the ion density and temperature profiles
print("Total D-D source neutrons:", sum(source.strength[Reactions.D_D]))
print("Calculated total source fusion power: ", source.calculate_total_fusion_power())
source.plot()