def _make_coils(self): list_of_components = [] self._inboard_tf_coils = paramak.CenterColumnShieldCylinder( height=self._blanket_rear_wall_end_height * 2, inner_radius=self._inboard_tf_coils_start_radius, outer_radius=self._inboard_tf_coils_end_radius, rotation_angle=self.rotation_angle, stp_filename="inboard_tf_coils.stp", stl_filename="inboard_tf_coils.stl", name="inboard_tf_coils", material_tag="inboard_tf_coils_mat", ) list_of_components.append(self._inboard_tf_coils) if self._tf_info_provided: self._tf_coil = paramak.ToroidalFieldCoilCoatHanger( with_inner_leg=False, horizontal_start_point=( self._inboard_tf_coils_start_radius, self._blanket_rear_wall_end_height, ), vertical_mid_point=(self._outboard_tf_coil_start_radius, 0), thickness=self.outboard_tf_coil_radial_thickness, number_of_coils=self.number_of_tf_coils, distance=self.outboard_tf_coil_poloidal_thickness, stp_filename="outboard_tf_coil.stp", stl_filename="outboard_tf_coil.stl", rotation_angle=self.rotation_angle, horizontal_length=self._outboard_tf_coils_horizontal_length, vertical_length=self._outboard_tf_coils_vertical_height) list_of_components.append(self._tf_coil) if self._pf_info_provided: self._pf_coil = paramak.PoloidalFieldCoilSet( heights=self.pf_coil_vertical_thicknesses, widths=self.pf_coil_radial_thicknesses, center_points=self._pf_coils_xy_values, rotation_angle=self.rotation_angle, stp_filename='pf_coils.stp', stl_filename='pf_coils.stl', name="pf_coil", material_tag="pf_coil_mat", ) list_of_components.append(self._pf_coil) self._pf_coils_casing = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=self._pf_coil, casing_thicknesses=self.pf_coil_case_thickness, rotation_angle=self.rotation_angle, stp_filename='pf_coil_cases.stp', stl_filename='pf_coil_cases.stl', name="pf_coil_case", material_tag="pf_coil_case_mat", ) list_of_components.append(self._pf_coils_casing) return list_of_components
def _make_pf_coils(self): list_of_components = [] if (self.pf_coil_vertical_thicknesses, self.pf_coil_radial_thicknesses, self.pf_coil_to_rear_blanket_radial_gap) != (None, None, None): self._pf_coil = paramak.PoloidalFieldCoilSet( heights=self.pf_coil_vertical_thicknesses, widths=self.pf_coil_radial_thicknesses, center_points=self._pf_coils_xy_values, rotation_angle=self.rotation_angle, stp_filename='pf_coils.stp', stl_filename='pf_coils.stl', name="pf_coil", material_tag="pf_coil_mat", ) self._pf_coils_casing = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=self._pf_coil, casing_thicknesses=self.pf_coil_case_thickness, rotation_angle=self.rotation_angle, stp_filename='pf_coil_cases.stp', stl_filename='pf_coil_cases.stl', name="pf_coil_case", material_tag="pf_coil_case_mat", ) list_of_components = [self._pf_coils_casing, self._pf_coil] return list_of_components
def test_PoloidalFieldCoilSet_creation(self): """creates a solid using the PoloidalFieldCoilSet parametric component and checks that a cadquery solid is created""" test_shape = paramak.PoloidalFieldCoilSet(heights=[10, 10, 10], widths=[20, 20, 20], center_points=[(100, 100), (200, 200), (300, 300)]) assert test_shape.solid is not None assert len(test_shape.solid.Solids()) == 3
def test_PoloidalFieldCoilSet_incorrect_lengths_FC(): """Checks PoloidalFieldCoilSet with the wrong number of casing thicknesses using a coil set object""" pf_coils_set = paramak.PoloidalFieldCoilSet( heights=[10, 10, 20, 20], widths=[10, 10, 20, 40], center_points=[(100, 100), (100, 150), (50, 200), (50, 50)], rotation_angle=180) paramak.PoloidalFieldCoilCaseSetFC(pf_coils=pf_coils_set, casing_thicknesses=[5, 5, 10], rotation_angle=180).solid
def setUp(self): self.pf_coils_set = paramak.PoloidalFieldCoilSet( heights=[10, 10, 20, 20], widths=[10, 10, 20, 40], center_points=[(100, 100), (100, 150), (50, 200), (50, 50)], ) self.test_shape = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=self.pf_coils_set, casing_thicknesses=[5, 10, 5, 10], )
def main(): number_of_toroidal_field_coils = 8 angle_offset = (360 / number_of_toroidal_field_coils) / 2. tf_coil_thickness = 50 tf_coil_distance = 130 tf_coil_casing_distance = tf_coil_distance + 40 tf_coil_casing_thickness = 20 inner_tf_case = paramak.InnerTfCoilsFlat( height=1800, inner_radius=330, outer_radius=430, number_of_coils=number_of_toroidal_field_coils, gap_size=5, rotation_angle=180, azimuth_start_angle=angle_offset) tf_coils = paramak.ToroidalFieldCoilPrincetonD( R1=400, R2=1500, # height thickness=tf_coil_thickness, distance=tf_coil_distance, number_of_coils=number_of_toroidal_field_coils, rotation_angle=180, ) tf_coil_casing = paramak.TFCoilCasing( magnet=tf_coils, distance=tf_coil_casing_distance, inner_offset=tf_coil_casing_thickness, outer_offset=tf_coil_casing_thickness, vertical_section_offset=tf_coil_casing_thickness, # rotation_angle=180, # producing occational errors with this arg ) pf_coils = paramak.PoloidalFieldCoilSet( heights=[100, 120, 80, 80, 120, 180], widths=[100, 120, 80, 80, 120, 180], center_points=[(530, 1030), (1370, 790), (1740, 250), (1750, -250), (1360, -780), (680, -1050)], rotation_angle=180) pf_coils_casing = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=pf_coils, casing_thicknesses=[10] * 6, rotation_angle=180) pf_coils.export_stp('pf_coils.stp') pf_coils_casing.export_stp('pf_coils_case.stp') tf_coils.export_stp('tf_coil.stp') tf_coil_casing.export_stp('tf_coil_casing.stp') inner_tf_case.export_stp('inner_tf_case.stp')
def test_volumes_add_up_to_total_volume_Compound(self): """Checks the volume and volumes attributes are correct types and that the volumes sum to equalt the volume for a Compound.""" test_shape = paramak.PoloidalFieldCoilSet(heights=[10, 10], widths=[20, 20], center_points=[(15, 15), (50, 50)]) assert isinstance(test_shape.volume, float) assert isinstance(test_shape.volumes, list) assert isinstance(test_shape.volumes[0], float) assert isinstance(test_shape.volumes[1], float) assert len(test_shape.volumes) == 2 assert sum(test_shape.volumes) == pytest.approx(test_shape.volume)
def test_PoloidalFieldCoilCaseSetFC_from_pf_coil_set(self): """Creates a set of PF coil cases from a PF coils object""" pf_coils_set = paramak.PoloidalFieldCoilSet(heights=[10, 10, 20, 20], widths=[10, 10, 20, 40], center_points=[(100, 100), (100, 150), (50, 200), (50, 50)], rotation_angle=180) test_shape = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=pf_coils_set, casing_thicknesses=[5, 5, 10, 10], rotation_angle=180) assert test_shape.solid is not None assert len(test_shape.solid.Solids()) == 4 assert len(pf_coils_set.solid.Solids()) == 4
def test_areas_add_up_to_total_area_Compound(self): """Checks the area and areas attributes are correct types and that the areas sum to equalt the area for a Compound.""" test_shape = paramak.PoloidalFieldCoilSet(heights=[10, 10], widths=[20, 20], center_points=[(15, 15), (50, 50)]) assert isinstance(test_shape.area, float) assert isinstance(test_shape.areas, list) assert isinstance(test_shape.areas[0], float) assert isinstance(test_shape.areas[1], float) assert isinstance(test_shape.areas[2], float) assert isinstance(test_shape.areas[3], float) assert isinstance(test_shape.areas[4], float) assert isinstance(test_shape.areas[5], float) assert isinstance(test_shape.areas[6], float) assert isinstance(test_shape.areas[7], float) assert len(test_shape.areas) == 8 assert sum(test_shape.areas) == pytest.approx(test_shape.area)
def _make_component_cuts(self): if (self.pf_coil_vertical_thicknesses is not None and self.pf_coil_radial_thicknesses is not None and self.pf_coil_to_rear_blanket_radial_gap is not None): self._pf_coil = paramak.PoloidalFieldCoilSet( heights=self.pf_coil_vertical_thicknesses, widths=self.pf_coil_radial_thicknesses, center_points=self._pf_coils_xy_values, rotation_angle=self.rotation_angle, stp_filename='pf_coils.stp', stl_filename='pf_coils.stl', name="pf_coil", material_tag="pf_coil_mat", ) self.shapes_and_components.append(self._pf_coil) if (self.pf_coil_to_tf_coil_radial_gap is not None and self.outboard_tf_coil_radial_thickness is not None): self._tf_coil = paramak.ToroidalFieldCoilRectangle( with_inner_leg=False, horizontal_start_point=( self._inboard_tf_coils_start_radius, self._tf_coil_height), vertical_mid_point=(self._tf_coil_start_radius, 0), thickness=self.outboard_tf_coil_radial_thickness, number_of_coils=self.number_of_tf_coils, distance=self.outboard_tf_coil_poloidal_thickness, stp_filename="tf_coil.stp", name="tf_coil", material_tag="tf_coil_mat", stl_filename="tf_coil.stl", rotation_angle=self.rotation_angle) self.shapes_and_components.append(self._tf_coil)
def make_PoloidalFieldCoilSet_incorrect_center_points(): paramak.PoloidalFieldCoilSet( heights=[10, 10, 10], widths=[20, 20, 20], center_points=100)
def make_PoloidalFieldCoilSet_incorrect_width(): paramak.PoloidalFieldCoilSet( heights=[10, 10, 10], widths=20, center_points=[(100, 100), (200, 200), (300, 300)])
def main(rotation_angle=180): inboard_pf_coils = paramak.PoloidalFieldCoilSet( center_points=[ (53.5, -169.58), (53.5, -118.43), (53.5, -46.54), (53.5, 46.54), (53.5, 118.43), (53.5, 169.58), ], heights=[ 41.5, 40.5, 82.95, 82.95, 40.5, 41.5, ], widths=[27.7, 27.7, 27.7, 27.7, 27.7, 27.7], rotation_angle=rotation_angle, stp_filename='inboard_pf_coils.stp') outboard_pf_coils = paramak.PoloidalFieldCoilSet( center_points=[ (86, 230), (86, -230), (164, 241), (164, -241), (263, 222), (263, -222), (373, 131), (373, -131), ], widths=[ 32, 32, 50, 50, 43, 43, 48, 48, ], heights=[ 40, 40, 30, 30, 28, 28, 37, 37, ], rotation_angle=rotation_angle, stp_filename='outboard_pf_coils.stp') div_coils = paramak.PoloidalFieldCoilSet(center_points=[ (207, 144), (207, 125), (207, -144), (207, -125), ], widths=[15, 15, 15, 15], heights=[15, 15, 15, 15], rotation_angle=rotation_angle, stp_filename='div_coils.stp') vs_coils = paramak.PoloidalFieldCoilSet(center_points=[ (240, 70), (240, -70), ], widths=[10, 10], heights=[10, 10], rotation_angle=rotation_angle, stp_filename='vs_coils.stp') EFCCu_coils_1 = paramak.RotateStraightShape( points=[ (235.56581986143186, -127.64976958525347), (240.1847575057737, -121.19815668202767), (246.65127020785218, -125.80645161290323), (242.0323325635104, -132.25806451612902), ], rotation_angle=rotation_angle, stp_filename='EFCCu_coils_1.stp') EFCCu_coils_2 = paramak.RotateStraightShape( points=[ (262.3556581986143, -90.78341013824888), (266.97459584295615, -84.33179723502303), (273.44110854503464, -88.94009216589859), (268.82217090069287, -94.47004608294935), ], rotation_angle=rotation_angle, stp_filename='EFCCu_coils_2.stp') EFCCu_coils_3 = paramak.RotateStraightShape( points=[ (281.7551963048499, -71.42857142857144), (289.1454965357968, -71.42857142857144), (289.1454965357968, -78.80184331797238), (281.7551963048499, -78.80184331797238), ], rotation_angle=rotation_angle, stp_filename='EFCCu_coils_3.stp') EFCCu_coils_4 = paramak.RotateStraightShape( points=[ (235.56581986143186, 127.64976958525347), (240.1847575057737, 121.19815668202767), (246.65127020785218, 125.80645161290323), (242.0323325635104, 132.25806451612902), ], rotation_angle=rotation_angle, stp_filename='EFCCu_coils_4.stp') EFCCu_coils_5 = paramak.RotateStraightShape( points=[ (262.3556581986143, 90.78341013824888), (266.97459584295615, 84.33179723502303), (273.44110854503464, 88.94009216589859), (268.82217090069287, 94.47004608294935), ], rotation_angle=rotation_angle, stp_filename='EFCCu_coils_5.stp') EFCCu_coils_6 = paramak.RotateStraightShape( points=[ (281.7551963048499, 71.42857142857144), (289.1454965357968, 71.42857142857144), (289.1454965357968, 78.80184331797238), (281.7551963048499, 78.80184331797238), ], rotation_angle=rotation_angle, stp_filename='EFCCu_coils_6.stp') plasma = paramak.Plasma( major_radius=185, minor_radius=57 - 6, # 3 is a small ofset to avoid overlaps triangularity=0.31, elongation=1.97, rotation_angle=rotation_angle, stp_filename='plasma.stp', ) antenna = paramak.RotateMixedShape(points=[ (263.2794457274827, 46.5437788018433, 'straight'), (263.2794457274827, -46.54377880184336, 'straight'), (231.87066974595842, -46.54377880184336, 'spline'), (243.87990762124713, 0, 'spline'), (231.87066974595842, 46.5437788018433, 'straight'), ], rotation_angle=rotation_angle, stp_filename='antenna.stp') tf_coil = paramak.ToroidalFieldCoilPrincetonD( R1=105, R2=339, thickness=33, distance=33, number_of_coils=12, rotation_angle=rotation_angle, stp_filename='tf_coil.stp') vac_vessel = paramak.RotateStraightShape(points=[ (117.32101616628177, 126.72811059907835), (163.51039260969978, 170.04608294930875), (181.98614318706697, 171.88940092165896), (196.76674364896073, 169.12442396313364), (196.76674364896073, 115.66820276497694), (236.4896073903002, 114.74654377880185), (273.44110854503464, 65.89861751152074), (272.51732101616625, -65.89861751152074), (236.4896073903002, -115.66820276497697), (196.76674364896073, -115.66820276497697), (196.76674364896073, -169.12442396313367), (181.98614318706697, -172.81105990783408), (163.51039260969978, -170.04608294930875), (117.32101616628177, -126.72811059907832), (117.32101616628177, 123.04147465437785), (123.78752886836028, 123.04147465437785), (123.78752886836028, -123.963133640553), (165.3579676674365, -162.67281105990781), (181.98614318706697, -164.5161290322581), (190.3002309468822, -162.67281105990781), (190.3002309468822, -112.90322580645159), (193.99538106235568, -109.21658986175117), (232.7944572748268, -109.21658986175117), (266.97459584295615, -63.13364055299536), (266.05080831408776, 62.21198156682027), (232.7944572748268, 109.21658986175115), (193.99538106235568, 109.21658986175115), (190.3002309468822, 111.98156682027647), (190.3002309468822, 162.67281105990784), (181.98614318706697, 164.51612903225805), (165.3579676674365, 162.67281105990784), (123.78752886836028, 123.04147465437785), (117.32101616628177, 123.04147465437785), ], rotation_angle=rotation_angle, stp_filename='vacvessel.stp') inner_vessel = paramak.RotateMixedShape( points=[ (269.7459584295612, -46.54377880184336, 'straight'), (231.87066974595842, -46.5437788018433, 'spline'), (223.55658198614316, -62.21198156682027, 'spline'), (207.85219399538107, -80.64516129032262, 'spline'), (166.28175519630486, -115.66820276497697, 'spline'), (164.43418013856814, -119.35483870967744, 'spline'), (164.43418013856814, -122.11981566820276, 'straight'), (173.67205542725173, -140.5529953917051, 'straight'), (184.75750577367205, -140.5529953917051, 'straight'), (184.75750577367205, -158.98617511520735, 'straight'), (181.98614318706697, -159.9078341013825, 'straight'), (147.80600461893764, -118.43317972350235, 'straight'), (129.33025404157044, -123.04147465437785, 'straight'), (145.95842956120094, -111.05990783410135, 'straight'), (126.55889145496536, -50.23041474654377, 'straight'), (127.48267898383372, 50.23041474654377, 'straight'), (145.95842956120094, 110.13824884792626, 'straight'), (128.40646651270208, 123.04147465437785, 'straight'), (147.80600461893764, 117.51152073732717, 'straight'), (181.98614318706697, 159.90783410138246, 'straight'), (185.6812933025404, 158.98617511520735, 'straight'), (184.75750577367205, 140.55299539170505, 'straight'), (172.74826789838338, 140.55299539170505, 'spline'), (164.43418013856814, 121.19815668202764, 'spline'), (164.43418013856814, 118.43317972350229, 'spline'), (165.3579676674365, 115.66820276497694, 'spline'), (173.67205542725173, 111.05990783410135, 'spline'), (207.85219399538107, 80.64516129032256, 'spline'), (220.7852193995381, 66.82027649769586, 'spline'), (231.87066974595842, 46.5437788018433, 'spline'), (268.82217090069287, 46.5437788018433, 'straight'), (268.82217090069287, 63.13364055299536, 'straight'), (233.71824480369514, 111.98156682027647, 'straight'), (193.99538106235568, 112.90322580645159, 'straight'), (192.14780600461893, 164.51612903225805, 'straight'), (163.51039260969978, 166.35944700460828, 'straight'), (121.93995381062356, 123.96313364055297, 'straight'), (121.0161662817552, -125.80645161290323, 'straight'), (163.51039260969978, -166.35944700460834, 'straight'), (192.14780600461893, -166.35944700460834, 'straight'), (193.99538106235568, -112.90322580645159, 'straight'), (234.64203233256353, -111.9815668202765, 'straight'), (269.7459584295612, -63.13364055299536, 'straight'), ], rotation_angle=rotation_angle, stp_filename='inner_vessel.stp', cut=[vac_vessel, vs_coils, antenna]) sparc = paramak.Reactor([ inboard_pf_coils, outboard_pf_coils, plasma, antenna, vs_coils, inner_vessel, tf_coil, EFCCu_coils_1, EFCCu_coils_2, EFCCu_coils_3, EFCCu_coils_4, EFCCu_coils_5, EFCCu_coils_6, vac_vessel, div_coils ]) sparc.export_stp() sparc.export_svg('htc_reactor.svg') sparc.export_html('htc_reactor.html')
def setUp(self): self.test_shape = paramak.PoloidalFieldCoilSet( heights=[10, 15, 5], widths=[20, 25, 30], center_points=[(100, 100), (200, 200), (300, 300)] )
def main(): rot_angle = 180 all_components = [] plasma = paramak.Plasma( # default parameters rotation_angle=rot_angle, stp_filename="plasma_shape.stp", ) all_components.append(plasma) component = paramak.BlanketFP( plasma=plasma, thickness=100, stop_angle=90, start_angle=-90, offset_from_plasma=30, rotation_angle=rot_angle, stp_filename="blanket_constant_thickness_outboard_plasma.stp", ) all_components.append(component) component = paramak.BlanketCutterStar(height=2000, width=2000, distance=100) all_components.append(component) component = paramak.BlanketFP( plasma=plasma, thickness=100, stop_angle=90, start_angle=250, offset_from_plasma=30, rotation_angle=rot_angle, stp_filename="blanket_constant_thickness_inboard_plasma.stp", ) all_components.append(component) component = paramak.BlanketFP( plasma=plasma, thickness=100, stop_angle=250, start_angle=-90, offset_from_plasma=30, rotation_angle=rot_angle, stp_filename="blanket_constant_thickness_plasma.stp", ) all_components.append(component) CenterColumnShieldCylinder = paramak.CenterColumnShieldCylinder( inner_radius=80, outer_radius=100, height=300, rotation_angle=rot_angle, stp_filename="center_column_shield_cylinder.stp", ) all_components.append(CenterColumnShieldCylinder) component = paramak.InboardFirstwallFCCS( central_column_shield=CenterColumnShieldCylinder, thickness=50, rotation_angle=rot_angle, stp_filename="firstwall_from_center_column_shield_cylinder.stp", ) all_components.append(component) CenterColumnShieldHyperbola = paramak.CenterColumnShieldHyperbola( inner_radius=50, mid_radius=75, outer_radius=100, height=300, rotation_angle=rot_angle, stp_filename="center_column_shield_hyperbola.stp", ) all_components.append(CenterColumnShieldHyperbola) component = paramak.InboardFirstwallFCCS( central_column_shield=CenterColumnShieldHyperbola, thickness=50, rotation_angle=rot_angle, stp_filename="firstwall_from_center_column_shield_hyperbola.stp", ) all_components.append(component) CenterColumnShieldCircular = paramak.CenterColumnShieldCircular( inner_radius=50, mid_radius=75, outer_radius=100, height=300, rotation_angle=rot_angle, stp_filename="center_column_shield_circular.stp", ) all_components.append(CenterColumnShieldCircular) component = paramak.InboardFirstwallFCCS( central_column_shield=CenterColumnShieldCircular, thickness=50, rotation_angle=rot_angle, stp_filename="firstwall_from_center_column_shield_circular.stp", ) all_components.append(component) CenterColumnShieldFlatTopHyperbola = paramak.CenterColumnShieldFlatTopHyperbola( inner_radius=50, mid_radius=75, outer_radius=100, arc_height=220, height=300, rotation_angle=rot_angle, stp_filename="center_column_shield_flat_top_hyperbola.stp", ) all_components.append(CenterColumnShieldFlatTopHyperbola) component = paramak.InboardFirstwallFCCS( central_column_shield=CenterColumnShieldFlatTopHyperbola, thickness=50, rotation_angle=rot_angle, stp_filename= "firstwall_from_center_column_shield_flat_top_hyperbola.stp", ) all_components.append(component) CenterColumnShieldFlatTopCircular = paramak.CenterColumnShieldFlatTopCircular( inner_radius=50, mid_radius=75, outer_radius=100, arc_height=220, height=300, rotation_angle=rot_angle, stp_filename="center_column_shield_flat_top_Circular.stp", ) all_components.append(CenterColumnShieldFlatTopCircular) component = paramak.InboardFirstwallFCCS( central_column_shield=CenterColumnShieldFlatTopCircular, thickness=50, rotation_angle=rot_angle, stp_filename= "firstwall_from_center_column_shield_flat_top_Circular.stp", ) all_components.append(component) CenterColumnShieldPlasmaHyperbola = paramak.CenterColumnShieldPlasmaHyperbola( inner_radius=150, mid_offset=50, edge_offset=40, height=800, rotation_angle=rot_angle, stp_filename="center_column_shield_plasma_hyperbola.stp", ) all_components.append(CenterColumnShieldPlasmaHyperbola) component = paramak.InboardFirstwallFCCS( central_column_shield=CenterColumnShieldPlasmaHyperbola, thickness=50, rotation_angle=rot_angle, stp_filename="firstwall_from_center_column_shield_plasma_hyperbola.stp", ) all_components.append(component) component = paramak.InnerTfCoilsCircular( inner_radius=25, outer_radius=100, number_of_coils=10, gap_size=5, height=300, stp_filename="inner_tf_coils_circular.stp", ) all_components.append(component) component = paramak.InnerTfCoilsFlat( inner_radius=25, outer_radius=100, number_of_coils=10, gap_size=5, height=300, stp_filename="inner_tf_coils_flat.stp", ) all_components.append(component) # this makes 4 pf coil cases pf_coil_set = paramak.PoloidalFieldCoilCaseSet( heights=[10, 10, 20, 20], widths=[10, 10, 20, 40], casing_thicknesses=[5, 5, 10, 10], center_points=[(100, 100), (100, 150), (50, 200), (50, 50)], rotation_angle=rot_angle, stp_filename="pf_coil_case_set.stp") all_components.append(pf_coil_set) # this makes 4 pf coils pf_coil_set = paramak.PoloidalFieldCoilSet(heights=[10, 10, 20, 20], widths=[10, 10, 20, 40], center_points=[(100, 100), (100, 150), (50, 200), (50, 50)], rotation_angle=rot_angle, stp_filename="pf_coil_set.stp") all_components.append(pf_coil_set) # this makes 4 pf coil cases for the 4 pf coils made above component = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=pf_coil_set, casing_thicknesses=[5, 5, 10, 10], rotation_angle=rot_angle, stp_filename="pf_coil_cases_set.stp") all_components.append(component) # this makes 1 pf coils pf_coil = paramak.PoloidalFieldCoil(center_point=(100, 100), height=20, width=20, rotation_angle=rot_angle, stp_filename="poloidal_field_coil.stp") all_components.append(pf_coil) # this makes one PF coil case for the provided pf coil component = paramak.PoloidalFieldCoilCaseSetFC( pf_coils=[pf_coil], casing_thicknesses=[10], rotation_angle=rot_angle, stp_filename="pf_coil_cases_set_fc.stp") all_components.append(component) component = paramak.PoloidalFieldCoilCaseFC( pf_coil=pf_coil, casing_thickness=10, rotation_angle=rot_angle, stp_filename="poloidal_field_coil_case_fc.stp", ) all_components.append(component) component = paramak.PoloidalFieldCoilCase( center_point=(100, 100), coil_height=20, coil_width=20, casing_thickness=10, rotation_angle=rot_angle, stp_filename="poloidal_field_coil_case.stp", ) all_components.append(component) component = paramak.BlanketConstantThicknessArcV( inner_lower_point=(300, -200), inner_mid_point=(500, 0), inner_upper_point=(300, 200), thickness=100, rotation_angle=rot_angle, stp_filename="blanket_arc_v.stp", ) all_components.append(component) component = paramak.BlanketConstantThicknessArcH( inner_lower_point=(300, -200), inner_mid_point=(400, 0), inner_upper_point=(300, 200), thickness=100, rotation_angle=rot_angle, stp_filename="blanket_arc_h.stp", ) all_components.append(component) component = paramak.ToroidalFieldCoilRectangle( horizontal_start_point=(100, 700), vertical_mid_point=(800, 0), thickness=150, distance=60, stp_filename="tf_coil_rectangle.stp", number_of_coils=1, ) all_components.append(component) component = paramak.ToroidalFieldCoilCoatHanger( horizontal_start_point=(200, 500), horizontal_length=400, vertical_mid_point=(700, 50), vertical_length=500, thickness=50, distance=50, stp_filename="toroidal_field_coil_coat_hanger.stp", number_of_coils=1, ) all_components.append(component) component = paramak.ToroidalFieldCoilTripleArc( R1=80, h=200, radii=(70, 100), coverages=(60, 60), thickness=30, distance=30, number_of_coils=1, stp_filename="toroidal_field_coil_triple_arc.stp") all_components.append(component) magnet = paramak.ToroidalFieldCoilPrincetonD( R1=80, R2=300, thickness=30, distance=30, number_of_coils=1, stp_filename="toroidal_field_coil_princeton_d.stp") all_components.append(magnet) component = paramak.ITERtypeDivertor( # default parameters rotation_angle=rot_angle, stp_filename="ITER_type_divertor.stp", ) all_components.append(component) component = paramak.PortCutterRotated(center_point=(450, 0), polar_coverage_angle=20, rotation_angle=10, polar_placement_angle=45, azimuth_placement_angle=0) all_components.append(component) component = paramak.PortCutterRectangular( distance=3, z_pos=0, height=0.2, width=0.4, fillet_radius=0.02, azimuth_placement_angle=[0, 45, 90, 180]) all_components.append(component) component = paramak.PortCutterCircular( distance=3, z_pos=0.25, radius=0.1, # azimuth_placement_angle=[0, 45, 90, 180], # TODO: fix issue #548 azimuth_placement_angle=[0, 45, 90], ) all_components.append(component) component = paramak.VacuumVessel(height=2, inner_radius=1, thickness=0.2, rotation_angle=270) all_components.append(component) component = paramak.CoolantChannelRingStraight( height=200, channel_radius=10, ring_radius=70, number_of_coolant_channels=8, workplane="XY", rotation_axis="Z", stp_filename="coolant_channel_ring_straight.stp", ) all_components.append(component) component = paramak.CoolantChannelRingCurved( height=200, channel_radius=10, ring_radius=70, mid_offset=-20, number_of_coolant_channels=8, workplane="XY", path_workplane="XZ", stp_filename="coolant_channel_ring_curved.stp", force_cross_section=True) all_components.append(component) component = paramak.RotatedIsoscelesTriangle( height=20, base_length=15, pivot_angle=0, pivot_point=(100, 50), rotation_angle=70, workplane='XY', stp_filename='rotated_isosceles_triangle.stp') all_components.append(component) component = paramak.RotatedTrapezoid(length_1=10, length_2=20, length_3=30, pivot_angle=0, pivot_point=(100, 50), rotation_angle=45, stp_filename='rotated_trapezoid.stp') all_components.append(component) component = paramak.PoloidalSegments(number_of_segments=5, center_point=(400, 50)) all_components.append(component) component = paramak.TFCoilCasing(magnet=magnet, inner_offset=10, outer_offset=15, vertical_section_offset=20, distance=40) all_components.append(component) component = paramak.HexagonPin(length_of_side=5, distance=10, center_point=(10, 20)) all_components.append(component) return all_components
def test_PoloidalFieldCoilSet_incorrect_center_points(): """Checks PoloidalFieldCoilSet with center_points as the wrong type""" paramak.PoloidalFieldCoilSet(heights=[10, 10, 10], widths=[20, 20, 20], center_points=100)
def _make_component_cuts(self): # the divertor is cut away then the firstwall can be added to the # reactor using CQ operations self._firstwall.solid = self._firstwall.solid.cut(self._divertor.solid) self.shapes_and_components.append(self._firstwall) # cutting the supports away from the blanket self._blanket.solid = self._blanket.solid.cut(self._supports.solid) self.shapes_and_components.append(self._blanket) self._outboard_rear_blanket_wall_upper = paramak.RotateStraightShape( points=[ (self._center_column_shield_end_radius, self._blanket_rear_wall_start_height), (self._center_column_shield_end_radius, self._blanket_rear_wall_end_height), ( max([item[0] for item in self._inboard_firstwall.points]), self._blanket_rear_wall_end_height, ), ( max([item[0] for item in self._inboard_firstwall.points]), self._blanket_rear_wall_start_height, ), ], rotation_angle=self.rotation_angle, ) self._outboard_rear_blanket_wall_lower = paramak.RotateStraightShape( points=[ (self._center_column_shield_end_radius, -self._blanket_rear_wall_start_height), (self._center_column_shield_end_radius, -self._blanket_rear_wall_end_height), ( max([item[0] for item in self._inboard_firstwall.points]), -self._blanket_rear_wall_end_height, ), ( max([item[0] for item in self._inboard_firstwall.points]), -self._blanket_rear_wall_start_height, ), ], rotation_angle=self.rotation_angle, ) self._outboard_rear_blanket_wall = paramak.BlanketFP( plasma=self._plasma, start_angle=90, stop_angle=-90, offset_from_plasma=self.outer_plasma_gap_radial_thickness + self.firstwall_radial_thickness + self.outboard_blanket_radial_thickness, thickness=self.blanket_rear_wall_radial_thickness, rotation_angle=self.rotation_angle, stp_filename="outboard_rear_blanket_wall.stp", stl_filename="outboard_rear_blanket_wall.stl", name="outboard_rear_blanket_wall", material_tag="rear_blanket_wall_mat", union=[ self._outboard_rear_blanket_wall_upper, self._outboard_rear_blanket_wall_lower ], ) self.shapes_and_components.append(self._outboard_rear_blanket_wall) if self._tf_info_provided: self._tf_coil = paramak.ToroidalFieldCoilRectangle( with_inner_leg=False, horizontal_start_point=( self._inboard_tf_coils_start_radius, self._blanket_rear_wall_end_height, ), vertical_mid_point=(self._outboard_tf_coil_start_radius, 0), thickness=self.outboard_tf_coil_radial_thickness, number_of_coils=self.number_of_tf_coils, distance=self.outboard_tf_coil_poloidal_thickness, stp_filename="outboard_tf_coil.stp", stl_filename="outboard_tf_coil.stl", rotation_angle=self.rotation_angle) self.shapes_and_components.append(self._tf_coil) if self._pf_info_provided: self._pf_coil = paramak.PoloidalFieldCoilSet( heights=self.pf_coil_vertical_thicknesses, widths=self.pf_coil_radial_thicknesses, center_points=self._pf_coils_xy_values, rotation_angle=self.rotation_angle, stp_filename='pf_coils.stp', name="pf_coil", material_tag="pf_coil_mat", ) self.shapes_and_components.append(self._pf_coil)
def test_PoloidalFieldCoilSet_incorrect_width_length(): """Checks PoloidalFieldCoilSet with not enough entries in width""" paramak.PoloidalFieldCoilSet(heights=[10, 10, 10], widths=[20, 20], center_points=[(100, 100), (200, 200), (300, 300)])
def test_PoloidalFieldCoilSet_incorrect_width(): """Checks PoloidalFieldCoilSet with width as the wrong type""" paramak.PoloidalFieldCoilSet(heights=[10, 10, 10], widths=20, center_points=[(100, 100), (200, 200), (300, 300)])