pyflange.bolts

Bolt, washer, and nut fastener components.

This module contains classes and factory functions representing bolt, washer, and nut fastener components. In particular it provides:

  • A MetricBolt class that models generic bolts with metric screw threads and a StandardMetricBolt factory function that generates MetricBolt objects with standard properties.
  • A standard_hole_diameter function returning the standard clearance hole diameter of a metric bolt.
  • A FlatWasher class that models generic flat washers and an ISOFlatWasher factory function that returns a FlatWasher with ISO 7089 standard dimensions.
  • A HexNut class that models generic hexagonal nuts, an ISOHexNut factory function that generates a HexNut with ISO 4032 dimensions, and a RoundNut factory function that generates a standard flanged nut.
  • Bolt, Washer and Nut base classes, and the BoltCrossSection helper class describing a circular cross-section.
Units

All parameters must be supplied in a consistent system of units, e.g. meters for lengths and pascals for stresses.

Example

The following example creates an M80 stud bolt of grade 10.9, together with its standard nut, and evaluates the bolt axial stiffness.

from pyflange.bolts import StandardMetricBolt, RoundNut

bolt = StandardMetricBolt("M80", "10.9", shank_length=0.160, stud=True)
nut = RoundNut("M80")
k = bolt.axial_stiffness(0.35)    # axial stiffness for a 350 mm clamped length

Bolt

Base class for bolt representations.

BoltCrossSection dataclass

Circular cross-section of a bolt.

Attributes:
  • diameter (float) –

    Cross-section diameter.

area cached property

float: Cross-sectional area.

elastic_section_modulus cached property

float: Elastic section modulus of the circular cross-section.

second_moment_of_area cached property

float: Second moment of area of the circular cross-section.

FlatWasher dataclass

Bases: Washer

Generic flat washer.

The parameters must be expressed in a consistent system of units. For example, if you choose to input distances in meters (m) and forces in newtons (N), then stresses must be expressed in pascals (N/m²). All attributes and methods return values consistent with the input units of measurement.

All input parameters are also available as attributes of the generated instance (e.g. washer.thickness, washer.poissons_ratio, etc.).

Instances of this class are designed to be immutable; changing attributes after instantiation is not recommended. If a washer with different attributes is needed, instantiate a new one.

Attributes:
  • outer_diameter (float) –

    Outer diameter of the washer.

  • inner_diameter (float) –

    Inner (hole) diameter of the washer.

  • thickness (float) –

    Thickness of the washer.

  • elastic_modulus (float) –

    Young's modulus of the washer material. Defaults to 210 GPa (210e9 N/m²).

  • poissons_ratio (float) –

    Poisson's ratio of the washer material. Defaults to 0.3.

area cached property

float: Surface area of the flat annular face.

axial_stiffness cached property

float: Compressive axial stiffness of the washer (EA / t).

HexNut dataclass

Bases: Nut

Generic hexagonal nut.

The parameters must be expressed in a consistent system of units. For example, if you choose to input distances in meters (m) and forces in newtons (N), then stresses must be expressed in pascals (N/m²). All attributes and methods return values consistent with the input units of measurement.

All input parameters are also available as attributes of the generated instance (e.g. nut.thickness, nut.bearing_diameter, etc.).

Instances of this class are designed to be immutable; changing attributes after instantiation is not recommended. If a nut with different attributes is needed, instantiate a new one.

Attributes:
  • nominal_diameter (float) –

    Nominal diameter of the inner thread.

  • thickness (float) –

    Height/thickness of the nut.

  • inscribed_diameter (float) –

    Diameter of the circle inscribed in the hexagon (distance between opposite flats).

  • circumscribed_diameter (float) –

    Diameter of the circle circumscribed around the hexagon (distance between opposite vertices).

  • bearing_diameter (float) –

    Outer diameter of the circular contact surface between nut and washer or flange.

  • elastic_modulus (float) –

    Young's modulus of the nut material. Defaults to 210 GPa (210e9 N/m²).

  • poissons_ratio (float) –

    Poisson's ratio of the nut material. Defaults to 0.3.

MetricBolt dataclass

Bases: Bolt

Generic bolt with ISO 68-1 metric screw thread.

The parameters must be expressed in a consistent system of units. For example, if you choose to input distances in meters (m) and forces in newtons (N), then stresses must be expressed in pascals (N/m²). All bolt attributes and methods return values consistent with the input units of measurement.

All input parameters are also available as attributes of the generated instance (e.g. bolt.shank_length, bolt.yield_stress, etc.).

Instances of this class are designed to be immutable; changing attributes after instantiation is not recommended. If a bolt with different parameters is needed, instantiate a new one.

Attributes:
  • nominal_diameter (float) –

    Outermost (nominal) diameter of the screw thread.

  • thread_pitch (float) –

    Pitch of the metric thread.

  • yield_stress (float) –

    Nominal yield stress (0.2% strain limit) of the bolt material.

  • ultimate_tensile_stress (float) –

    Nominal ultimate tensile stress of the bolt material.

  • elastic_modulus (float) –

    Young's modulus of the bolt material. Defaults to 210 GPa (210e9 N/m²).

  • poissons_ratio (float) –

    Poisson's ratio of the bolt material. Defaults to 0.3.

  • shank_length (float) –

    Length of the unthreaded shank. Defaults to 0.0.

  • shank_diameter_ratio (float) –

    Ratio between the shank diameter and the nominal diameter. Defaults to 1.0 (shank has nominal diameter).

  • stud (bool) –

    True if this is a stud bolt, False otherwise. Defaults to False.

designation cached property

str: Bolt designation string (e.g. 'M16' for a bolt with 16 mm diameter).

nominal_cross_section cached property

BoltCrossSection: Bolt cross-section with nominal diameter.

nominal_cross_section_area cached property

float: Area of a circle with nominal diameter.

Deprecated

Use MetricBolt.nominal_cross_section.area instead.

shank_cross_section cached property

BoltCrossSection: Bolt shank cross-section.

shank_cross_section_area cached property

float: Area of the shank transversal cross-section.

Deprecated

Use MetricBolt.shank_cross_section.area instead.

shank_diameter cached property

float: Diameter of the unthreaded shank.

shear_modulus cached property

float: Shear modulus G, under the assumption of isotropic linear elastic material.

tensile_cross_section_area cached property

float: Tensile stress area, according to ISO 898-1:2013, section 9.1.6.1.

Deprecated

Use MetricBolt.thread_cross_section.area instead.

tensile_moment_of_resistance cached property

float: Tensile moment of resistance, according to ISO 898-1:2013, section 9.1.6.1.

Deprecated

Use MetricBolt.thread_cross_section.elastic_section_modulus instead.

thread_basic_minor_diameter cached property

float: Basic minor diameter (d1), per ISO 68-1:1998.

thread_basic_pitch_diameter cached property

float: Basic pitch diameter (d2), per ISO 68-1:1998.

thread_cross_section cached property

BoltCrossSection: Bolt cross-section used for tensile calculations (ISO 898-1:2013, sec. 9.1.6.1).

thread_height cached property

float: Height of the metric thread fundamental triangle (H), per ISO 68-1:1998.

thread_minor_diameter cached property

float: Minor diameter (d3), per ISO 898-1:2013.

axial_stiffness(length)

Evaluate the axial stiffness of the clamped bolt.

Calculates the axial stiffness according to VDI 2230 Part 1, Section 5.1.1.1.

Parameters:
  • length (float) –

    Clamped length.

Returns:
  • float –

    Axial stiffness of the bolt.

Raises:
  • AssertionError –

    If length is less than shank_length.

bending_stiffness(length)

Evaluate the bending stiffness of the clamped bolt.

Calculates the bending stiffness according to VDI 2230 Part 1, Section 5.1.1.2.

Parameters:
  • length (float) –

    Clamped length.

Returns:
  • float –

    Bending stiffness of the bolt.

Raises:
  • AssertionError –

    If length is less than shank_length.

ultimate_tensile_capacity(standard='Eurocode')

Evaluate the ultimate tensile force that the bolt can sustain.

Parameters:
  • standard (str, default: 'Eurocode' ) –

    Standard according to which the ultimate tensile force should be calculated. Currently supported: "Eurocode" (EN 1993-1-8:2005). Defaults to "Eurocode".

Returns:
  • float –

    The bolt ultimate tensile force according to the specified standard.

Raises:
  • ValueError –

    If the requested standard is not supported.

Nut

Base class for nut representations.

Washer

Base class for washer representations.

ISOFlatWasher(designation)

Generate a standard flat washer according to ISO 7089.

Parameters:
  • designation (str) –

    Metric screw thread designation. Allowed values: 'M4', 'M5', 'M6', 'M8', 'M10', 'M12', 'M14', 'M16', 'M18', 'M20', 'M22', 'M24', 'M27', 'M30', 'M33', 'M36', 'M39', 'M42', 'M45', 'M48', 'M52', 'M56', 'M60', 'M64', 'M72', 'M80', 'M90', 'M100'.

Returns:
  • FlatWasher –

    A FlatWasher instance having standard dimensions defined in ISO 7089 (e.g., for "M16", outer diameter 30 mm, hole diameter 17 mm, thickness 3 mm).

ISOHexNut(designation)

Generate a standard hexagonal nut according to ISO 4032.

Parameters:
  • designation (str) –

    Metric screw thread designation. Allowed values: 'M4', 'M5', 'M6', 'M8', 'M10', 'M12', 'M14', 'M16', 'M18', 'M20', 'M22', 'M24', 'M27', 'M30', 'M33', 'M36', 'M39', 'M42', 'M45', 'M48', 'M52', 'M56', 'M60', 'M64', 'M72', 'M80', 'M90', 'M100'.

Returns:
  • HexNut –

    A HexNut instance with dimensions according to ISO 4032.

RoundNut(designation)

Generate a standard flanged round nut.

Parameters:
  • designation (str) –

    Metric screw thread designation. Allowed values: 'M4', 'M5', 'M6', 'M8', 'M10', 'M12', 'M14', 'M16', 'M18', 'M20', 'M22', 'M24', 'M27', 'M30', 'M33', 'M36', 'M39', 'M42', 'M45', 'M48', 'M52', 'M56', 'M60', 'M64', 'M72', 'M80', 'M90', 'M100'.

Returns:
  • HexNut –

    A HexNut instance configured with dimensions of a standard flanged round nut.

StandardMetricBolt(designation, material_grade, shank_length=0.0, shank_diameter_ratio=1.0, stud=False)

Create a metric bolt with standard dimensions and material properties.

This function provides a convenient way of creating a MetricBolt object, given the standard geometry designation (e.g. "M20") and the standard material grade designation (e.g. "8.8").

Parameters:
  • designation (str) –

    Metric screw thread designation. Allowed values: 'M4', 'M5', 'M6', 'M8', 'M10', 'M12', 'M14', 'M16', 'M18', 'M20', 'M22', 'M24', 'M27', 'M30', 'M33', 'M36', 'M39', 'M42', 'M45', 'M48', 'M52', 'M56', 'M60', 'M64', 'M72', 'M80', 'M90', 'M100'.

  • material_grade (str) –

    Material grade designation. Allowed values: - Carbon-steel: '4.6', '4.8', '5.6', '5.8', '6.8', '8.8', '9.8', '10.9', '12.9' - Austenitic stainless: 'A50', 'A70', 'A80', 'A100' - Duplex stainless: 'D70', 'D80', 'D100' - Martensitic stainless: 'C50', 'C70', 'C80', 'C110' - Ferritic stainless: 'F45', 'F60'

  • shank_length (float, default: 0.0 ) –

    Length of the unthreaded shank. Defaults to 0.0.

  • shank_diameter_ratio (float | str, default: 1.0 ) –

    Ratio between the shank diameter and the bolt nominal diameter. If it is the string "pitch", the shank diameter is taken equal to the thread basic pitch diameter (ISO 724), as is common for reduced-shank stud bolts. Defaults to 1.0.

  • stud (bool, default: False ) –

    True if this is a stud bolt, False otherwise. Defaults to False.

Returns:
  • MetricBolt –

    A MetricBolt instance with standard properties.

Example
# M80 stud bolt whose shank diameter equals the thread pitch diameter
bolt = StandardMetricBolt("M80", "10.9", shank_length=0.160,
                          shank_diameter_ratio="pitch", stud=True)

standard_hole_diameter(designation)

Return the standard clearance hole diameter for a metric bolt.

The values are tabulated in the bolts.metric_screws database for the sizes 'M8', 'M10', 'M12', 'M16', 'M20', 'M24', 'M30', 'M36', 'M42', 'M48', 'M56', 'M64', 'M72' and 'M80'.

Parameters:
  • designation (str) –

    Metric screw thread designation (e.g. "M80").

Returns:
  • float –

    The clearance hole diameter, in meters (e.g. 0.086 for "M80").

Raises:
  • KeyError –

    If no standard hole diameter is available for the given designation.

Example
Do = standard_hole_diameter("M80")    # 0.086 m