Contact loading and fretting

Armour wires press on each other and on the polymer layers beside them, and they slip along their helices when the cable bends.

Goal: form the contact pressures of the armour over a tension history, solve the Hertz contact where the wires of two armour layers cross, follow the slip of every wire round the section, classify every slip cycle into a fretting regime, and recover a Smith–Watson–Topper (SWT) critical-plane indicator next to a crossing.

Script: doc/tutorials/scripts/tutorial_04_contact_and_fretting.py · Run time: about ten seconds

Run it from a source checkout:

python doc/tutorials/scripts/tutorial_04_contact_and_fretting.py

The code blocks below are taken from the script and the output blocks are what it prints. tests/test_tutorials_03_04.py runs the script and checks that the two still agree.

Imports

import math
import sys
from pathlib import Path

import matplotlib.pyplot as plt
import numpy as np

import cablexsec as cx
from cablexsec.analysis.fatigue import rainflow_cycles, wire_stress_field
from cablexsec.cable_adapters import armour_crossing_line_loads, cable_to_fatigue_layers
from cablexsec.materials import library
from cablexsec.materials.sn_curves import SWTLifeConstants
from cablexsec.mechanics.hertz_contact import (
    crossed_cylinder_curvatures,
    layer_crossing_angle_rad,
    layer_crossing_density_per_m,
    reduced_modulus,
    reduced_shear_modulus,
    solve_contact,
)
from cablexsec.plotting.style import COLORS, LABELS, apply_style

FIGURES = (
    Path(sys.argv[1])
    if len(sys.argv) > 1
    else Path(__file__).resolve().parents[1] / "figures"
)

1. The two armour layers cross each other

cable = cx.load_cable(cx.export_three_core_yaml_path())
print(cable.cable.name)
for layer in cable.helical_layers:
    clamping = layer.manufacturing_clamping
    print(
        f"{layer.name}: {layer.n_wires} wires, d = {layer.d_wire_m * 1e3:.1f} mm, "
        f"R = {layer.r_helix_m * 1e3:.1f} mm, lay {layer.lay_angle_deg:.0f} deg "
        f"{layer.lay_direction.replace('_', ' ')}, P0 = {clamping.value_Pa / 1e6:.1f} "
        f"MPa ({clamping.basis})"
    )
Three-core export 220 kV (public representative)
inner_armour: 110 wires, d = 6.0 mm, R = 118.0 mm, lay 18 deg right hand, P0 = 3.0 MPa (representative)
outer_armour: 118 wires, d = 6.0 mm, R = 124.0 mm, lay 18 deg left hand, P0 = 3.0 MPa (representative)

The bundled 220 kV three-core export cable is a public representative template, not a qualified design. Its two armour layers are laid in opposite directions and touch: the inner wires reach 121 mm, where the outer wires start. Each layer declares a manufacturing clamping P0 of 3 MPa, the radial pressure jump across the layer. Tutorial 3 used a cable whose armour layers are separated by a bedding. Here the wires cross each other directly.

2. The load history

# A synthetic record at a sag bend: true wall tension and biaxial curvature.
duration_s = 300.0
record = cx.jonswap_series(
    hs_m=3.0,
    tp_s=9.0,
    duration_s=duration_s,
    dt_s=0.2,
    rms_curvature_1_m=0.003,
    dynamic_tension_rms_N=10.0e3,
    tension_phase_deg=30.0,
    out_of_plane_fraction=0.3,
    seed=11,
    tension_kind="true",
)
kx = 0.02 + record.curvature_x_1_m
ky = record.curvature_y_1_m
tension = 150.0e3 + record.tension_N
print(
    f"record: {kx.size} samples, curvature {np.hypot(kx, ky).min():.4f} to "
    f"{np.hypot(kx, ky).max():.4f} 1/m, tension {tension.min() / 1e3:.0f} to "
    f"{tension.max() / 1e3:.0f} kN"
)
record: 1500 samples, curvature 0.0117 to 0.0295 1/m, tension 120 to 180 kN

The record is synthetic, as in Tutorial 3: 300 s of JONSWAP-shaped biaxial curvature about a static curvature of 0.02 1/m, with a tension that follows the in-plane curvature. The template does not declare the state of its armour annulus, so the record is generated directly as true wall tension.

3. Clamping accumulates from the outside in

pressure, line_load = cx.armour_contact_histories(cable, tension)
for name in pressure:
    print(
        f"{name}: P1+P2 {pressure[name].min() / 1e6:.3f} to "
        f"{pressure[name].max() / 1e6:.3f} MPa, crossing line load "
        f"{line_load[name].min() / 1e3:.2f} to {line_load[name].max() / 1e3:.2f} kN/m"
    )
inner_armour: P1+P2 9.151 to 9.226 MPa, crossing line load 21.08 to 21.25 kN/m
outer_armour: P1+P2 3.050 to 3.075 MPa, crossing line load 19.65 to 19.81 kN/m

armour_contact_histories gives, for every armour layer and sample, the friction-setting pressure P1+P2 and the line load on the crossed-wire interface. P1+P2 is the sum of the pressures on the inner and outer faces of the layer, referred to the helix radius. These are the histories compute_fatigue uses when it is given a tension history.

The clamping jumps accumulate from the outside in. The interface under the outer armour carries P0 and the interface under the inner armour 2 P0, so P1+P2 is about 3 P0 for the inner layer and P0 for the outer layer, plus the increment from the tension. Over this record the pressures change by less than 0.1 MPa.

4. Crossing wires meet in a Hertz contact

inner = cable.get_layer("inner_armour")
outer = cable.get_layer("outer_armour")
reference_tension = float(np.mean(tension))
partner, load_per_m = armour_crossing_line_loads(cable, reference_tension)[
    "inner_armour"
]
angle_in, angle_out = (
    math.radians(inner.lay_angle_deg),
    math.radians(outer.lay_angle_deg),
)
crossing = layer_crossing_angle_rad(angle_in, angle_out)
density = layer_crossing_density_per_m(
    outer.n_wires,
    inner.r_helix_m,
    angle_in,
    1.0 if inner.lay_direction == "right_hand" else -1.0,
    outer.r_helix_m,
    angle_out,
    1.0 if outer.lay_direction == "right_hand" else -1.0,
)
crossing_force = load_per_m / density
young, poisson = (library.get_property(inner.material, p) for p in ("E_Pa", "nu"))
curv_a, curv_b = crossed_cylinder_curvatures(
    inner.d_wire_m, crossing, partner_diameter_m=outer.d_wire_m
)
hertz = solve_contact(
    crossing_force,
    curv_a,
    curv_b,
    reduced_modulus(young, poisson, young, poisson),
    reduced_shear_modulus(young, poisson, young, poisson),
)
depth = np.linspace(0.0, 3.0 * hertz.b_m, 601)
axis = cx.compute_hertz_axis_stress(hertz, depth, poisson_ratio=poisson)
print(
    f"crossing with {partner.name}: angle {math.degrees(crossing):.0f} deg, "
    f"{density:.1f} crossings per metre, {crossing_force:.1f} N per crossing"
)
print(
    f"Hertz ellipse a = {hertz.a_m * 1e6:.1f} um, b = {hertz.b_m * 1e6:.1f} um, "
    f"p0 = {hertz.p0_Pa / 1e6:.0f} MPa, K_t = {hertz.K_t_N_per_m / 1e6:.1f} N/um"
)
print(
    f"peak von Mises {axis.sampled_peak_von_mises_Pa / 1e6:.0f} MPa at depth "
    f"{axis.sampled_peak_depth_m * 1e6:.1f} um; wire yield stress "
    f"{library.get_property(inner.material, 'sigma_y_Pa') / 1e6:.0f} MPa"
)
crossing with outer_armour: angle 36 deg, 100.9 crossings per metre, 209.7 N per crossing
Hertz ellipse a = 374.0 um, b = 86.0 um, p0 = 3112 MPa, K_t = 34.1 N/um
peak von Mises 1835 MPa at depth 60.2 um; wire yield stress 690 MPa

Wires of opposite lay cross at the sum of their lay angles. Each inner wire meets the outer wires about 101 times per metre, so the interface line load at the mean tension gives 210 N per crossing.

crossed_cylinder_curvatures turns the wire diameters and the crossing angle into the two principal curvatures of the gap. solve_contact gives the elliptical Hertz contact: the semi-axes, the peak pressure p0 and the tangential stiffness K_t used by the Mindlin slip model. compute_hertz_axis_stress resolves the elastic stress on the axis of the contact.

The elastic peak pressure and the peak von Mises stress lie well above the yield stress of the wire material in the library. A crossing loaded this way yields locally and flattens. The elastic Hertz values indicate the contact loading; they are not the stresses of the deformed contact.

5. Every slip cycle has a fretting regime

fretting = cx.compute_fretting(cable, kx, ky, duration_s=duration_s, tension_N=tension)
print(
    f"contact loads at {fretting.reference_tension_N / 1e3:.0f} kN; extreme fibre "
    f"of the dynamic bending at {fretting.extreme_fibre_deg:.1f} deg"
)
for key, row in fretting.summary().items():
    if fretting.faces[key].contact.normal_load <= 0.0:
        print(f"{key}: no normal load on this face")
        continue
    print(
        f"{key} on {row['partner']}: mu {row['mu']:.2f}, load "
        f"{row['line_or_point_load']:.1f} N, p0 {row['p0_MPa']:.0f} MPa, "
        f"transition amplitude {row['transition_amplitude_um']:.2f} um"
    )
    print(
        f"  largest slip amplitude {row['max_amplitude_um']:.0f} um; cycles in "
        f"stick {row['share_stick']:.0%}, partial slip "
        f"{row['share_partial_slip']:.0%}, gross slip {row['share_gross_slip']:.0%}"
    )
    print(
        f"  damage per year at the contact fibre {row['max_D_fretting_per_year']:.3f}"
        f" at {row['max_damage_offset_deg']:.0f} deg from the extreme fibre; "
        f"largest wear at {row['max_wear_offset_deg']:.0f} deg"
    )
contact loads at 150 kN; extreme fibre of the dynamic bending at -4.0 deg
inner_armour/outer_face on outer_armour: mu 0.12, load 209.7 N, p0 3112 MPa, transition amplitude 1.11 um
  largest slip amplitude 364 um; cycles in stick 0%, partial slip 16%, gross slip 84%
  damage per year at the contact fibre 9.687 at 1 deg from the extreme fibre; largest wear at 88 deg
outer_armour/inner_face on inner_armour: mu 0.12, load 209.7 N, p0 3112 MPa, transition amplitude 1.11 um
  largest slip amplitude 402 um; cycles in stick 0%, partial slip 15%, gross slip 85%
  damage per year at the contact fibre 2.149 at 4 deg from the extreme fibre; largest wear at 88 deg
outer_armour/outer_face: no normal load on this face

compute_fretting assesses both radial faces of every armour layer, keyed "<layer>/<face>". A face against an opposite-laid armour layer is a Mindlin point contact at each crossing, with the Hertz contact of step 4. A face against a polymer layer is a line contact on the support stiffness of the section. The normal loads are those at one reference tension, by default the mean of the record.

Each wire’s slip history is rainflow-counted, and every cycle is classified by its amplitude against the transition amplitude δ_t = 3 μ P / (2 K_t), at which the tangential load reaches μ P. Up to it the cycle is partial slip, above it gross slip, and without slip or without load it is stick (Fouvry et al. 1995). The dissipated energy of each cycle gives the wear. The stress cycles at the contact fibre are counted again with the regime knock-down of the wire material, to give the damage per year of this loading.

The outer face of the outer armour carries no load. The clamping jumps accumulate from the outside in, so nothing presses on the outermost face.

The damage and the wear peak in different places. The damage at the contact fibre peaks at the extreme fibre of the dynamic bending, where the stress range is largest. The wear peaks near the neutral axis, 90° away, where the slip is largest.

FrettingFace keeps every per-wire array: cycles and energy per regime, largest amplitude, wear depth rate, and damage with and without the knock-down. Its wear depth is computed on the unworn contact width, so it is the rate at the start of wear. fretting.provenance lists the assumed coefficients and the other limitations of the assessment.

6. Friction holds the wires back

compute_fretting takes the kinematic slip of each wire, the slip of a wire free to slide along its helix: r² cos²α / sin α times the curvature change at the neutral axis. Friction holds the wires back. kinematic_history follows the friction law of the stress route instead, with the contact pressure history of step 3:

history = cx.kinematic_history(
    cable, kx, ky, tension_N=tension, contact_pressure_Pa=pressure
)
faces = {
    "inner_armour": "inner_armour/outer_face",
    "outer_armour": "outer_armour/inner_face",
}
friction_slip = {}
for field in history.layers:
    amplitude = 0.5 * np.ptp(field.slip_m, axis=1)
    friction_slip[field.name] = (np.degrees(field.azimuth_rad), amplitude)
    full = fretting.faces[faces[field.name]].max_amplitude_m
    print(
        f"{field.name}: full-slip amplitude up to {full.max() * 1e6:.0f} um, "
        f"friction law up to {amplitude.max() * 1e6:.1f} um, "
        f"stations slipping {field.slipping.mean():.1%} of the time"
    )
inner_armour: full-slip amplitude up to 364 um, friction law up to 127.1 um, stations slipping 7.7% of the time
outer_armour: full-slip amplitude up to 402 um, friction law up to 278.6 um, stations slipping 39.2% of the time
Slip amplitude of the inner and outer armour wires against azimuth, for full slip and for the friction law.

Half the range of the axial slip of every wire over the record. Dashed: kinematic slip of free wires, as used by compute_fretting. Solid: the friction law with the contact pressure history.

The inner armour, with P1+P2 of about 9 MPa, slips to about a third of the kinematic amplitude at these curvatures. The outer armour, with about 3 MPa, slips to about 70 % of it, most near the neutral axis. The kinematic slip is therefore an upper estimate of the slip amplitude, and the regime shares and wear of step 5 are upper estimates wherever friction holds the wires.

7. The shear–slip product ranks wires

face = fretting.faces["inner_armour/outer_face"]
shear_slip = face.contact.mu * face.contact.p0_Pa * face.max_amplitude_m
k = int(np.argmax(shear_slip))
print(
    f"shear-slip product mu p0 delta*: largest {shear_slip.max() / 1e3:.0f} kN/m "
    f"at {face.extreme_fibre_offset_deg[k]:.0f} deg from the extreme fibre"
)
shear-slip product mu p0 delta*: largest 136 kN/m at 88 deg from the extreme fibre

The shear–slip product Φ = μ p0 δ* combines the nominal frictional shear and the slip amplitude. It ranks wires and compares designs. It is not a fretting life.

Nor is it the Ruiz parameter (Ruiz et al. 1984), which is formed from the local surface shear traction and slip and, in its second form, the local tangential stress. CableXSec 0.2.1 does not compute Ruiz parameters.

8. The SWT critical plane next to a crossing

The SWT indicator σ_max ε_a is evaluated on many planes through one material point over one closed load cycle. The plane with the largest value is the sampled critical plane. CableXSec gives the two parts of such a calculation. compute_hertz_subsurface_stress integrates prescribed Hertz-shaped normal and shear tractions at points below the surface, and compute_swt_cycle finds the sampled critical plane of coincident stress and strain histories.

layers = cable_to_fatigue_layers(cable, contact_tension_N=float(tension[0]))
layer = next(item for item in layers if item.name == inner.name)
field = wire_stress_field(
    layer,
    kx,
    ky,
    tension,
    cx.compute_stiffness(cable).ea_fixed_N,
    contact_pressure_Pa=pressure[inner.name],
)
wire = int(np.argmax(face.D_fretting_per_year))
contact_fibre = field.at_fibre(0.0)[wire]  # the outer face touches the outer armour
largest = max(rainflow_cycles(contact_fibre), key=lambda cycle: cycle[0])
bulk_range, bulk_mean = largest[0], largest[1]
print(
    f"wire {wire} ({face.dominant_regime[wire].replace('_', ' ')}): largest bulk "
    f"cycle {bulk_range / 1e6:.1f} MPa about {bulk_mean / 1e6:.1f} MPa"
)
# One closed cycle: the bulk stress along the wire axis and a Hertz-shaped
# shear traction of mu p reversing along it, the gross-slip traction.
phase = np.linspace(0.0, 2.0 * np.pi, 181)
axis_t = np.array([math.cos(crossing / 2), math.sin(crossing / 2), 0.0])
bulk = (bulk_mean + 0.5 * bulk_range * np.sin(phase))[:, None, None] * np.outer(
    axis_t, axis_t
)
mu = face.contact.mu
polar, azimuth = np.meshgrid(
    np.radians(np.arange(10, 91, 10)), np.radians(np.arange(0, 360, 10)), indexing="ij"
)
normals = np.vstack(
    (
        [0.0, 0.0, 1.0],
        np.column_stack(
            (
                (np.sin(polar) * np.cos(azimuth)).ravel(),
                (np.sin(polar) * np.sin(azimuth)).ravel(),
                np.cos(polar).ravel(),
            )
        ),
    )
)
# compute_swt_cycle also gives a formal life from a strain-life law. No
# strain-life constants of armour steel are registered, so a placeholder law
# with the wire modulus is passed and no life is printed.
placeholder = SWTLifeConstants(1.0e9, -0.1, 0.5, -0.6, young)


def swt_indicator(stress, label):
    """Largest sampled SWT indicator and its plane for one closed cycle."""
    stress = stress.copy()
    stress[-1] = stress[0]
    trace = np.trace(stress, axis1=1, axis2=2)[:, None, None]
    strain = ((1 + poisson) * stress - poisson * trace * np.eye(3)) / young
    result = cx.compute_swt_cycle(
        stress, strain, normals, placeholder, material_point_id=label
    )
    return result.sampled_max_swt_Pa, result.critical_plane_normal


def contact_cycle(x_over_a, z_over_b):
    """Stress history of one cycle at a point of the contact frame."""
    point = [x_over_a * hertz.a_m, 0.0, z_over_b * hertz.b_m]
    normal = cx.compute_hertz_subsurface_stress(hertz, point, poisson_ratio=poisson)
    shear = cx.compute_hertz_subsurface_stress(
        hertz,
        point,
        poisson_ratio=poisson,
        tangential_traction_ratio=(mu * axis_t[0], mu * axis_t[1]),
    )
    return (
        normal.normal_stress_Pa
        + np.sin(phase)[:, None, None] * shear.tangential_stress_Pa
        + bulk
    )


bulk_only, _ = swt_indicator(bulk, "bulk cycle alone")
print(f"SWT of the bulk cycle alone {bulk_only / 1e6:.4f} MPa")
for x_over_a in (0.0, -1.0, -1.1):
    value, _ = swt_indicator(contact_cycle(x_over_a, 0.5), f"x/a {x_over_a}")
    print(f"x = {x_over_a:+.1f} a, z = 0.5 b: SWT {value / 1e6:.4f} MPa")
depths = np.array([0.05, 0.1, 0.2, 0.3, 0.5, 0.75, 1.0])
profile = []
for z_over_b in depths:
    value, plane = swt_indicator(contact_cycle(-1.1, z_over_b), f"z/b {z_over_b}")
    profile.append(value)
    tilt = math.degrees(math.acos(min(1.0, abs(float(plane @ axis_t)))))
    print(
        f"x = -1.1 a, z = {z_over_b:.2f} b: SWT {value / 1e6:.4f} MPa, "
        f"plane normal {tilt:.0f} deg from the wire axis"
    )
wire 109 (gross slip): largest bulk cycle 373.9 MPa about 107.1 MPa
SWT of the bulk cycle alone 0.2610 MPa
x = +0.0 a, z = 0.5 b: SWT 0.0000 MPa
x = -1.0 a, z = 0.5 b: SWT 0.2923 MPa
x = -1.1 a, z = 0.5 b: SWT 0.3560 MPa
x = -1.1 a, z = 0.05 b: SWT 0.8079 MPa, plane normal 8 deg from the wire axis
x = -1.1 a, z = 0.10 b: SWT 0.7413 MPa, plane normal 8 deg from the wire axis
x = -1.1 a, z = 0.20 b: SWT 0.6134 MPa, plane normal 8 deg from the wire axis
x = -1.1 a, z = 0.30 b: SWT 0.5049 MPa, plane normal 8 deg from the wire axis
x = -1.1 a, z = 0.50 b: SWT 0.3560 MPa, plane normal 8 deg from the wire axis
x = -1.1 a, z = 0.75 b: SWT 0.2677 MPa, plane normal 10 deg from the wire axis
x = -1.1 a, z = 1.00 b: SWT 0.2356 MPa, plane normal 10 deg from the wire axis

The script builds one cycle at the crossing of the inner-armour wire with the largest contact-fibre damage, which is in gross slip. The cycle has three parts.

The first is the bulk stress of the wire at its outer fibre, cycling over the largest rainflow range of the record, along the wire axis. For two equal crossed wires the major axis of the contact ellipse, x, bisects the acute angle between the wire axes, so the wire axis lies at half the crossing angle, 18°, from it.

The second is the Hertz pressure of step 4, held fixed. The third is a Hertz-shaped shear traction μ p along the wire axis that reverses over the cycle in phase with the bulk stress: the traction of gross sliding.

These are stated simplifications. The footprint does not change with the load, the shear traction is the sliding field and not a Cattaneo–Mindlin partial-slip distribution, and the material is elastic.

Under the middle of the contact the compressive Hertz field leaves no plane in tension, and the indicator is zero. At the edge and just outside it, behind the traction, the shear traction adds tension to the wire stress. At x = −1.1 a the indicator near the surface is about three times that of the bulk cycle alone, and it falls towards the bulk value at a depth of one semi-axis b. The critical plane lies nearly across the wire.

Points nearer the surface at the edge itself need a higher quadrature order. compute_hertz_subsurface_stress raises CableSolverError when it cannot converge; it never returns an unconverged stress.

compute_swt_cycle also returns a formal life from a strain-life law (SWTLifeConstants). The SWT constants registered in CableXSec 0.2.1 (sn_curves.SWT_LIFE) are those of copper, and none are for armour steel, so the script passes a placeholder law and prints no life. With constants from a source, result.life_cycles gives it.

SWT indicator against depth just outside the edge of the crossing contact, with the value of the bulk cycle alone.

SWT indicator at x = −1.1 a against depth, and the indicator of the bulk stress cycle alone.

9. Figures

apply_style()  # the MATLAB-style figures of every CableXSec plot
fig, ax = plt.subplots(figsize=(6.4, 4.0), layout="constrained")
for name, colour in (
    ("inner_armour", COLORS["BLUE"]),
    ("outer_armour", COLORS["ORANGE"]),
):
    face_name = faces[name]
    full = fretting.faces[face_name]
    label = name.replace("_", " ")
    ax.plot(
        full.wire_azimuth_deg,
        full.max_amplitude_m * 1e6,
        color=colour,
        linestyle="--",
        label=f"{label}, full slip",
    )
    stations, amplitude = friction_slip[name]
    ax.plot(stations, amplitude * 1e6, color=colour, label=f"{label}, friction law")
ax.set_xlabel(r"Wire azimuth from $\mathbf{e}_\mathrm{1}$, $\varphi$ [$^\circ$]")
ax.set_ylabel(LABELS["slip_um"])
ax.set_xlim(0.0, 360.0)
ax.set_xticks(np.arange(0, 361, 45))
ax.set_ylim(bottom=0.0)
fig.legend(fontsize=8, ncols=2, loc="outside lower center")
fig.savefig(FIGURES / "tutorial_04_slip_amplitude.png", dpi=200)
plt.close(fig)
print("wrote tutorial_04_slip_amplitude.png")

fig, ax = plt.subplots(figsize=(6.4, 3.2), layout="constrained")
ax.plot(
    depths,
    np.array(profile) / 1e6,
    marker="o",
    color=COLORS["BLUE"],
    label="next to the crossing",
)
ax.axhline(
    bulk_only / 1e6,
    color=COLORS["GREY"],
    linestyle="--",
    linewidth=1.0,
    label="bulk cycle alone",
)
ax.set_xlabel(r"Depth $z/b$ at $x = -1.1\,a$ [–]")
ax.set_ylabel(r"SWT indicator $\sigma_\mathrm{max}\,\varepsilon_\mathrm{a}$ [MPa]")
ax.set_xlim(0.0, 1.05)
ax.set_ylim(bottom=0.0)
ax.legend()
fig.savefig(FIGURES / "tutorial_04_swt_depth.png", dpi=200)
plt.close(fig)
print("wrote tutorial_04_swt_depth.png")
wrote tutorial_04_slip_amplitude.png
wrote tutorial_04_swt_depth.png

Where next

The fretting options (wear coefficients, knock-down laws, section loss and occurrence fractions) and the trellis fretting of stranded conductors are in Sections 10 and 11 of the local analysis guide. Step 4 in its Section 5 writes out the crossing calculation of step 4 with the Mindlin slip history of each wire.

examples/hertz_axis_stress.py, examples/prescribed_contact_swt.py and examples/critical_plane_swt.py check the contact stress and critical-plane routines on their own.