Skip to content

Cylindrical crack geometries

py_fatigue.geometry.cylinder.AxialCylinderThroughCrack dataclass

Bases: _ShellThroughCrack

TC07 axial through crack in a cylinder opened by hoop stress, in mm.

Source code in py_fatigue/geometry/cylinder.py
314
315
316
317
318
319
@dataclass(frozen=True)
class AxialCylinderThroughCrack(_ShellThroughCrack):
    """TC07 axial through crack in a cylinder opened by hoop stress, in mm."""

    _case = "TC07"
    _title = "TC07 · Axial cylinder through crack"

py_fatigue.geometry.cylinder.CircumferentialCylinderThroughCrack dataclass

Bases: _ShellThroughCrack

TC08 circumferential arc in a thin cylinder under axial tension.

Use the mid-wall radius and arc half-length. Length is the cylinder's full axial length. All lengths are in mm. Supply Poisson's ratio.

Source code in py_fatigue/geometry/cylinder.py
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
@dataclass(frozen=True)
class CircumferentialCylinderThroughCrack(_ShellThroughCrack):
    """TC08 circumferential arc in a thin cylinder under axial tension.

    Use the mid-wall radius and arc half-length. Length is the cylinder's
    full axial length. All lengths are in mm. Supply Poisson's ratio.
    """

    length: float
    poisson: float
    _case = "TC08"
    _title = "TC08 · Circumferential cylinder through crack"

    def _growth_state(self) -> GeometryState:
        return (
            (
                self._case,
                self.mean_radius,
                self.thickness,
                (self.length, self.poisson),
            ),
            (self.half_length, 0.0),
            ("Half-length",),
        )

py_fatigue.geometry.cylinder.CircumferentialCylinderSurfaceCrack dataclass

Bases: OrderedCrackGeometry

SC05 thumbnail crack subject to remote axial tension.

Parameters:

Name Type Description Default
inner_radius float

Pipe inner radius and wall thickness in mm.

required
thickness float

Pipe inner radius and wall thickness in mm.

required
depth float

Radial depth and arc half-length along the cracked wall in mm.

required
half_length float

Radial depth and arc half-length along the cracked wall in mm.

required
internal bool

Locate the crack at the inner wall. Defaults to the outer wall.

False
Notes

Interpolates NASA TM-111707 Table 9 for internal cracks and NASA TM-87594 Table 1 for external cracks within 1 <= R/t <= 10, 0.2 <= a/t <= 0.8 and 0.6 <= a/c <= 1.

Source code in py_fatigue/geometry/cylinder.py
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
@dataclass(frozen=True)
class CircumferentialCylinderSurfaceCrack(OrderedCrackGeometry):
    """SC05 thumbnail crack subject to remote axial tension.

    Parameters
    ----------
    inner_radius, thickness : float
        Pipe inner radius and wall thickness in mm.
    depth, half_length : float
        Radial depth and arc half-length along the cracked wall in mm.
    internal : bool, optional
        Locate the crack at the inner wall. Defaults to the outer wall.

    Notes
    -----
    Interpolates NASA TM-111707 Table 9 for internal cracks and
    NASA TM-87594 Table 1 for external cracks within 1 <= R/t <= 10,
    0.2 <= a/t <= 0.8 and 0.6 <= a/c <= 1.
    """

    inner_radius: float
    thickness: float
    depth: float
    half_length: float
    internal: bool = False

    def _growth_state(self) -> GeometryState:
        case = "SC05-internal" if self.internal else "SC05"
        return (
            (case, self.inner_radius, self.thickness, None),
            (self.depth, self.half_length),
            ("Radial depth", "Surface arc half-length"),
        )

    def stress_intensity(self, stress: float) -> tuple[float, float]:
        """Return deepest and free-surface K in MPa sqrt(mm)."""
        section, sizes, _ = self._growth_state()
        depth, surface = plate_factors(section, sizes)
        return stress * depth, stress * surface

    def plot(
        self,
        fig: Figure | None = None,
        ax: Axes | None = None,
        *,
        result: GrowthResult | None = None,
    ) -> tuple[Figure, Axes]:
        """Draw the pipe section and the initial and last accepted fronts."""
        self.stress_intensity(1.0)
        final = final_profile((self.depth, self.half_length), result)
        fig, ax = make_axes(fig, ax)
        outer_radius = self.inner_radius + self.thickness
        radius = self.inner_radius if self.internal else outer_radius
        direction = -1 if self.internal else 1
        wall_name = "inner" if self.internal else "outer"
        location = "Internal" if self.internal else "External"
        angle = np.linspace(0, 2 * np.pi, 201)
        for wall, label in (
            (outer_radius, "Outer wall"),
            (self.inner_radius, "Inner wall"),
        ):
            ax.plot(wall * np.cos(angle), wall * np.sin(angle), label=label)
        plot_profiles(
            ax,
            _curved_surface_front(
                radius, direction * self.depth, self.half_length
            ),
            (
                _curved_surface_front(radius, direction * final[0], final[1])
                if final
                else None
            ),
            "Crack front",
        )
        ax.set(
            xlabel="Section x (mm)",
            ylabel="Section y (mm)",
            title=(
                f"SC05 · {location} circumferential pipe crack\n"
                f"Inner radius {self.inner_radius:g} mm, "
                f"wall thickness {self.thickness:g} mm\n"
                f"Initial radial depth {self.depth:g} mm, "
                f"{wall_name} arc half-length {self.half_length:g} mm"
            ),
            aspect="equal",
        )
        ax.legend()
        return fig, ax

Methods:

plot

plot(fig=None, ax=None, *, result=None)

Draw the pipe section and the initial and last accepted fronts.

Source code in py_fatigue/geometry/cylinder.py
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
def plot(
    self,
    fig: Figure | None = None,
    ax: Axes | None = None,
    *,
    result: GrowthResult | None = None,
) -> tuple[Figure, Axes]:
    """Draw the pipe section and the initial and last accepted fronts."""
    self.stress_intensity(1.0)
    final = final_profile((self.depth, self.half_length), result)
    fig, ax = make_axes(fig, ax)
    outer_radius = self.inner_radius + self.thickness
    radius = self.inner_radius if self.internal else outer_radius
    direction = -1 if self.internal else 1
    wall_name = "inner" if self.internal else "outer"
    location = "Internal" if self.internal else "External"
    angle = np.linspace(0, 2 * np.pi, 201)
    for wall, label in (
        (outer_radius, "Outer wall"),
        (self.inner_radius, "Inner wall"),
    ):
        ax.plot(wall * np.cos(angle), wall * np.sin(angle), label=label)
    plot_profiles(
        ax,
        _curved_surface_front(
            radius, direction * self.depth, self.half_length
        ),
        (
            _curved_surface_front(radius, direction * final[0], final[1])
            if final
            else None
        ),
        "Crack front",
    )
    ax.set(
        xlabel="Section x (mm)",
        ylabel="Section y (mm)",
        title=(
            f"SC05 · {location} circumferential pipe crack\n"
            f"Inner radius {self.inner_radius:g} mm, "
            f"wall thickness {self.thickness:g} mm\n"
            f"Initial radial depth {self.depth:g} mm, "
            f"{wall_name} arc half-length {self.half_length:g} mm"
        ),
        aspect="equal",
    )
    ax.legend()
    return fig, ax

stress_intensity

stress_intensity(stress)

Return deepest and free-surface K in MPa sqrt(mm).

Source code in py_fatigue/geometry/cylinder.py
258
259
260
261
262
def stress_intensity(self, stress: float) -> tuple[float, float]:
    """Return deepest and free-surface K in MPa sqrt(mm)."""
    section, sizes, _ = self._growth_state()
    depth, surface = plate_factors(section, sizes)
    return stress * depth, stress * surface

py_fatigue.geometry.cylinder.RoundBarSurfaceCrack dataclass

Bases: OrderedCrackGeometry

SC07 circular-arc surface crack in a solid round bar in tension.

Diameter and depth are in mm. The opening-mode solution applies for 0 < depth < diameter / 2. The front meets the bar surface at right angles.

Source code in py_fatigue/geometry/cylinder.py
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@dataclass(frozen=True)
class RoundBarSurfaceCrack(OrderedCrackGeometry):
    """SC07 circular-arc surface crack in a solid round bar in tension.

    Diameter and depth are in mm. The opening-mode solution applies for
    0 < depth < diameter / 2. The front meets the bar surface at right angles.
    """

    diameter: float
    depth: float

    def _growth_state(self) -> GeometryState:
        return (
            ("SC07", self.diameter, None, None),
            (self.depth, 0.0),
            ("Depth",),
        )

    def stress_intensity(self, stress: float) -> float:
        """Return deepest-point stress intensity in MPa sqrt(mm)."""
        section, sizes, _ = self._growth_state()
        factor, _ = plate_factors(section, sizes)
        return stress * factor

    def plot(
        self,
        fig: Figure | None = None,
        ax: Axes | None = None,
        *,
        result: GrowthResult | None = None,
    ) -> tuple[Figure, Axes]:
        """Draw the bar cross section and the initial and final crack fronts."""
        self.stress_intensity(1.0)
        final = final_profile((self.depth,), result)
        radius = self.diameter / 2
        end = None
        if final is not None:
            RoundBarSurfaceCrack(self.diameter, final[0]).stress_intensity(1.0)
            end = _round_bar_front(radius, final[0])
        fig, ax = make_axes(fig, ax)
        angle = np.linspace(0, 2 * np.pi, 201)
        ax.plot(radius * np.cos(angle), radius * np.sin(angle), label="Bar")
        plot_profiles(
            ax, _round_bar_front(radius, self.depth), end, "Crack front"
        )
        ax.set(
            xlabel="Position across bar (mm)",
            ylabel="Position across bar (mm)",
            title=(
                "SC07 · Surface crack in a solid round bar\n"
                f"Diameter {self.diameter:g} mm, "
                f"initial depth {self.depth:g} mm"
            ),
            aspect="equal",
        )
        ax.legend()
        return fig, ax

Methods:

plot

plot(fig=None, ax=None, *, result=None)

Draw the bar cross section and the initial and final crack fronts.

Source code in py_fatigue/geometry/cylinder.py
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
def plot(
    self,
    fig: Figure | None = None,
    ax: Axes | None = None,
    *,
    result: GrowthResult | None = None,
) -> tuple[Figure, Axes]:
    """Draw the bar cross section and the initial and final crack fronts."""
    self.stress_intensity(1.0)
    final = final_profile((self.depth,), result)
    radius = self.diameter / 2
    end = None
    if final is not None:
        RoundBarSurfaceCrack(self.diameter, final[0]).stress_intensity(1.0)
        end = _round_bar_front(radius, final[0])
    fig, ax = make_axes(fig, ax)
    angle = np.linspace(0, 2 * np.pi, 201)
    ax.plot(radius * np.cos(angle), radius * np.sin(angle), label="Bar")
    plot_profiles(
        ax, _round_bar_front(radius, self.depth), end, "Crack front"
    )
    ax.set(
        xlabel="Position across bar (mm)",
        ylabel="Position across bar (mm)",
        title=(
            "SC07 · Surface crack in a solid round bar\n"
            f"Diameter {self.diameter:g} mm, "
            f"initial depth {self.depth:g} mm"
        ),
        aspect="equal",
    )
    ax.legend()
    return fig, ax

stress_intensity

stress_intensity(stress)

Return deepest-point stress intensity in MPa sqrt(mm).

Source code in py_fatigue/geometry/cylinder.py
46
47
48
49
50
def stress_intensity(self, stress: float) -> float:
    """Return deepest-point stress intensity in MPa sqrt(mm)."""
    section, sizes, _ = self._growth_state()
    factor, _ = plate_factors(section, sizes)
    return stress * factor