From 5e65f8313aa8d863398903cc0dc8ca1dc00ba7ef Mon Sep 17 00:00:00 2001 From: shimwell Date: Sat, 28 Sep 2024 23:14:09 +0100 Subject: [PATCH] enums --- docs/usage.rst | 316 +++++++++--------- src/paramak/workplanes/blanket_from_plasma.py | 1 - 2 files changed, 158 insertions(+), 159 deletions(-) diff --git a/docs/usage.rst b/docs/usage.rst index d0b7cd91..5575efcc 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -3,8 +3,8 @@ Usage There are two main reactors to choose from, Tokamak and Spherical Tokamak. These can be built with: - - A radial and vertical build - - A radial build and plasma elongation. +- A radial and vertical build +- A radial build and plasma elongation. The former gives the user more control of the size of components allowing reactor blankets to vary both radially and vertically. The later allows reactors to be built with a minimal number of parameters. @@ -56,17 +56,17 @@ Tokamak from plasma result = paramak.tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -80,17 +80,17 @@ Tokamak from plasma result = paramak.tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -117,14 +117,14 @@ Spherical tokamak from plasma result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -138,14 +138,14 @@ Spherical tokamak from plasma result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -174,28 +174,28 @@ Tokamak result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, @@ -208,28 +208,28 @@ Tokamak result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=0.55, rotation_angle=180, @@ -259,26 +259,26 @@ Spherical tokamak radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=0.55, @@ -292,26 +292,26 @@ Spherical tokamak radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=0.55, @@ -336,14 +336,14 @@ Reactor with divertor(s) radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column [(paramak.LayerType.GAP, 120), ("upper_divertor", 100)], # this divertor has some blanket between the center colum and itself @@ -360,14 +360,14 @@ Reactor with divertor(s) radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], [(paramak.LayerType.GAP, 75), ("lower_divertor", 100)], # this divertor connects to the center column [(paramak.LayerType.GAP, 120), ("upper_divertor", 140)], # this divertor has some blanket between the center colum and itself @@ -417,14 +417,14 @@ Reactor with poloidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -460,14 +460,14 @@ Reactor with poloidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 15), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2, triangularity=0.55, @@ -508,14 +508,14 @@ Reactor with toroidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 70), - (LayerType.SOLID, 10), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, @@ -539,14 +539,14 @@ Reactor with toroidal field coils result = paramak.spherical_tokamak_from_plasma( radial_builds=[ (paramak.LayerType.GAP, 70), - (LayerType.SOLID, 10), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ], elongation=2.5, rotation_angle=180, @@ -575,28 +575,28 @@ Tokamak with negative triangularity result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=-0.55, rotation_angle=180, @@ -609,28 +609,28 @@ Tokamak with negative triangularity result = paramak.tokamak( radial_builds=[ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 30), - (LayerType.SOLID, 50), - (LayerType.SOLID, 10), - (LayerType.SOLID, 120), - (LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 30), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 20), (paramak.LayerType.GAP, 60), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 20), - (LayerType.SOLID, 120), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 20), + (paramak.LayerType.SOLID, 120), + (paramak.LayerType.SOLID, 10), ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], triangularity=-0.55, rotation_angle=180, @@ -659,26 +659,26 @@ Spherical tokamak with negative triangularity radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 40), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, @@ -692,26 +692,26 @@ Spherical tokamak with negative triangularity radial_builds=[ [ (paramak.LayerType.GAP, 10), - (LayerType.SOLID, 50), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 50), + (paramak.LayerType.SOLID, 15), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 300), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 60), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 60), + (paramak.LayerType.SOLID, 10), ] ], vertical_build=[ - (LayerType.SOLID, 15), - (LayerType.SOLID, 80), - (LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 80), + (paramak.LayerType.SOLID, 10), (paramak.LayerType.GAP, 50), (paramak.LayerType.PLASMA, 700), (paramak.LayerType.GAP, 60), - (LayerType.SOLID, 10), - (LayerType.SOLID, 40), - (LayerType.SOLID, 15), + (paramak.LayerType.SOLID, 10), + (paramak.LayerType.SOLID, 40), + (paramak.LayerType.SOLID, 15), ], rotation_angle=180, triangularity=-0.55, diff --git a/src/paramak/workplanes/blanket_from_plasma.py b/src/paramak/workplanes/blanket_from_plasma.py index 71049e34..20c72361 100644 --- a/src/paramak/workplanes/blanket_from_plasma.py +++ b/src/paramak/workplanes/blanket_from_plasma.py @@ -106,7 +106,6 @@ def outer_offset(theta): # assemble points = inner_points + outer_points - print(overlapping_shape, allow_overlapping_shape) if overlapping_shape and allow_overlapping_shape is False: msg = "blanket_from_plasma: Some points with negative R coordinate have " "been ignored." warnings.warn(msg, category=UserWarning)