Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating tokamak_from_plasma to base vertical_build off of inboard bu… #352

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/paramak/assemblies/tokamak.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,14 @@ def tokamak_from_plasma(
major_radius = (outer_equatorial_point + inner_equatorial_point) / 2
minor_radius = major_radius - inner_equatorial_point

# make vertical build from outer radial build
# make vertical build from inner radial build
pi = get_plasma_index(radial_build)
upper_vertical_build = radial_build[pi:]

rbi = len(radial_build)-1 - pi # number of unique entries in outer or inner radial build
upper_vertical_build = radial_build[pi-rbi:pi][::-1] #get the inner radial build

plasma_height = 2 * minor_radius * elongation
# slice opperation reverses the list and removes the last value to avoid two plasmas
vertical_build = upper_vertical_build[::-1][:-1] + [(LayerType.PLASMA, plasma_height)] + upper_vertical_build[1:]
vertical_build = upper_vertical_build[::-1] + [(LayerType.PLASMA, plasma_height)] + upper_vertical_build

return tokamak(
radial_build=radial_build,
Expand Down