Skip to content

Commit

Permalink
Merge pull request #352 from tokasamwin/main
Browse files Browse the repository at this point in the history
Updating tokamak_from_plasma to base vertical_build off of inboard bu…
  • Loading branch information
shimwell authored Oct 15, 2024
2 parents 7d393ee + a7e20bb commit ff32ec1
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit ff32ec1

Please sign in to comment.