Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,15 @@ All notable changes to CableXSec are recorded in this file. The format follows
- `CoreFrictionSpec(central_filler=...)` selects the support of the inward core loads in the
bounded core contact estimate: the neighbouring cores of a touching trefoil (default) or a
central filler.
- A cylindrical layer defined by its section stiffness: `stiffness: {EA_N, EI_Nm2, GJ_Nm2,
mass_kg_per_m, source}` (optional `poisson_ratio`) replaces `material` for a component whose
properties come from a datasheet. It adds its `EA` to the axial stiffness and the load
sharing, its `EI` to the stick and slip bending stiffness, its `GJ` to the torsional stiffness
and its mass to the section; the radii place it in the bounded contact chain. A stand-in
material, an isotropic solid filling the annulus (`E = EA/A`, `EI/I`, `m/A`, Poisson ratio
0.3 unless given, no thermal expansion), serves the calculations that read a material. The
coupled radial models refuse the layer. A stiffness block that repeats a material layer's
values reproduces its stiffness, mass and fatigue damage to round-off.
- A serving layer: `construction: serving` on a `cylindrical` layer declares a served yarn or a
wound tape. It keeps its mass, its radial and hoop stiffness (an annulus of its material in
plane stress along the cable axis, in the concentric and the meshed three-core radial
Expand Down
35 changes: 34 additions & 1 deletion doc/file_formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,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, serving) | `r_inner_m`, `r_outer_m` | `tape` (helical tape winding), `strain_life`, `extrusion_shrinkage`, `construction` (`serving`) |
| `cylindrical` (polymer annulus, bedding, filler, sheath, serving) | `r_inner_m`, `r_outer_m` | `tape` (helical tape winding), `strain_life`, `extrusion_shrinkage`, `construction` (`serving`), `stiffness` (instead of `material`) |
| `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` |

Expand All @@ -111,6 +111,39 @@ marked `kinematic`. A serving is non-structural
and is never an interstitial filler. Without `construction` a `cylindrical`
layer is a solid annulus, as before.

A `cylindrical` layer whose properties come from a datasheet is defined by its
section stiffness instead of a material:

```yaml
- name: datasheet_unit
layer_type: cylindrical
r_inner_m: 0.0
r_outer_m: 0.012
stiffness:
EA_N: 2.4e6 # axial stiffness [N]
EI_Nm2: 4.1 # bending stiffness [N m2]
GJ_Nm2: 3.2 # torsional stiffness [N m2]
mass_kg_per_m: 0.21
poisson_ratio: 0.35 # optional; default 0.3 (model assumption)
source: "manufacturer datasheet, rev. B"
```

The layer adds `EA_N` to the axial stiffness and the load sharing, `EI_Nm2`
to the bending stiffness (stick and slip; a concentric layer has no
parallel-axis term) and `GJ_Nm2` to the torsional stiffness, and
`mass_kg_per_m` to the mass. It takes no `material` key: the cable supplies a
stand-in material `"<name> (stiffness)"`, an isotropic solid filling the
annulus (`E = EA/A`, bending modulus `EI/I`, density `m/A`, the Poisson ratio
above, no thermal expansion), for the calculations that read a material: the
shear support of the armour in the finite-support no-slip coefficient, the
hoop restraint of the armour buckling screen and the component stress, which
is that of the stand-in and has no limit. The radii place the layer in the
bounded contact chain. The coupled radial models (`contact_model="qp"`,
`"solved"`, coiling, the solved torque balance) refuse the layer, which has
no radial law, and thermal analyses need the material properties it lacks.
The layer is structural and cannot be a serving or carry a tape winding or an
extrusion shrinkage.

`lay_angle_deg` lies between −90° and 90°. A rectangular or profiled wire
fills in `d_wire_m` as the diameter of the round wire of the same area. A
given value must agree with it, and a layer whose wires overfill the
Expand Down
151 changes: 147 additions & 4 deletions src/cablexsec/cables/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
"HelicalStrandedLayer",
"InitialStateProperties",
"Layer",
"LayerStiffness",
"ManufacturingClamping",
"MaterialValue",
"PressureIdentification",
Expand Down Expand Up @@ -936,9 +937,56 @@ def _documented(self) -> ExtrusionShrinkage:
return self


#: Poisson ratio of a stiffness-defined layer whose ``stiffness`` block gives
#: none: the stand-in of an isotropic solid (a model assumption).
STIFFNESS_LAYER_POISSON = 0.3


class LayerStiffness(_Frozen):
"""Section stiffness of a cylindrical layer from a datasheet.

``EA_N`` axial, ``EI_Nm2`` bending and ``GJ_Nm2`` torsional stiffness of
the layer about its own (the cable) axis, ``mass_kg_per_m`` its mass per
length; ``source`` names the datasheet. ``poisson_ratio`` (optional) sets
the Poisson ratio of the isotropic stand-in that a calculation needing a
material modulus uses (default :data:`STIFFNESS_LAYER_POISSON`).
"""

EA_N: float
EI_Nm2: float
GJ_Nm2: float
mass_kg_per_m: float
source: str
poisson_ratio: float | None = None
notes: str = ""

@model_validator(mode="after")
def _stiffness_values(self) -> LayerStiffness:
for name in ("EA_N", "EI_Nm2", "mass_kg_per_m"):
if not getattr(self, name) > 0.0:
raise ValueError(f"stiffness {name} must be > 0")
if not self.GJ_Nm2 >= 0.0:
raise ValueError("stiffness GJ_Nm2 must be >= 0")
if self.poisson_ratio is not None and not 0.0 <= self.poisson_ratio < 0.5:
raise ValueError("stiffness poisson_ratio must lie in [0, 0.5)")
if not self.source.strip():
raise ValueError("a stiffness-defined layer needs a source")
return self


def stiffness_material_name(layer_name: str) -> str:
"""Material key of the stand-in material of a stiffness-defined layer."""
return f"{layer_name} (stiffness)"


class CylindricalLayer(_LayerBase):
"""Solid annular layer (bedding, filler, polymer sheath) or a serving.

``stiffness`` (:class:`LayerStiffness`) defines the layer by its section
stiffness instead of a material: a component whose properties come from a
datasheet. Its ``material`` is then a stand-in that the cable supplies
(:func:`stiffness_material_name`).

``construction: serving`` declares a served yarn or a wound tape. The
layer keeps its mass, its radial and hoop stiffness (an annulus in plane
stress along the cable axis, so it transmits contact pressure) and its
Expand All @@ -958,6 +1006,23 @@ class CylindricalLayer(_LayerBase):
# "" (extruded or solid annulus) or "serving" (yarn or tape serving:
# radial and hoop stiffness only).
construction: Literal["", "serving"] = ""
# Section stiffness from a datasheet instead of a material.
stiffness: LayerStiffness | None = None

@model_validator(mode="before")
@classmethod
def _stiffness_material(cls, data: Any) -> Any:
"""A stiffness-defined layer takes the stand-in material of its name."""
if not isinstance(data, Mapping) or data.get("stiffness") is None:
return data
expected = stiffness_material_name(str(data.get("name", "")))
given = data.get("material")
if given not in (None, "", expected):
raise ValueError(
"a stiffness-defined layer takes no material; omit 'material' "
"(its stand-in is named after the layer)"
)
return {**data, "material": expected}

@model_validator(mode="before")
@classmethod
Expand Down Expand Up @@ -1001,6 +1066,21 @@ def _annulus_physical_values(self) -> CylindricalLayer:
raise ValueError(
"a serving is wound, not extruded: it has no extrusion_shrinkage"
)
if self.stiffness is not None:
if self.is_serving or not self.structural:
raise ValueError(
"a stiffness-defined layer carries its stiffness: it cannot "
"be a serving or non-structural"
)
if (
self.tape is not None
or self.strain_life
or self.extrusion_shrinkage is not None
):
raise ValueError(
"a stiffness-defined layer has no material for a tape "
"winding, strain-life constants or an extrusion shrinkage"
)
return self


Expand All @@ -1009,6 +1089,11 @@ def is_serving(layer: object) -> bool:
return isinstance(layer, CylindricalLayer) and layer.is_serving


def layer_stiffness(layer: object) -> LayerStiffness | None:
"""The datasheet stiffness of a stiffness-defined layer (else ``None``)."""
return layer.stiffness if isinstance(layer, CylindricalLayer) else None


class CoreStrandRing(_Frozen):
"""One uniform wire ring about a power-core axis, or its straight centre.

Expand Down Expand Up @@ -1335,6 +1420,48 @@ def yaml_body(self) -> dict[str, Any]:
return self.model_dump(mode="json", exclude={"name"}, exclude_defaults=True)


def stiffness_material(layer: CylindricalLayer) -> CableMaterial | None:
"""The stand-in material of a stiffness-defined layer (``None`` otherwise).

An isotropic solid filling the annulus with the datasheet's axial
stiffness and mass: ``E = EA / A``, ``E_eff_bending = EI / I``, density
``m / A``, Poisson ratio from the block (default
:data:`STIFFNESS_LAYER_POISSON`) and no thermal expansion. It serves the
calculations that read a material (mass, stress recovery, the shear
support of the armour, the hoop restraint of the buckling screen); the
section stiffness itself is taken from the block. ``None`` also while
the radii are withheld.
"""
block = layer.stiffness
if block is None or layer.r_inner_m is None or layer.r_outer_m is None:
return None
ri, ro = layer.r_inner_m, layer.r_outer_m
area = math.pi * (ro**2 - ri**2)
inertia = math.pi * (ro**4 - ri**4) / 4.0
source = f"stiffness of layer {layer.name!r}: {block.source}"

def value(number: float, how: str) -> MaterialValue:
return MaterialValue(value=number, source=f"{how} ({source})")

nu = block.poisson_ratio
return CableMaterial(
name=layer.material,
description=f"stand-in of the stiffness-defined layer {layer.name!r}",
E_Pa=value(block.EA_N / area, "EA over the annulus area"),
E_eff_bending_Pa=value(block.EI_Nm2 / inertia, "EI over the annulus inertia"),
nu=MaterialValue(
value=STIFFNESS_LAYER_POISSON if nu is None else nu,
source="model assumption (isotropic stand-in)"
if nu is None
else f"stiffness block ({source})",
),
rho_kg_m3=value(block.mass_kg_per_m / area, "mass over the annulus area"),
alpha_T_K=MaterialValue(
value=0.0, source="model assumption: no thermal expansion given"
),
)


@lru_cache(maxsize=64)
def material_overlay(
materials: tuple[CableMaterial, ...],
Expand Down Expand Up @@ -1685,10 +1812,24 @@ def _unique_layer_names(self) -> CableData:
if len(names) != len(set(names)):
raise ValueError("layer names must be unique within a cable")
keys = [material.name for material in self.materials]
keys += [material.name for material in self.stiffness_materials]
if len(keys) != len(set(keys)):
raise ValueError("material names must be unique within a cable")
raise ValueError(
"material names must be unique within a cable (a stiffness-defined "
"layer reserves the key '<layer> (stiffness)')"
)
return self

@property
def stiffness_materials(self) -> tuple[CableMaterial, ...]:
"""Stand-in materials of the stiffness-defined layers."""
return tuple(
material
for layer in self.layers
if isinstance(layer, CylindricalLayer)
and (material := stiffness_material(layer)) is not None
)

@model_validator(mode="after")
def _radially_ordered(self) -> CableData:
_check_radial_order(self.layers)
Expand Down Expand Up @@ -1720,11 +1861,13 @@ 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))
return library.material_scope(
material_overlay(self.materials + self.stiffness_materials)
)

def get_material(self, name: str) -> CableMaterial:
"""Return the cable material ``name``."""
for material in self.materials:
"""Return the cable material ``name`` (or a stiffness-defined stand-in)."""
for material in self.materials + self.stiffness_materials:
if material.name == name:
return material
raise CableLookupError(
Expand Down
8 changes: 8 additions & 0 deletions src/cablexsec/mechanics/contact_qp.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CylindricalShellLayer,
HelicalLayer,
is_serving,
layer_stiffness,
)
from cablexsec.exceptions import CableSchemaError
from cablexsec.materials import library
Expand Down Expand Up @@ -145,6 +146,13 @@ def _concentric_layers(
initial_wire_strain: Mapping[str, float] | None = None,
) -> list[ElasticAnnulus | ElasticHelicalRing]:
"""Translate every layer or raise; no silent geometrical homogenisation."""
stiff = [x.name for x in cable.layers if layer_stiffness(x) is not None]
if stiff:
raise CableSchemaError(
f"{stiff[0]}: a stiffness-defined layer has no radial constitutive law; "
"the coupled radial models ('qp', 'solved') need a material; use the "
"bounded contact model"
)
result: list[ElasticAnnulus | ElasticHelicalRing] = []
for layer in cable.layers:
if isinstance(layer, CylindricalOffsetLayer) and (
Expand Down
8 changes: 8 additions & 0 deletions src/cablexsec/mechanics/radial_cable.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
CylindricalShellLayer,
HelicalLayer,
is_serving,
layer_stiffness,
)
from cablexsec.exceptions import CableInputError, CableSchemaError
from cablexsec.materials import library
Expand Down Expand Up @@ -290,6 +291,13 @@ def build_radial_section(
"""
if cable.missing_fields():
raise CableSchemaError("radial solution requires complete geometry")
stiff = [x.name for x in cable.layers if layer_stiffness(x) is not None]
if stiff:
raise CableSchemaError(
f"{stiff[0]}: a stiffness-defined layer has no radial constitutive law; "
"the coupled radial models ('qp', 'solved') need a material; use the "
"bounded contact model"
)
if filler not in {"auto", "solid", "void"}:
raise CableSchemaError("filler must be 'auto', 'solid' or 'void'")
if loose_layers not in {"declared", "neighbour"}:
Expand Down
25 changes: 19 additions & 6 deletions src/cablexsec/mechanics/stiffness.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
K_et += s n_w E_w A_w r_h cos^2(alpha) sin(alpha) (axial-twist coupling)
K_tt += n_w E_w A_w r_h^2 cos(alpha) sin^2(alpha) (twist)

(cylindrical layers add ``E A`` to ``K_ee`` only). With both ends rotationally
(cylindrical layers add ``E A`` to ``K_ee`` only; a stiffness-defined layer
adds its datasheet ``E A`` to ``K_ee`` and its ``G J`` to ``K_tt``, the
measured torsion of that component). With both ends rotationally
fixed the twist is constrained, so ``EA_fixed = K_ee``; with one end free the
twist relaxes and the Schur complement applies,
``EA_free = K_ee - K_et^2 / K_tt`` ([WitzTan1992a]).
Expand Down Expand Up @@ -51,6 +53,7 @@
CylindricalShellLayer,
HelicalLayer,
is_serving,
layer_stiffness,
)
from cablexsec.exceptions import CableInputError
from cablexsec.materials import library
Expand Down Expand Up @@ -191,6 +194,9 @@ def axial_torsional_matrix(
base = lyr.n_wires * e_w * a_w
k_et += s * base * r * math.cos(a) ** 2 * math.sin(a)
k_tt += base * r**2 * math.cos(a) * math.sin(a) ** 2
block = layer_stiffness(lyr)
if block is not None and lyr.name in axial:
k_tt += block.GJ_Nm2
return AxialTorsional(K_ee=k_ee, K_et=k_et, K_tt=k_tt)


Expand Down Expand Up @@ -229,6 +235,9 @@ def _axial_EA_contribution(
"""
if is_serving(layer):
return 0.0
block = layer_stiffness(layer)
if block is not None:
return block.EA_N
if not layer.structural:
if isinstance(layer, CylindricalLayer): # interstitial filler
area = (
Expand Down Expand Up @@ -346,12 +355,16 @@ def _individual_bending_by_layer(
ei += lyr.n_cores * _layer_bending_modulus(lyr) * i_core
ei *= bending_factor(core_angle(cable, lyr))
elif isinstance(lyr, CylindricalLayer):
if not _has_modulus(lyr.material):
block = layer_stiffness(lyr)
if block is not None:
ei = block.EI_Nm2
elif not _has_modulus(lyr.material):
continue
ro = lyr.r_outer_m or 0.0
ri = lyr.r_inner_m or 0.0
i_ann = math.pi * (ro**4 - ri**4) / 4.0
ei += _layer_bending_modulus(lyr) * i_ann
else:
ro = lyr.r_outer_m or 0.0
ri = lyr.r_inner_m or 0.0
i_ann = math.pi * (ro**4 - ri**4) / 4.0
ei += _layer_bending_modulus(lyr) * i_ann
elif isinstance(lyr, CylindricalShellLayer):
# Use the same effective thin-wall law as shell stress recovery.
# The corrugation SCF amplifies local stress, not section rigidity.
Expand Down
Loading
Loading