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
MetricBoltclass that models generic bolts with metric screw threads and aStandardMetricBoltfactory function that generatesMetricBoltobjects with standard properties. - A
standard_hole_diameterfunction returning the standard clearance hole diameter of a metric bolt. - A
FlatWasherclass that models generic flat washers and anISOFlatWasherfactory function that returns aFlatWasherwith ISO 7089 standard dimensions. - A
HexNutclass that models generic hexagonal nuts, anISOHexNutfactory function that generates aHexNutwith ISO 4032 dimensions, and aRoundNutfactory function that generates a standard flanged nut. Bolt,WasherandNutbase classes, and theBoltCrossSectionhelper 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.
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
¶
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:
-
ultimate_tensile_capacity–Evaluate the ultimate tensile force that the bolt can sustain.
-
axial_stiffness–Evaluate the axial stiffness of the clamped bolt.
-
bending_stiffness–Evaluate the bending stiffness of the clamped bolt.
designation
cached
property
¶
str: Bolt designation string (e.g. 'M16' for a bolt with 16 mm diameter).
thread_height
cached
property
¶
float: Height of the metric thread fundamental triangle (H), per ISO 68-1:1998.
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_minor_diameter
cached
property
¶
float: Minor diameter (d3), per ISO 898-1:2013.
nominal_cross_section
cached
property
¶
BoltCrossSection: Bolt cross-section with nominal diameter.
shank_cross_section
cached
property
¶
BoltCrossSection: Bolt shank cross-section.
thread_cross_section
cached
property
¶
BoltCrossSection: Bolt cross-section used for tensile calculations (ISO 898-1:2013, sec. 9.1.6.1).
shear_modulus
cached
property
¶
float: Shear modulus G, under the assumption of isotropic linear elastic material.
shank_cross_section_area
cached
property
¶
float: Area of the shank transversal cross-section.
Deprecated
Use MetricBolt.shank_cross_section.area instead.
nominal_cross_section_area
cached
property
¶
float: Area of a circle with nominal diameter.
Deprecated
Use MetricBolt.nominal_cross_section.area instead.
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.
ultimate_tensile_capacity
¶
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
¶
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
lengthis less thanshank_length.
bending_stiffness
¶
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
lengthis less thanshank_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.
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
MetricBoltinstance with standard properties.
standard_hole_diameter
¶
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.
ISOFlatWasher
¶
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
FlatWasherinstance having standard dimensions defined in ISO 7089 (e.g., for "M16", outer diameter 30 mm, hole diameter 17 mm, thickness 3 mm).
ISOHexNut
¶
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
HexNutinstance with dimensions according to ISO 4032.
RoundNut
¶
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
HexNutinstance configured with dimensions of a standard flanged round nut.