Python API reference#

Assemblies#

paramak.tokamak(radial_build, vertical_build, triangularity=0.55, rotation_angle=180.0, extra_cut_shapes=[], extra_intersect_shapes=[])[source]#

Creates a tokamak fusion reactor from a radial build and plasma parameters.

Parameters:
  • radial_build – A list of tuples containing the radial build of the reactor.

  • elongation – The elongation of the plasma. Defaults to 2.0.

  • triangularity – The triangularity of the plasma. Defaults to 0.55.

  • rotation_angle – The rotation angle of the plasma. Defaults to 180.0.

  • extra_cut_shapes – A list of extra shapes to cut the reactor with. Defaults to [].

  • extra_intersect_shapes – A list of extra shapes to intersect the reactor with. Defaults to [].

Returns:

A CadQuery Assembly object representing the tokamak fusion reactor.

Return type:

CadQuery.Assembly

paramak.tokamak_from_plasma(radial_build, elongation=2.0, triangularity=0.55, rotation_angle=180.0, extra_cut_shapes=[], extra_intersect_shapes=[])[source]#
paramak.spherical_tokamak(radial_build, vertical_build, triangularity=0.55, rotation_angle=180.0, extra_cut_shapes=[], extra_intersect_shapes=[])[source]#

_summary_

Parameters:
  • radial_build

  • elongation (float, optional) – _description_. Defaults to 2.0.

  • triangularity (float, optional) – _description_. Defaults to 0.55.

  • rotation_angle (Optional[str], optional) – _description_. Defaults to 180.0.

  • extra_cut_shapes (Sequence, optional) – _description_. Defaults to [].

Returns:

_description_

Return type:

_type_

paramak.spherical_tokamak_from_plasma(radial_build, elongation=2.0, triangularity=0.55, rotation_angle=180.0, extra_cut_shapes=[], extra_intersect_shapes=[])[source]#

_summary_

Parameters:
  • elongation (float, optional) – _description_. Defaults to 2.0.

  • triangularity (float, optional) – _description_. Defaults to 0.55.

  • rotation_angle (Optional[str], optional) – _description_. Defaults to 180.0.

  • extra_cut_shapes (Sequence, optional) – _description_. Defaults to [].

Returns:

_description_

Return type:

_type_

Workplanes#

paramak.blanket_from_plasma(thickness, start_angle, stop_angle, minor_radius=150.0, major_radius=450.0, triangularity=0.55, elongation=2.0, vertical_displacement=0.0, offset_from_plasma=0.0, num_points=50, name='blanket_from_plasma', color=(0.333, 0.0, 0.0), rotation_angle=90.0, plane='XZ', origin=(0, 0, 0), obj=None, allow_overlapping_shape=False, connect_to_center=False)[source]#

A blanket volume created from plasma parameters. In might be nessecary to increase the num_points when making long but thin geometry with this component.

Parameters:
  • thickness (float or [float] or callable or [(float), (float)]) – the thickness of the blanket (cm). If the thickness is a float then this produces a blanket of constant thickness. If the thickness is a tuple of floats, blanket thickness will vary linearly between the two values. If thickness is callable, then the blanket thickness will be a function of poloidal angle (in degrees). If thickness is a list of two lists (thicknesses and angles) then these will be used together with linear interpolation.

  • start_angle – the angle in degrees to start the blanket, measured anti clockwise from 3 o’clock.

  • stop_angle – the angle in degrees to stop the blanket, measured anti clockwise from 3 o’clock.

  • plasma – If not None, the parameters of the plasma Object will be used.

  • minor_radius – the minor radius of the plasma (cm).

  • major_radius – the major radius of the plasma (cm).

  • triangularity – the triangularity of the plasma.

  • elongation – the elongation of the plasma.

  • vertical_displacement – the vertical_displacement of the plasma (cm).

  • offset_from_plasma – the distance between the plasma and the blanket (cm). If float, constant offset. If list of floats, offset will vary linearly between the values. If callable, offset will be a function of poloidal angle (in degrees). If a list of two lists (angles and offsets) then these will be used together with linear interpolation.

  • num_points – number of points that will describe the shape.

  • allow_overlapping_shape – allows parameters to create a shape that overlaps itself.

paramak.center_column_shield_cylinder(height, inner_radius, thickness, reference_point=('center', 0), name='center_column_shield_cylinder', color=(0.0, 0.333, 0.0), rotation_angle=90, plane='XZ', origin=(0, 0, 0), obj=None)[source]#

A cylindrical center column shield volume with constant thickness.

Parameters:
  • height – height of the center column shield.

  • inner_radius – the inner radius of the center column shield.

  • thickness – the outer radius of the center column shield.

  • reference_point – the vertical coordinates to build te vessel from and description of the reference point. Can be either the ‘center’ with a numerical value or ‘lower’ with a numerical value.

paramak.constant_thickness_dome(thickness=10, chord_center_height=0, chord_width=100, chord_height=20, upper_or_lower='upper', name='constant_thickness_dome', plane='XZ', color=(0.0, 0.333, 0.0), origin=(0, 0, 0), rotation_angle=90, obj=None, **kwargs)[source]#

A cylindrical vessel volume with constant thickness with a simple dished head. This style of tank head has no knuckle radius or straight flange. The dished shape is made from a chord of a circle.

Parameters:
  • thickness – the radial thickness of the dome.

  • chord_center_height – the vertical position of the chord center

  • chord_width – the width of the chord base

  • chord_height – the height of the chord which is also distance between the chord_center_height and the inner surface of the dome

  • upper_or_lower – Curves the dish with a positive or negative direction to allow the upper section or lower section of vacuum vessel domes to be made.

  • name – the name of the shape, used in the graph legend and as a filename prefix when exporting.

paramak.cutting_wedge(height, radius, rotation_angle=180.0, plane='XZ', origin=(0, 0, 0), obj=None, color=(0.0, 0.333, 0.0), name='cutting_wedge')[source]#

Creates a wedge from height, radius and rotation angle arguments than can be useful for cutting sector models.

Parameters:
  • height – the vertical (z axis) height of the coil (cm).

  • radius – the horizontal (x axis) width of the coil (cm).

  • rotation_angle – Defaults to 180.0.

paramak.dished_vacuum_vessel(radius=300, reference_point=('center', 0), dish_height=(20, 50), cylinder_height=400, thickness=15, rotation_angle=90, name='dished_vessel', plane='XZ')[source]#

A cylindrical vessel volume with constant thickness with a simple dished head. This style of tank head has no knuckle radius or straight flange.

Parameters:
  • radius – the radius from which the centres of the vessel meets the outer circumference.

  • reference_point – the x,z coordinates to build te vessel from. Can be either the ‘center’ with a value or ‘lower’ with a value. For example

  • dish_height – the height of the lower and upper dish sections.

  • cylinder_height – the height of the cylindrical section of the vacuum vessel.

  • thickness – the radial thickness of the vessel in cm.

paramak.plasma_simplified(elongation=2.0, major_radius=450.0, minor_radius=150.0, triangularity=0.55, vertical_displacement=0.0, num_points=50, name='tokamak_plasma', color=(0.333, 0.0, 0.0), rotation_angle=90, plane='XZ', origin=(0, 0, 0), obj=None)[source]#

Creates a double null tokamak plasma shape that is controlled by 4 shaping parameters.

Parameters:
  • elongation – the elongation of the plasma.

  • major_radius – the major radius of the plasma (cm).

  • minor_radius – the minor radius of the plasma (cm).

  • triangularity – the triangularity of the plasma.

  • vertical_displacement – the vertical_displacement of the plasma (cm)..

  • num_points – number of points to describe the shape.

paramak.poloidal_field_coil_case(coil_height, coil_width, casing_thickness, center_point, name='poloidal_field_coil_case', color=(1.0, 1.0, 0.498), rotation_angle=90, plane='XZ', origin=(0, 0, 0), obj=None)[source]#

Constant thickness casing for a rectangular poloidal coil.

Parameters:
  • coil_height – the vertical (z axis) height of the coil (cm).

  • coil_width – the horizontal (x axis) width of the coil (cm).

  • center_point – the center of the coil (x,z) values (cm).

  • casing_thickness – the thickness of the coil casing (cm).

paramak.poloidal_field_coil(height, width, center_point, name='poloidal_field_coil', color=(0.0, 0.333, 0.0), rotation_angle=90, plane='XZ', origin=(0, 0, 0), obj=None)[source]#

A rectangular poloidal field coil.

Parameters:
  • height – the vertical (z axis) height of the coil.

  • width – the horizontal (x axis) width of the coil.

  • center_point – the center of the coil (x,z) values.

paramak.toroidal_field_coil_rectangle(horizontal_start_point=(20, 200), vertical_mid_point=(350, 0), thickness=30, distance=20, rotation_angle=360.0, name='toroidal_field_coil', with_inner_leg=True, azimuthal_placement_angles=[0], vertical_displacement=0.0, color=(0.0, 0.0, 1.0), plane='XZ', origin=(0.0, 0.0, 0.0), obj=None)[source]#

Creates a rectangular shaped toroidal field coil.

Parameters:
  • horizontal_start_point – the (x,z) coordinates of the inner upper point (cm).

  • vertical_mid_point – the (x,z) coordinates of the mid point of the vertical section (cm).

  • thickness – the thickness of the toroidal field coil.

  • distance – the extrusion distance.

  • rotation_angle (float) – angle of rotation in degrees, this cuts the resulting shape with a wedge. Useful for sector models.

  • with_inner_leg – include the inner tf leg. Defaults to True.

  • azimuth_start_angle – The azimuth angle to for the first TF coil which offsets the placement of coils around the azimuthal angle

paramak.u_shaped_dome(radius=310, reference_point=('lower', 0), dish_height=50, cylinder_height=400, thickness=16, rotation_angle=180, name='u_shaped_dome', plane='XZ', upper_or_lower='upper')[source]#

A cylindrical u shaped dome with constant thickness.

Parameters:
  • radius – the radius from which the centres of the vessel meets the outer circumference.

  • reference_point – the x,z coordinates to build te vessel from. Can be either the ‘center’ with a value or ‘lower’ with a value. For example

  • dish_height – the height of the lower and upper dish sections.

  • cylinder_height – the height of the cylindrical section of the vacuum vessel.

  • thickness – the radial thickness of the vessel in cm.