diff --git a/CHANGELOG.md b/CHANGELOG.md index 8398a3e..d5fcfb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,21 @@ All notable changes to CableXSec are recorded in this file. The format follows ### Added +- Frozen extrusion shrinkage of a concentric layer: `extrusion_shrinkage` (`hoop_strain`, + `basis`, `source`; `cx.ExtrusionShrinkage`) declares the part of an extruded sheath's or + bedding's cooling shrinkage that stays as a shrink fit on the layers inside it. The radial + solutions carry it as an in-plane initial strain of the layer: the solved radial state (the + ring around a trefoil bundle included, so the laid-core law reads the clamped trefoil) and the + concentric `qp` route; `include_manufacturing=False` leaves it out. The bounded pressure chain, + which has no displacement compatibility, refuses a non-zero value. A shrinkage outside an + armour layer counts as that layer's clamping declaration. Checked against the Lamé shrink fit + of a sleeve with an in-plane eigenstrain on a stiff core (both radial solvers, 1e-4). +- `calibration_scope` (`armour_only` or `all_contacts`) on a calibrated `initial_state` and on a + `published_calibration` armour clamping. The laid-core stick-slip law warns + (`cx.ClampingCalibrationWarning`) when it is combined with a value fitted with the armour + friction alone, which already holds the friction of the other contacts. The Ménard and + Cartraud (2023) pressure is tagged `all_contacts` (its source FE has friction on every + contact) and the identified Witz (1996) pressures `armour_only`. - Laid filler profiles in the core stick-slip law: `CoreFrictionSpec(filler_profiles=True)` (and `mu_filler_profile`) turns the interstitial filler annulus into three profiles laid with the cores that stick and slip with the same direction-tied cap. Their radius `√(J_f/A_f)` and lay @@ -199,6 +214,9 @@ All notable changes to CableXSec are recorded in this file. The format follows stale without changing a gate. CI checks the committed report before the coverage run, so a stale report fails within about 15 minutes instead of after the 45-minute coverage run. +- `MissingClampingStateWarning` now states that at low tension the friction moment and the + bending hysteresis tend to zero without a declared clamping state, so a low-tension + hysteresis is unreliable, and names the extrusion shrinkage among the declarations. - Bounded core contact loads of the laid-core law: the inward resultant of a core (capstan load plus its share of the ring line force) is now reacted by its two neighbours, whose contact forces sum to the resultant over `sin(π/n)`, besides the ring share on the outer face. The diff --git a/doc/file_formats.md b/doc/file_formats.md index 276af90..917a6de 100644 --- a/doc/file_formats.md +++ b/doc/file_formats.md @@ -52,7 +52,7 @@ examples with a cited source for every value. Section 4.1 of the | `cable` | yes | metadata: `name` (required), `description`, `manufacturer`, `withheld_note`, `source_document`, `voltage_kV`, `design_life_years`, `DFF`, `MBR_installation_m`, `MBR_dynamic_m` | | `layers` | yes | list of layers from the centre outwards | | `environment` | no | thermal boundary: `ambient_C`, `T4_external_Km_W` (external thermal resistance, K m/W), `frequency_Hz` (default 50), `source` | -| `initial_state` | no | uniform pressure on the assembled cable before loading: `external_pressure_Pa` (default 0), `identification`, `source`, `bounds_Pa` | +| `initial_state` | no | uniform pressure on the assembled cable before loading: `external_pressure_Pa` (default 0), `identification`, `source`, `bounds_Pa`, `calibration_scope` | | `water_ingress` | no | `design` (`wet` or `dry`), `armour_annulus` (`flooded` or `sealed`), `source` | | `core_lay` | no | assembly lay of offset cores: `pitch_m`, `lay_direction`, `source`; omit for cores aligned with the axis | | `aggregate_properties` | no | published values for comparison, never inputs: `EA_fixed_MN`, `EI_min_kNm2`, `EI_max_kNm2`, `GJ_kNm2`, `OD_mm`, `mass_kg_m`, `EI_min_tension_kN`, `GJ_tension_kN`, `MBL_kN`, `MBL_basis` | @@ -64,7 +64,11 @@ inside the layers. A mistyped key is reported, never ignored. A non-zero `initial_state.external_pressure_Pa` needs an `identification` (`measured`, `manufacturing_specification`, `published_calibration`, `identified` or `assumed_bound`) and a `source`. `assumed_bound` also needs -`bounds_Pa`. A `wet` design may not contain a radial metallic water barrier, +`bounds_Pa`. A `published_calibration` or `identified` pressure may state +`calibration_scope`: `armour_only` (fitted with the armour friction alone; the +value then already holds the friction of the other contacts and the laid-core +friction law warns with `ClampingCalibrationWarning`) or `all_contacts` +(fitted with friction on every contact, cores included). A `wet` design may not contain a radial metallic water barrier, that is a `cylindrical_shell` or a lead or aluminium sheath. A `dry` design must contain one. @@ -89,7 +93,7 @@ them filled. | --- | --- | --- | | `helical` (armour wires) | `n_wires`, `d_wire_m`, `r_helix_m`, `lay_angle_deg` | `lay_direction` (`right_hand` default, `left_hand`), `manufacturing_clamping`, `bulk_sn`, `fretting_sn`, `transverse_slip_fraction`; flat or profiled wires: `wire_shape` (`round` default, `rectangular`, `profiled`), `wire_width_m`, `wire_thickness_m`, `wire_corner_radius_m`, `wire_area_m2`, `wire_I_normal_m4`, `wire_I_lateral_m4`, `wire_J_m4` | | `helical_stranded` (strand within conductor within cable) | `n_conductors`, `r_cable_m`, `lay_angle_cable_deg`, `n_strands`, `r_strand_m`, `d_strand_m`, `lay_angle_strand_deg` | `bulk_sn`, `fretting_sn` | -| `cylindrical` (polymer annulus, bedding, filler, sheath) | `r_inner_m`, `r_outer_m` | `tape` (helical tape winding), `strain_life` | +| `cylindrical` (polymer annulus, bedding, filler, sheath) | `r_inner_m`, `r_outer_m` | `tape` (helical tape winding), `strain_life`, `extrusion_shrinkage` | | `cylindrical_offset` (core component: conductor, insulation, screen) | `r_offset_m`, `r_inner_m`, `r_outer_m` | `n_cores` (default 3), `conductor_area_mm2`, `strand_layers`, `n_strands`, `strand_diameter_mm`, `strand_lay_angle_deg`, `construction`, `electrical`, `bulk_sn`, `fretting_sn`, `strain_life`, `outer_face_pressure`, `tape` | | `cylindrical_shell` (lead or corrugated aluminium sheath) | `r_mid_m`, `t_m` | `f_corrugation` (default 1), `scf` (default 1), `construction` (`bonded_laminate`), `bulk_sn`, `fretting_sn`, `strain_life` | @@ -121,6 +125,7 @@ declared on the layer: | `armour_winding_stress_Pa` | residual wire stress from stranding [Pa], converted to a pressure jump | | `basis` | `measured`, `manufacturing_specification`, `published_calibration`, `assumed`, `representative` or `not_published` | | `source` | required | +| `calibration_scope` | `armour_only` or `all_contacts`, for a `published_calibration` value (as for `initial_state`) | Exactly one of the two values is given. `not_published` requires the value zero, and analyses that depend on the friction then warn with @@ -128,6 +133,28 @@ zero, and analyses that depend on the friction then warn with `winding_stress_Pa` still load. Section 4.4 of the local analysis guide covers the clamping state in full. +An extruded sheath or bedding declares its frozen shrinkage, the part of its +cooling shrinkage that stays as a shrink fit on the layers inside it: + +```yaml + extrusion_shrinkage: + hoop_strain: 0.004 + basis: assumed + source: "Assumed frozen hoop shrinkage of the extruded outer sheath" +``` + +| Key | Meaning | +| --- | --- | +| `hoop_strain` | frozen in-plane shrinkage of the layer (hoop and radial; no axial part), 0 to 0.1 | +| `basis` | `measured`, `manufacturing_specification`, `assumed`, `representative` or `not_published` (which requires zero) | +| `source` | required | + +The radial solutions carry it as an initial strain of the layer +(`contact_model="solved"`, including the ring around a trefoil bundle, and +`"qp"`); the bounded pressure chain refuses a non-zero value. An interstitial +filler cannot declare one. A shrinkage covers the clamping declaration of the +armour layers inside the layer. + ### Materials with sources A layer's `material` names a material of the library diff --git a/doc/local_analysis_guide.md b/doc/local_analysis_guide.md index d7ac268..626692e 100644 --- a/doc/local_analysis_guide.md +++ b/doc/local_analysis_guide.md @@ -436,7 +436,45 @@ clamping is zero because it is declared `not_published`, it issues `cx.MissingClampingStateWarning`. The results are then those of tension-induced contact alone: friction stresses and damages sit at their low end and ratios that change the clamping (temperature, tension) at their -high end. +high end. At low tension the friction moment and the bending hysteresis then +tend to zero, which a manufactured cable does not show: a low-tension +hysteresis is unreliable without a declared clamping state. + +**Extrusion shrinkage.** An extruded sheath or bedding cools and shrinks onto +the layers inside it; the part that is not relaxed stays as a shrink fit. +Declare it on the `cylindrical` layer: + +```yaml + extrusion_shrinkage: + hoop_strain: 0.004 # frozen in-plane shrinkage + basis: assumed + source: "Assumed frozen hoop shrinkage of the extruded sheath" +``` + +The radial solutions carry it as an initial in-plane strain of the layer +(hoop and radial, no axial part): the solved radial state +(`contact_model="solved"`, including the ring around a trefoil bundle, so the +laid-core law reads the clamped trefoil) and the concentric `"qp"` route. +Contacts then open or close under later loads, and +`include_manufacturing=False` leaves it out as it does the winding stress. +The bounded chain has no displacement compatibility to carry an interference +and refuses a non-zero value. The frozen strain depends on the extrusion and +cooling history and on the polymer's relaxation, which CableXSec does not +model: it is an input like the winding stress. A shrinkage of a layer +outside an armour layer counts as that layer's clamping declaration. + +**Calibration scope.** A pressure calibrated on a measured loop holds +whatever friction the calibrating model had. `initial_state` (for +`published_calibration` and `identified` values) and `manufacturing_clamping` +(for `published_calibration`) take `calibration_scope`: `armour_only` or +`all_contacts`. A value fitted with the armour friction alone was raised +until the armour matched the measured dissipation, so it already holds the +friction of the other contacts; the core stick–slip law (Section 6.1) then +warns (`cx.ClampingCalibrationWarning`), because adding the cores counts that +friction twice: re-identify the value with the friction model in use. A value +fitted with friction on every contact is consistent with the core law in +principle, but it belongs to the calibrating model's contact accounting, so a +transfer to CableXSec is still a transfer, not a prediction. Packaged cables: @@ -444,8 +482,8 @@ Packaged cables: | --- | --- | --- | | 33 kV single and three core | `P0` 2.0 MPa, both armours | representative | | 220 kV three-core export | `P0` 3.0 MPa, both armours | representative | -| Ménard and Cartraud (2023) | `initial_state` 0.3 MPa | published calibration | -| Witz (1996) 2.5-inch pipe | `initial_state` 1.037 MPa | identified (0-bar loop width, μ = 0.10) | +| Ménard and Cartraud (2023) | `initial_state` 0.3 MPa | published calibration, all contacts | +| Witz (1996) 2.5-inch pipe | `initial_state` 1.037 MPa | identified (0-bar loop width, μ = 0.10), armour only | | 66 kV IEA Task 49 template | zero | not published (warns) | | CIGRE TB 880 export | none declared | missing (warns) | diff --git a/doc/radial_model.md b/doc/radial_model.md index 5125932..0c78b75 100644 --- a/doc/radial_model.md +++ b/doc/radial_model.md @@ -170,7 +170,7 @@ The section state minimises the small-strain elastic energy per axial metre with | Internal pressure | On the bore of a concentric cable. Opt-in `pressure_barrier=""` names the innermost fluid-tight layer (a flexible pipe's pressure sheath; the interlocked carcass is not fluid-tight): the pressure acts on that layer's bore, the layers inside carry it on both faces (radially; their axial pressure term is not applied) and their face pressures exclude the fluid, and `end_cap` uses the barrier bore. Default unchanged. On the Witz (1996) pipe the default (pressure on the carcass bore) gives 6.04 MPa P1+P2 on the inner tensile armour at 300 bar and the barrier 7.55 MPa, equal to the section without the carcass within 0.03% (`tests/test_pressure_barrier.py`). | | Flooded (wet design) | Every surface at water pressure p. The exact decomposition is a uniform stress −p plus the correction with free strain `−p(1−2ν)/E` and no surface load. Reactions are mechanical (net of water). The mechanical axial force is `T + p A_solid`, the effective-tension relation. | | Temperature | Per-layer free strain `α (T − T_ref)`; E(T) for registered materials. | -| Manufacturing | The layer's declared `manufacturing_clamping` ([local_analysis_guide.md](local_analysis_guide.md) Section 4.4): a pressure jump (`pretension_Pa`) is converted by the inverse of Féret–Bournazel Eq. 5, plus a winding stress (`winding_stress_Pa`), giving a residual wire stress. Initial wire strains are *identified* so that the reference state (zero tension and twist, no pressure, T_ref) carries exactly these stresses. They are then carried through every load case, so contact opens or closes; nothing is superposed. | +| Manufacturing | The layer's declared `manufacturing_clamping` ([local_analysis_guide.md](local_analysis_guide.md) Section 4.4): a pressure jump (`pretension_Pa`) is converted by the inverse of Féret–Bournazel Eq. 5, plus a winding stress (`winding_stress_Pa`), giving a residual wire stress. Initial wire strains are *identified* so that the reference state (zero tension and twist, no pressure, T_ref) carries exactly these stresses. They are then carried through every load case, so contact opens or closes; nothing is superposed. A concentric layer's `extrusion_shrinkage` is an in-plane free strain `−hoop_strain` of that annulus (or of its elements, for the ring around a trefoil bundle), with `include_manufacturing` as the switch. | ### 3.3 Outputs diff --git a/src/cablexsec/__init__.py b/src/cablexsec/__init__.py index 1da60de..ebde3df 100644 --- a/src/cablexsec/__init__.py +++ b/src/cablexsec/__init__.py @@ -240,6 +240,7 @@ ) from cablexsec.cables import chae2023_yaml_path, thies2016_yaml_path from cablexsec.cables.schema import ( + ExtrusionShrinkage, FacePressure, ManufacturingClamping, TapeWinding, @@ -307,6 +308,7 @@ from cablexsec.mechanics.tendon_section import WireSection from cablexsec.mechanics.thermal_network import ThermalNetwork, thermal_network from cablexsec.provenance import ( + ClampingCalibrationWarning, DirectionTiedFrictionWarning, MissingClampingStateWarning, UnmodelledPolymerSofteningWarning, @@ -375,6 +377,7 @@ "CableData", # manufacturing clamping state (gap 4.1b) "ManufacturingClamping", + "ExtrusionShrinkage", "ClampingState", "LayerClamping", "clamping_state", @@ -571,6 +574,7 @@ "Provenance", "ValidatedRange", "ExtrapolationWarning", + "ClampingCalibrationWarning", "DirectionTiedFrictionWarning", "UnevaluatedFatigueCurveWarning", "UnvalidatedModelWarning", diff --git a/src/cablexsec/analysis/capacity.py b/src/cablexsec/analysis/capacity.py index 77ab0ba..54a342a 100644 --- a/src/cablexsec/analysis/capacity.py +++ b/src/cablexsec/analysis/capacity.py @@ -732,6 +732,13 @@ def _crush_uf(cable: CableData, T_N: float, allowable_Pa: float | None) -> float """Polymer-crush screen, or NaN when no project allowable is available.""" if allowable_Pa is None: return math.nan + from cablexsec.clamping import require_radial_shrinkage_route # noqa: PLC0415 + + require_radial_shrinkage_route( + cable, + "bounded pressure chain of the polymer-crush screen", + "no crush allowable", + ) res = _contact_forces(cable, abs(T_N)) p = res.interface_pressure_Pa p_max = float(np.max(p)) if p.size else 0.0 diff --git a/src/cablexsec/api.py b/src/cablexsec/api.py index 8a016b2..67cf925 100644 --- a/src/cablexsec/api.py +++ b/src/cablexsec/api.py @@ -2959,6 +2959,15 @@ def compute_fretting( cable, contact_tension_N=reference, mu=mu, contact_model=contact_model ) p_ext = cable.initial_state.external_pressure_Pa + # The faces are split with the bounded chain, which cannot carry an + # extrusion shrinkage (an interference). + from cablexsec.clamping import require_radial_shrinkage_route # noqa: PLC0415 + + require_radial_shrinkage_route( + cable, + "bounded chain that splits the fretting face pressures", + "a cable without extrusion shrinkage for compute_fretting", + ) chain = compute_contact_forces(cable, reference, p_ext_Pa=p_ext) interface = chain.interface_pressure_Pa winding = winding_interface_pressure(cable) diff --git a/src/cablexsec/cable_adapters.py b/src/cablexsec/cable_adapters.py index 1b728c0..0fde2d9 100644 --- a/src/cablexsec/cable_adapters.py +++ b/src/cablexsec/cable_adapters.py @@ -32,7 +32,7 @@ HelicalLayer, Layer, ) -from cablexsec.clamping import warn_if_unclamped +from cablexsec.clamping import require_radial_shrinkage_route, warn_if_unclamped from cablexsec.exceptions import CableSchemaError from cablexsec.materials import library from cablexsec.materials.sn_curves import ( @@ -133,6 +133,7 @@ def _normal_force_map( mech = cable p_ext = cable.initial_state.external_pressure_Pa if contact_model == "bounded": + require_radial_shrinkage_route(cable, "bounded pressure chain") return compute_contact_forces(mech, tension_N, p_ext_Pa=p_ext).Fn_per_wire_N if contact_model == "qp": return solve_contact_qp(cable, tension_N, p_ext_Pa=p_ext).Fn_per_wire_N @@ -279,6 +280,8 @@ def armour_contact_pressure( else None ) ) + if radial is None: + require_radial_shrinkage_route(cable, "bounded pressure chain") winding = { lyr.name: lyr.winding_stress_Pa for lyr in cable.helical_layers @@ -742,6 +745,8 @@ def armour_crossing_line_loads( ) if contact_model not in {"bounded", "qp"}: raise CableSchemaError("contact_model must be 'bounded' or 'qp'") + if radial is None: + require_radial_shrinkage_route(cable, "bounded pressure chain") bounded = ( section_state.bounded if section_state is not None diff --git a/src/cablexsec/cables/menard2023.yaml b/src/cablexsec/cables/menard2023.yaml index e17f179..857a257 100644 --- a/src/cablexsec/cables/menard2023.yaml +++ b/src/cablexsec/cables/menard2023.yaml @@ -47,6 +47,7 @@ core_lay: initial_state: external_pressure_Pa: 300000.0 identification: published_calibration + calibration_scope: all_contacts # the source FE has friction on every contact (Section 5) source: "[MenardCartraud2023] Sections 5.1-5.3, P = 0.3 MPa" layers: diff --git a/src/cablexsec/cables/menard2023_filled.yaml b/src/cablexsec/cables/menard2023_filled.yaml index 3102b5d..f30057d 100644 --- a/src/cablexsec/cables/menard2023_filled.yaml +++ b/src/cablexsec/cables/menard2023_filled.yaml @@ -53,6 +53,7 @@ core_lay: initial_state: external_pressure_Pa: 300000.0 identification: published_calibration + calibration_scope: all_contacts # the source FE has friction on every contact (Section 5) source: "[MenardCartraud2023] Sections 5.1-5.3, P = 0.3 MPa" layers: diff --git a/src/cablexsec/cables/schema.py b/src/cablexsec/cables/schema.py index f204094..4229d4c 100644 --- a/src/cablexsec/cables/schema.py +++ b/src/cablexsec/cables/schema.py @@ -201,6 +201,15 @@ def _physical_values(self) -> EnvironmentProperties: "assumed_bound", ] +#: What friction a calibrated clamping value was fitted with: the armour +#: friction alone, or friction on every contact (cores, fillers and sheaths +#: included). A value fitted with the armour alone was raised until the armour +#: matched the measured dissipation, so it already holds the friction of the +#: other contacts: adding the laid-core law to it counts that twice. +CalibrationScope = Literal["armour_only", "all_contacts"] + +_CALIBRATED = ("published_calibration", "identified") + class InitialStateProperties(_Frozen): """Documented initial contact state used by nonlinear section analyses. @@ -211,17 +220,32 @@ class InitialStateProperties(_Frozen): be mistaken for an independent prediction: ``"identified"`` marks a value that CableXSec itself fitted to a named measured response (that response is then not a prediction; VALIDATION_POLICY Rule 3). + + ``calibration_scope`` states, for a calibrated or identified value, what + friction it was fitted with (:data:`CalibrationScope`): a pressure fitted + with the armour friction alone already carries the friction of the other + contacts, and the core stick-slip law then warns + (:class:`~cablexsec.provenance.ClampingCalibrationWarning`). """ external_pressure_Pa: float = 0.0 identification: PressureIdentification = "none" source: str = "" bounds_Pa: tuple[float, float] | None = None + calibration_scope: CalibrationScope | None = None @model_validator(mode="after") def _physical_values(self) -> InitialStateProperties: if self.external_pressure_Pa < 0.0: raise ValueError("external_pressure_Pa must be >= 0") + if ( + self.calibration_scope is not None + and self.identification not in _CALIBRATED + ): + raise ValueError( + "calibration_scope applies to a published_calibration or " + "identified initial pressure" + ) if self.external_pressure_Pa > 0.0: if self.identification == "none": raise ValueError( @@ -372,15 +396,22 @@ class ManufacturingClamping(_Frozen): ``"not_published"`` declares that no value is available and requires a zero; analyses that depend on it then warn (:class:`~cablexsec.provenance.MissingClampingStateWarning`). + ``calibration_scope`` states, for a ``published_calibration`` value, what + friction it was fitted with (:data:`CalibrationScope`). """ armour_winding_stress_Pa: float | None = None initial_contact_pressure_Pa: float | None = None basis: ClampingBasis source: str + calibration_scope: CalibrationScope | None = None @model_validator(mode="after") def _one_value(self) -> ManufacturingClamping: + if self.calibration_scope is not None and self.basis != "published_calibration": + raise ValueError( + "calibration_scope applies to a published_calibration clamping" + ) values = [ v for v in (self.armour_winding_stress_Pa, self.initial_contact_pressure_Pa) @@ -861,6 +892,50 @@ def lay_angle_strand_rad(self) -> float | None: return math.radians(self.lay_angle_strand_deg) +class ExtrusionShrinkage(_Frozen): + """Frozen shrinkage of an extruded concentric layer (sheath, bedding). + + An extruded polymer layer cools and shrinks onto the layers it was + extruded over; the part of that shrinkage that is not relaxed stays as a + shrink fit, a manufacturing clamping of everything inside it. + ``hoop_strain`` (>= 0) is that frozen shrinkage: the stress-free + cross-section of the layer is the declared one contracted by + ``hoop_strain`` in every in-plane direction (hoop and radial; no axial + part). It is an input, not a prediction: it depends on the extrusion and + cooling history and on the polymer's relaxation, which CableXSec does not + model. ``basis`` and ``source`` are as for + :class:`ManufacturingClamping`; ``"not_published"`` requires zero. + + The radial solutions carry it as an initial (eigen)strain of the layer: + the solved radial state (``contact_model="solved"``, including the + surrounding ring of a trefoil bundle) and the concentric ``qp`` route, so + contacts open or close under later loads. The bounded pressure chain has + no displacement compatibility to carry an interference and refuses a + non-zero value. + """ + + hoop_strain: float = Field(ge=0.0, lt=0.1, allow_inf_nan=False) + basis: ClampingBasis + source: str + + @model_validator(mode="after") + def _documented(self) -> ExtrusionShrinkage: + if not self.source.strip(): + raise ValueError("extrusion_shrinkage requires a source") + if self.basis == "not_published" and self.hoop_strain != 0.0: + raise ValueError( + "a not_published extrusion shrinkage must be zero; give the " + "value's basis (assumed, representative, ...) instead" + ) + if self.basis == "published_calibration": + raise ValueError( + "extrusion_shrinkage takes a physical basis (measured, " + "manufacturing_specification, representative, assumed or " + "not_published)" + ) + return self + + class CylindricalLayer(_LayerBase): """Solid annular layer (bedding, filler, polymer sheath).""" @@ -870,6 +945,8 @@ class CylindricalLayer(_LayerBase): # Helical tape winding of the layer (gap P2) and its strain-life constants. tape: TapeWinding | None = None strain_life: str = "" + # Frozen extrusion shrinkage (a manufacturing clamping of the layers inside). + extrusion_shrinkage: ExtrusionShrinkage | None = None @model_validator(mode="after") def _annulus_physical_values(self) -> CylindricalLayer: diff --git a/src/cablexsec/cables/witz1996.yaml b/src/cablexsec/cables/witz1996.yaml index 64d3092..1a48cac 100644 --- a/src/cablexsec/cables/witz1996.yaml +++ b/src/cablexsec/cables/witz1996.yaml @@ -38,6 +38,7 @@ cable: initial_state: external_pressure_Pa: 1071328.0 identification: identified + calibration_scope: armour_only # identified with the armour friction law (no cores) source: "Identified on [Witz1996] Fig. 5 loop width at zero curvature (552.7 N m), mu = 0.10, bounded chain; scripts/run_validation.py WITZ-ID" layers: diff --git a/src/cablexsec/cables/witz1996_rect.yaml b/src/cablexsec/cables/witz1996_rect.yaml index c29d1da..0a5dfd2 100644 --- a/src/cablexsec/cables/witz1996_rect.yaml +++ b/src/cablexsec/cables/witz1996_rect.yaml @@ -42,6 +42,7 @@ cable: initial_state: external_pressure_Pa: 1037264.0 identification: identified + calibration_scope: armour_only # identified with the armour friction law (no cores) source: "Identified on [Witz1996] Fig. 5 loop width at zero curvature (552.7 N m), mu = 0.10, bounded chain; scripts/run_validation.py WITZ-ID" layers: diff --git a/src/cablexsec/clamping.py b/src/cablexsec/clamping.py index 143483e..e663aac 100644 --- a/src/cablexsec/clamping.py +++ b/src/cablexsec/clamping.py @@ -40,19 +40,43 @@ from __future__ import annotations import warnings -from dataclasses import dataclass +from dataclasses import dataclass, field -from cablexsec.cables.schema import CableData, HelicalLayer -from cablexsec.provenance import MissingClampingStateWarning +from cablexsec.cables.schema import CableData, CylindricalLayer, HelicalLayer +from cablexsec.exceptions import CableInputError +from cablexsec.provenance import ( + ClampingCalibrationWarning, + MissingClampingStateWarning, +) __all__ = [ "ClampingState", "LayerClamping", + "LayerShrinkage", "clamping_state", + "require_radial_shrinkage_route", + "warn_if_calibrated_with_armour_only", "warn_if_unclamped", ] +@dataclass(frozen=True) +class LayerShrinkage: + """Declared frozen extrusion shrinkage of one concentric layer.""" + + layer: str + r_inner_m: float + hoop_strain: float + basis: str + source: str + + def describe(self) -> str: + return ( + f"{self.layer}: extrusion shrinkage {self.hoop_strain * 100:g} % " + f"({self.basis})" + ) + + @dataclass(frozen=True) class LayerClamping: """Resolved manufacturing clamping of one structural helical layer. @@ -95,11 +119,19 @@ class ClampingState: initial_external_pressure_Pa: float initial_identification: str initial_source: str + shrinkage: tuple[LayerShrinkage, ...] = () + #: Structural helical layers inside a layer that declares a shrinkage. + shrink_covered: frozenset[str] = field(default_factory=frozenset) @property def missing_layers(self) -> tuple[str, ...]: - """Structural helical layers with no declaration and no legacy value.""" - return tuple(x.layer for x in self.layers if x.basis == "missing") + """Structural helical layers with no declaration and no legacy value, + and no declared extrusion shrinkage of a layer outside them.""" + return tuple( + x.layer + for x in self.layers + if x.basis == "missing" and x.layer not in self.shrink_covered + ) @property def has_initial_state(self) -> bool: @@ -117,8 +149,10 @@ def is_declared(self) -> bool: @property def is_zero(self) -> bool: """No clamping at zero tension from either declaration.""" - return self.initial_external_pressure_Pa == 0.0 and all( - x.is_zero for x in self.layers + return ( + self.initial_external_pressure_Pa == 0.0 + and all(x.is_zero for x in self.layers) + and all(x.hoop_strain == 0.0 for x in self.shrinkage) ) def warning_message(self) -> str | None: @@ -130,17 +164,22 @@ def warning_message(self) -> str | None: "stress, fretting contact loads, thermal or tension changes of the " "clamping) then rest on tension-induced contact alone: friction " "stresses and damages sit at their low end and ratios that change " - "the clamping at their high end" + "the clamping at their high end. At low tension the friction " + "moment, the bending hysteresis and its damping tend to zero, which " + "a manufactured cable does not show, so a low-tension hysteresis is " + "unreliable without a declared clamping state" ) if not self.is_declared: return ( f"cable {self.cable!r} declares no manufacturing clamping state " f"for {', '.join(self.missing_layers)}; {consequence}. Declare " "the manufacturing clamping of each armour layer, an armour " - "winding stress or an initial contact pressure with its basis and " + "winding stress or an initial contact pressure, or the frozen " + "extrusion shrinkage of the sheath over it, with its basis and " "source (the local analysis guide, Section 4.4)." ) unpublished = [x.layer for x in self.layers if x.basis == "not_published"] + unpublished += [x.layer for x in self.shrinkage if x.basis == "not_published"] if self.is_zero and unpublished: return ( f"cable {self.cable!r} has zero manufacturing clamping because " @@ -153,6 +192,7 @@ def warning_message(self) -> str | None: def describe(self) -> str: """One-line report of the declared state.""" parts = [x.describe() for x in self.layers] + parts += [x.describe() for x in self.shrinkage] if self.has_initial_state: parts.append( f"initial external pressure " @@ -198,15 +238,92 @@ def clamping_state(cable: CableData) -> ClampingState: ``"undocumented"``; a legacy zero counts as missing. """ initial = cable.initial_state + shrinkage = tuple( + LayerShrinkage( + layer.name, + float(layer.r_inner_m or 0.0), + float(layer.extrusion_shrinkage.hoop_strain), + layer.extrusion_shrinkage.basis, + layer.extrusion_shrinkage.source, + ) + for layer in cable.layers + if isinstance(layer, CylindricalLayer) and layer.extrusion_shrinkage is not None + ) + helical = [layer for layer in cable.helical_layers if layer.structural] + covered = frozenset( + layer.name + for layer in helical + if any(s.r_inner_m > float(layer.r_helix_m or 0.0) for s in shrinkage) + ) return ClampingState( cable=cable.cable.name, - layers=tuple( - _layer_clamping(layer) for layer in cable.helical_layers if layer.structural - ), + layers=tuple(_layer_clamping(layer) for layer in helical), initial_external_pressure_Pa=float(initial.external_pressure_Pa), initial_identification=initial.identification, initial_source=initial.source, + shrinkage=shrinkage, + shrink_covered=covered, + ) + + +def require_radial_shrinkage_route( + cable: CableData, route: str, remedy: str = "contact_model 'solved' or 'qp'" +) -> None: + """Refuse a declared non-zero extrusion shrinkage on the bounded chain. + + The frozen shrinkage of a concentric layer is an interference that only + a displacement-compatible solution carries: the solved radial state and + the concentric ``qp`` route. The bounded pressure chain would silently + drop it. + """ + shrinking = [ + layer.name + for layer in cable.layers + if isinstance(layer, CylindricalLayer) + and layer.extrusion_shrinkage is not None + and layer.extrusion_shrinkage.hoop_strain > 0.0 + ] + if shrinking: + raise CableInputError( + f"{', '.join(shrinking)}: a frozen extrusion shrinkage is carried by " + f"a radial solution, not by the {route}; use {remedy}" + ) + + +def warn_if_calibrated_with_armour_only( + cable: CableData, *, stacklevel: int = 2 +) -> bool: + """Warn when core friction is added to a value fitted with the armour alone. + + Issues :class:`~cablexsec.provenance.ClampingCalibrationWarning` when the + cable's initial pressure or an armour clamping declares + ``calibration_scope="armour_only"``; returns whether it did. Such a value + was raised until the armour friction alone matched the measured + dissipation, so it already holds the share of the other contacts; the + laid-core stick-slip law, which calls this, adds that share again. + """ + names = [] + if cable.initial_state.calibration_scope == "armour_only": + names.append("initial_state") + names += [ + layer.name + for layer in cable.helical_layers + if layer.manufacturing_clamping is not None + and layer.manufacturing_clamping.calibration_scope == "armour_only" + ] + if not names: + return False + warnings.warn( + f"cable {cable.cable.name!r}: {', '.join(names)} was calibrated with " + "the armour friction alone, so it already holds the friction of the " + "other contacts; the core stick-slip law adds the cores' share a " + "second time. " + "Re-identify the clamping with the friction model in use (the local " + "analysis guide, Section 4.4).", + ClampingCalibrationWarning, + stacklevel=stacklevel + 1, ) + return True def warn_if_unclamped(cable: CableData, *, stacklevel: int = 2) -> ClampingState: diff --git a/src/cablexsec/mechanics/concentric_section.py b/src/cablexsec/mechanics/concentric_section.py index 9b31a6f..1a3c4aa 100644 --- a/src/cablexsec/mechanics/concentric_section.py +++ b/src/cablexsec/mechanics/concentric_section.py @@ -37,6 +37,16 @@ class ElasticAnnulus: youngs_modulus_Pa: float poisson_ratio: float free_thermal_strain: float = 0.0 + # In-plane (radial and hoop) free strain added to the isotropic one: a + # frozen extrusion shrinkage is -hoop_strain (no axial part). + free_transverse_strain: float = 0.0 + + @property + def free_strain_vector(self) -> NDArray[np.float64]: + """Free strain (radial, hoop, axial).""" + e = self.free_thermal_strain + t = self.free_transverse_strain + return np.array([e + t, e + t, e], dtype=np.float64) @dataclass(frozen=True) @@ -194,7 +204,13 @@ def solve_concentric_section( for i, layer in enumerate(layers): a, b = layer.inner_radius_m, layer.outer_radius_m if not np.isfinite( - [a, b, layer.youngs_modulus_Pa, layer.free_thermal_strain] + [ + a, + b, + layer.youngs_modulus_Pa, + layer.free_thermal_strain, + getattr(layer, "free_transverse_strain", 0.0), + ] ).all(): raise CableInputError( "layer geometry, modulus and free strain must be finite" @@ -277,7 +293,7 @@ def solve_concentric_section( volume_weight * strain_map.T @ constitutive - @ np.full(3, layer.free_thermal_strain) + @ layer.free_strain_vector ) matrix[1, 1] += shear * math.pi * (b**4 - a**4) / 2 initial_load = load.copy() diff --git a/src/cablexsec/mechanics/contact_qp.py b/src/cablexsec/mechanics/contact_qp.py index 164d677..8caedd2 100644 --- a/src/cablexsec/mechanics/contact_qp.py +++ b/src/cablexsec/mechanics/contact_qp.py @@ -224,9 +224,15 @@ def _concentric_layers( raise CableSchemaError(f"{layer.name}: unsupported concentric layer type") if a is None or b is None: raise CableSchemaError(f"{layer.name}: incomplete annulus geometry") + shrink = getattr(layer, "extrusion_shrinkage", None) result.append( ElasticAnnulus( - layer.name, a, b, e, library.get_property(layer.material, "nu") + layer.name, + a, + b, + e, + library.get_property(layer.material, "nu"), + free_transverse_strain=-float(shrink.hoop_strain) if shrink else 0.0, ) ) result.sort(key=lambda layer: layer.inner_radius_m) diff --git a/src/cablexsec/mechanics/core_friction.py b/src/cablexsec/mechanics/core_friction.py index 57f7ee1..ce2f1e1 100644 --- a/src/cablexsec/mechanics/core_friction.py +++ b/src/cablexsec/mechanics/core_friction.py @@ -480,6 +480,11 @@ def core_contact_loads( "solved", profile, ) + from cablexsec.clamping import require_radial_shrinkage_route # noqa: PLC0415 + + require_radial_shrinkage_route( + cable, "bounded core contact estimate", "contact_model='solved'" + ) if section_state is not None: section_state.require_cable(cable) axi = section_state.bounded @@ -818,6 +823,11 @@ def build_core_friction( if not math.isfinite(tension_N) or tension_N < 0.0: raise CableInputError("tension must be finite and non-negative") n_cores, r_c, beta, r_core = _core_geometry(cable) + from cablexsec.clamping import ( # noqa: PLC0415 + warn_if_calibrated_with_armour_only, + ) + + warn_if_calibrated_with_armour_only(cable, stacklevel=2) loads = core_contact_loads( cable, tension_N, diff --git a/src/cablexsec/mechanics/radial_cable.py b/src/cablexsec/mechanics/radial_cable.py index f989f57..9bea940 100644 --- a/src/cablexsec/mechanics/radial_cable.py +++ b/src/cablexsec/mechanics/radial_cable.py @@ -135,6 +135,8 @@ class _Material: modulus: float poisson: float free_strain: float + # In-plane free strain of a frozen extrusion shrinkage (-hoop_strain). + transverse_strain: float = 0.0 def _layer_state( @@ -146,6 +148,7 @@ def _layer_state( youngs_modulus_Pa: Mapping[str, float] | None, flooded_pressure_Pa: float, material_source: Mapping[str, str] | None = None, + include_shrinkage: bool = True, ) -> dict[str, _Material]: names = {layer.name for layer in cable.layers} sources = dict(material_source or {}) @@ -185,7 +188,9 @@ def _layer_state( free += library.get_property(material, "alpha_T_K") * (t - T_ref_C) if flooded_pressure_Pa: free += flooded_free_strain(modulus, nu, flooded_pressure_Pa) - out[layer.name] = _Material(modulus, nu, free) + shrink = getattr(layer, "extrusion_shrinkage", None) + transverse = -float(shrink.hoop_strain) if include_shrinkage and shrink else 0.0 + out[layer.name] = _Material(modulus, nu, free, transverse) return out @@ -275,8 +280,13 @@ def build_radial_section( filler: str = "auto", angular_cells: int = 48, loose_layers: str = "declared", + include_shrinkage: bool = True, ) -> tuple[RadialSection, tuple[str, ...]]: - """Assemble the coupled section of a cable; returns it with notes.""" + """Assemble the coupled section of a cable; returns it with notes. + + ``include_shrinkage`` carries the declared frozen extrusion shrinkage of + concentric layers as their in-plane free strain. + """ if cable.missing_fields(): raise CableSchemaError("radial solution requires complete geometry") if filler not in {"auto", "solid", "void"}: @@ -294,6 +304,7 @@ def build_radial_section( youngs_modulus_Pa=youngs_modulus_Pa, flooded_pressure_Pa=flooded_pressure_Pa, material_source=sources, + include_shrinkage=include_shrinkage, ) notes: list[str] = [ f"loose layer {name!r} meshed with the material of {source!r}" @@ -343,6 +354,11 @@ def build_radial_section( if fillers: concentric_source.remove(fillers[0]) f = fillers[0] + if mats[f.name].transverse_strain: + raise CableSchemaError( + f"{f.name}: an interstitial filler cannot declare an " + "extrusion shrinkage" + ) if filler in {"auto", "solid"}: filler_body = ElasticFiller( f.name, @@ -385,6 +401,7 @@ def build_radial_section( mats[item.name].modulus, mats[item.name].poisson, mats[item.name].free_strain, + free_transverse_strain=mats[item.name].transverse_strain, ) ) if not ring: @@ -441,7 +458,15 @@ def build_radial_section( elif isinstance(x, (CylindricalLayer, CylindricalShellLayer)): a, b = _annulus_bounds(x) layers.append( - ElasticAnnulus(x.name, a, b, m.modulus, m.poisson, m.free_strain) + ElasticAnnulus( + x.name, + a, + b, + m.modulus, + m.poisson, + m.free_strain, + free_transverse_strain=m.transverse_strain, + ) ) else: raise CableSchemaError( @@ -679,11 +704,19 @@ def solve_cable_radial_states( residual = residual_wire_stress(cable) if include_manufacturing else {} reference, notes = _cached_section( cable, - ("reference", filler, angular_cells, T_ref_C, loose_layers), + ( + "reference", + filler, + angular_cells, + T_ref_C, + loose_layers, + include_manufacturing, + ), filler=filler, angular_cells=angular_cells, T_ref_C=T_ref_C, loose_layers=loose_layers, + include_shrinkage=include_manufacturing, ) initial = _cached_identification(reference, residual) loaded_inputs = ( @@ -702,6 +735,7 @@ def solve_cable_radial_states( filler=filler, angular_cells=angular_cells, loose_layers=loose_layers, + include_shrinkage=include_manufacturing, ) else: section = reference diff --git a/src/cablexsec/mechanics/radial_solution.py b/src/cablexsec/mechanics/radial_solution.py index 40891f7..fb1aab5 100644 --- a/src/cablexsec/mechanics/radial_solution.py +++ b/src/cablexsec/mechanics/radial_solution.py @@ -457,9 +457,7 @@ def add_dense(ids: list[int], block: FloatArray) -> None: bmat[1, 1] = 1 / b vw = 2 * math.pi * rr * 0.5 * (b - a) * weight block += vw * bmat.T @ constitutive @ bmat - vec_load += ( - vw * bmat.T @ constitutive @ np.full(3, layer.free_thermal_strain) - ) + vec_load += vw * bmat.T @ constitutive @ layer.free_strain_vector add_dense(ids, block) load[ids] += vec_load axial_rows.append( @@ -946,6 +944,11 @@ def _element_axial_forces(self, u: FloatArray) -> FloatArray: e = model.element_moduli nu = model.element_poisson e0 = model.element_free_strain + transverse = ( + np.zeros_like(e0) + if model.element_transverse_strain is None + else model.element_transverse_strain + ) lam = e * nu / ((1 + nu) * (1 - 2 * nu)) mu = e / (2 * (1 + nu)) ux = u[2 + 2 * conn] @@ -969,7 +972,9 @@ def _element_axial_forces(self, u: FloatArray) -> FloatArray: dn = np.einsum("ka,eia->eki", dshape, inv) exx = np.einsum("ek,ek->e", dn[:, :, 0], ux) eyy = np.einsum("ek,ek->e", dn[:, :, 1], uy) - szz = lam * (exx + eyy + ezz - 3 * e0) + 2 * mu * (ezz - e0) + szz = lam * (exx + eyy + ezz - 3 * e0 - 2 * transverse) + 2 * mu * ( + ezz - e0 + ) force += w * det * szz return np.asarray(SYMMETRY_FACTOR * force * amap[:, 0], dtype=np.float64) @@ -1013,6 +1018,11 @@ def _core_axial_force(self, u: FloatArray) -> float: e = model.element_moduli[idx] nu = model.element_poisson[idx] e0 = model.element_free_strain[idx] + transverse = ( + np.zeros_like(e0) + if model.element_transverse_strain is None + else model.element_transverse_strain[idx] + ) lam = e * nu / ((1 + nu) * (1 - 2 * nu)) mu = e / (2 * (1 + nu)) ux = u[2 + 2 * conn] @@ -1036,7 +1046,9 @@ def _core_axial_force(self, u: FloatArray) -> float: dn = np.einsum("ka,eia->eki", dshape, inv) exx = np.einsum("ek,ek->e", dn[:, :, 0], ux) eyy = np.einsum("ek,ek->e", dn[:, :, 1], uy) - szz = lam * (exx + eyy + ezz - 3 * e0) + 2 * mu * (ezz - e0) + szz = lam * (exx + eyy + ezz - 3 * e0 - 2 * transverse) + 2 * mu * ( + ezz - e0 + ) force += float(np.sum(w * det * szz)) # The sector holds half a core. The cable-plane integral F_zz equals # the rod force divided by cos(beta); its axial projection is diff --git a/src/cablexsec/mechanics/section_state.py b/src/cablexsec/mechanics/section_state.py index 803bf29..ea2afff 100644 --- a/src/cablexsec/mechanics/section_state.py +++ b/src/cablexsec/mechanics/section_state.py @@ -142,6 +142,10 @@ def solve_section_state( raise CableSchemaError("section-state calculation requires complete geometry") if contact_model not in {"bounded", "qp"}: raise CableSchemaError("contact_model must be 'bounded' or 'qp'") + if contact_model == "bounded": + from cablexsec.clamping import require_radial_shrinkage_route # noqa: PLC0415 + + require_radial_shrinkage_route(cable, "bounded pressure chain") if any(isinstance(layer, HelicalStrandedLayer) for layer in cable.layers): raise CableSchemaError( "nested-strand normal section mechanics require a strand model" @@ -268,11 +272,13 @@ def solve_section_state( coeff_b = a * b * (b * u_a - a * u_b) / (b * b - a * a) shear = e / (2 * (1 + nu)) lame = e * nu / ((1 + nu) * (1 - 2 * nu)) - common = lame * (2 * coeff_a + strain - 3 * elastic.free_thermal_strain) - axial = common + 2 * shear * (strain - elastic.free_thermal_strain) - hoop_const = common + 2 * shear * ( - coeff_a - elastic.free_thermal_strain - ) + # Free strain (radial, hoop, axial) = (e + t, e + t, e): the + # isotropic thermal part e and the in-plane extrusion shrinkage t. + free_e = elastic.free_thermal_strain + free_t = elastic.free_transverse_strain + common = lame * (2 * coeff_a + strain - 3 * free_e - 2 * free_t) + axial = common + 2 * shear * (strain - free_e) + hoop_const = common + 2 * shear * (coeff_a - free_e - free_t) torque = shear * math.pi * (b**4 - a**4) / 2 * twist layer_states[elastic.name] = LayerNormalState( axial, diff --git a/src/cablexsec/mechanics/trefoil_section.py b/src/cablexsec/mechanics/trefoil_section.py index 08cb5e7..300c11f 100644 --- a/src/cablexsec/mechanics/trefoil_section.py +++ b/src/cablexsec/mechanics/trefoil_section.py @@ -163,6 +163,9 @@ class TrefoilModel: element_layers: tuple[str, ...] = () """Name of the layer of each element (a core layer, ring layer or the filler); a radial gap filled with a neighbour's material is that layer's.""" + element_transverse_strain: FloatArray | None = None + """In-plane free strain of each element added to its isotropic one (a + ring layer's frozen extrusion shrinkage); ``None`` is zero.""" @property def size(self) -> int: @@ -313,7 +316,7 @@ def build_trefoil_model(bundle: TrefoilBundle) -> TrefoilModel: nodes = _NodeTable() elements: list[list[int]] = [] groups: dict[str, list[int]] = {} - material: list[tuple[float, float, float]] = [] + material: list[tuple[float, float, float, float]] = [] axial: list[tuple[float, ...]] = [] owners: list[str] = [] @@ -343,7 +346,12 @@ def add(group: str, conn: list[int], layer: object, ext: tuple[float, ...]) -> N groups.setdefault(group, []).append(len(elements)) elements.append(conn) material.append( - (layer.youngs_modulus_Pa, layer.poisson_ratio, layer.free_thermal_strain) # type: ignore[attr-defined] + ( + layer.youngs_modulus_Pa, # type: ignore[attr-defined] + layer.poisson_ratio, # type: ignore[attr-defined] + layer.free_thermal_strain, # type: ignore[attr-defined] + getattr(layer, "free_transverse_strain", 0.0), + ) ) axial.append(ext) owners.append(str(layer.name)) # type: ignore[attr-defined] @@ -680,6 +688,7 @@ def family(name: str, start: int, factor: float) -> None: props[:, 2].copy(), axial_map, tuple(owners), + props[:, 3].copy() if np.any(props[:, 3]) else None, ) @@ -776,6 +785,7 @@ def _assemble( ke += np.einsum("e,eai,eab,ebj->eij", weight, b, d, b) e0v = np.zeros((ne, 4)) e0v[:, :3] = e0[:, None] + e0v[:, :2] += props[:, 3, None] fe += np.einsum("e,eai,eab,eb->ei", weight, b, d, e0v) point = np.einsum("k,eki->ei", shape, coords) r2 = np.where( diff --git a/src/cablexsec/provenance.py b/src/cablexsec/provenance.py index 1d5cbf1..212f5ac 100644 --- a/src/cablexsec/provenance.py +++ b/src/cablexsec/provenance.py @@ -46,6 +46,7 @@ from cablexsec.exceptions import PhysicalRangeError __all__ = [ + "ClampingCalibrationWarning", "DirectionTiedFrictionWarning", "ExtrapolationWarning", "MissingClampingStateWarning", @@ -117,7 +118,21 @@ class MissingClampingStateWarning(UserWarning): (and the cable no identified ``initial_state``), or when the clamping is zero because it is declared as not published. Bending hysteresis, armour friction stress, fretting loads and their changes with temperature then - rest on tension-induced contact alone (:mod:`cablexsec.clamping`). + rest on tension-induced contact alone (:mod:`cablexsec.clamping`); at low + tension they tend to zero, so a low-tension hysteresis is unreliable. + """ + + +class ClampingCalibrationWarning(UserWarning): + """A calibrated clamping value is combined with friction it already holds. + + Emitted by the laid-core stick-slip law when the cable's initial pressure + or an armour clamping was calibrated with the armour friction alone + (``calibration_scope="armour_only"``): that value was raised until the + armour matched the measured dissipation, so it already carries the + friction of the other contacts, which the law then adds a second time. + Re-identify the value with the friction model in use + (:mod:`cablexsec.clamping`). """ diff --git a/tests/test_extrusion_shrinkage.py b/tests/test_extrusion_shrinkage.py new file mode 100644 index 0000000..b0cbf6a --- /dev/null +++ b/tests/test_extrusion_shrinkage.py @@ -0,0 +1,320 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +"""Frozen extrusion shrinkage, calibration scope and the clamping warning. + +Verification only: the shrink fit of a sleeve on a stiff core against the +Lamé solution with an in-plane eigenstrain, the two radial solvers against +each other, the identity of a zero shrinkage, the refusal of the bounded +chain and the clamping-state and calibration warnings. +""" + +import math +import warnings + +import numpy as np +import pytest +from pydantic import ValidationError + +import cablexsec as cx +from cablexsec.clamping import clamping_state +from cablexsec.exceptions import CableInputError, CableSchemaError +from cablexsec.mechanics.concentric_section import ( + ElasticAnnulus, + solve_concentric_section, +) +from cablexsec.mechanics.core_friction import build_core_friction, core_contact_loads +from cablexsec.mechanics.radial_solution import RadialSection + +pytestmark = [ + pytest.mark.analytical_sanity, + pytest.mark.filterwarnings( + "ignore::cablexsec.provenance.MissingClampingStateWarning" + ), +] + +SHRINK = cx.ExtrusionShrinkage(hoop_strain=0.005, basis="assumed", source="test") + + +def _with_shrinkage(cable, name, shrink=SHRINK): + layers = tuple( + x.model_copy(update={"extrusion_shrinkage": shrink}) if x.name == name else x + for x in cable.layers + ) + return cable.model_copy(update={"layers": layers}) + + +def _lame_shrink_fit(a, b, e, nu, strain): + """Pressure of a sleeve (a..b) with in-plane eigenstrain -strain on a rigid + core in plane strain: u(a) = 0, sigma_r(b) = 0.""" + lam = e * nu / ((1 + nu) * (1 - 2 * nu)) + mu = e / (2 * (1 + nu)) + eig = -strain + amp = (lam + mu) * eig / (lam + mu + mu * a * a / (b * b)) + return -(2 * (lam + mu) * (amp - eig) + 2 * mu * amp) + + +@pytest.mark.parametrize("solver", ["concentric", "radial"]) +def test_shrink_fit_on_a_stiff_core_matches_lame(solver): + a, b, e, nu, strain = 0.05, 0.056, 1.0e9, 0.4, 0.004 + layers = [ + ElasticAnnulus("core", 0.0, a, 1.0e6 * e, 0.3), + ElasticAnnulus("sleeve", a, b, e, nu, free_transverse_strain=-strain), + ] + if solver == "concentric": + pressure = float(solve_concentric_section(layers).contact_pressure_Pa[0]) + else: + result = RadialSection(layers).solve() + pressure = float(result.interface_line_force_N_per_m[0] / (2 * math.pi * a)) + expected = _lame_shrink_fit(a, b, e, nu, strain) + assert expected > 0.0 + assert pressure == pytest.approx(expected, rel=1e-4) + # Thin-ring limit E eps t / ((1 - nu^2) r): within the thickness ratio. + thin = e * strain * (b - a) / ((1 - nu * nu) * 0.5 * (a + b)) + assert pressure == pytest.approx(thin, rel=0.15) + + +def test_zero_or_omitted_shrinkage_is_the_same_section(): + cable = cx.load_cable(cx.iea_task49_66kv_yaml_path(), geometry_override=None) + zero = cx.ExtrusionShrinkage(hoop_strain=0.0, basis="not_published", source="x") + other = _with_shrinkage(cable, "hdpe_outer_sheath", zero) + a = cx.solve_cable_radial_state(cable, 5.0e4) + b = cx.solve_cable_radial_state(other, 5.0e4) + assert a.armour_contact_pressure() == b.armour_contact_pressure() + assert a.result.bundle == b.result.bundle + + +def test_solved_state_carries_the_shrinkage(): + cable = cx.load_cable(cx.iea_task49_66kv_yaml_path(), geometry_override=None) + base = cx.solve_cable_radial_state(cable, 0.0) + outer = cx.solve_cable_radial_state( + _with_shrinkage(cable, "hdpe_outer_sheath"), 0.0 + ) + before, after = base.armour_contact_pressure(), outer.armour_contact_pressure() + for name in ("inner_armour", "outer_armour"): + assert after[name] > before[name] + 1.0e4 + # The ring around the trefoil (the inner sheath) clamps the cores. + ring = cx.solve_cable_radial_state(_with_shrinkage(cable, "mdpe_inner_sheath"), 0.0) + assert ring.result.bundle is not None and base.result.bundle is not None + assert ( + ring.result.bundle.filler_core_force_N_per_m + > base.result.bundle.filler_core_force_N_per_m + 1.0e3 + ) + # include_manufacturing=False leaves the shrinkage out. + off = cx.solve_cable_radial_state( + _with_shrinkage(cable, "hdpe_outer_sheath"), 0.0, include_manufacturing=False + ) + np.testing.assert_allclose( + list(off.armour_contact_pressure().values()), + list(before.values()), + rtol=1e-12, + atol=1e-9, + ) + # The laid-core law reads the solved, clamped trefoil. + clamped = _with_shrinkage(cable, "mdpe_inner_sheath") + loads = core_contact_loads(clamped, 0.0, contact_model="solved") + assert loads.total_N_per_m > 1.0e3 + # An interstitial filler cannot declare one. + with pytest.raises(CableSchemaError, match="interstitial filler"): + cx.solve_cable_radial_state(_with_shrinkage(cable, "mdpe_filler"), 0.0) + + +def test_qp_route_carries_the_shrinkage(): + cable = cx.load_cable( + cx.inter_array_single_core_yaml_path(), geometry_override=None + ) + shrunk = _with_shrinkage(cable, "hdpe_outer_sheath") + from cablexsec.cable_adapters import armour_contact_pressure + + base = armour_contact_pressure(cable, 1.0e4, contact_model="qp") + clamped = armour_contact_pressure(shrunk, 1.0e4, contact_model="qp") + for name in base: + assert clamped[name] > base[name] + solved = armour_contact_pressure(shrunk, 1.0e4, contact_model="solved") + for name in base: + assert ( + solved[name] + > armour_contact_pressure(cable, 1.0e4, contact_model="solved")[name] + ) + + +def test_bounded_chain_refuses_a_shrinkage(): + cable = cx.load_cable(cx.iea_task49_66kv_yaml_path(), geometry_override=None) + shrunk = _with_shrinkage(cable, "hdpe_outer_sheath") + k = 0.1 * np.sin(np.linspace(0.0, 2 * math.pi, 41)) + with pytest.raises(CableInputError, match="extrusion shrinkage"): + cx.compute_mkappa(shrunk, k, tension_N=5.0e4) + with pytest.raises(CableInputError, match="contact_model='solved'"): + core_contact_loads(shrunk, 5.0e4) + with pytest.raises(CableInputError, match="extrusion shrinkage"): + cx.solve_section_state(shrunk, tension_N=5.0e4, contact_model="bounded") + # The solved route runs. + res = cx.compute_mkappa(shrunk, k, tension_N=5.0e4, contact_model="solved") + assert np.all(np.isfinite(res.moment_Nm)) + + +def test_schema_of_the_shrinkage_and_scope(): + with pytest.raises(ValidationError, match="source"): + cx.ExtrusionShrinkage(hoop_strain=0.01, basis="assumed", source=" ") + with pytest.raises(ValidationError, match="not_published"): + cx.ExtrusionShrinkage(hoop_strain=0.01, basis="not_published", source="x") + with pytest.raises(ValidationError, match="physical basis"): + cx.ExtrusionShrinkage( + hoop_strain=0.01, basis="published_calibration", source="x" + ) + for bad in (-0.001, 0.1, math.nan): + with pytest.raises(ValidationError): + cx.ExtrusionShrinkage(hoop_strain=bad, basis="assumed", source="x") + from cablexsec.cables.schema import InitialStateProperties + + with pytest.raises(ValidationError, match="calibration_scope"): + InitialStateProperties( + external_pressure_Pa=1e5, + identification="assumed_bound", + bounds_Pa=(0.0, 2e5), + source="x", + calibration_scope="all_contacts", + ) + with pytest.raises(ValidationError, match="calibration_scope"): + cx.ManufacturingClamping( + armour_winding_stress_Pa=5e7, + basis="assumed", + source="x", + calibration_scope="armour_only", + ) + cx.ManufacturingClamping( + armour_winding_stress_Pa=5e7, + basis="published_calibration", + source="x", + calibration_scope="armour_only", + ) + + +def test_clamping_state_reads_the_shrinkage(): + cable = cx.load_cable( + cx.inter_array_single_core_yaml_path(), geometry_override=None + ) + layers = tuple( + x.model_copy( + update={ + "manufacturing_clamping": None, + "winding_stress_Pa": None, + "pretension_Pa": None, + } + ) + if x.layer_type == "helical" + else x + for x in cable.layers + ) + bare = cable.model_copy(update={"layers": layers}) + state = clamping_state(bare) + assert state.missing_layers == ("inner_armour", "outer_armour") + message = state.warning_message() + assert message is not None + assert "low-tension hysteresis is unreliable" in message + # A shrinking outer sheath covers both armour layers inside it. + covered = clamping_state(_with_shrinkage(bare, "hdpe_outer_sheath")) + assert covered.missing_layers == () + assert covered.is_declared and not covered.is_zero + assert covered.warning_message() is None + assert "extrusion shrinkage 0.5 %" in covered.describe() + # A bedding inside both covers neither. + inner = clamping_state(_with_shrinkage(bare, "hdpe_bedding")) + assert inner.missing_layers == ("inner_armour", "outer_armour") + # A not-published zero shrinkage is reported as such. + zero = cx.ExtrusionShrinkage(hoop_strain=0.0, basis="not_published", source="x") + unpublished = clamping_state(_with_shrinkage(bare, "hdpe_outer_sheath", zero)) + text = unpublished.warning_message() + assert text is not None and "hdpe_outer_sheath" in text + + +def test_calibration_scope_warns_on_double_counted_core_friction(): + from cablexsec.cables.schema import InitialStateProperties + + menard = cx.load_cable(cx.menard2023_yaml_path(), geometry_override=None) + assert menard.initial_state.calibration_scope == "all_contacts" + witz = cx.load_cable(cx.witz1996_yaml_path(), geometry_override=None) + assert witz.initial_state.calibration_scope == "armour_only" + # Fitted with friction on every contact: consistent with the core law. + with warnings.catch_warnings(): + warnings.simplefilter("error", cx.ClampingCalibrationWarning) + build_core_friction(menard, cx.CoreFrictionSpec(), 0.0) + # Fitted with the armour alone: the core law double counts. + armour_only = menard.model_copy( + update={ + "initial_state": InitialStateProperties( + external_pressure_Pa=3.0e5, + identification="identified", + source="test", + calibration_scope="armour_only", + ) + } + ) + with pytest.warns(cx.ClampingCalibrationWarning, match="armour friction alone"): + build_core_friction(armour_only, cx.CoreFrictionSpec(), 0.0) + # Without the core law nothing is added, so no warning. + with warnings.catch_warnings(): + warnings.simplefilter("error", cx.ClampingCalibrationWarning) + cx.compute_mkappa(armour_only, 0.05 * np.sin(np.linspace(0, 6.3, 41)), mu=0.2) + # The same tag on an armour clamping. + clamp = cx.ManufacturingClamping( + initial_contact_pressure_Pa=1.0e5, + basis="published_calibration", + source="test", + calibration_scope="armour_only", + ) + layers = tuple( + x.model_copy(update={"manufacturing_clamping": clamp}) + if x.layer_type == "helical" + else x + for x in menard.layers + ) + tagged = menard.model_copy(update={"layers": layers}) + with pytest.warns(cx.ClampingCalibrationWarning, match="armour"): + build_core_friction(tagged, cx.CoreFrictionSpec(), 0.0) + + +def test_fretting_refuses_a_shrinkage(): + cable = cx.load_cable( + cx.inter_array_single_core_yaml_path(), geometry_override=None + ) + shrunk = _with_shrinkage(cable, "hdpe_outer_sheath") + k = 0.002 * np.sin(np.linspace(0.0, 2 * math.pi, 41)) + with pytest.raises(CableInputError, match="fretting"): + cx.compute_fretting( + shrunk, k, np.zeros_like(k), duration_s=10.0, contact_model="solved" + ) + + +def test_other_bounded_consumers_refuse_a_shrinkage(): + from cablexsec.analysis.capacity import _crush_uf + from cablexsec.cable_adapters import _normal_force_map + + cable = cx.load_cable( + cx.inter_array_single_core_yaml_path(), geometry_override=None + ) + shrunk = _with_shrinkage(cable, "hdpe_outer_sheath") + with pytest.raises(CableInputError, match="extrusion shrinkage"): + _normal_force_map(shrunk, 1.0e4, contact_model="bounded") + assert _normal_force_map(shrunk, 1.0e4, contact_model="qp") + with pytest.raises(CableInputError, match="crush"): + _crush_uf(shrunk, 1.0e4, 5.0e6) + assert math.isnan(_crush_uf(shrunk, 1.0e4, None)) + + +def test_qp_section_state_recovers_the_shrink_fit_stresses(): + cable = cx.load_cable( + cx.inter_array_single_core_yaml_path(), geometry_override=None + ) + shrunk = _with_shrinkage(cable, "hdpe_outer_sheath") + base = cx.solve_section_state(cable, tension_N=1.0e4, contact_model="qp") + state = cx.solve_section_state(shrunk, tension_N=1.0e4, contact_model="qp") + # The recovered layer forces balance the section force (checked inside), + # and the shrunk sheath is in hoop tension that the base sheath is not. + sheath = state.layers["hdpe_outer_sheath"] + a = ( + sheath.radial_stress_constant_Pa + + sheath.radial_stress_inverse_Pa_m2 / 0.0335**2 + ) + plain = base.layers["hdpe_outer_sheath"] + b = plain.radial_stress_constant_Pa + plain.radial_stress_inverse_Pa_m2 / 0.0335**2 + assert a > b + 1.0e6 diff --git a/validation/validation_report.md b/validation/validation_report.md index 4137b3f..6d7f7cb 100644 --- a/validation/validation_report.md +++ b/validation/validation_report.md @@ -68,7 +68,7 @@ Every row is computed from published data or closed-form references in this repo ## Test taxonomy (full gate suite) -- analytical_sanity: `1168 passed` +- analytical_sanity: `1180 passed` - independent_method: `76 passed` - full_scale: `31 passed`