diff --git a/CHANGELOG.md b/CHANGELOG.md index e7380d1..5f77feb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,16 @@ 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 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 + solutions) and its shear compliance under the armour, and carries no axial force, bending + moment or torque: no contribution to the axial, bending (stick and slip) or torsional + stiffness or to the load sharing; in the component response it is outside the load path, as a + loose screen (kinematic upper-bound stress). A serving is non-structural (`structural: true` is refused) and never an interstitial filler. Layers + without the key are unchanged. Checked in closed form: at zero Poisson ratio a serving gives + the solid annulus's radial response with exactly its `E A` and `G J` removed, and an outer + serving under external pressure has the plane-stress thick-cylinder displacements. - The armour friction coefficient can depend on the contact pressure: `FrictionLaw(pressure_factor=((P, f), ...))`, a piecewise-linear factor `f(P)` on the coefficient, clamped at the table ends, evaluated at the local friction-setting pressure @@ -209,6 +218,14 @@ All notable changes to CableXSec are recorded in this file. The format follows ### Changed +- Templates whose source describes a layer as a yarn serving now declare it as one. The Chae, + Nam and Shim (2023) coiling cable's two yarn layers: full-slip EI 47.3 to 30.6 kN·m², stick EI + 876 to 860 kN·m², fixed-end EA 631 to 626 MN, solved torsional secant under the source's + torque at pitch 1.8 m 106.5 to 89.5 kN·m², least armour surface stress under that torque + −204.8 to −216.9 MPa. Thies et al. (2016) 30 kV outer PP yarn serving: fixed-end EA 328.3 to + 325.8 MN, free-end EA 125.7 to 123.2 MN, bending stiffness unchanged (it was already + non-structural). Layers the source does not call a serving are unchanged, among them the 66 kV + template's PPY beddings (the source's footnote names the material polypyrrole). - The validation report's test-taxonomy lines record the passed count only: the deselected count is the rest of the suite, so a test added anywhere else marked the committed report stale without changing a gate. CI checks the committed report before the coverage run, so a diff --git a/doc/file_formats.md b/doc/file_formats.md index 917a6de..da9e73a 100644 --- a/doc/file_formats.md +++ b/doc/file_formats.md @@ -93,10 +93,24 @@ 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`, `extrusion_shrinkage` | +| `cylindrical` (polymer annulus, bedding, filler, sheath, serving) | `r_inner_m`, `r_outer_m` | `tape` (helical tape winding), `strain_life`, `extrusion_shrinkage`, `construction` (`serving`) | | `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` | +`construction: serving` on a `cylindrical` layer declares a served yarn or a +wound tape. The serving keeps its mass, its radial and hoop stiffness (an +annulus of its material in plane stress along the cable axis, so it transmits +contact pressure and its thermal expansion acts in the cross-section plane) +and its shear compliance in the finite-support no-slip coefficient. It carries +no axial force, no bending moment and no torque: it adds nothing to the axial, +bending (stick or slip) or torsional stiffness and nothing to the load +sharing. In the component response it lies outside the load path, like a +loose screen: it is given the stress of the strain it follows, an upper bound +marked `kinematic`. A serving is non-structural +(`structural` defaults to `false`; `true` is refused), needs `r_inner_m > 0`, has no `extrusion_shrinkage` +and is never an interstitial filler. Without `construction` a `cylindrical` +layer is a solid annulus, as before. + `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 diff --git a/doc/howto.md b/doc/howto.md index e50fa77..cce5c44 100644 --- a/doc/howto.md +++ b/doc/howto.md @@ -185,14 +185,14 @@ cable coiled into a static tank with one twist per turn. ```text -D = 14.4 m: kappa = twist = 0.1389 1/m, torque 14.79 kN m - armour wire centre -244.0 to -205.4 MPa, surface -299.8 to -150.6 MPa - bird-caging capacity 231.7 MPa, buckling 1.053, yield 0.750 - governing: armour (radial), utilisation 1.053, elastic True -D = 8.0 m: kappa = twist = 0.2500 1/m, torque 26.62 kN m - armour wire centre -439.1 to -369.7 MPa, surface -539.7 to -271.1 MPa - bird-caging capacity 231.7 MPa, buckling 1.895, yield 1.349 - governing: armour (radial), utilisation 1.895, elastic False +D = 14.4 m: kappa = twist = 0.1389 1/m, torque 12.43 kN m + armour wire centre -223.6 to -188.3 MPa, surface -280.5 to -132.7 MPa + bird-caging capacity 231.7 MPa, buckling 0.965, yield 0.701 + governing: armour (radial), utilisation 0.965, elastic True +D = 8.0 m: kappa = twist = 0.2500 1/m, torque 22.37 kN m + armour wire centre -402.6 to -338.9 MPa, surface -505.0 to -238.9 MPa + bird-caging capacity 231.7 MPa, buckling 1.737, yield 1.262 + governing: armour (radial), utilisation 1.737, elastic False ``` The check is elastic. When the wires yield (`elastic False`) the stresses are diff --git a/doc/radial_model.md b/doc/radial_model.md index 0c78b75..201f9e0 100644 --- a/doc/radial_model.md +++ b/doc/radial_model.md @@ -200,6 +200,7 @@ The section state minimises the small-strain elastic energy per axial metre with - Unlisted gaps inside a core (semiconducting screens) are filled with the softer neighbouring material. - Loose (non-structural) core layers, such as copper tape and wire screens, are meshed with their declared material by default (`loose_layers="declared"`), so they carry axial load and torque in the solved section although the fixed-radius stiffness gives them none. `loose_layers="neighbour"` gives each the material of its softer structural neighbour; `torque_balance` uses it by default. On the 66 kV template the declared copper screens raise the solved torque/tension coefficient from 1.50 to 3.24 mm (fixed radius 1.51 mm). +- A serving (`construction: serving`: a served yarn or a wound tape) is an annulus, or ring of the three-core mesh, in plane stress along the cable axis: it has the radial and hoop stiffness of its material, so it transmits pressure, but no axial stress and no Saint-Venant torsion. It therefore adds nothing to the solved EA or GJ. - Geometric overlaps below 0.5 % of the contact radius are treated as a snug fit (Ménard: 0.067 mm core-to-inner-sheath). - A three-core cylindrical layer overlapping the cores is the interstitial filler, with three options: - `filler="solid"`: meshed in the outer interstices with unilateral contact. diff --git a/src/cablexsec/analysis/components.py b/src/cablexsec/analysis/components.py index 3b9c4bb..56a6d4b 100644 --- a/src/cablexsec/analysis/components.py +++ b/src/cablexsec/analysis/components.py @@ -55,11 +55,11 @@ conductor (wire rings) is on the wire basis already: each wire bends about its own axis with its own diameter. -Layers outside the load path (a loose tape or wire screen of a core: no axial -stiffness, :data:`KINEMATIC`) are given the stress of the strain they follow, -their modulus times that strain, and are assessed against their limits as -the others; ``kinematic`` marks them. That stress is an upper bound: a loose -screen that slips over its core takes less. +Layers outside the load path (a loose tape or wire screen of a core, or a +serving: no axial stiffness, :data:`KINEMATIC`) are given the stress of the +strain they follow, their modulus times that strain, and are assessed against +their limits as the others; ``kinematic`` marks them. That stress is an upper +bound: a loose screen that slips over its core takes less. Thermal stress is formed from axial-force equilibrium. A common cable strain is solved from the imposed tension and the free thermal forces of every @@ -93,6 +93,7 @@ HelicalLayer, HelicalStrandedLayer, Layer, + is_serving, ) from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library @@ -1188,7 +1189,10 @@ def compute_component_response( ) continue - if section_state.radial is not None: + # A serving is outside the load path in either contact model: it + # takes the kinematic stress of the strain it follows, as a loose + # screen does, not the coupled normal stress. + if section_state.radial is not None and not is_serving(layer): normal = section_state.layers[layer.name] if isinstance(layer, CylindricalShellLayer): assert layer.r_mid_m is not None and layer.t_m is not None diff --git a/src/cablexsec/analysis/section_stress.py b/src/cablexsec/analysis/section_stress.py index dd49048..beeab2f 100644 --- a/src/cablexsec/analysis/section_stress.py +++ b/src/cablexsec/analysis/section_stress.py @@ -90,6 +90,7 @@ CylindricalShellLayer, HelicalLayer, HelicalStrandedLayer, + is_serving, ) from cablexsec.exceptions import CableInputError from cablexsec.mechanics.core_friction import CoreFrictionSpec @@ -405,7 +406,7 @@ def compute_section_stress( if isinstance(layer, HelicalStrandedLayer): fields.append(_none(name, states[name].basis)) continue - if section_state.radial is not None: + if section_state.radial is not None and not is_serving(layer): fields.append( _radial_field( layer, diff --git a/src/cablexsec/cables/chae2023_coiling.yaml b/src/cablexsec/cables/chae2023_coiling.yaml index c13810c..678bdef 100644 --- a/src/cablexsec/cables/chae2023_coiling.yaml +++ b/src/cablexsec/cables/chae2023_coiling.yaml @@ -23,6 +23,8 @@ # of overlap with touching cores); # circular string fillers of the source (Fig. 6) as a non-structural # annulus between the cores; +# the two yarn layers as servings (construction: serving): radial and hoop +# stiffness of the Table 2 yarn, no axial, bending or torsional stiffness; # straight cores (no core_lay block): the core lay pitch is not given; # zero manufacturing clamping: all tools start from a stress-free state # (Sec. 2.4). @@ -64,6 +66,7 @@ layers: - name: yarn1 layer_type: cylindrical material: yarn_chae2023 + construction: serving r_inner_m: 0.076277 r_outer_m: 0.0785 source: "[ChaeNamShim2023] Table 1 1st yarn to 157.0 mm (2.22 mm with touching cores)" @@ -87,6 +90,7 @@ layers: - name: yarn2 layer_type: cylindrical material: yarn_chae2023 + construction: serving r_inner_m: 0.0835 r_outer_m: 0.0875 source: "[ChaeNamShim2023] Table 1 2nd yarn 4.0 mm to 175.0 mm" diff --git a/src/cablexsec/cables/schema.py b/src/cablexsec/cables/schema.py index 4229d4c..c941a93 100644 --- a/src/cablexsec/cables/schema.py +++ b/src/cablexsec/cables/schema.py @@ -937,7 +937,15 @@ def _documented(self) -> ExtrusionShrinkage: class CylindricalLayer(_LayerBase): - """Solid annular layer (bedding, filler, polymer sheath).""" + """Solid annular layer (bedding, filler, polymer sheath) or a serving. + + ``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 + shear compliance between the layers it separates, but it carries no axial + force, no bending moment and no torque. A serving is non-structural; + ``structural: true`` is refused. + """ layer_type: Literal["cylindrical"] = "cylindrical" r_inner_m: float | None = None @@ -947,6 +955,26 @@ class CylindricalLayer(_LayerBase): strain_life: str = "" # Frozen extrusion shrinkage (a manufacturing clamping of the layers inside). extrusion_shrinkage: ExtrusionShrinkage | None = None + # "" (extruded or solid annulus) or "serving" (yarn or tape serving: + # radial and hoop stiffness only). + construction: Literal["", "serving"] = "" + + @model_validator(mode="before") + @classmethod + def _serving_is_not_structural(cls, data: Any) -> Any: + """A serving carries no section load, so ``structural`` is false.""" + if ( + not isinstance(data, Mapping) + or data.get("construction") != "serving" + or "structural" in data + ): + return data + return {**data, "structural": False} + + @property + def is_serving(self) -> bool: + """Whether the layer is a yarn or tape serving (no section stiffness).""" + return self.construction == "serving" @model_validator(mode="after") def _annulus_physical_values(self) -> CylindricalLayer: @@ -960,9 +988,27 @@ def _annulus_physical_values(self) -> CylindricalLayer: and self.r_outer_m <= self.r_inner_m ): raise ValueError("r_outer_m must be greater than r_inner_m") + if self.is_serving and self.r_inner_m is not None and self.r_inner_m <= 0.0: + raise ValueError( + "a serving is wound onto the layer beneath it: r_inner_m must be > 0" + ) + if self.is_serving and self.structural: + raise ValueError( + "a serving (construction: serving) carries no axial, bending or " + "torsional load: structural must be false" + ) + if self.is_serving and self.extrusion_shrinkage is not None: + raise ValueError( + "a serving is wound, not extruded: it has no extrusion_shrinkage" + ) return self +def is_serving(layer: object) -> bool: + """Whether ``layer`` is a ``cylindrical`` layer declared as a serving.""" + return isinstance(layer, CylindricalLayer) and layer.is_serving + + class CoreStrandRing(_Frozen): """One uniform wire ring about a power-core axis, or its straight centre. diff --git a/src/cablexsec/cables/thies2016_30kv.yaml b/src/cablexsec/cables/thies2016_30kv.yaml index 75bb08c..15c2cbe 100644 --- a/src/cablexsec/cables/thies2016_30kv.yaml +++ b/src/cablexsec/cables/thies2016_30kv.yaml @@ -204,6 +204,7 @@ layers: - name: pp_yarn_serving layer_type: cylindrical material: pp_filler + construction: serving r_inner_m: 0.0570 r_outer_m: 0.0615 structural: false diff --git a/src/cablexsec/mechanics/concentric_section.py b/src/cablexsec/mechanics/concentric_section.py index 1a3c4aa..cc660b7 100644 --- a/src/cablexsec/mechanics/concentric_section.py +++ b/src/cablexsec/mechanics/concentric_section.py @@ -40,6 +40,10 @@ class ElasticAnnulus: # 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 + # False for a yarn or tape serving: plane stress along the cable axis + # (no axial stress) and no Saint-Venant torsion; the radial and hoop + # stiffness are those of the isotropic material. + carries_axial_load: bool = True @property def free_strain_vector(self) -> NDArray[np.float64]: @@ -49,6 +53,37 @@ def free_strain_vector(self) -> NDArray[np.float64]: return np.array([e + t, e + t, e], dtype=np.float64) +def annulus_constitutive( + youngs_modulus_Pa: float, poisson_ratio: float, carries_axial_load: bool = True +) -> FloatArray: + """Isotropic stiffness in (radial, hoop, axial) strains [Pa], 3 x 3. + + Three-dimensional elasticity for a solid annulus; plane stress along the + axis (zero axial row and column) for a serving that carries no axial load. + """ + e, nu = youngs_modulus_Pa, poisson_ratio + if not carries_axial_load: + plane = e / (1 - nu * nu) + out = np.zeros((3, 3)) + out[:2, :2] = plane * np.array([[1.0, nu], [nu, 1.0]]) + return out + shear = e / (2 * (1 + nu)) + lame = e * nu / ((1 + nu) * (1 - 2 * nu)) + return np.asarray(lame * np.ones((3, 3)) + 2 * shear * np.eye(3), dtype=np.float64) + + +def annulus_torsional_rigidity(layer: ElasticAnnulus) -> float: + """Saint-Venant torsional rigidity ``G J`` of an annulus [N m^2]. + + Zero for a serving, which carries no torque. + """ + if not layer.carries_axial_load: + return 0.0 + a, b = layer.inner_radius_m, layer.outer_radius_m + shear = layer.youngs_modulus_Pa / (2 * (1 + layer.poisson_ratio)) + return shear * math.pi * (b**4 - a**4) / 2 + + @dataclass(frozen=True) class ElasticHelicalRing: name: str @@ -266,10 +301,9 @@ def solve_concentric_section( * strain_map ) else: - nu = layer.poisson_ratio - shear = e / (2 * (1 + nu)) - lame = e * nu / ((1 + nu) * (1 - 2 * nu)) - constitutive = lame * np.ones((3, 3)) + 2 * shear * np.eye(3) + constitutive = annulus_constitutive( + e, layer.poisson_ratio, layer.carries_axial_load + ) # Rows of the strain map are radial, circumferential and axial. if a > 0: coeff = np.linalg.inv(np.array([[a, 1 / a], [b, 1 / b]])) @@ -295,7 +329,7 @@ def solve_concentric_section( @ constitutive @ layer.free_strain_vector ) - matrix[1, 1] += shear * math.pi * (b**4 - a**4) / 2 + matrix[1, 1] += annulus_torsional_rigidity(layer) initial_load = load.copy() load[0] += tension_N load[1] += torque_Nm diff --git a/src/cablexsec/mechanics/contact_qp.py b/src/cablexsec/mechanics/contact_qp.py index 8caedd2..926e719 100644 --- a/src/cablexsec/mechanics/contact_qp.py +++ b/src/cablexsec/mechanics/contact_qp.py @@ -30,6 +30,7 @@ CylindricalOffsetLayer, CylindricalShellLayer, HelicalLayer, + is_serving, ) from cablexsec.exceptions import CableSchemaError from cablexsec.materials import library @@ -233,6 +234,7 @@ def _concentric_layers( e, library.get_property(layer.material, "nu"), free_transverse_strain=-float(shrink.hoop_strain) if shrink else 0.0, + carries_axial_load=not is_serving(layer), ) ) result.sort(key=lambda layer: layer.inner_radius_m) diff --git a/src/cablexsec/mechanics/radial_cable.py b/src/cablexsec/mechanics/radial_cable.py index 9bea940..148ffc8 100644 --- a/src/cablexsec/mechanics/radial_cable.py +++ b/src/cablexsec/mechanics/radial_cable.py @@ -59,6 +59,7 @@ CylindricalOffsetLayer, CylindricalShellLayer, HelicalLayer, + is_serving, ) from cablexsec.exceptions import CableInputError, CableSchemaError from cablexsec.materials import library @@ -350,6 +351,10 @@ def build_radial_section( ] if len(fillers) > 1: raise CableSchemaError("more than one interstitial filler layer") + if any(is_serving(x) for x in fillers): + raise CableSchemaError( + "a serving is wound on a layer; it cannot fill the core interstices" + ) filler_body = None if fillers: concentric_source.remove(fillers[0]) @@ -402,6 +407,7 @@ def build_radial_section( mats[item.name].poisson, mats[item.name].free_strain, free_transverse_strain=mats[item.name].transverse_strain, + carries_axial_load=not is_serving(item), ) ) if not ring: @@ -466,6 +472,7 @@ def build_radial_section( m.poisson, m.free_strain, free_transverse_strain=m.transverse_strain, + carries_axial_load=not is_serving(x), ) ) else: diff --git a/src/cablexsec/mechanics/radial_solution.py b/src/cablexsec/mechanics/radial_solution.py index fb1aab5..60068da 100644 --- a/src/cablexsec/mechanics/radial_solution.py +++ b/src/cablexsec/mechanics/radial_solution.py @@ -48,7 +48,12 @@ from scipy.optimize import nnls from cablexsec.exceptions import CableInputError, CableSolverError -from cablexsec.mechanics.concentric_section import ElasticAnnulus, ElasticHelicalRing +from cablexsec.mechanics.concentric_section import ( + ElasticAnnulus, + ElasticHelicalRing, + annulus_constitutive, + annulus_torsional_rigidity, +) from cablexsec.mechanics.trefoil_section import ( SYMMETRY_FACTOR, TrefoilBundle, @@ -434,10 +439,9 @@ def add_dense(ids: list[int], block: FloatArray) -> None: ) ) continue - nu = layer.poisson_ratio - shear = e / (2 * (1 + nu)) - lame = e * nu / ((1 + nu) * (1 - 2 * nu)) - constitutive = lame * np.ones((3, 3)) + 2 * shear * np.eye(3) + constitutive = annulus_constitutive( + e, layer.poisson_ratio, layer.carries_axial_load + ) if a > 0: ids = [0, inner_ids[i], outer_ids[i]] coeff = np.linalg.inv(np.array([[a, 1 / a], [b, 1 / b]])) @@ -463,7 +467,7 @@ def add_dense(ids: list[int], block: FloatArray) -> None: axial_rows.append( (layer.name, ids, block[0].copy(), float(vec_load[0]), 0.0) ) - torsion += shear * math.pi * (b**4 - a**4) / 2 + torsion += annulus_torsional_rigidity(layer) for member in self.members: if member.axial_rigidity_N < 0 or member.torsional_rigidity_Nm2 < 0: raise CableInputError("member rigidities must be non-negative") @@ -975,7 +979,7 @@ def _element_axial_forces(self, u: FloatArray) -> FloatArray: szz = lam * (exx + eyy + ezz - 3 * e0 - 2 * transverse) + 2 * mu * ( ezz - e0 ) - force += w * det * szz + force += w * det * szz * model.element_axial_weight return np.asarray(SYMMETRY_FACTOR * force * amap[:, 0], dtype=np.float64) def _bundle_state( diff --git a/src/cablexsec/mechanics/section_geometry.py b/src/cablexsec/mechanics/section_geometry.py index a987a22..d5b8c74 100644 --- a/src/cablexsec/mechanics/section_geometry.py +++ b/src/cablexsec/mechanics/section_geometry.py @@ -107,9 +107,9 @@ def is_interstitial_filler(layer: Layer, cable: CableData) -> bool: Declared either by the ``pp_filler`` material or, for any filler material, as a non-structural annulus starting at the axis (``r_inner_m = 0``) of a multi-core cable. Such a disc necessarily encloses the cores, so its full - area would count the core envelopes twice. + area would count the core envelopes twice. A serving is never a filler. """ - if not isinstance(layer, CylindricalLayer): + if not isinstance(layer, CylindricalLayer) or layer.is_serving: return False if layer.material == "pp_filler": return True diff --git a/src/cablexsec/mechanics/section_state.py b/src/cablexsec/mechanics/section_state.py index ea2afff..5ac144a 100644 --- a/src/cablexsec/mechanics/section_state.py +++ b/src/cablexsec/mechanics/section_state.py @@ -271,22 +271,30 @@ def solve_section_state( coeff_a = (b * u_b - a * u_a) / (b * b - a * a) 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)) - # 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 + if elastic.carries_axial_load: + lame = e * nu / ((1 + nu) * (1 - 2 * nu)) + # Free strain (radial, hoop, axial) = (e + t, e + t, e): the + # isotropic thermal part e and the in-plane extrusion + # shrinkage t. + 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) + twist_shear = shear + else: + # A serving: plane stress along the axis, no torsion. + axial = 0.0 + hoop_const = e * (coeff_a - free_e - free_t) / (1 - nu) + twist_shear = 0.0 + torque = twist_shear * math.pi * (b**4 - a**4) / 2 * twist layer_states[elastic.name] = LayerNormalState( axial, axial * math.pi * (b * b - a * a), torque, hoop_const, 2 * shear * coeff_b, - shear, + twist_shear, ) recovered = sum(layer.axial_force_N for layer in layer_states.values()) if not math.isclose(recovered, tension_N, rel_tol=1e-9, abs_tol=1e-5): diff --git a/src/cablexsec/mechanics/stiffness.py b/src/cablexsec/mechanics/stiffness.py index 8697603..75060b4 100644 --- a/src/cablexsec/mechanics/stiffness.py +++ b/src/cablexsec/mechanics/stiffness.py @@ -50,6 +50,7 @@ CylindricalOffsetLayer, CylindricalShellLayer, HelicalLayer, + is_serving, ) from cablexsec.exceptions import CableInputError from cablexsec.materials import library @@ -222,10 +223,12 @@ def _axial_EA_contribution( """Axial stiffness contribution ``E A`` of a (offset) cylindrical layer [N]. Loose-layer treatment: a non-structural *offset* layer (loose helical tape - screen) carries no axial load; a non-structural *cylindrical* layer - (interstitial filler) carries axial load over its true area (cores + screen) and a serving carry no axial load; a non-structural *cylindrical* + layer (interstitial filler) carries axial load over its true area (cores excluded). Structural layers use the full annulus area. """ + if is_serving(layer): + return 0.0 if not layer.structural: if isinstance(layer, CylindricalLayer): # interstitial filler area = ( diff --git a/src/cablexsec/mechanics/trefoil_section.py b/src/cablexsec/mechanics/trefoil_section.py index 300c11f..7df292a 100644 --- a/src/cablexsec/mechanics/trefoil_section.py +++ b/src/cablexsec/mechanics/trefoil_section.py @@ -160,6 +160,8 @@ class TrefoilModel: element_poisson: FloatArray element_free_strain: FloatArray element_axial_map: FloatArray # (ne, 4): ext, twist, two centre dofs + # One for an element that carries axial stress, zero for a serving's. + element_axial_weight: FloatArray 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.""" @@ -316,7 +318,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, float]] = [] + material: list[tuple[float, float, float, float, float]] = [] axial: list[tuple[float, ...]] = [] owners: list[str] = [] @@ -345,12 +347,15 @@ def core_node(i: int, j: int) -> int: def add(group: str, conn: list[int], layer: object, ext: tuple[float, ...]) -> None: groups.setdefault(group, []).append(len(elements)) elements.append(conn) + # The fifth entry is one for a layer that carries axial stress and + # zero for a serving (plane stress along the axis, no torsion). material.append( ( 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), + 1.0 if getattr(layer, "carries_axial_load", True) else 0.0, ) ) axial.append(ext) @@ -687,6 +692,7 @@ def family(name: str, start: int, factor: float) -> None: props[:, 1].copy(), props[:, 2].copy(), axial_map, + props[:, 4].copy(), tuple(owners), props[:, 3].copy() if np.any(props[:, 3]) else None, ) @@ -749,7 +755,7 @@ def _assemble( """Generalised plane-strain T6 stiffness, free-strain load, twist rigidity.""" ne = len(conn) coords = xy[conn] # (ne, 6, 2) - e, nu, e0 = props[:, 0], props[:, 1], props[:, 2] + e, nu, e0, carries = props[:, 0], props[:, 1], props[:, 2], props[:, 4] lam = e * nu / ((1 + nu) * (1 - 2 * nu)) mu = e / (2 * (1 + nu)) d = np.zeros((ne, 4, 4)) @@ -758,6 +764,14 @@ def _assemble( d[:, i, j] = lam d[:, i, i] += 2 * mu d[:, 3, 3] = mu + # A serving: plane stress along the axis (no axial row or column), the + # in-plane stiffness of the isotropic material. + serving = carries == 0.0 + if np.any(serving): + plane = e[serving] / (1 - nu[serving] ** 2) + d[serving, :3, :3] = 0.0 + d[serving, 0, 0] = d[serving, 1, 1] = plane + d[serving, 0, 1] = d[serving, 1, 0] = plane * nu[serving] ndof_e = 16 ke = np.zeros((ne, ndof_e, ndof_e)) fe = np.zeros((ne, ndof_e)) @@ -793,7 +807,7 @@ def _assemble( (point[:, 0] - rc) ** 2 + point[:, 1] ** 2, point[:, 0] ** 2 + point[:, 1] ** 2, ) - polar += weight * mu * r2 + polar += weight * mu * r2 * carries twist = float(np.sum(np.where(is_core, polar * cb**4, polar))) dofs = np.zeros((ne, ndof_e), dtype=np.int64) dofs[:, 0:12:2] = 2 + 2 * conn diff --git a/tests/test_serving_layer.py b/tests/test_serving_layer.py new file mode 100644 index 0000000..04e1d67 --- /dev/null +++ b/tests/test_serving_layer.py @@ -0,0 +1,252 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright (c) 2026 Jae Hoon Seo, SMI Lab, Inha University +"""Serving layers (``construction: serving``): radial and hoop stiffness only. + +A served yarn or wound tape transmits contact pressure but carries no axial +force, bending moment or torque. Checked against closed forms: plane-stress +thick-cylinder displacements, the exact removal of the layer's ``E A`` and +``G J`` at zero Poisson ratio, and the section stiffness assembly. +""" + +import math + +import numpy as np +import pytest +from pydantic import ValidationError + +import cablexsec as cx +from cablexsec.cables.schema import CylindricalLayer, is_serving +from cablexsec.materials import library +from cablexsec.mechanics.axisymmetric import lame_thick_wall +from cablexsec.mechanics.concentric_section import ( + ElasticAnnulus, + annulus_constitutive, + solve_concentric_section, +) +from cablexsec.mechanics.radial_cable import solve_cable_radial_state +from cablexsec.mechanics.stiffness import ( + axial_stiffness_by_layer, + bending_stiffness_by_layer, + ei_min_slip, +) + + +def _yarn(**extra: object) -> dict[str, object]: + return { + "name": "yarn", + "layer_type": "cylindrical", + "material": "yarn_chae2023", + "r_inner_m": 0.05, + "r_outer_m": 0.052, + **extra, + } + + +def test_a_serving_is_non_structural_and_wound_on_a_layer() -> None: + layer = CylindricalLayer.model_validate(_yarn(construction="serving")) + assert layer.is_serving and is_serving(layer) and not layer.structural + assert CylindricalLayer.model_validate( + _yarn(construction="serving", structural=False) + ).is_serving + with pytest.raises(ValidationError, match="structural must be false"): + CylindricalLayer.model_validate(_yarn(construction="serving", structural=True)) + with pytest.raises(ValidationError, match="r_inner_m must be > 0"): + CylindricalLayer.model_validate(_yarn(construction="serving", r_inner_m=0.0)) + with pytest.raises(ValidationError): + CylindricalLayer.model_validate(_yarn(construction="tape")) + shrink = {"hoop_strain": 0.001, "basis": "assumed", "source": "test"} + with pytest.raises(ValidationError, match="not extruded"): + CylindricalLayer.model_validate( + _yarn(construction="serving", extrusion_shrinkage=shrink) + ) + plain = CylindricalLayer.model_validate(_yarn()) + assert not plain.is_serving and plain.structural + + +def test_plane_stress_constitutive() -> None: + e, nu = 1.5e9, 0.45 + d = annulus_constitutive(e, nu, carries_axial_load=False) + plane = e / (1 - nu * nu) + np.testing.assert_array_equal(d[2], 0.0) + np.testing.assert_array_equal(d[:, 2], 0.0) + assert d[0, 0] == d[1, 1] == pytest.approx(plane, rel=1e-15) + assert d[0, 1] == pytest.approx(plane * nu, rel=1e-15) + # Static condensation of the axial stress from the 3D law gives it too. + full = annulus_constitutive(e, nu) + condensed = full[:2, :2] - np.outer(full[:2, 2], full[2, :2]) / full[2, 2] + np.testing.assert_allclose(d[:2, :2], condensed, rtol=1e-13) + + +@pytest.mark.parametrize("tension_N", [0.0, 2.0e5]) +def test_serving_under_pressure_is_a_plane_stress_thick_cylinder( + tension_N: float, +) -> None: + e, nu, a, b, p = 1.5e9, 0.45, 0.03, 0.035, 2.0e6 + core = ElasticAnnulus("core", 0.0, a, 110e9, 0.34) + serving = ElasticAnnulus("serving", a, b, e, nu, carries_axial_load=False) + result = solve_concentric_section( + [core, serving], tension_N=tension_N, external_pressure_Pa=p + ) + q = float(result.contact_pressure_Pa[0]) + assert q > 0 + for radius, value in ( + (a, result.inner_displacement_m["serving"]), + (b, result.outer_displacement_m["serving"]), + ): + exact = lame_thick_wall(radius, a, b, q, p, e, nu).u_r_m + assert value == pytest.approx(exact, rel=1e-10) + # The core carries the whole tension: under the uniform lateral pressure + # q its axial stress is E eps - 2 nu q, so eps = (T / A + 2 nu q) / E. + area = math.pi * a * a + assert result.axial_resultant_N == pytest.approx(tension_N, abs=1e-6) + assert result.axial_strain == pytest.approx( + (tension_N / area + 2 * 0.34 * q) / 110e9, rel=1e-10 + ) + + +def test_zero_poisson_serving_removes_exactly_its_ea_and_gj() -> None: + e, a, b = 1.5e9, 0.03, 0.035 + core = ElasticAnnulus("core", 0.0, a, 110e9, 0.34) + + def tangent(carries: bool) -> np.ndarray: + layers = [core, ElasticAnnulus("s", a, b, e, 0.0, carries_axial_load=carries)] + return solve_concentric_section( + layers, tension_N=1e5, external_pressure_Pa=1e6 + ).tangent.matrix + + solid, serving = tangent(True), tangent(False) + assert solid[0, 0] - serving[0, 0] == pytest.approx( + e * math.pi * (b * b - a * a), rel=1e-11 + ) + assert solid[1, 1] - serving[1, 1] == pytest.approx( + e / 2 * math.pi * (b**4 - a**4) / 2, rel=1e-11 + ) + + +def _chae(serving: bool) -> cx.CableData: + cable = cx.load_cable(cx.chae2023_yaml_path()) + layers = [] + for layer in cable.layers: + if layer.name in {"yarn1", "yarn2"} and not serving: + layer = CylindricalLayer.model_validate( + {**layer.model_dump(), "construction": "", "structural": True} + ) + layers.append(layer) + return cable.model_copy(update={"layers": tuple(layers)}) + + +def test_packaged_chae_yarns_are_servings() -> None: + cable = cx.load_cable(cx.chae2023_yaml_path()) + assert {x.name for x in cable.layers if is_serving(x)} == {"yarn1", "yarn2"} + + +def test_serving_adds_no_section_stiffness() -> None: + solid, serving = _chae(False), _chae(True) + e = library.get_property("yarn_chae2023", "E_Pa") + ea_solid = axial_stiffness_by_layer(solid) + ea_serving = axial_stiffness_by_layer(serving) + assert "yarn1" not in ea_serving and "yarn2" not in ea_serving + removed_ea = removed_ei = 0.0 + for name in ("yarn1", "yarn2"): + layer = solid.get_layer(name) + assert isinstance(layer, CylindricalLayer) + ri, ro = float(layer.r_inner_m or 0), float(layer.r_outer_m or 0) + removed_ea += e * math.pi * (ro**2 - ri**2) + removed_ei += e * math.pi * (ro**4 - ri**4) / 4 + assert bending_stiffness_by_layer(serving)[name].plane_section_Nm2 == 0.0 + assert sum(ea_solid.values()) - sum(ea_serving.values()) == pytest.approx( + removed_ea, rel=1e-12 + ) + assert ei_min_slip(solid) - ei_min_slip(serving) == pytest.approx( + removed_ei, rel=1e-12 + ) + # The other layers keep their values exactly. + for name, value in ea_serving.items(): + assert value == ea_solid[name] + + +def test_three_core_mesh_serving_ring_carries_no_axial_force_or_torque() -> None: + solid, serving = _chae(False), _chae(True) + kwargs = {"tension_N": 1.0e5, "external_pressure_Pa": 1.0e5} + a = solve_cable_radial_state(solid, **kwargs).result + b = solve_cable_radial_state(serving, **kwargs).result + forces = b.layer_axial_force_N + # yarn1 is the meshed ring of the bundle, yarn2 a concentric annulus. + assert abs(forces["yarn1"]) < 1e-9 * 1.0e5 + assert abs(forces["yarn2"]) < 1e-9 * 1.0e5 + # The layer forces sum to the tension to the contact solve's tolerance. + assert sum(forces.values()) == pytest.approx(1.0e5, rel=1e-6) + assert abs(a.layer_axial_force_N["yarn1"]) > 1.0 + # Removing the yarn torsion lowers the solved torsional rigidity. + assert b.gj_fixed_tension_Nm2 < a.gj_fixed_tension_Nm2 + assert b.ea_fixed_twist_N < a.ea_fixed_twist_N + + +def test_serving_is_outside_the_component_load_path() -> None: + cable = cx.load_cable(cx.thies2016_yaml_path()) + assert is_serving(cable.get_layer("pp_yarn_serving")) + response = cx.compute_component_response(cable, 0.1, tension_N=5.0e4) + state = next(s for s in response.states if s.name == "pp_yarn_serving") + # The kinematic stress of the strain it follows, as a loose screen. + assert state.kinematic + assert response.critical_component != "pp_yarn_serving" + e = response.section_state.youngs_modulus_Pa["pp_yarn_serving"] + assert state.sigma_local_max_Pa == pytest.approx(e * state.strain_max, rel=1e-9) + + +def test_serving_in_the_solved_concentric_section() -> None: + # A concentric section (the bundled single-core cable) with its bedding + # declared as a serving: the coupled path keeps it in the pressure chain + # as a plane-stress annulus without axial force or torque, and the + # component and section stress fields agree. + base = cx.load_cable(cx.inter_array_single_core_yaml_path()) + layers = tuple( + CylindricalLayer.model_validate( + {**x.model_dump(), "construction": "serving", "structural": False} + ) + if x.name == "hdpe_bedding" + else x + for x in base.layers + ) + cable = base.model_copy(update={"layers": layers}) + state = cx.solve_section_state( + cable, tension_N=2.0e5, p_ext_Pa=1.0e6, contact_model="qp" + ) + name = "hdpe_bedding" + normal = state.layers[name] + assert normal.longitudinal_stress_Pa == 0.0 + assert normal.axial_force_N == 0.0 and normal.torque_Nm == 0.0 + layer = cable.get_layer(name) + assert isinstance(layer, CylindricalLayer) + a, b = float(layer.r_inner_m or 0), float(layer.r_outer_m or 0) + p_a = -( + normal.radial_stress_constant_Pa - normal.radial_stress_inverse_Pa_m2 / a**2 + ) + p_b = -( + normal.radial_stress_constant_Pa - normal.radial_stress_inverse_Pa_m2 / b**2 + ) + assert p_a > 0 and p_b > 0 + # Its face displacements are those of a plane-stress thick cylinder under + # the solved face pressures. + assert state.radial is not None + section = state.radial.section + e = state.youngs_modulus_Pa[name] + nu = library.get_property(layer.material, "nu") + for radius, value in ( + (a, section.inner_displacement_m[name]), + (b, section.outer_displacement_m[name]), + ): + exact = lame_thick_wall(radius, a, b, p_a, p_b, e, nu).u_r_m + assert value == pytest.approx(exact, rel=1e-9) + response = cx.compute_component_response( + cable, 0.05, tension_N=2.0e5, p_ext_Pa=1.0e6, contact_model="qp" + ) + item = next(s for s in response.states if s.name == name) + assert item.kinematic + field = cx.compute_section_stress( + cable, 0.05, tension_N=2.0e5, p_ext_Pa=1.0e6, contact_model="qp" + ) + tape = next(x for x in field.layers if x.name == name) + assert float(np.max(tape.sigma_max_Pa)) == pytest.approx( + item.sigma_local_max_Pa, rel=1e-9 + )