pyflange.fatigue
Fatigue calculation and S-N curve tools for flanged connections.
This module provides data structures, fatigue (Wöhler) curve representations, and analysis classes to evaluate structural fatigue damage and fatigue life for large bolted flanges.
Key components provided by this module:
MarkovMatrix: Encapsulates a discrete cyclic load or stress history (load ranges, mean values, cycle counts, and duration) obtained from rainflow counting or design load spectra.FatigueCurve: Abstract base class defining the S-N curve interface and Palmgren-Miner linear cumulative damage accumulation: $$D = \sum_{i} \frac{n_i}{N(\Delta S_i)}$$SingleSlopeFatigueCurve: Represents a Wöhler curve with a single logarithmic slope exponent $m$, defined by the power law $N \cdot \Delta S^m = a$.MultiSlopeFatigueCurve: Represents a composite multi-slope S-N curve constructed as the upper envelope of multiple single-slope curve segments.DoubleSlopeFatigueCurve: Represents a bilinear S-N curve with two slopes ($m_1, m_2$) intersecting at a transition knee point $(\Delta S_{12}, N_{12})$.BoltFatigueCurve: Specialized bilinear S-N curve for threaded bolts conforming to IEC 61400-6 AMD1, incorporating nominal diameter size-effect corrections and a material partial safety factor $\gamma_M$.BoltFatigueAnalysis: End-to-end fatigue analysis pipeline that evaluates bolt stress spectra from flange bending moment histories, calculates total cumulative damage, and predicts bolt fatigue life.
Units
All parameters must be supplied in a consistent system of units. When using SI units:
- Distances and diameters: meters (m)
- Forces: newtons (N)
- Bending moments: newton-meters (N·m)
- Stresses and pressures: pascals (Pa)
- Duration and fatigue life: consistent time units (e.g., seconds or years)
BoltFatigueAnalysis
dataclass
Fatigue analysis pipeline for a flange bolt.
Evaluates the cyclic stress history, total cumulative fatigue damage, and expected fatigue life for a bolt in a flanged connection under external bending moment histories.
The analysis transforms the flange shell moment Markov matrix into a bolt stress Markov matrix using the segment's non-linear transfer functions, accounting for axial force, bolt bending, bolt diameter effects, and dynamic stress multiplication.
| Attributes: |
|
|---|
bolt_mkvm
cached
property
MarkovMatrix: The bolt stress Markov matrix including axial and bending stresses.
damage
cached
property
float: Total cumulative fatigue damage $D = \sum \frac{n_i}{N(\Delta S_i)}$.
fatigue_curve
cached
property
FatigueCurve: The S-N fatigue curve used for bolt damage evaluation.
fatigue_life
cached
property
float: Predicted fatigue life in the same time units as flange_mkvm.duration.
BoltFatigueCurve
Bases: DoubleSlopeFatigueCurve
Bolt fatigue S-N curve according to IEC 61400-6 AMD1.
Constructs a design bilinear S-N curve for threaded bolts with logarithmic slopes $m_1 = 3$ (for $N \le 2 \times 10^6$) and $m_2 = 5$ (for $N > 2 \times 10^6$), with a knee point located at $N_{12} = 2 \times 10^6$ cycles.
The characteristic reference stress range $\Delta \sigma_c$ at 2 million cycles is adjusted for bolt size effects according to IEC 61400-6 AMD1:
- For $d \le 30\text{ mm}$: $$\Delta \sigma_c = \Delta S_{\text{ref}}$$
- For $30\text{ mm} < d \le 72\text{ mm}$: $$\Delta \sigma_c = \Delta S_{\text{ref}} \cdot \left(\frac{0.030}{d}\right)^{0.1}$$
- For $d > 72\text{ mm}$: $$\Delta \sigma_c = \Delta S_{\text{ref}} \cdot \left(\frac{0.030}{d}\right)^{0.1} \cdot \left(\frac{0.072}{d}\right)^{0.25}$$
The knee point stress range for the design curve is obtained by dividing the characteristic strength by the material partial safety factor:
$$\Delta S_{12} = \frac{\Delta \sigma_c}{\gamma_M}$$
| Parameters: |
|
|---|
| Attributes: |
|
|---|
Example
import numpy as np
from pyflange.fatigue import BoltFatigueCurve, MarkovMatrix
curve = BoltFatigueCurve(0.080) # M80 bolt, default fatigue class
N = curve.N(40e6) # cycles to failure at a 40 MPa range
mkvm = MarkovMatrix(range=np.array([20e6, 40e6]),
mean=np.array([300e6, 300e6]),
cycles=np.array([1e6, 1e4]),
duration=20) # e.g. 20 years
D = curve.cumulated_damage(mkvm) # Miner's sum
__init__(diameter, DS_ref=50000000.0, gamma_M=1.1)
Initializes the BoltFatigueCurve (see the class documentation).
DoubleSlopeFatigueCurve
Bases: MultiSlopeFatigueCurve
Bilinear (double-slope) Wöhler (S-N) fatigue curve.
Implements a two-slope S-N curve commonly used in structural design standards (e.g., Eurocode 3, DNV, IEC standards). The curve transitions from slope $m_1$ in the lower-cycle / higher-stress regime ($N \le N_{12}$) to slope $m_2$ in the higher-cycle / lower-stress regime ($N > N_{12}$) at an intersection knee point $(\Delta S_{12}, N_{12})$.
| Parameters: |
|
|---|
__init__(m1, m2, DS12, N12)
Initializes the DoubleSlopeFatigueCurve (see the class documentation).
FatigueCurve
Abstract base class for Wöhler (S-N) fatigue strength curves.
This class provides the interface for evaluating fatigue endurance (number of cycles to failure $N$ as a function of stress range $\Delta S$, and vice versa), as well as calculating fatigue damage and cumulative damage using the Palmgren-Miner linear cumulative damage hypothesis:
$$D = \sum_{i} \frac{n_i}{N(\Delta S_i)}$$
This class should not be instantiated directly; use one of its concrete
subclasses such as SingleSlopeFatigueCurve, DoubleSlopeFatigueCurve, or
BoltFatigueCurve.
DS(N)
Calculates the allowable stress range for a given number of cycles.
| Parameters: |
|
|---|
| Returns: |
|
|---|
N(DS)
Calculates the number of cycles to failure for a given stress range.
| Parameters: |
|
|---|
| Returns: |
|
|---|
cumulated_damage(markov_matrix)
Calculates cumulative fatigue damage according to Miner's sum.
Evaluates the total cumulative damage over all bins in the load spectrum:
$$D_{\text{total}} = \sum_{i} \frac{n_i}{N(\Delta S_i)}$$
Bins producing NaN damage values (e.g., zero stress or invalid evaluations)
are ignored in the summation via numpy.nansum.
| Parameters: |
|
|---|
| Returns: |
|
|---|
damage(n, DS)
Calculates fatigue damage according to the Palmgren-Miner rule.
Computes the elementary fatigue damage ratio:
$$D = \frac{n}{N(\Delta S)}$$
| Parameters: |
|
|---|
| Returns: |
|
|---|
MarkovMatrix
dataclass
A Markov matrix representation of a cyclic load history.
Encapsulates a discrete load or stress spectrum resulting from cycle counting (e.g., rainflow counting). The load history is characterized by arrays of cycle ranges, mean values, and associated cycle counts, along with an overall duration.
The physical quantity represented can be stress (Pa), force (N), bending moment (N·m), etc., provided that consistent units are maintained throughout downstream calculations.
| Attributes: |
|
|---|
MultiSlopeFatigueCurve
Bases: FatigueCurve
Multi-slope composite Wöhler (S-N) fatigue curve.
Represents an S-N curve formed by combining multiple SingleSlopeFatigueCurve
segments. For any given stress range or cycle count, the effective capacity is
evaluated as the upper envelope (maximum endurance / maximum allowable stress
range) among all constituent curve segments.
| Attributes: |
|
|---|
DS(N)
Calculates the maximum allowable stress range among all curve segments.
Evaluates:
$$\Delta S(N) = \max_{i} \Delta S_i(N)$$
| Parameters: |
|
|---|
| Returns: |
|
|---|
N(DS)
Calculates the maximum number of cycles to failure among all curve segments.
Evaluates:
$$N(\Delta S) = \max_{i} N_i(\Delta S)$$
| Parameters: |
|
|---|
| Returns: |
|
|---|
__init__(*fatigue_curves)
Initializes the MultiSlopeFatigueCurve.
| Parameters: |
|
|---|
SingleSlopeFatigueCurve
dataclass
Bases: FatigueCurve
Wöhler (S-N) fatigue curve with a single logarithmic slope.
Represents a linear S-N relationship in log-log space governed by the power-law equation:
$$N \cdot \Delta S^m = a = \Delta S_{\text{ref}}^m \cdot N_{\text{ref}}$$
where $m$ is the inverse slope exponent, $\Delta S_{\text{ref}}$ is a reference stress range, and $N_{\text{ref}}$ is the corresponding cycle count at failure.
| Attributes: |
|
|---|
a
cached
property
float: Curve capacity constant $a = \Delta S_{\text{ref}}^m \cdot N_{\text{ref}}$.
DS(N)
Calculates the allowable stress range for given cycle count(s).
Evaluates:
$$\Delta S = \left(\frac{a}{N}\right)^{1/m}$$
| Parameters: |
|
|---|
| Returns: |
|
|---|
N(DS)
Calculates the number of cycles to failure for given stress range(s).
Evaluates:
$$N = \frac{a}{\Delta S^m}$$
| Parameters: |
|
|---|
| Returns: |
|
|---|