@@ -711,3 +711,173 @@ Spherical tokamak with negative triangularity
711
711
triangularity = - 0.55 ,
712
712
)
713
713
result.save(f " spherical_tokamak_minimal.step " )
714
+
715
+
716
+ Tokamak with several customizations
717
+ -----------------------------------
718
+
719
+ - Combining many of the examples together to produce a Tokamak
720
+ with extra blanket layers, a lower divertor, PF and TF coils.
721
+
722
+ .. cadquery ::
723
+ :gridsize: 0
724
+ :select: result
725
+ :color: #00cd00
726
+ :width: 100%
727
+ :height: 600px
728
+
729
+ import paramak
730
+ from cadquery import vis, Workplane
731
+
732
+ # makes a rectangle that overlaps the lower blanket under the plasma
733
+ # the intersection of this and the layers will form the lower divertor
734
+ points = [(300, -700), (300, 0), (400, 0), (400, -700)]
735
+ divertor_lower = Workplane('XZ', origin=(0,0,0)).polyline(points).close().revolve(180)
736
+
737
+ # creates a toroidal
738
+ tf = paramak.toroidal_field_coil_rectangle(
739
+ horizontal_start_point = (10, 520),
740
+ vertical_mid_point = (860, 0),
741
+ thickness = 50,
742
+ distance = 40,
743
+ with_inner_leg = True,
744
+ azimuthal_placement_angles = [0, 30, 60, 90, 120, 150, 180],
745
+ )
746
+
747
+ add_extra_cut_shapes = [tf]
748
+
749
+ # creates pf coil
750
+ for case_thickness, height, width, center_point in zip(
751
+ [10, 15, 15, 10], [20, 50, 50, 20], [20, 50, 50, 20],
752
+ [(730, 370), (810, 235), (810, -235), (730, -370)]
753
+ ):
754
+ add_extra_cut_shapes.append(
755
+ paramak.poloidal_field_coil(
756
+ height=height, width=width, center_point=center_point, rotation_angle=180
757
+ )
758
+ )
759
+ add_extra_cut_shapes.append(
760
+ paramak.poloidal_field_coil_case(
761
+ coil_height=height,
762
+ coil_width=width,
763
+ casing_thickness=case_thickness,
764
+ rotation_angle=180,
765
+ center_point=center_point,
766
+ )
767
+ )
768
+
769
+ result = paramak.tokamak(
770
+ radial_build=[
771
+ (paramak.LayerType.GAP, 10),
772
+ (paramak.LayerType.SOLID, 30),
773
+ (paramak.LayerType.SOLID, 50),
774
+ (paramak.LayerType.SOLID, 10),
775
+ (paramak.LayerType.SOLID, 60),
776
+ (paramak.LayerType.SOLID, 60),
777
+ (paramak.LayerType.SOLID, 20),
778
+ (paramak.LayerType.GAP, 60),
779
+ (paramak.LayerType.PLASMA, 300),
780
+ (paramak.LayerType.GAP, 60),
781
+ (paramak.LayerType.SOLID, 20),
782
+ (paramak.LayerType.SOLID, 60),
783
+ (paramak.LayerType.SOLID, 60),
784
+ (paramak.LayerType.SOLID, 10),
785
+ ],
786
+ vertical_build=[
787
+ (paramak.LayerType.SOLID, 10),
788
+ (paramak.LayerType.SOLID, 50),
789
+ (paramak.LayerType.SOLID, 50),
790
+ (paramak.LayerType.SOLID, 20),
791
+ (paramak.LayerType.GAP, 60),
792
+ (paramak.LayerType.PLASMA, 650),
793
+ (paramak.LayerType.GAP, 60),
794
+ (paramak.LayerType.SOLID, 20),
795
+ (paramak.LayerType.SOLID, 50),
796
+ (paramak.LayerType.SOLID, 50),
797
+ (paramak.LayerType.SOLID, 10),
798
+ ],
799
+ triangularity=0.55,
800
+ rotation_angle=180,
801
+ add_extra_cut_shapes=add_extra_cut_shapes,
802
+ extra_intersect_shapes=[divertor_lower]
803
+ )
804
+ result.toCompound()
805
+
806
+ .. code-block :: python
807
+
808
+ import paramak
809
+ from cadquery import vis, Workplane
810
+
811
+ # makes a rectangle that overlaps the lower blanket under the plasma
812
+ # the intersection of this and the layers will form the lower divertor
813
+ points = [(300 , - 700 ), (300 , 0 ), (400 , 0 ), (400 , - 700 )]
814
+ divertor_lower = Workplane(' XZ' , origin = (0 ,0 ,0 )).polyline(points).close().revolve(180 )
815
+
816
+ # creates a toroidal
817
+ tf = paramak.toroidal_field_coil_rectangle(
818
+ horizontal_start_point = (10 , 520 ),
819
+ vertical_mid_point = (860 , 0 ),
820
+ thickness = 50 ,
821
+ distance = 40 ,
822
+ with_inner_leg = True ,
823
+ azimuthal_placement_angles = [0 , 30 , 60 , 90 , 120 , 150 , 180 ],
824
+ )
825
+
826
+ add_extra_cut_shapes = [tf]
827
+
828
+ # creates pf coil
829
+ for case_thickness, height, width, center_point in zip (
830
+ [10 , 15 , 15 , 10 ], [20 , 50 , 50 , 20 ], [20 , 50 , 50 , 20 ],
831
+ [(730 , 370 ), (810 , 235 ), (810 , - 235 ), (730 , - 370 )]
832
+ ):
833
+ add_extra_cut_shapes.append(
834
+ paramak.poloidal_field_coil(
835
+ height = height, width = width, center_point = center_point, rotation_angle = 180
836
+ )
837
+ )
838
+ add_extra_cut_shapes.append(
839
+ paramak.poloidal_field_coil_case(
840
+ coil_height = height,
841
+ coil_width = width,
842
+ casing_thickness = case_thickness,
843
+ rotation_angle = 180 ,
844
+ center_point = center_point,
845
+ )
846
+ )
847
+
848
+ my_reactor = paramak.tokamak(
849
+ radial_build = [
850
+ (paramak.LayerType.GAP , 10 ),
851
+ (paramak.LayerType.SOLID , 30 ),
852
+ (paramak.LayerType.SOLID , 50 ),
853
+ (paramak.LayerType.SOLID , 10 ),
854
+ (paramak.LayerType.SOLID , 60 ),
855
+ (paramak.LayerType.SOLID , 60 ),
856
+ (paramak.LayerType.SOLID , 20 ),
857
+ (paramak.LayerType.GAP , 60 ),
858
+ (paramak.LayerType.PLASMA , 300 ),
859
+ (paramak.LayerType.GAP , 60 ),
860
+ (paramak.LayerType.SOLID , 20 ),
861
+ (paramak.LayerType.SOLID , 60 ),
862
+ (paramak.LayerType.SOLID , 60 ),
863
+ (paramak.LayerType.SOLID , 10 ),
864
+ ],
865
+ vertical_build = [
866
+ (paramak.LayerType.SOLID , 10 ),
867
+ (paramak.LayerType.SOLID , 50 ),
868
+ (paramak.LayerType.SOLID , 50 ),
869
+ (paramak.LayerType.SOLID , 20 ),
870
+ (paramak.LayerType.GAP , 60 ),
871
+ (paramak.LayerType.PLASMA , 650 ),
872
+ (paramak.LayerType.GAP , 60 ),
873
+ (paramak.LayerType.SOLID , 20 ),
874
+ (paramak.LayerType.SOLID , 50 ),
875
+ (paramak.LayerType.SOLID , 50 ),
876
+ (paramak.LayerType.SOLID , 10 ),
877
+ ],
878
+ triangularity = 0.55 ,
879
+ rotation_angle = 180 ,
880
+ add_extra_cut_shapes = add_extra_cut_shapes,
881
+ extra_intersect_shapes = [divertor_lower]
882
+ )
883
+ my_reactor.save(f " tokamak_with_divertor.step " )
0 commit comments