From e82616d11758c6b3ac1aa70aef436afb507de062 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Mon, 23 Nov 2026 14:20:14 +0900 Subject: [PATCH 1/3] fix: direct calls read the cable materials; Skeie 2023 credit and row SK23-T1 Ninety public functions of 36 submodules that take a cable read the library values when called directly (xi_for_layer gave 1.000 for Zeidan's inner armour instead of 0.832): every submodule now wraps them with scope_entry_points, as cablexsec and cablexsec.api do, and a nested call with the same cable object skips re-entering the scope (no measurable cost). A test walks every module. The coupled intralayer core slip credits Skeie, Sodahl, Pettersen and Verde (2023, OMAE2023-104817); the largest friction stress saturates at pi/3 times the onset, the "full slip" of their Table 1, before the coalescence at 1.209. New reported row SK23-T1 runs their worked case. Documentation: the bonded face's stuck coefficient takes the support and the bond in parallel (unchanged only on a rigid support) and its friction cap is not reduced; the stuck cos^4 normal curvature cites Saevik (2011) Eq. 50; report cells escape a literal |; 0.2.1 version references. Tests: a tolerance instead of exact equality in the curvature-component test; short numba cache folder names. Signed-off-by: Jae Hoon Seo --- CHANGELOG.md | 41 +++++++++++ DEVELOPMENT.md | 2 +- VALIDATION.md | 1 + doc/benchmarks.md | 13 +++- doc/citing.rst | 2 +- doc/local_analysis_guide.md | 18 +++-- doc/template_66kv.md | 6 +- src/cablexsec/analysis/beam_test.py | 5 ++ src/cablexsec/analysis/bending_law.py | 5 ++ src/cablexsec/analysis/capacity.py | 5 ++ src/cablexsec/analysis/capacity_check.py | 5 ++ src/cablexsec/analysis/components.py | 5 ++ src/cablexsec/analysis/compression.py | 5 ++ src/cablexsec/analysis/core_screen.py | 5 ++ src/cablexsec/analysis/electrical_life.py | 5 ++ src/cablexsec/analysis/frictional_heating.py | 5 ++ src/cablexsec/analysis/kinematics.py | 5 ++ src/cablexsec/analysis/neutral_axis.py | 5 ++ src/cablexsec/analysis/rig_test.py | 5 ++ src/cablexsec/analysis/sea_state_batch.py | 5 ++ src/cablexsec/analysis/section_properties.py | 5 ++ src/cablexsec/analysis/section_stress.py | 5 ++ src/cablexsec/analysis/sheath_strain.py | 5 ++ src/cablexsec/analysis/sheave.py | 5 ++ src/cablexsec/analysis/slip_curvatures.py | 5 ++ src/cablexsec/analysis/stress.py | 5 ++ src/cablexsec/analysis/tape.py | 5 ++ src/cablexsec/analysis/thermal_coupling.py | 5 ++ src/cablexsec/analysis/torque_balance.py | 5 ++ src/cablexsec/cable_adapters.py | 5 ++ src/cablexsec/cables/schema.py | 40 +++++++++-- src/cablexsec/clamping.py | 5 ++ src/cablexsec/mechanics/axisymmetric.py | 5 ++ src/cablexsec/mechanics/contact_qp.py | 5 ++ src/cablexsec/mechanics/core_friction.py | 15 +++- src/cablexsec/mechanics/core_kinematics.py | 5 ++ src/cablexsec/mechanics/radial_cable.py | 5 ++ src/cablexsec/mechanics/station_coupling.py | 6 ++ src/cablexsec/mechanics/stiffness.py | 5 ++ src/cablexsec/mechanics/thermal.py | 5 ++ src/cablexsec/mechanics/thermal_network.py | 5 ++ src/cablexsec/mechanics/wire_stress.py | 3 +- src/cablexsec/plotting/cross_section.py | 5 ++ src/cablexsec/plotting/dashboard.py | 4 ++ src/cablexsec/plotting/thermal.py | 5 ++ src/cablexsec/preflight.py | 5 ++ tests/conftest.py | 6 +- tests/test_bonded_face.py | 6 +- tests/test_cable_materials.py | 42 +++++++++++ tests/test_cabledyn_outputs.py | 2 +- tests/test_core_coupled_slip.py | 21 ++++++ validation/scripts/check_core_friction.py | 75 ++++++++++++++++++++ validation/scripts/run_validation.py | 51 +++++++++++-- 53 files changed, 491 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6b3fb8..1033e4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,47 @@ All notable changes to CableXSec are recorded in this file. The format follows monotonic curves in plotted curvature (not loops), and the record zero and centre. No target, band, gated input or default changes; SV11-PLANE and SV11-GJ stay FAIL. +### Fixed + +- Every public function of the submodules that takes a cable now reads the cable's own + materials when it is called directly, as the functions of `cablexsec` and + `cablexsec.api` already did. Before, `xi_for_layer`, `yun_shear_stack`, `ei_min_slip` + and 87 other functions of 36 modules (mechanics, analysis, adapters, plotting) used the + library values outside a material scope: Zeidan's inner armour gave ξ 1.000 instead of + 0.832. Results through `cablexsec` and `cablexsec.api` do not change. A nested call + with the same cable object does not re-enter the scope (no measurable cost); a test + now checks every module. + +### Documentation + +- Credit: the coupled intralayer slip of laid cores (`core_core_coupling="relative"`, 0.2.1) + follows Skeie, Sødahl, Pettersen and Verde (2023, OMAE2023-104817, + doi:10.1115/OMAE2023-104817), who formulated the relative slip of three cores, its onset + and the coalescence of the slip zones; cited in `core_friction`, `station_coupling`, the + local analysis guide and doc/template_66kv.md. The largest friction stress saturates at + `π/3` times the onset, before the coalescence at `2π/(3√3) = 1.209`: the "full slip" of + their Table 1. New reported row SK23-T1: with the contact load per metre of helix the + onset is their Eq. 16 (2.2518e-5 1/mm against 2.25e-5), the saturation 1.0472 times the + onset against 1.049 (their model) and 1.053 (their FE). +- The bonded outer face (0.2.1): stuck, the inner support and the bond act in parallel, + `xi_tot = (K_s + K_b) / (K_s + K_b + k2)`. The 0.2.1 entry's "the stuck layer is + unchanged" holds for a rigid support only (Zeidan's outer armour, ξ = 1); with ξ 0.5 + the bond raises it to 0.510. The friction cap stays the inner face's: the bond is a + separate elastic shear flow, and scaling the cap by `1 - xi_bond` would count it twice + (doc/benchmarks.md). +- The stuck-wire normal curvature `cos^4(a)` cites Sævik (2011) Eq. 50, the prescribed + normal curvature of the stuck helix. +- Validation report cells escape a literal `|` (as in `|cos|`). +- Version references of 0.2.1 in doc/template_66kv.md, doc/citing.rst (BibTeX key) and + DEVELOPMENT.md. + +### Tests + +- The CableDyn curvature-component test compares the strain gradient with a relative + tolerance of 1e-15 instead of exact equality. +- The per-worker numba cache folders of the tests have short names, below the 260-character + path limit of Windows. + ## [0.2.1] - 2026-11-23 The Python interfaces are versioned but may change before `1.0.0`. The evidence for diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 1e44776..5189264 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -101,7 +101,7 @@ python -m build --outdir dist python -m twine check dist/* python -m venv wheel-test wheel-test\Scripts\python -m pip install dist\cablexsec-0.2.1-py3-none-any.whl -wheel-test\Scripts\python release\smoke_test_wheel.py --version 0.2.0 +wheel-test\Scripts\python release\smoke_test_wheel.py --version 0.2.1 ``` The wheel contains only the `cablexsec` package (with its bundled cable definitions) diff --git a/VALIDATION.md b/VALIDATION.md index fb2a11e..dd71a4a 100644 --- a/VALIDATION.md +++ b/VALIDATION.md @@ -80,6 +80,7 @@ afterwards: a comparison that misses its target is reported as failed. | **SV11-SIDE** | Which quantity Sævik normalised: static stress implied by each reading of the two sides | Sævik (2011) Fig. 21(a); Lukassen (2019) | larger side 272–334 MPa (CV 0.08), axial CV 0.45; model 271 MPa | stated, not gated | Info | | **SV11-SUB** | SV11 metrics without the one-sided stations 2.1/2.5, with coincident pairs by geometric mean, SV11-GJ at 3.1/3.5 | Sævik (2011); Gjøsteen et al. (2027) | 1.89 / 1.12; 2.22 / 1.21; GJ 1.51 / 1.33 (corrected / sectional) | stated, not gated | Info | | **SV11-NORM** | Hypothesis: one normalising static stress for all load cases | Sævik (2011) | median 2.06 (3 of 14), sectional 1.07 (13 of 14) | stated, not gated | Info | +| **SK23-T1** | Three tubes in core–core contact only: onset, the curvature where the largest friction stress stops growing, and coalescence of the slip zones (`core_core_coupling="relative"`), code-to-code | Skeie, Sødahl, Pettersen and Verde (2023, OMAE2023-104817), Table 1, model and FE | onset 2.2518e-5 1/mm with the load per metre of helix, as their Eq. 16 (2.2320e-5 per metre of cable) vs 2.25e-5; saturation 1.0472 × onset (π/3) vs 1.049 (model) and 1.053 (FE); coalescence 1.209 × onset | stated, not gated | Info | | **AW-DONG25** | Armour wire anchored at both ends of one pitch at uniform curvature: stress at the anchor and peak, code-to-code | Dong et al. (2025), FE, Figs 14 and 25 | anchor 156.4 vs 156.9 MPa (source theory 147.8); peak 207.8 vs 204.5 MPa | stated, not gated | Info | | **AW-ZT14** | Same at a = 4.92: normalised anchor and peak stress, code-to-code | Zhu and Tan (2014), FE, Figs 4–8 | 1.19 / 1.70 vs 2.22 (the FE far field is not in slip) | stated, not gated | Info | | **DAI20-KAPPA** | Curvature at two stations inside a bellmouth against the rocking angle, steel-tube umbilical at 200 kN: contact angles predicted after identifying the bending stiffness on one curvature value | Dai, Sævik and Ye (2020), Fig. 9 | −0.87° (S2), −0.89° (S3); 59.1 kN m² identified | both within ±1.0° | Pass | diff --git a/doc/benchmarks.md b/doc/benchmarks.md index fd20c03..6acca53 100644 --- a/doc/benchmarks.md +++ b/doc/benchmarks.md @@ -1612,9 +1612,18 @@ into friction and dissipates about twice the measured work. - the bond is an elastic spring through the polymer outside the wires, an inner-loaded layered annulus free at the cable surface plus the strip concentration (`annulus_mode1_compliance_inner`, `bonded_face_terms`); -- the stuck layer is unchanged; +- stuck, the inner support `K_s` and the bond `K_b` act in parallel: + `xi_tot = (K_s + K_b) / (K_s + K_b + k2)`, `k2 = EA_w sin^2(a) / r_h^2`. + It equals the support's `xi` for a rigid support (`xi = 1`, Zeidan's outer + armour) and is higher otherwise (`xi` 0.50 becomes 0.510 and 0.90 becomes + 0.9004 on the Zeidan layer); - in full slip the bond keeps `xi_bond` of the layer's plane-section - stiffness, added in parallel to the law (`bonded_face_ei`). + stiffness, added in parallel to the law (`bonded_face_ei`); +- the friction cap is not reduced by the bond. The slider is the shear flow + of the inner face, bounded by mu times the inner-face pressure; the bond is + a separate elastic shear flow through the polymer outside, which adds wire + stress without sharing that bound. Scaling the cap by `1 - xi_bond` would + count the bond twice. **Zeidan.** The sheath sits on the outer armour with no tape (Table 5.2, Fig. 5.2). With the outer face bonded: diff --git a/doc/citing.rst b/doc/citing.rst index e4e7ca5..2987645 100644 --- a/doc/citing.rst +++ b/doc/citing.rst @@ -16,7 +16,7 @@ power cables* (version 0.2.1) [Computer software]. https://github.com/SMI-Lab-In .. code-block:: bibtex - @software{CableXSec_0_2_0, + @software{CableXSec_0_2_1, author = {Seo, Jae Hoon}, title = {{CableXSec}: Component-resolved local cross-section mechanics of dynamic power cables}, diff --git a/doc/local_analysis_guide.md b/doc/local_analysis_guide.md index 146bbb2..23b30fd 100644 --- a/doc/local_analysis_guide.md +++ b/doc/local_analysis_guide.md @@ -1000,10 +1000,13 @@ print(core.loads, core.xi, core.mu_effective, core.stick_EI_Nm2) (`"absolute"`) every contact of a core, its neighbours included, resists the slip of that core against the plane section, as for a helix on a fixed cylinder: full slip at `π/2` times the onset curvature. `"relative"` is a - coupled intralayer slip model of laid cores: neighbouring cores touch at - the same axial position, so the friction between them resists their - relative slip `u_i − u_j`, while the filler and ring contacts keep the - absolute slip. The stations of the cores at one axial position form a + coupled intralayer slip model of laid cores after Skeie, Sødahl, Pettersen + and Verde (2023, OMAE2023-104817), who formulated the relative slip of + three cores, its onset and the coalescence of the slip zones at `π/3`: + neighbouring cores touch at the same axial position, so the friction + between them resists their relative slip `u_i − u_j`, while the filler and + ring contacts keep the absolute slip (the interlayer share and the + direction-tied cap are this library's). The stations of the cores at one axial position form a group whose intralayer friction shares sum to zero; the intralayer share of a station is bounded by `σ0 μ_cc (q_cc/q) |sin β| min(ψ, π/n)` (`ψ` from the neutral axis), the interlayer share by the Papailiou cap with @@ -1012,6 +1015,11 @@ print(core.loads, core.xi, core.mu_effective, core.stick_EI_Nm2) contact only (three cores) slip starts at the same onset, the largest frozen friction stress is 2/3 and the full-slip moment `√3/2` of the absolute values, and full slip comes at `2π/(3√3) = 1.209` times the onset. + The largest friction stress stops growing earlier, at `π/3 = 1.047` times + the onset, when the slip front passes `π/3` from the neutral axis; beyond + it only the moment still grows. Skeie et al.'s Table 1 "full slip" + curvature (1.049 times the onset in their model, 1.053 in their FE) is this + saturation, not the coalescence at 1.209 (validation row SK23-T1). An independent field solver of the coupled axial equilibrium of the three cores (`validation/scripts/coupled_core_slip_reference.py`) gives the same onset, full-slip curvature, moment–curvature, friction-force distribution @@ -1079,7 +1087,7 @@ print(core.loads, core.xi, core.mu_effective, core.stick_EI_Nm2) (Skeie and Sødahl 2012, Eq. 2.31) and all slip from `q expm1(μ sin β π/2) / (ξ EA_core sin² β cos β)` (Papailiou 1997, Eq. 15; with `core_core_coupling="relative"` the full-slip curvature of the coupled - stations, `core_full_slip_curvature`); + stations, `core_full_slip_curvature`, Skeie et al. 2023); both curvatures are reported per case and are nodes of the backbone grid. With `CoreFrictionSpec(core_shear=False, strand_slip=False)` the backbone starts on `compute_stiffness(cable).ei_max_Nm2`; with the core insulation diff --git a/doc/template_66kv.md b/doc/template_66kv.md index ad21863..8bc00a4 100644 --- a/doc/template_66kv.md +++ b/doc/template_66kv.md @@ -190,7 +190,7 @@ armour governs): | `distributed` | 1.30e-9 | 7.77e-10 | Since the normal local bending of the wires follows their slip state -(CHANGELOG, Unreleased), the largest wire damage of this record (0.1 s +(CHANGELOG, 0.2.1), the largest wire damage of this record (0.1 s sampling, noise 4e-4 1/m) is 0.23–0.27 % higher for the inner armour and 0.05–0.06 % higher for the outer armour in all four columns, at the same wire and fibre; the table keeps its earlier values, like the other @@ -267,8 +267,8 @@ What the comparison shows: raises the half-height by a further 0.03 kN·m. - **Core–core coupling.** With `CoreFrictionSpec(core_core_coupling="relative")` (the coupled intralayer slip model of the local analysis guide, - Section 6.1) the friction between neighbouring cores acts on their relative - slip. At 50 kN with the default coefficients (0.2) the bounded trefoil puts + Section 6.1, after Skeie et al. 2023, OMAE2023-104817) the friction between + neighbouring cores acts on their relative slip. At 50 kN with the default coefficients (0.2) the bounded trefoil puts 67 % of the core contact load on the core–core contacts; the solved radial state has no core–core contact force at that tension (98 % of the load is on the filler), so the two options agree on it. On the bounded state the cores reach full slip at 1.22 instead of diff --git a/src/cablexsec/analysis/beam_test.py b/src/cablexsec/analysis/beam_test.py index 471ca53..42d28fc 100644 --- a/src/cablexsec/analysis/beam_test.py +++ b/src/cablexsec/analysis/beam_test.py @@ -81,6 +81,7 @@ from cablexsec.api import _prepare_mkappa_law from cablexsec.cable_adapters import require_fully_specified from cablexsec.cables.schema import CableData, uses_cable_materials +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSolverError from cablexsec.mechanics.bend_restrictor import ArticulatedRestrictor from cablexsec.mechanics.core_friction import ( @@ -1742,3 +1743,7 @@ def _simulate_along_wire( notes=tuple(notes), along_wire=aw_out, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/bending_law.py b/src/cablexsec/analysis/bending_law.py index 6b55a0f..1a849e3 100644 --- a/src/cablexsec/analysis/bending_law.py +++ b/src/cablexsec/analysis/bending_law.py @@ -100,6 +100,7 @@ import numpy as np from numpy.typing import ArrayLike, NDArray +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.mechanics.friction_law import FrictionLaw from cablexsec.mechanics.papailiou import ( @@ -1821,3 +1822,7 @@ def caps(tension: float, pressure: float | None) -> FloatArray: group_cap_dT_Nm_per_N=d_t, group_cap_dpe_Nm_per_Pa=d_p, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/capacity.py b/src/cablexsec/analysis/capacity.py index 07f77bf..c275db9 100644 --- a/src/cablexsec/analysis/capacity.py +++ b/src/cablexsec/analysis/capacity.py @@ -128,6 +128,7 @@ CylindricalShellLayer, HelicalLayer, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.axisymmetric import ( @@ -946,3 +947,7 @@ def compute_capacity( ), ), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/capacity_check.py b/src/cablexsec/analysis/capacity_check.py index aaf09dd..de75f1d 100644 --- a/src/cablexsec/analysis/capacity_check.py +++ b/src/cablexsec/analysis/capacity_check.py @@ -87,6 +87,7 @@ from numpy.typing import ArrayLike, NDArray from cablexsec.cables.schema import CableData +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.provenance import Provenance @@ -1390,3 +1391,7 @@ def capacity_extremes( if len(results) < 2: raise CableInputError("an extreme-value fit needs at least two seeds") return gumbel_fit([r.max_utilisation for r in results], fractile=fractile) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/components.py b/src/cablexsec/analysis/components.py index 67efc98..88a049a 100644 --- a/src/cablexsec/analysis/components.py +++ b/src/cablexsec/analysis/components.py @@ -95,6 +95,7 @@ Layer, is_serving, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.core_friction import ( @@ -1910,3 +1911,7 @@ def core_component_utilisation( usage = np.maximum(usage, peak / modulus / limit.value) best = usage if best is None else np.maximum(best, usage) return best + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/compression.py b/src/cablexsec/analysis/compression.py index 5476379..7c47415 100644 --- a/src/cablexsec/analysis/compression.py +++ b/src/cablexsec/analysis/compression.py @@ -97,6 +97,7 @@ HelicalLayer, HelicalStrandedLayer, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.materials import library from cablexsec.mechanics.stiffness import axial_stiffness_by_layer @@ -1466,3 +1467,7 @@ def compute_compression_capacity( kappa_component_1_m=k_comp if component_limits else np.zeros(0), governing_component=tuple(comp_governing), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/core_screen.py b/src/cablexsec/analysis/core_screen.py index 2c416c6..ecc27a3 100644 --- a/src/cablexsec/analysis/core_screen.py +++ b/src/cablexsec/analysis/core_screen.py @@ -80,6 +80,7 @@ helical_layer_fretting, ) from cablexsec.cables.schema import CableData, CylindricalOffsetLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableLookupError, CableSchemaError from cablexsec.materials import library from cablexsec.materials.sn_curves import BlockedSNCurveError, get_sn_curve @@ -707,3 +708,7 @@ def face_mu(partner: CylindricalOffsetLayer | None, given: float | None) -> floa D_strain_life=d_life, strain_life_constants="" if life_constants is None else life_constants.name, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/electrical_life.py b/src/cablexsec/analysis/electrical_life.py index affa083..8bf6df3 100644 --- a/src/cablexsec/analysis/electrical_life.py +++ b/src/cablexsec/analysis/electrical_life.py @@ -52,6 +52,7 @@ from numpy.typing import NDArray from cablexsec.cables.schema import CylindricalOffsetLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.provenance import Provenance, ValidatedRange, check_range @@ -261,3 +262,7 @@ def compute_electrical_life( limitations=tuple(limitations), ), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/frictional_heating.py b/src/cablexsec/analysis/frictional_heating.py index 3744c5b..54138ef 100644 --- a/src/cablexsec/analysis/frictional_heating.py +++ b/src/cablexsec/analysis/frictional_heating.py @@ -66,6 +66,7 @@ from cablexsec.api import compute_mkappa from cablexsec.cable_adapters import structural_armour_layers from cablexsec.cables.schema import CableData, CylindricalOffsetLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.mechanics.clamp_layer import anchored_wire_node_dissipation from cablexsec.mechanics.papailiou import compute_mkappa_wire_slip_front @@ -678,3 +679,7 @@ def heater_power( updates=updates, network=network, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/kinematics.py b/src/cablexsec/analysis/kinematics.py index baa5516..63a77cf 100644 --- a/src/cablexsec/analysis/kinematics.py +++ b/src/cablexsec/analysis/kinematics.py @@ -107,6 +107,7 @@ from cablexsec._numba import HAVE_NUMBA from cablexsec.cables.schema import CableData, HelicalLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.core_friction import ( @@ -1053,3 +1054,7 @@ def kinematic_history( limitations=tuple(limitations), ), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/neutral_axis.py b/src/cablexsec/analysis/neutral_axis.py index c056b88..3de6eac 100644 --- a/src/cablexsec/analysis/neutral_axis.py +++ b/src/cablexsec/analysis/neutral_axis.py @@ -81,6 +81,7 @@ import numpy as np from numpy.typing import NDArray +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.provenance import Provenance @@ -695,3 +696,7 @@ def compute_neutral_axes( core_stick_EI_Nm2=core_stick, core_description=core_description, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/rig_test.py b/src/cablexsec/analysis/rig_test.py index 5868c87..4f7c512 100644 --- a/src/cablexsec/analysis/rig_test.py +++ b/src/cablexsec/analysis/rig_test.py @@ -68,6 +68,7 @@ structural_armour_layers, ) from cablexsec.cables.schema import CableData +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableXSecError from cablexsec.materials import library from cablexsec.mechanics.bend_restrictor import CurvatureField @@ -1713,3 +1714,7 @@ def extreme(g: GaugeResult) -> bool: "where the sectional law alone applies.", ) return tuple(out) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/sea_state_batch.py b/src/cablexsec/analysis/sea_state_batch.py index 07a4016..0e419e3 100644 --- a/src/cablexsec/analysis/sea_state_batch.py +++ b/src/cablexsec/analysis/sea_state_batch.py @@ -95,6 +95,7 @@ from cablexsec.analysis.termination import TerminationSpec from cablexsec.analysis.thermal_coupling import ThermalHistory, ThermalState from cablexsec.cables.schema import CableData +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.io.cabledyn import ( CableDynLineType, @@ -1583,3 +1584,7 @@ def _json_default(value: Any) -> Any: if isinstance(value, Path): return str(value) raise TypeError(f"not JSON serialisable: {type(value).__name__}") + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/section_properties.py b/src/cablexsec/analysis/section_properties.py index 1bc9255..02ab96e 100644 --- a/src/cablexsec/analysis/section_properties.py +++ b/src/cablexsec/analysis/section_properties.py @@ -82,6 +82,7 @@ structural_armour_layers, ) from cablexsec.cables.schema import CableData +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.core_friction import ( @@ -1691,3 +1692,7 @@ def compute_load_sharing( ), ), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/section_stress.py b/src/cablexsec/analysis/section_stress.py index beeab2f..c337e90 100644 --- a/src/cablexsec/analysis/section_stress.py +++ b/src/cablexsec/analysis/section_stress.py @@ -92,6 +92,7 @@ HelicalStrandedLayer, is_serving, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.mechanics.core_friction import CoreFrictionSpec from cablexsec.mechanics.core_kinematics import CoreSlipState @@ -728,3 +729,7 @@ def _radial_field( basis="coupled normal section stress with superposed elastic bending " "about the cable axis", ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/sheath_strain.py b/src/cablexsec/analysis/sheath_strain.py index 75c9cfc..43c07c3 100644 --- a/src/cablexsec/analysis/sheath_strain.py +++ b/src/cablexsec/analysis/sheath_strain.py @@ -47,6 +47,7 @@ CylindricalOffsetLayer, CylindricalShellLayer, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.materials.strain_life import ( @@ -385,3 +386,7 @@ def strain_life_sheath_fatigue( correction=correction, core_state=state, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/sheave.py b/src/cablexsec/analysis/sheave.py index 6a5fbd6..0132e60 100644 --- a/src/cablexsec/analysis/sheave.py +++ b/src/cablexsec/analysis/sheave.py @@ -56,6 +56,7 @@ import numpy as np +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.provenance import Provenance, relayed_warnings @@ -441,3 +442,7 @@ def compute_sheave( ), ), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/slip_curvatures.py b/src/cablexsec/analysis/slip_curvatures.py index 011e146..973aeed 100644 --- a/src/cablexsec/analysis/slip_curvatures.py +++ b/src/cablexsec/analysis/slip_curvatures.py @@ -30,6 +30,7 @@ from cablexsec.cable_adapters import cable_to_mkappa_specs, structural_armour_layers from cablexsec.cables.schema import CableData +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.mechanics.papailiou import full_slip_curvature, slip_onset_curvature @@ -88,3 +89,7 @@ def armour_slip_curvatures( return tuple( LayerSlipCurvatures(name, onset[i], full[i]) for i, name in enumerate(names) ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/stress.py b/src/cablexsec/analysis/stress.py index 79028da..5a6003e 100644 --- a/src/cablexsec/analysis/stress.py +++ b/src/cablexsec/analysis/stress.py @@ -73,6 +73,7 @@ structural_armour_layers, ) from cablexsec.cables.schema import CableData +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.papailiou import wire_slip_stress_bounds @@ -569,3 +570,7 @@ def compute_stress( ), ), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/tape.py b/src/cablexsec/analysis/tape.py index 2238235..cc17f7a 100644 --- a/src/cablexsec/analysis/tape.py +++ b/src/cablexsec/analysis/tape.py @@ -119,6 +119,7 @@ CylindricalOffsetLayer, TapeWinding, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.materials.mean_stress import MeanStressSpec @@ -722,3 +723,7 @@ def compute_tape_fatigue( D_sn=None if d_sn_map is None else float(np.max(d_sn_map)), sn_curve=None if curve is None else curve.name, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/thermal_coupling.py b/src/cablexsec/analysis/thermal_coupling.py index cf0f314..0d3f8d8 100644 --- a/src/cablexsec/analysis/thermal_coupling.py +++ b/src/cablexsec/analysis/thermal_coupling.py @@ -125,6 +125,7 @@ structural_armour_layers, ) from cablexsec.cables.schema import CableData, CylindricalOffsetLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.clamping import clamping_state from cablexsec.exceptions import CableInputError from cablexsec.materials import library @@ -1734,3 +1735,7 @@ def run(state: ThermalState) -> FatigueResult: relaxation_damage_ratio=MappingProxyType(relaxation_ratio), clamping=clamping, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/analysis/torque_balance.py b/src/cablexsec/analysis/torque_balance.py index 5cb96cb..d999381 100644 --- a/src/cablexsec/analysis/torque_balance.py +++ b/src/cablexsec/analysis/torque_balance.py @@ -80,6 +80,7 @@ Layer, uses_cable_materials, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.clamping import ClampingState, clamping_state from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library @@ -1093,3 +1094,7 @@ def _integer_candidates(f: Callable[[float], float], lo: int, hi: int) -> list[i else: a = m1 return list(range(a, b + 1)) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/cable_adapters.py b/src/cablexsec/cable_adapters.py index a70e6af..ea5dc14 100644 --- a/src/cablexsec/cable_adapters.py +++ b/src/cablexsec/cable_adapters.py @@ -32,6 +32,7 @@ HelicalLayer, Layer, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.clamping import require_radial_shrinkage_route, warn_if_unclamped from cablexsec.exceptions import CableSchemaError from cablexsec.materials import library @@ -1174,3 +1175,7 @@ def cable_to_fatigue_layers( ) ) return fatigue_layers + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/cables/schema.py b/src/cablexsec/cables/schema.py index 1442ab9..497f8d8 100644 --- a/src/cablexsec/cables/schema.py +++ b/src/cablexsec/cables/schema.py @@ -55,8 +55,9 @@ import inspect import math import warnings -from collections.abc import Callable, Mapping, Sequence -from contextlib import AbstractContextManager +from collections.abc import Callable, Iterator, Mapping, Sequence +from contextlib import AbstractContextManager, contextmanager +from contextvars import ContextVar from functools import lru_cache from pathlib import Path from typing import Annotated, Any, Literal, ParamSpec, Self, TypeVar @@ -1874,9 +1875,7 @@ def material_scope(self) -> AbstractContextManager[None]: the library alone answer, also inside the scope of another cable. The scope is local to the current thread (and task). """ - return library.material_scope( - material_overlay(self.materials + self.stiffness_materials) - ) + return _cable_scope(self) def get_material(self, name: str) -> CableMaterial: """Return the cable material ``name`` (or a stiffness-defined stand-in).""" @@ -2240,6 +2239,34 @@ def _cable_argument(args: tuple[Any, ...], kwargs: Mapping[str, Any]) -> Any: return None +#: The cable whose material scope this context entered last, with the overlay +#: it set (``None``: none). A nested entry point that receives the same cable +#: object, while that overlay is still the active one, skips re-entering. +_SCOPE_OWNER: ContextVar[tuple[CableData, library.MaterialOverlay | None] | None] = ( + ContextVar("cablexsec_material_scope_owner", default=None) +) + + +@contextmanager +def _cable_scope(cable: CableData) -> Iterator[None]: + """The library scope of ``cable``'s materials, recording ``cable`` as owner.""" + overlay = material_overlay(cable.materials + cable.stiffness_materials) + token = _SCOPE_OWNER.set((cable, overlay)) + try: + with library.material_scope(overlay): + yield + finally: + _SCOPE_OWNER.reset(token) + + +def _in_scope_of(cable: CableData) -> bool: + """True if ``cable``'s own scope is the active material scope.""" + owner = _SCOPE_OWNER.get() + return ( + owner is not None and owner[0] is cable and library.active_overlay() is owner[1] + ) + + def uses_cable_materials(func: Callable[P, R]) -> Callable[P, R]: """Run ``func`` in the material scope of its first cable argument. @@ -2253,7 +2280,8 @@ def uses_cable_materials(func: Callable[P, R]) -> Callable[P, R]: @functools.wraps(func) def run(*args: P.args, **kwargs: P.kwargs) -> R: cable = _cable_argument(args, kwargs) - if cable is None: + if cable is None or _in_scope_of(cable): + # no cable, or already inside this cable's scope (a nested call) return func(*args, **kwargs) with cable.material_scope(): return func(*args, **kwargs) diff --git a/src/cablexsec/clamping.py b/src/cablexsec/clamping.py index 3a19715..392b525 100644 --- a/src/cablexsec/clamping.py +++ b/src/cablexsec/clamping.py @@ -44,6 +44,7 @@ from dataclasses import dataclass, field from cablexsec.cables.schema import CableData, CylindricalLayer, HelicalLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.provenance import ( ClampingCalibrationWarning, @@ -340,3 +341,7 @@ def warn_if_unclamped(cable: CableData, *, stacklevel: int = 2) -> ClampingState if message is not None: warnings.warn(message, MissingClampingStateWarning, stacklevel=stacklevel + 1) return state + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/axisymmetric.py b/src/cablexsec/mechanics/axisymmetric.py index 5d5fcaa..7d02df7 100644 --- a/src/cablexsec/mechanics/axisymmetric.py +++ b/src/cablexsec/mechanics/axisymmetric.py @@ -44,6 +44,7 @@ from numpy.typing import NDArray from cablexsec.cables.schema import CableData, CylindricalLayer, HelicalLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.materials import library from cablexsec.mechanics.stiffness import load_sharing @@ -407,3 +408,7 @@ def compute_winding_contact_pressure( p_above = float(p_iface[k + 1]) if k + 1 < n else p_ext_Pa out[lyr.name] = p_below + p_above # P1 + P2 (both clamping faces) return out + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/contact_qp.py b/src/cablexsec/mechanics/contact_qp.py index 400cc7e..4dd4a8d 100644 --- a/src/cablexsec/mechanics/contact_qp.py +++ b/src/cablexsec/mechanics/contact_qp.py @@ -33,6 +33,7 @@ is_serving, layer_stiffness, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.axisymmetric import lame_thick_wall @@ -336,3 +337,7 @@ def solve_contact_qp( int(np.count_nonzero(reactions > 0)), section, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/core_friction.py b/src/cablexsec/mechanics/core_friction.py index f506a49..4245cf8 100644 --- a/src/cablexsec/mechanics/core_friction.py +++ b/src/cablexsec/mechanics/core_friction.py @@ -154,7 +154,10 @@ field, like a helix on a fixed cylinder, with the load-weighted coefficient ``mu_eff``. Under planar bending full slip comes at ``pi / 2`` times the onset curvature. -* ``"relative"``: a coupled intralayer slip model of laid cores. The +* ``"relative"``: a coupled intralayer slip model of laid cores, after + Skeie, Sødahl, Pettersen and Verde (2023, OMAE2023-104817, + doi:10.1115/OMAE2023-104817), who formulated the relative slip of three + cores, its onset and the coalescence of the slip zones. The neighbouring cores of the layer touch at the same axial position, and the friction between two of them resists their relative slip ``u_i - u_j``; the filler and ring contacts (interlayer) keep the absolute slip. The stations @@ -170,7 +173,10 @@ stress at full slip is ``2/3`` of the absolute value (the stress plateaus beyond ``pi / 3`` from the neutral axis), the full-slip moment is ``sqrt(3)/2`` of the absolute one and full slip comes at - ``2 pi / (3 sqrt 3) = 1.209`` times the onset curvature. These match an + ``2 pi / (3 sqrt 3) = 1.209`` times the onset curvature. The largest + friction stress saturates earlier, at ``pi / 3 = 1.047`` times the onset + (the slip front at ``pi / 3``): the "full slip" curvature of Skeie et al.'s + Table 1 (validation row SK23-T1). These match an independent field solver of the coupled axial equilibrium of the cores (``validation/scripts/coupled_core_slip_reference.py``) on monotonic and reversed planar paths, with and without interlayer friction. Two cores @@ -248,6 +254,7 @@ CylindricalLayer, CylindricalOffsetLayer, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.axisymmetric import AxisymmetricResult, compute_contact_forces @@ -1622,3 +1629,7 @@ def core_friction_history( friction_model=resolved, loads=loads, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/core_kinematics.py b/src/cablexsec/mechanics/core_kinematics.py index 2b56eb7..f00ddda 100644 --- a/src/cablexsec/mechanics/core_kinematics.py +++ b/src/cablexsec/mechanics/core_kinematics.py @@ -76,6 +76,7 @@ from numpy.typing import ArrayLike, NDArray from cablexsec.cables.schema import CableData, CylindricalOffsetLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.mechanics.core_friction import ( CoreFrictionModel, @@ -333,3 +334,7 @@ def core_kinematics( slipping=slipping, model=model, ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/radial_cable.py b/src/cablexsec/mechanics/radial_cable.py index 3badc4c..e47ab55 100644 --- a/src/cablexsec/mechanics/radial_cable.py +++ b/src/cablexsec/mechanics/radial_cable.py @@ -62,6 +62,7 @@ is_serving, layer_stiffness, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library from cablexsec.mechanics.concentric_section import ElasticAnnulus, ElasticHelicalRing @@ -819,3 +820,7 @@ def solve_cable_radial_states( ) ) return states + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/station_coupling.py b/src/cablexsec/mechanics/station_coupling.py index 3248a15..aadaba4 100644 --- a/src/cablexsec/mechanics/station_coupling.py +++ b/src/cablexsec/mechanics/station_coupling.py @@ -2,6 +2,12 @@ # Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University r"""Coupled spring--slider stations of laid cores (relative intralayer slip). +The relative slip of neighbouring cores, its onset and the coalescence of the +slip zones at ``pi / 3`` follow Skeie, Sødahl, Pettersen and Verde (2023, +OMAE2023-104817, doi:10.1115/OMAE2023-104817); the interlayer share, the +direction-tied cap and the closest-point return map of a group are this +module's. + Used by :func:`cablexsec.mechanics.papailiou.wire_slip_history` when the laid-core law takes ``CoreFrictionSpec(core_core_coupling="relative")`` (:mod:`cablexsec.mechanics.core_friction`). Neighbouring cores of one layer diff --git a/src/cablexsec/mechanics/stiffness.py b/src/cablexsec/mechanics/stiffness.py index 99c80d7..9c51498 100644 --- a/src/cablexsec/mechanics/stiffness.py +++ b/src/cablexsec/mechanics/stiffness.py @@ -57,6 +57,7 @@ layer_stiffness, uses_cable_materials, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError from cablexsec.materials import library from cablexsec.mechanics.core_lay import bending_factor, core_angle @@ -982,3 +983,7 @@ def load_sharing(cable: CableData, T_N: float) -> dict[str, float]: return dict.fromkeys(ea, 0.0) eps = T_N / total return {name: eps * v for name, v in ea.items()} + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/thermal.py b/src/cablexsec/mechanics/thermal.py index 011afa5..1fbfab9 100644 --- a/src/cablexsec/mechanics/thermal.py +++ b/src/cablexsec/mechanics/thermal.py @@ -79,6 +79,7 @@ import numpy as np from numpy.typing import NDArray +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.cables.schema import uses_cable_materials from cablexsec.exceptions import CableInputError from cablexsec.materials.library import get_property @@ -1148,3 +1149,7 @@ def _in_t1(a: _LadderAnnulus) -> bool: return _LadderGeometry( path, in_t1, n, n_geo, multi_core, r_core, geometry_notes, sheath_found ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/thermal_network.py b/src/cablexsec/mechanics/thermal_network.py index 1b32ba3..82e2fe7 100644 --- a/src/cablexsec/mechanics/thermal_network.py +++ b/src/cablexsec/mechanics/thermal_network.py @@ -73,6 +73,7 @@ import numpy as np from numpy.typing import NDArray +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.exceptions import CableInputError, CableLookupError from cablexsec.materials.library import get_property from cablexsec.mechanics.thermal import ( @@ -818,3 +819,7 @@ def interpolation(r: float) -> list[tuple[int, float]]: armour_source=armour_source, passive_cores=max(passive, 0), ) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/mechanics/wire_stress.py b/src/cablexsec/mechanics/wire_stress.py index dec9f74..080092d 100644 --- a/src/cablexsec/mechanics/wire_stress.py +++ b/src/cablexsec/mechanics/wire_stress.py @@ -38,7 +38,8 @@ with ``eps_w = sigma_f / E_w`` the bending-induced axial strain the wire carries (:func:`slip_state_normal_curvature`). A stuck wire with the full -plane-section strain ``eps_w = r_h cos^2(a) p_n`` takes ``cos^4(a) p_n``; +plane-section strain ``eps_w = r_h cos^2(a) p_n`` takes ``cos^4(a) p_n`` +(the prescribed normal curvature of the stuck helix, [Saevik2011] Eq. 50); with the shear-lag stick coefficient ``xi`` (``k_f = xi E_w cos^2 a``) it takes ``cos^2(a) cos(2a) + xi sin^2(a) cos^2(a)``; a wire sliding freely along its helix (``sigma_f = 0``) takes ``cos^2(a) cos(2a)``; a wire in diff --git a/src/cablexsec/plotting/cross_section.py b/src/cablexsec/plotting/cross_section.py index 20f84ae..5350665 100644 --- a/src/cablexsec/plotting/cross_section.py +++ b/src/cablexsec/plotting/cross_section.py @@ -15,6 +15,7 @@ CylindricalShellLayer, HelicalLayer, ) +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.plotting.style import ( COLORS, FIGSIZE, @@ -231,3 +232,7 @@ def _component_label(component: str) -> str: "sigma_vm_Pa": "Axial/contact indicator [MPa]", } return names.get(component, component) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/plotting/dashboard.py b/src/cablexsec/plotting/dashboard.py index 7ee5e55..4743817 100644 --- a/src/cablexsec/plotting/dashboard.py +++ b/src/cablexsec/plotting/dashboard.py @@ -25,6 +25,7 @@ from pathlib import Path from typing import TYPE_CHECKING, Any +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.plotting.style import COLORS if TYPE_CHECKING: @@ -306,3 +307,6 @@ def build_dashboard( """ + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/plotting/thermal.py b/src/cablexsec/plotting/thermal.py index 4d14838..57fe830 100644 --- a/src/cablexsec/plotting/thermal.py +++ b/src/cablexsec/plotting/thermal.py @@ -6,6 +6,7 @@ from typing import TYPE_CHECKING +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.plotting.style import ( COLORS, FIGSIZE, @@ -100,3 +101,7 @@ def plot_temperature_gradient( ) annotate_provenance(ax, result.provenance, loc="upper left", max_items=2) return ax + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/src/cablexsec/preflight.py b/src/cablexsec/preflight.py index a79e5b2..94b598b 100644 --- a/src/cablexsec/preflight.py +++ b/src/cablexsec/preflight.py @@ -20,6 +20,7 @@ import numpy as np from cablexsec.cables.schema import CableData, CylindricalOffsetLayer +from cablexsec.cables.schema import scope_entry_points as _scope_entry_points from cablexsec.clamping import clamping_state from cablexsec.exceptions import CableSchemaError from cablexsec.io.series import LoadCaseSeries @@ -333,3 +334,7 @@ def preflight(project: Project) -> PreflightReport: ) issues.extend(preflight_request(model.definition, request, series)) return PreflightReport(tuple(issues)) + + +# Public entry points read the cable's own materials when called directly. +_scope_entry_points(globals(), __all__) diff --git a/tests/conftest.py b/tests/conftest.py index de9dbbf..7dba4a5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,14 +23,16 @@ if _WORKER: _RUN = os.environ.get("PYTEST_XDIST_TESTRUNUID", "run") _ROOT = os.environ.get("NUMBA_CACHE_DIR") or tempfile.gettempdir() - _NUMBA_CACHE = Path(_ROOT) / f"cablexsec-numba-{_RUN}-{_WORKER}" + # Short: numba's cache file names repeat the source path, and a long folder + # name overflows the 260-character path limit of Windows. + _NUMBA_CACHE = Path(_ROOT) / f"cxnb-{_RUN[:8]}-{_WORKER}" os.environ["NUMBA_CACHE_DIR"] = str(_NUMBA_CACHE) # The sea-state batch workers keep persistent numba caches in the user cache # directory; the tests give them a folder of this process, removed at the end. _BATCH_CACHE: Path | None = None if "CABLEXSEC_BATCH_CACHE_DIR" not in os.environ: - _BATCH_CACHE = Path(tempfile.gettempdir()) / f"cablexsec-batch-{os.getpid()}" + _BATCH_CACHE = Path(tempfile.gettempdir()) / f"cxbt-{os.getpid()}" os.environ["CABLEXSEC_BATCH_CACHE_DIR"] = str(_BATCH_CACHE) _SCRIPTS = Path(__file__).resolve().parents[1] / "validation" / "scripts" diff --git a/tests/test_bonded_face.py b/tests/test_bonded_face.py index 793b9f0..e588514 100644 --- a/tests/test_bonded_face.py +++ b/tests/test_bonded_face.py @@ -3,8 +3,8 @@ """Bonded outer armour face (``bonded_face="outer"``, gap G8). Closed form of the inner-loaded annulus compliance; the default unchanged bit -for bit; the stuck section unchanged and the full-slip tangent raised by the -bond's share; the friction cap from the inner face only; energy balance; and +for bit; the stuck section unchanged on a rigid support (raised by the bond in +parallel otherwise) and the full-slip tangent raised by the bond's share; the friction cap from the inner face only; energy balance; and refusal on the routes that would miss the bond's share of the wire force. """ @@ -127,6 +127,8 @@ def test_bond_terms_keep_the_stuck_layer_and_add_the_bond_share() -> None: def test_law_stuck_stiffness_unchanged_and_full_slip_tangent_raised() -> None: + """Zeidan's outer armour has a rigid support (xi = 1), so the stuck + stiffness is unchanged; the bond adds only the full-slip share.""" base, bonded = _bond(_zeidan(), face="none"), _zeidan() law0, law1 = _law(base), _law(bonded) with bonded.material_scope(): diff --git a/tests/test_cable_materials.py b/tests/test_cable_materials.py index 0b1ad22..f9f6322 100644 --- a/tests/test_cable_materials.py +++ b/tests/test_cable_materials.py @@ -14,6 +14,7 @@ import threading from collections.abc import Callable from concurrent.futures import ThreadPoolExecutor +from importlib.resources import files from pathlib import Path from typing import Any @@ -339,6 +340,47 @@ def test_every_public_function_that_takes_a_cable_uses_its_materials() -> None: assert cx.compute_stiffness is api.compute_stiffness +def test_every_public_function_of_every_module_uses_the_cable_materials() -> None: + """Direct calls of submodule functions read the cable's materials too + (xi_for_layer gave the library's 1.000 for Zeidan's inner armour).""" + import importlib + import inspect + import pkgutil + + import cablexsec + + missing = [] + for info in pkgutil.walk_packages(cablexsec.__path__, "cablexsec."): + if info.name.startswith("cablexsec.app"): + continue # the desktop application is not part of the package + module = importlib.import_module(info.name) + for name in getattr(module, "__all__", ()): + value = getattr(module, name, None) + if ( + inspect.isfunction(value) + and takes_cable(value) + and not getattr(value, "__uses_cable_materials__", False) + ): + missing.append(f"{info.name}.{name}") + assert not missing, missing + + +def test_a_direct_call_reads_the_cable_materials_and_nests_cheaply() -> None: + from cablexsec.mechanics.stiffness import xi_for_layer + + cable = cx.load_cable( + files("cablexsec.cables") / "zeidan2025.yaml", geometry_override=None + ) + direct = xi_for_layer(cable, "inner_armour") + with cable.material_scope(): + scoped = xi_for_layer(cable, "inner_armour") + # another scope inside: the nested call must not reuse the outer one + with library.material_scope(None): + library_only = xi_for_layer(cable, "inner_armour") + assert direct == scoped == pytest.approx(0.8321, abs=1e-4) + assert library_only == direct + + def test_cable_scope_decorator() -> None: seen: list[object] = [] diff --git a/tests/test_cabledyn_outputs.py b/tests/test_cabledyn_outputs.py index 66876f4..02cbc1d 100644 --- a/tests/test_cabledyn_outputs.py +++ b/tests/test_cabledyn_outputs.py @@ -713,7 +713,7 @@ def test_components_route_takes_cabledyns_curvature_components(): np.testing.assert_array_equal(history.rotation_curvature_x_1_m, -curv_y) np.testing.assert_array_equal(history.rotation_curvature_y_1_m, curv_x) gx, gy = history.strain_gradient() - np.testing.assert_array_equal(gx, -curv_x) + np.testing.assert_allclose(gx, -curv_x, rtol=1e-15, atol=0.0) assert history.twist_rad is not None with pytest.raises(CableSchemaError, match="already carry the hang-off"): read_cabledyn_sections( diff --git a/tests/test_core_coupled_slip.py b/tests/test_core_coupled_slip.py index 59e1c25..137a757 100644 --- a/tests/test_core_coupled_slip.py +++ b/tests/test_core_coupled_slip.py @@ -704,3 +704,24 @@ def test_coupled_full_slip_curvature_inputs(cable): reference = wire_slip_stress_bounds(absolute.population, 0.2) np.testing.assert_array_equal(upper, reference[0]) np.testing.assert_array_equal(lower, reference[1]) + + +@pytest.mark.independent_method +def test_skeie2023_table1_is_the_saturation_of_the_peak_friction_stress() -> None: + """Skeie, Sødahl, Pettersen and Verde (2023) Table 1 (row SK23-T1): with + the contact load per metre of helix the onset is their Eq. 16; the largest + friction stress stops growing at pi/3 times the onset (their "full slip", + 1.049 in their model, 1.053 in their FE), the slip zones coalesce at + 2 pi / (3 sqrt 3).""" + from check_core_friction import SKEIE2023, skeie2023_table1 + + sk = skeie2023_table1() + assert sk["onset_helix_1_mm"] == pytest.approx(sk["eq16_1_mm"], rel=1e-12) + assert sk["onset_helix_1_mm"] == pytest.approx( + SKEIE2023["table1_onset_1_mm"], rel=0.01 + ) + assert sk["first_slip_ratio"] == pytest.approx(1.0, abs=2e-4) + assert sk["saturation_ratio"] == pytest.approx(math.pi / 3, abs=2e-4) + assert sk["coalescence_ratio"] == pytest.approx(FULL_SLIP_RATIO, abs=2e-4) + table = SKEIE2023["table1_full_helica_1_mm"] / SKEIE2023["table1_onset_1_mm"] + assert sk["saturation_ratio"] == pytest.approx(table, rel=0.005) diff --git a/validation/scripts/check_core_friction.py b/validation/scripts/check_core_friction.py index 9ae6b2f..f3cf701 100644 --- a/validation/scripts/check_core_friction.py +++ b/validation/scripts/check_core_friction.py @@ -516,3 +516,78 @@ def menard() -> None: f"targets {'PASS' if out['pass'] else 'FAIL'}" ) print("Janocha Fig. 6 half-height, code-to-code:", janocha_code_to_code()) + + +#: Skeie, Sødahl, Pettersen and Verde (2023, OMAE2023-104817), Sec. 4.2 and +#: Table 1: three tubes in core-core contact only. +SKEIE2023 = { + "r_helix_m": 5.37e-3, + "lay_angle_deg": 7.6, + "tube_outer_radius_m": 4.65e-3, + "tube_thickness_m": 0.1e-3, + "E_Pa": 2.1e11, + "mu": 0.2, + "contact_N_per_m": 4.44e3, # per neighbour (Table 1 prints 4.44 "MPa") + "table1_onset_1_mm": 2.25e-5, + "table1_full_helica_1_mm": 2.36e-5, + "table1_full_abaqus_1_mm": 2.37e-5, +} + + +def skeie2023_table1(stations_per_core: int = 720) -> dict[str, float]: + """Skeie et al. (2023) Table 1 through the coupled stations of CableXSec. + + Three tubes, core-core friction only (``StationCoupling`` with no + interlayer share), monotonic planar bending. Returns the onset curvature + (contact load per metre of cable, as CableXSec takes it, and per metre of + helix, as their Eq. 16 matches), the curvature at which the largest + friction stress stops growing, and the coalescence (every station + slipping), as ratios of the onset. + """ + from cablexsec.mechanics.mkappa import HelicalLayerSpec # noqa: PLC0415 + from cablexsec.mechanics.papailiou import ( # noqa: PLC0415 + slip_onset_curvature, + wire_slip_history, + ) + from cablexsec.mechanics.station_coupling import StationCoupling # noqa: PLC0415 + + sk = SKEIE2023 + n = 3 + ro, t = sk["tube_outer_radius_m"], sk["tube_thickness_m"] + area = math.pi * (ro**2 - (ro - t) ** 2) + q = 2.0 * sk["contact_N_per_m"] # both neighbours of one core + r_c, beta = sk["r_helix_m"], math.radians(sk["lay_angle_deg"]) + pressure = n * q / (2.0 * math.pi * r_c) + layer = HelicalLayerSpec( + n_wires=n * stations_per_core, + r_helix_m=r_c, + lay_angle_rad=beta, + E_wire_Pa=sk["E_Pa"], + A_wire_m2=area / stations_per_core, + xi=1.0, + mu=sk["mu"], + F_n_axi_N=q, + contact_pressure_Pa=pressure, + normal_load_is_line=True, + ) + coupling = StationCoupling(n, 0.0, sk["mu"], pressure) + onset = slip_onset_curvature(layer) + a = np.linspace(0.0, 1.4, 14001) + history = wire_slip_history( + layer, + a * onset, + np.zeros_like(a), + coupling=coupling, + direction_hold_fraction=0.0, + ) + peak = np.max(np.abs(history.stress_Pa), axis=0) + slipping = history.slipping_count + closed = sk["mu"] * q / (sk["E_Pa"] * area * math.cos(beta) ** 2 * math.sin(beta)) + return { + "onset_1_mm": onset * 1e-3, + "onset_helix_1_mm": onset / math.cos(beta) * 1e-3, + "eq16_1_mm": closed * 1e-3, + "first_slip_ratio": float(a[np.argmax(slipping > 0)]), + "saturation_ratio": float(a[np.argmax(peak >= peak[-1] * (1.0 - 1e-9))]), + "coalescence_ratio": float(a[np.argmax(slipping == n * stations_per_core)]), + } diff --git a/validation/scripts/run_validation.py b/validation/scripts/run_validation.py index 17fd786..68b0c6e 100644 --- a/validation/scripts/run_validation.py +++ b/validation/scripts/run_validation.py @@ -88,10 +88,23 @@ class Row: status: str def line(self) -> str: - return ( - f"| {self.tier} | {self.ident} | {self.quantity} | {self.target} | " - f"{self.value} | {self.status} |" - ) + return _prefix(self) + _cell(self.value) + _suffix(self) + + +def _cell(text: str) -> str: + """A Markdown table cell: a literal ``|`` (as in ``|cos|``) is escaped.""" + return text.replace("|", r"\|") + + +def _prefix(row: Row) -> str: + return ( + f"| {_cell(row.tier)} | {_cell(row.ident)} | {_cell(row.quantity)} | " + f"{_cell(row.target)} | " + ) + + +def _suffix(row: Row) -> str: + return f" | {_cell(row.status)} |" # Staleness check. A value far inside its own tolerance and below an absolute @@ -154,14 +167,15 @@ def _row_recorded(row: Row, line: str) -> bool: """True if a recorded report line states this row up to round-off.""" if line == row.line(): return True - prefix = f"| {row.tier} | {row.ident} | {row.quantity} | {row.target} | " - suffix = f" | {row.status} |" + prefix, suffix = _prefix(row), _suffix(row) if not (line.startswith(prefix) and line.endswith(suffix)): return False if len(line) < len(prefix) + len(suffix): return False recorded = line[len(prefix) : len(line) - len(suffix)] - return _value_classes(recorded, row.target) == _value_classes(row.value, row.target) + return _value_classes(recorded, row.target) == _value_classes( + _cell(row.value), row.target + ) def report_is_stale( @@ -719,7 +733,30 @@ def _anchored_wire_fe_rows() -> list[Row]: z90, f90 = zt["cablexsec"][90.0], zt["fea"][90.0] z45, f45 = zt["cablexsec"][45.0], zt["fea"][45.0] rms = zt["fea_far_field_rms"] + from check_core_friction import SKEIE2023, skeie2023_table1 # noqa: PLC0415 + + sk = skeie2023_table1() + t1 = SKEIE2023 return [ + Row( + "2", + "SK23-T1", + "Skeie et al. (2023) Table 1: three tubes in core-core contact only " + "(R 5.37 mm, lay 7.6 deg, mu 0.2, 4.44 N/mm per neighbour), coupled " + "stations of core_core_coupling='relative' against the source's model " + "and FE: onset (contact load per metre of cable; per metre of helix as " + "their Eq. 16) and the curvature where the largest friction stress " + "stops growing, as a ratio of the onset; coalescence of the slip zones", + "stated, not gated (code-to-code)", + f"onset {sk['onset_1_mm']:.4e} 1/mm ({sk['onset_helix_1_mm']:.4e} per " + f"metre of helix; Eq. 16 {sk['eq16_1_mm']:.4e}) vs " + f"{t1['table1_onset_1_mm']:.2e}; saturation {sk['saturation_ratio']:.4f} " + f"x onset (pi/3) vs " + f"{t1['table1_full_helica_1_mm'] / t1['table1_onset_1_mm']:.3f} (model) / " + f"{t1['table1_full_abaqus_1_mm'] / t1['table1_onset_1_mm']:.3f} (FE); " + f"coalescence {sk['coalescence_ratio']:.4f} x onset (2 pi/(3 sqrt 3))", + "INFO", + ), Row( "2", "AW-DONG25", From 2cd153dd7aa67ee6addc739b0edab3dd2e49c683 Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Mon, 23 Nov 2026 15:23:43 +0900 Subject: [PATCH 2/3] test: regenerate the validation report on the rebased branch After #63: the SV11 rows of dev and the SK23-T1 row of this branch; escaped cells; taxonomy counts. Signed-off-by: Jae Hoon Seo --- validation/validation_report.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/validation/validation_report.md b/validation/validation_report.md index 9123d3d..66b6285 100644 --- a/validation/validation_report.md +++ b/validation/validation_report.md @@ -31,9 +31,9 @@ Every row is computed from published data or closed-form references in this repo | 1 | MK-Tcyc | compute_mkappa with a tension history cycling within the bending cycles vs the fatigue-path friction stress on the same history; work balance under the changing friction bound | < 1e-12 relative; < 1e-12 relative | 3.4e-16; 8.9e-16 | PASS | | 1 | MX-scale | Exported law with a slip scaling variable: compute_mkappa at T2 vs the T1 law with the bound scaled (66 kV, cores included); group elements at T2 vs the T1 elements with yield curvatures scaled (Menard, two layers); tension cycle inside the bending cycles, scaled law vs the contact-tension history over the fixed-tension Iwan residual | < 1e-12 relative; < 1e-9 relative; ratio <= 1.25 | 5.5e-16; 1.2e-13; 1.21 | PASS | | 1 | FL-P | Pressure-dependent friction coefficient (FrictionLaw.pressure_factor): spring-slider under pressure steps vs closed form; compiled vs NumPy direction-tied kernel under a pressure history (static/dynamic law, local pressures across the table); work balance | < 1e-9 relative; < 1e-9 relative; < 1e-9 relative | 3.0e-16; 8.7e-16; 2.5e-15 | PASS | -| 1 | slip-onset | First-to-slip wire at the neutral axis (|cos| → 0, compression side at psi ≈ 3 lam/2; Raoof/Papailiou, not extreme-fibre loop) | |cos| < 0.2 | |cos|=0.156 | PASS | +| 1 | slip-onset | First-to-slip wire at the neutral axis (\|cos\| → 0, compression side at psi ≈ 3 lam/2; Raoof/Papailiou, not extreme-fibre loop) | \|cos\| < 0.2 | \|cos\|=0.156 | PASS | | 1 | xsec-K | Coupling tangent bounds (κ→0=EI_max, κ→∞=EI_min); slip-front local slope | < 0.01% | κ0:1.91e-14% / κ∞:5.99e-13% | PASS | -| 1 | QP-KKT | Concentric contact max|normal line force times gap| (common extension, twist and radial equilibrium) | < 1e-8 N | 1.1e-13 (q>=0: True) | PASS | +| 1 | QP-KKT | Concentric contact max\|normal line force times gap\| (common extension, twist and radial equilibrium) | < 1e-8 N | 1.1e-13 (q>=0: True) | PASS | | 1 | QP-Lamé | Isolated cylinder surface compliances vs compound-cylinder shrink-fit closed form | < 1e-6 | 1.3e-16 | PASS | | 1 | COMP-T | Uniform free thermal expansion, all components | < 1e-6 Pa residual | 0.00e+00 Pa | PASS | | 1 | COMP-N | All-component axial-force equilibrium | < 1e-12 relative | 0.00e+00 | PASS | @@ -70,6 +70,7 @@ Every row is computed from published data or closed-form references in this repo | 2 | SV11-SPLIT | Sævik (2011) termination increment by origin: (a) end-fitting anchor alone (the correction with uniform curvature from the end-fitting face), 14 load cases (SV11-PLANE) and LC 14 at +-8 deg (SV11-GJ); (b) no end fitting (armour anchored 20 m upstream of the face, bellmouth curvature profile unchanged), LC 14 (SV11-PLANE) and LC 14 at +-8 deg (SV11-GJ) | stated, not gated | (a) median R 1.23 (11 of 14 in band), GJ 1.36; (b) LC 14 R 2.09, GJ 2.07, largest change against the registered correction below 1e-12; registered 2.17 and 2.07, sectional 1.19 and 1.27 | INFO | | 2 | SV11-REACH | SV11-PLANE reach of any termination correction: largest slip demand a = kappa / kappa_c of the correction at 0.5 and 1 deg, and the load cases whose sectional R is outside [0.70, 1.43] | stated, not gated | a_max 0.37 and 0.64; R corrected 0.79 and 0.86 (sectional 0.79 and 0.86); sectional outside the band: LC 4 2.39, LC 6 1.48 | INFO | | 2 | SV11-EQ88 | Sævik (2011) Eq. 88, kappa = 0.067 + 0.11 s, at the two published bellmouth ends (Sævik 1.72 m; Gjøsteen et al. 1.79 m): radius and slope | Sævik's text: 3.9 m and 16 deg | 1.72 m: 3.90 m, 15.9 deg; 1.79 m: 3.79 m, 17.0 deg; 3.9 m at s = 1.722 m | INFO | +| 2 | SK23-T1 | Skeie et al. (2023) Table 1: three tubes in core-core contact only (R 5.37 mm, lay 7.6 deg, mu 0.2, 4.44 N/mm per neighbour), coupled stations of core_core_coupling='relative' against the source's model and FE: onset (contact load per metre of cable; per metre of helix as their Eq. 16) and the curvature where the largest friction stress stops growing, as a ratio of the onset; coalescence of the slip zones | stated, not gated (code-to-code) | onset 2.2320e-05 1/mm (2.2518e-05 per metre of helix; Eq. 16 2.2518e-05) vs 2.25e-05; saturation 1.0472 x onset (pi/3) vs 1.049 (model) / 1.053 (FE); coalescence 1.2092 x onset (2 pi/(3 sqrt 3)) | INFO | | 2 | AW-DONG25 | Dong et al. (2025) Figs 14 and 25: armour wire anchored at both ends of one pitch, pipe bent to a uniform 0.005 1/m (a = 1.87), clamp-layer solver against the source's FE: neutral-axis wire (Fig. 14) and anchor stress for theta0 = 0, 45, 90, 135, 180 deg (Fig. 25) [MPa] | stated, not gated (code-to-code) | Fig. 14 anchor 156.4 vs FE 156.9 (source theory 147.8); peak 207.8 at X/P 0.217 vs 204.5 at 0.223; Fig. 25 anchors 81.8/117.6/156.4/191.9/200.0 vs 89.3/121.2/164.8/199.1/195.0 | INFO | | 2 | AW-ZT14 | Zhu and Tan (2014) Figs 4-8: normalised anchor / peak stress of an anchored wire at a = 4.92 (from their Table 2), clamp-layer solver against the source's FE, wires starting at 45 and 90 deg; FE far field against the full-slip triangle | stated, not gated (code-to-code) | 90 deg 1.19 / 1.70 vs FE 2.22 / 2.23; 45 deg 0.05 / 1.32 vs 0.97 / 1.59; FE far field RMS distance to a cosine 0.028, to the full-slip triangle 0.154 (the FE wire is not in slip) | INFO | | 2 | DAI20-KAPPA | Dai et al. (2020) Fig. 9: centre-tube curvature in a bellmouth (0.1 1/m, 3 m, 200 kN) at S2 and S3, rig beam with the bending stiffness identified on the S2 curvature at 4 deg (0.03995 1/m): angle where S2 reaches 90 % and S3 50 % of the bellmouth curvature | both within +-1.0 deg of the measured 7.03 and 14.57 deg | EI 59.1 kN m2; S2 6.16 deg (-0.87), S3 13.69 deg (-0.89); finer beam meshes S2/S3 error 10 mm -0.89/-0.89; 5 mm -0.91/-0.90; 2.5 mm -0.91/-0.90 deg | PASS | @@ -83,8 +84,8 @@ Every row is computed from published data or closed-form references in this repo ## Test taxonomy (full gate suite) -- analytical_sanity: `1319 passed` -- independent_method: `92 passed` +- analytical_sanity: `1321 passed` +- independent_method: `93 passed` - full_scale: `62 passed` Run `pytest -m ` to reproduce each group. From 1ecfa220cc88db23a60e47ed4db5ab053f697b1f Mon Sep 17 00:00:00 2001 From: Jae Hoon Seo Date: Tue, 24 Nov 2026 11:25:46 +0900 Subject: [PATCH 3/3] refactor: neutral key names of the Table 1 values of row SK23-T1 The keys say what the two printed values are (the source's model and its FE). No value, row or test result changes. Signed-off-by: Jae Hoon Seo --- tests/test_core_coupled_slip.py | 2 +- validation/scripts/check_core_friction.py | 4 ++-- validation/scripts/run_validation.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_core_coupled_slip.py b/tests/test_core_coupled_slip.py index 137a757..a623cbf 100644 --- a/tests/test_core_coupled_slip.py +++ b/tests/test_core_coupled_slip.py @@ -723,5 +723,5 @@ def test_skeie2023_table1_is_the_saturation_of_the_peak_friction_stress() -> Non assert sk["first_slip_ratio"] == pytest.approx(1.0, abs=2e-4) assert sk["saturation_ratio"] == pytest.approx(math.pi / 3, abs=2e-4) assert sk["coalescence_ratio"] == pytest.approx(FULL_SLIP_RATIO, abs=2e-4) - table = SKEIE2023["table1_full_helica_1_mm"] / SKEIE2023["table1_onset_1_mm"] + table = SKEIE2023["table1_full_model_1_mm"] / SKEIE2023["table1_onset_1_mm"] assert sk["saturation_ratio"] == pytest.approx(table, rel=0.005) diff --git a/validation/scripts/check_core_friction.py b/validation/scripts/check_core_friction.py index f3cf701..76970f4 100644 --- a/validation/scripts/check_core_friction.py +++ b/validation/scripts/check_core_friction.py @@ -529,8 +529,8 @@ def menard() -> None: "mu": 0.2, "contact_N_per_m": 4.44e3, # per neighbour (Table 1 prints 4.44 "MPa") "table1_onset_1_mm": 2.25e-5, - "table1_full_helica_1_mm": 2.36e-5, - "table1_full_abaqus_1_mm": 2.37e-5, + "table1_full_model_1_mm": 2.36e-5, + "table1_full_fe_1_mm": 2.37e-5, } diff --git a/validation/scripts/run_validation.py b/validation/scripts/run_validation.py index 68b0c6e..efc4676 100644 --- a/validation/scripts/run_validation.py +++ b/validation/scripts/run_validation.py @@ -752,8 +752,8 @@ def _anchored_wire_fe_rows() -> list[Row]: f"metre of helix; Eq. 16 {sk['eq16_1_mm']:.4e}) vs " f"{t1['table1_onset_1_mm']:.2e}; saturation {sk['saturation_ratio']:.4f} " f"x onset (pi/3) vs " - f"{t1['table1_full_helica_1_mm'] / t1['table1_onset_1_mm']:.3f} (model) / " - f"{t1['table1_full_abaqus_1_mm'] / t1['table1_onset_1_mm']:.3f} (FE); " + f"{t1['table1_full_model_1_mm'] / t1['table1_onset_1_mm']:.3f} (model) / " + f"{t1['table1_full_fe_1_mm'] / t1['table1_onset_1_mm']:.3f} (FE); " f"coalescence {sk['coalescence_ratio']:.4f} x onset (2 pi/(3 sqrt 3))", "INFO", ),