Calculate crack growth¶
The embedded plate tutorial follows both plate geometries from initial profile to final dimensions under the same ordered tensile history. The worked notebook below aligns stress, crack size and intensity on the same cycle axis.
For comparisons by crack family and a long tensile waveform, see Crack growth examples. For a circular round-bar crack, use the surface-crack cases or follow the same three tensile load blocks through MCP.
Choose a geometry and tensile load¶
Match the crack shape and loading direction to a supported case. Check the dimensions and validity limits in the geometry reference. Supply the tensile load blocks in their original order.
Material inputs¶
Use a calibrated NASGRO curve with parameters in MPa, mm, and MPa·√mm. See the material parameter reference.
Solver controls and result¶
The following center-cracked plate example uses two tensile load blocks and a synthetic NASGRO curve.
from py_fatigue.crack_growth import LoadBlock, calc_crack_growth
from py_fatigue.geometry.plate import CenterThroughCrack
from py_fatigue.material.crack_growth_curve import NasgroCurve
geometry = CenterThroughCrack(half_width=50, half_length=5)
curve = NasgroCurve(
coefficient=1e-10, exponent=2, p=0.5, q=1,
threshold_zero=25, threshold_fanning=0, toughness=500,
constraint=2, peak_to_flow=0.3,
)
loads = [LoadBlock(0, 40, 85), LoadBlock(10, 50, 100)]
result = calc_crack_growth(
geometry, curve, loads,
max_cycle_step=1, length_tolerance=1e-6,
cycle_tolerance=1e-4, max_trials=400,
)
print(result.termination, result.final_cycles)
Expect spectrum_exhausted at 185 cycles. Compare the last accepted
geometry with the initial flaw. The
solver reference
describes the controls, output conventions, and validation cases.
Plot the geometry, material law and result¶
Call geometry.plot() or geometry.echarts() to draw the initial plate
crack. Pass result=result to overlay the last accepted profile.
Surface cracks are drawn in the crack plane of the plate, pipe, bar, or
thread. If a run stops before accepting a state, the plot shows the
starting geometry.
fig, ax = geometry.plot(result=result)
geometry.echarts(result=result)
Call curve.plot() or curve.echarts() to show the long-crack reference
curve at stress ratio R = 0 (k_min = 0). Both sweep maximum stress
intensity up to toughness and mark that limit with a dashed line. Supply
length to apply the finite-crack correction to the growth threshold and
k_min to change the minimum stress intensity.
fig, ax = curve.plot()
curve.echarts()
fig, ax = curve.plot(length=4.0, k_min=20.0, scale="loglog")
fig, ax = result.plot()
result.echarts()
A scalar k_max sets a shorter sweep endpoint. Supply an array to evaluate
exact sample points, or a one-element array to show one point. With explicit
samples, k_min can be one value or an array paired with k_max.
Use scale="semilogx" to show zero growth below threshold, or
scale="loglog" for the default logarithmic axes.
To compare results on shared axes, use other_result.plot(ax=ax,
label="Surface crack"). The plot uses the accepted points in
result.history.