Skip to content

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
References

The reference numbers are the same in all the PyFlange modules (see the references page). This module cites:

  • [2] IEC 61400-6:2020+AMD1:2025 CSV. Wind energy generation systems - Part 6: Tower and foundation design requirements. Consolidated version,
  • The bolt tensile resistance is given by its eq. G.6.

and the following product and design standards:

  • ISO 68-1:1998, ISO general purpose screw threads - Basic profile.
  • ISO 724, ISO general-purpose metric screw threads - Basic dimensions.
  • ISO 898-1:2013, Mechanical properties of fasteners - Part 1: Bolts, screws and studs.
  • ISO 4032, Hexagon regular nuts (style 1).
  • ISO 7089, Plain washers - Normal series.
  • EN 1993-1-8:2005, Eurocode 3 - Design of joints.
  • VDI 2230 Part 1, Systematic calculation of highly stressed bolted joints.

Classes:

  • Bolt –

    Base class for bolt representations.

  • BoltCrossSection –

    Circular cross-section of a bolt.

  • MetricBolt –

    Generic bolt with ISO 68-1 metric screw thread.

  • Washer –

    Base class for washer representations.

  • FlatWasher –

    Generic flat washer.

  • Nut –

    Base class for nut representations.

  • HexNut –

    Generic hexagonal nut.

Functions:

  • StandardMetricBolt –

    Create a metric bolt with standard dimensions and material properties.

  • standard_hole_diameter –

    Return the standard clearance hole diameter for a metric bolt.

  • ISOFlatWasher –

    Generate a standard flat washer according to ISO 7089.

  • ISOHexNut –

    Generate a standard hexagonal nut according to ISO 4032.

  • RoundNut –

    Generate a standard flanged round nut.

Bolt

Base class for bolt representations.

BoltCrossSection dataclass

BoltCrossSection(diameter)

Circular cross-section of a bolt.

Attributes:

  • diameter (float) –

    Cross-section diameter.

area cached property

area

float: Cross-sectional area.

second_moment_of_area cached property

second_moment_of_area

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

elastic_section_modulus cached property

elastic_section_modulus

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

MetricBolt dataclass

MetricBolt(nominal_diameter, thread_pitch, yield_stress, ultimate_tensile_stress, elastic_modulus=210 * GPa, poissons_ratio=0.3, shank_length=0, shank_diameter_ratio=1, stud=False)

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.

Methods:

designation cached property

designation

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

shank_diameter cached property

shank_diameter

float: Diameter of the unthreaded shank.

thread_height cached property

thread_height

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

thread_basic_minor_diameter cached property

thread_basic_minor_diameter

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

thread_basic_pitch_diameter cached property

thread_basic_pitch_diameter

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

thread_minor_diameter cached property

thread_minor_diameter

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

nominal_cross_section cached property

nominal_cross_section

BoltCrossSection: Bolt cross-section with nominal diameter.

shank_cross_section cached property

shank_cross_section

BoltCrossSection: Bolt shank cross-section.

thread_cross_section cached property

thread_cross_section

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

shear_modulus cached property

shear_modulus

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

shank_cross_section_area cached property

shank_cross_section_area

float: Area of the shank transversal cross-section.

Deprecated

Use MetricBolt.shank_cross_section.area instead.

nominal_cross_section_area cached property

nominal_cross_section_area

float: Area of a circle with nominal diameter.

Deprecated

Use MetricBolt.nominal_cross_section.area instead.

tensile_cross_section_area cached property

tensile_cross_section_area

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

tensile_moment_of_resistance

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.

ultimate_tensile_capacity

ultimate_tensile_capacity(standard='Eurocode')

Evaluate the ultimate tensile force that the bolt can sustain.

According to EN 1993-1-8, the tensile resistance is 0.9 * fub * As / 1.25, where fub is the ultimate tensile stress and As the area of thread_cross_section. This is also the tensile resistance F_t,R used by the flange segment models (ref. [2], eq. G.6).

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.

axial_stiffness

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

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.

Washer

Base class for washer representations.

FlatWasher dataclass

FlatWasher(outer_diameter, inner_diameter, thickness, elastic_modulus=210 * GPa, poissons_ratio=0.3)

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

area

float: Surface area of the flat annular face.

axial_stiffness cached property

axial_stiffness

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

Nut

Base class for nut representations.

HexNut dataclass

HexNut(nominal_diameter, thickness, inscribed_diameter, circumscribed_diameter, bearing_diameter, elastic_modulus=210 * GPa, poissons_ratio=0.3)

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.

StandardMetricBolt

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

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

ISOFlatWasher

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

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

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.