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
626
627
628
629
630
631
@frozen_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
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
@frozen_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
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
@frozen_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
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
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
570
571
572
573
574
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
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
@frozen_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
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
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
358
359
360
361
362
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