In this section
- Calculations render · cable-trench-or-drill / releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/calculations.js lines 1–166
- Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser transform · cable-trench-or-drill / releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/data.js lines 1–428
- Export render · cable-trench-or-drill / releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/export.js lines 1–28
Calculations
A JavaScript file in the cable geometry visualiser folder of Cable Trench or Drill that clamps integer (`clampInteger`), formats mm (`formatMm`) and gets burial depth computation (`getBurialDepthForComputation`), covering cables.
rendercable-trench-or-drill / releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/calculations.js · lines 1–166 of 166 · version 2026-09-05 19:21 · Entry point · pattern normaliseBurialDepthFieldOnBlur (shared by 4 files)
- What it does
- Defines 11 functions or classes, including byId, clampInteger, formatMm, effectiveGap, getBurialDepthForComputation. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: cables, 33kV.
- Inputs & outputs
- Voltage levels named: 33kV.
- Downstream impact
- Used directly by 2 files: Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (cable-trench-or-drill); Solar Battery Energy Storage System (BESS) Topology V6 — Cable Geometry Visualiser Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v6/cable-geometry-visualiser/). Reached from 144 other entry points, including Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/); Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/); Demonstration Videos (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/docs/demonstration-videos.html).
- What it achieves
- It clamps integer (`clampInteger`), formats mm (`formatMm`) and gets burial depth computation (`getBurialDepthForComputation`). Defines `byId`, `clampInteger`, `formatMm` and 8 more. Its code works with 33 kV.
- Why it matters
- Loaded by the Cable Geometry Visualiser page and 1 other page.
- Application
- cable-trench-or-drill · releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser · script
- Uses
- none found
- Used by
- loaded by Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V6 — Cable Geometry Visualiser Page (script src), mentioned in Standalone (comment link)
- Produces
- byId, clampInteger, formatMm, effectiveGap, getBurialDepthForComputation, normaliseBurialDepthFieldOnBlur, normaliseIntegerFields, getInputs, getGroupGeometry, computeLayout, buildReview
- Defines here
- byId, clampInteger, formatMm, effectiveGap, getBurialDepthForComputation, normaliseBurialDepthFieldOnBlur, normaliseIntegerFields, getInputs, getGroupGeometry, computeLayout, buildReview
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- cable-trench-or-drill@bf00f9503ff7a662933775a022557c4ca9d9880a releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/calculations.js:1-166 · blob 9d111dd34dbaf67d1de0c1b67c096b8352a9b3a9 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unknown
function byId(id) { return document.getElementById(id); }
function clampInteger(value, fallback, minValue) {
const num = Number(value);
if (!Number.isFinite(num)) return fallback;
return Math.max(Math.round(num), minValue);
}
function formatMm(v) { return `${Math.round(v)} mm`; }
function effectiveGap(basis, spacing, od) {
if (basis === "touching") return 0;
if (basis === "centre_to_centre") return Math.max(spacing - od, 0);
return spacing;
}
function getBurialDepthForComputation() {
const raw = Number(byId("burial_depth").value);
if (!Number.isFinite(raw) || raw <= 0) {
return DEFAULT_BURIAL_DEPTHS[byId("service_type").value] || 900;
}
return Math.max(Math.round(raw), 0);
}
function normaliseBurialDepthFieldOnBlur() {
const burial = byId("burial_depth");
const serviceType = byId("service_type").value;
const minDepth = MIN_BURIAL_DEPTHS[serviceType] || 0;
const fallback = DEFAULT_BURIAL_DEPTHS[serviceType] || minDepth;
const normalised = clampInteger(burial.value, fallback, minDepth);
burial.value = String(normalised);
return normalised;
}
function normaliseIntegerFields() {
[
{ id: "circuit_qty", fallback: 1, min: 1 },
{ id: "max_per_row", fallback: 1, min: 1 },
{ id: "section_length", fallback: 0, min: 0 },
{ id: "cable_od", fallback: 45, min: 1 },
{ id: "spacing_h", fallback: appState.previousSpacing.h || 0, min: 0 },
{ id: "spacing_v", fallback: appState.previousSpacing.v || 0, min: 0 },
{ id: "bend_factor", fallback: 15, min: 1 }
].forEach(item => {
const el = byId(item.id);
el.value = String(clampInteger(el.value, item.fallback, item.min));
});
}
function getInputs() {
return {
route_name: byId("route_name").value.trim() || "Unnamed_Route",
section_length_m: clampInteger(byId("section_length").value, 0, 0),
installation_condition: byId("installation_condition").value,
service_type: byId("service_type").value,
grouping_basis: byId("grouping_basis").value,
burial_depth_mm: getBurialDepthForComputation(),
formation_type: byId("formation_type").value,
circuit_qty: clampInteger(byId("circuit_qty").value, 1, 1),
max_per_row: clampInteger(byId("max_per_row").value, 1, 1),
cable_od_mm: clampInteger(byId("cable_od").value, 45, 1),
spacing_basis: byId("spacing_basis").value,
spacing_h_mm: clampInteger(byId("spacing_h").value, appState.previousSpacing.h || 0, 0),
spacing_v_mm: clampInteger(byId("spacing_v").value, appState.previousSpacing.v || 0, 0),
bend_factor: clampInteger(byId("bend_factor").value, 15, 1)
};
}
function getGroupGeometry(inputs) {
const d = inputs.cable_od_mm;
const sqrt3 = Math.sqrt(3);
switch (inputs.formation_type) {
case "trefoil_single_row": return { width: d*2, depth: d*(1+sqrt3/2), drawType: "trefoil", note: "Trefoil 1c groups" };
case "flat_single_row": return { width: d*3, depth: d, drawType: "flat_3", note: "Flat 1c groups" };
case "stacked_two_high": return { width: d*3, depth: d*2, drawType: "stacked_2x3", note: "Stacked 2 high 1c groups" };
case "multicore_3c": return { width: d, depth: d, drawType: "multicore_3c",note: "Three core cable groups" };
case "multicore_4c": return { width: d, depth: d, drawType: "multicore_4c",note: "Four core cable groups" };
case "multicore_5c": return { width: d, depth: d, drawType: "multicore_5c",note: "Five core cable groups" };
case "dc_pair_horizontal": return { width: d*2, depth: d, drawType: "dc_pair_h", note: "DC horizontal pair" };
case "dc_pair_vertical": return { width: d, depth: d*2, drawType: "dc_pair_v", note: "DC vertical pair" };
default: return { width: d*2, depth: d*(1+sqrt3/2), drawType: "trefoil", note: "Trefoil 1c groups" };
}
}
function computeLayout(inputs) {
const gapH = effectiveGap(inputs.spacing_basis, inputs.spacing_h_mm, inputs.cable_od_mm);
const gapV = effectiveGap(inputs.spacing_basis, inputs.spacing_v_mm, inputs.cable_od_mm);
const geom = getGroupGeometry(inputs);
const perRow = Math.max(1, inputs.max_per_row);
const groupCount = Math.max(1, inputs.circuit_qty);
const rows = Math.ceil(groupCount / perRow);
const rowCounts = [];
let remaining = groupCount;
for (let i = 0; i < rows; i++) {
const c = Math.min(perRow, remaining);
rowCounts.push(c);
remaining -= c;
}
const maxRowCount = Math.max(...rowCounts);
const formationWidth = (maxRowCount * geom.width) + (Math.max(maxRowCount-1,0) * gapH);
const formationDepth = (rows * geom.depth) + (Math.max(rows-1,0) * gapV);
const appliedBendRadius = inputs.cable_od_mm * inputs.bend_factor;
const singleCableOuterSweepRadius = appliedBendRadius + inputs.cable_od_mm / 2;
const approxGroupCtcH = inputs.spacing_basis === "centre_to_centre" ? inputs.spacing_h_mm : geom.width + gapH;
const approxGroupCtcV = inputs.spacing_basis === "centre_to_centre" ? inputs.spacing_v_mm : geom.depth + gapV;
return {
rows, rowCounts,
groupWidth: geom.width, groupDepth: geom.depth,
drawType: geom.drawType, groupNote: geom.note,
gapH, gapV,
formationWidth, formationDepth,
appliedBendRadius, singleCableOuterSweepRadius,
approxGroupCtcH, approxGroupCtcV,
indicativeTrenchWidth: formationWidth,
indicativeTrenchDepth: inputs.burial_depth_mm + formationDepth,
hasUnevenLastRow: rowCounts.length > 1 && rowCounts[rowCounts.length-1] !== maxRowCount
};
}
function buildReview(inputs, layout) {
const inputConflicts = [];
const reviewPoints = [];
const standingAssumptions = [
"Within group cable spacing is assumed touching unless separately modelled.",
"Mixed service visual uses one worst case OD for all shown services and is schematic only.",
"Bend model is a single cable body sweep only.",
"Burial depth is recorded as an indicative input only.",
"4-core and 5-core multicore formations are drawn as a single cable OD."
];
if (inputs.grouping_basis === "mixed_service")
reviewPoints.push("Mixed service grouping selected. Visual remains schematic and uses one worst case OD for all shown services.");
if (inputs.spacing_basis === "centre_to_centre") {
if (inputs.spacing_h_mm <= inputs.cable_od_mm)
inputConflicts.push("Horizontal centre to centre spacing is less than or equal to cable outer diameter. This collapses to touching or overlap risk.");
if (inputs.spacing_v_mm <= inputs.cable_od_mm)
inputConflicts.push("Vertical centre to centre spacing is less than or equal to cable outer diameter. This collapses to touching or overlap risk.");
}
if (inputs.spacing_basis === "touching" && inputs.grouping_basis !== "same_circuit")
reviewPoints.push("Touching groups outside a single circuit basis should be reviewed.");
if (layout.formationWidth >= 3000)
reviewPoints.push("Formation width is at or above 3000 mm and may need corridor review.");
if (layout.formationDepth > 2000)
reviewPoints.push("Formation depth is above 2000 mm and may need trench or enclosure review.");
if (inputs.burial_depth_mm > 3000)
reviewPoints.push("Burial depth input is unusually deep. Confirm civil, thermal and utility basis.");
if (inputs.bend_factor < 12)
reviewPoints.push("Low bend factor entered. Confirm against manufacturer installation data. This is not a generic limit.");
if (inputs.service_type === "mv" && inputs.formation_type === "trefoil_single_row" && layout.approxGroupCtcH < (inputs.cable_od_mm * 3))
reviewPoints.push("33kV trefoil group spacing is tight. Check separation against the relevant rating and installation standard before use.");
if (layout.hasUnevenLastRow)
reviewPoints.push("Worst case envelope is based on the fullest row. The final row is shallower or narrower than the plotted maximum envelope.");
const worstSeverity = inputConflicts.length ? "error" : reviewPoints.length ? "warn" : "ok";
const summary = worstSeverity === "ok"
? "Geometry capture complete. No active conflicts or review points detected."
: worstSeverity === "warn"
? "Geometry capture complete with review points."
: "Input conflict detected. Review before using output.";
return { inputConflicts, reviewPoints, standingAssumptions, worstSeverity, summary };
}
Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser
A JavaScript file in Cable Trench or Drill that works with cables, 33kV, 66kV and 110kV, using IEC 60502-2 and BS EN 60502-1. It looks up od (`lookupOD`).
transformcable-trench-or-drill / releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/data.js · lines 1–428 of 428 · version 2026-09-05 19:21 · Entry point · pattern lookupOD (shared by 4 files)
- What it does
- It calculates cables, 33kV, 66kV and 110kV. Defines lookupOD.
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: cables, 33kV, 66kV, 110kV, 132kV, 20kV.
- Inputs & outputs
- Voltage levels named: 132kV, 110kV, 66kV, 33kV, 20kV, 15kV, 10kV, 6kV.
- Downstream impact
- Used directly by 2 files: Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (cable-trench-or-drill); Solar Battery Energy Storage System (BESS) Topology V6 — Cable Geometry Visualiser Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v6/cable-geometry-visualiser/). Reached from 144 other entry points, including Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/); Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/); Demonstration Videos (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/docs/demonstration-videos.html).
- What it achieves
- Model coefficients (single core, fitted to Utility/Manufacturer data). Its code works with 1 kV, 33 kV and 66 kV.
- Why it matters
- Loaded by the page of the same name and 1 other page.
- Application
- cable-trench-or-drill · releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser · script
- Uses
- none found
- Used by
- loaded by Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V6 — Cable Geometry Visualiser Page (script src)
- Produces
- lookupOD
- Defines here
- lookupOD
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- cable-trench-or-drill@bf00f9503ff7a662933775a022557c4ca9d9880a releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/data.js:1-428 · blob f1d5051ef114f1be92a8f5e89c36785439ac6951 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: transform · effects: none found · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unknown
/* ── constants ──────────────────────────────────────────────────────────── */
const DEFAULT_BURIAL_DEPTHS = { lv: 900, mv: 900, ehv: 900, dc: 900 };
const MIN_BURIAL_DEPTHS = { lv: 450, mv: 900, ehv: 900, dc: 600 };
const FORMATION_LIBRARY = {
lv: [
{ value: "trefoil_single_row", label: "Trefoil Single Row (1c×3ph)" },
{ value: "flat_single_row", label: "Flat Single Row (1c×3ph)" },
{ value: "stacked_two_high", label: "Stacked 2 High (1c×3ph)" },
{ value: "multicore_3c", label: "Three Core Cable (3c)" },
{ value: "multicore_4c", label: "Four Core Cable (4c)" },
{ value: "multicore_5c", label: "Five Core Cable (5c)" }
],
mv: [
{ value: "trefoil_single_row", label: "Trefoil Single Row (1c×3ph)" },
{ value: "flat_single_row", label: "Flat Single Row (1c×3ph)" },
{ value: "stacked_two_high", label: "Stacked 2 High (1c×3ph)" },
{ value: "multicore_3c", label: "Three Core Cable (3c)" },
{ value: "multicore_4c", label: "Four Core Cable (4c)" },
{ value: "multicore_5c", label: "Five Core Cable (5c)" }
],
ehv: [
{ value: "trefoil_single_row", label: "Trefoil Single Row (1c×3ph)" },
{ value: "flat_single_row", label: "Flat Single Row (1c×3ph)" }
],
dc: [
{ value: "dc_pair_horizontal", label: "DC Pair Horizontal" },
{ value: "dc_pair_vertical", label: "DC Pair Vertical" }
]
};
/* ── OD lookup database ───────────────────────────────────────────────────
* Single-core: model OD = 21.408 + 1.3736·√CSA + 0.3530·Uo (RMSE 0.64mm)
* Anchored on: Utility 66kV (300,400mm²), Utility 132kV (300,630,1000,1200,1600mm²),
* Manufacturer 110kV (630mm²), Catalogue 33kV full series.
* Three-core Al: Catalogue direct values (33kV unarmoured Al).
* Three-core Cu: Catalogue direct values (33kV unarmoured Cu).
* Lower voltages from catalogue; 66kV+ single-core only —
* three-core cables do not exist at 66 kV and above.
* MBR: actual datasheet values where confirmed; 15×OD otherwise (Utility standard).
* 110kV uses 25×OD (laying MBR per their datasheet).
* All values indicative for routing/civils planning only.
* Verify against manufacturer datasheet before any design or procurement.
*/
// Model coefficients (single core, fitted to Utility/Manufacturer data)
const OD_A = 21.408, OD_B = 1.3736, OD_C = 0.353;
const OD_CONFIRMED = {
// 66kV (Uo=38)
"sc_38_300": { od: 59, mbr: 885, src: "Utility schedule" },
"sc_38_400": { od: 62, mbr: 930, src: "Utility schedule" },
// 132kV (Uo=76)
"sc_76_300": { od: 72, mbr: 1080, src: "Utility schedule" },
"sc_76_630": { od: 83, mbr: 1245, src: "Utility schedule" },
"sc_76_1000": { od: 91, mbr: 1365, src: "Utility schedule" },
"sc_76_1200": { od: 97, mbr: 1455, src: "Utility schedule" },
"sc_76_1600": { od: 104, mbr: 1560, src: "Utility schedule" },
// 110kV (Uo=64)
"sc_64_630": { od: 76.4, mbr: 1910, src: "Manufacturer datasheet" },
// 33kV single core (Uo=18) — catalogue values
"sc_18_35": { od: 36.5, mbr: 548, src: "Generic catalogue" },
"sc_18_50": { od: 37.5, mbr: 563, src: "Generic catalogue" },
"sc_18_70": { od: 39.5, mbr: 593, src: "Generic catalogue" },
"sc_18_95": { od: 41.0, mbr: 615, src: "Generic catalogue" },
"sc_18_120": { od: 43.0, mbr: 645, src: "Generic catalogue" },
"sc_18_150": { od: 44.5, mbr: 668, src: "Generic catalogue" },
"sc_18_185": { od: 46.5, mbr: 698, src: "Generic catalogue" },
"sc_18_240": { od: 49.5, mbr: 743, src: "Generic catalogue" },
"sc_18_300": { od: 51.5, mbr: 773, src: "Generic catalogue" },
"sc_18_400": { od: 55.0, mbr: 825, src: "Generic catalogue" },
"sc_18_500": { od: 58.0, mbr: 870, src: "Generic catalogue" },
"sc_18_630": { od: 62.0, mbr: 930, src: "Generic catalogue" },
// 33kV three core ALUMINIUM unarmoured (Uo=18) — catalogue values
"3c_18_35": { od: 42.0, mbr: 630, src: "Generic catalogue" },
"3c_18_50": { od: 45.0, mbr: 675, src: "Generic catalogue" },
"3c_18_70": { od: 48.5, mbr: 728, src: "Generic catalogue" },
"3c_18_95": { od: 53.0, mbr: 795, src: "Generic catalogue" },
"3c_18_120": { od: 57.0, mbr: 855, src: "Generic catalogue" },
"3c_18_150": { od: 60.5, mbr: 908, src: "Generic catalogue" },
"3c_18_185": { od: 64.5, mbr: 968, src: "Generic catalogue" },
"3c_18_240": { od: 71.0, mbr: 1065, src: "Generic catalogue" },
"3c_18_300": { od: 77.5, mbr: 1163, src: "Generic catalogue" },
"3c_18_400": { od: 86.0, mbr: 1290, src: "Generic catalogue" },
// 33kV three core COPPER unarmoured (Uo=18) — Power Cable Catalogue
// ODs confirmed from Power Cable Catalogue
// IEC 60502-2 / VDE 0276-620
// MBR = 15×OD per catalogue (Min. bending radius: 15 x D)
"3c_cu18_35": { od: 68.0, mbr: 1020, src: "Generic catalogue Cu" },
"3c_cu18_50": { od: 71.5, mbr: 1073, src: "Generic catalogue Cu" },
"3c_cu18_70": { od: 75.0, mbr: 1125, src: "Generic catalogue Cu" },
"3c_cu18_95": { od: 79.0, mbr: 1185, src: "Generic catalogue Cu" },
"3c_cu18_120": { od: 83.0, mbr: 1245, src: "Generic catalogue Cu" },
"3c_cu18_150": { od: 86.0, mbr: 1290, src: "Generic catalogue Cu" },
"3c_cu18_185": { od: 90.0, mbr: 1350, src: "Generic catalogue Cu" },
"3c_cu18_240": { od: 97.0, mbr: 1455, src: "Generic catalogue Cu" },
"3c_cu18_300": { od: 102.0, mbr: 1530, src: "Generic catalogue Cu" },
"3c_cu18_400": { od: 110.0, mbr: 1650, src: "Generic catalogue Cu" },
// ── LV POWER 0.6/1kV XLPE — catalogue model values ──────────────────
// Source: Generic UK catalogue constructions
// Standard: BS EN 60502-1, BS 5467, XLPE insulation, PVC bedding, SWA/AWA, PVC oversheath
// MBR: 15×OD single core, 12×OD multicore — BS 8434 / manufacturer standard
// ALL VALUES ARE ESTIMATES (±1–2mm). Flag: estimated: true
// ⚠ MUST BE VERIFIED against manufacturer controlled datasheets before use in design.
//
// Key format: sc/2c/3c/4c/5c _ cu/al _ lv _ {csa}
//
// Single core Cu — solid below 16mm², stranded above
"sc_cu_lv_1.5": { od: 8.2, mbr: 123, src: "Generic catalogue model" },
"sc_cu_lv_2.5": { od: 8.7, mbr: 131, src: "Generic catalogue model" },
"sc_cu_lv_4": { od: 9.3, mbr: 140, src: "Generic catalogue model" },
"sc_cu_lv_6": { od: 9.9, mbr: 149, src: "Generic catalogue model" },
"sc_cu_lv_10": { od: 11.2, mbr: 168, src: "Generic catalogue model" },
"sc_cu_lv_16": { od: 12.3, mbr: 185, src: "Generic catalogue model" },
"sc_cu_lv_25": { od: 14.0, mbr: 210, src: "Generic catalogue model" },
"sc_cu_lv_35": { od: 15.3, mbr: 230, src: "Generic catalogue model" },
"sc_cu_lv_50": { od: 17.0, mbr: 255, src: "Generic catalogue model" },
"sc_cu_lv_70": { od: 19.3, mbr: 290, src: "Generic catalogue model" },
"sc_cu_lv_95": { od: 21.5, mbr: 323, src: "Generic catalogue model" },
"sc_cu_lv_120": { od: 23.5, mbr: 353, src: "Generic catalogue model" },
"sc_cu_lv_150": { od: 25.7, mbr: 386, src: "Generic catalogue model" },
"sc_cu_lv_185": { od: 28.2, mbr: 423, src: "Generic catalogue model" },
"sc_cu_lv_240": { od: 31.5, mbr: 473, src: "Generic catalogue model" },
"sc_cu_lv_300": { od: 34.5, mbr: 518, src: "Generic catalogue model" },
"sc_cu_lv_400": { od: 38.5, mbr: 578, src: "Generic catalogue model" },
"sc_cu_lv_500": { od: 42.5, mbr: 638, src: "Generic catalogue model" },
"sc_cu_lv_630": { od: 47.5, mbr: 713, src: "Generic catalogue model" },
// Single core Al
"sc_al_lv_16": { od: 11.5, mbr: 173, src: "Generic catalogue model" },
"sc_al_lv_25": { od: 13.0, mbr: 195, src: "Generic catalogue model" },
"sc_al_lv_35": { od: 14.3, mbr: 215, src: "Generic catalogue model" },
"sc_al_lv_50": { od: 15.8, mbr: 237, src: "Generic catalogue model" },
"sc_al_lv_70": { od: 18.0, mbr: 270, src: "Generic catalogue model" },
"sc_al_lv_95": { od: 20.0, mbr: 300, src: "Generic catalogue model" },
"sc_al_lv_120": { od: 22.0, mbr: 330, src: "Generic catalogue model" },
"sc_al_lv_150": { od: 24.0, mbr: 360, src: "Generic catalogue model" },
"sc_al_lv_185": { od: 26.5, mbr: 398, src: "Generic catalogue model" },
"sc_al_lv_240": { od: 29.5, mbr: 443, src: "Generic catalogue model" },
"sc_al_lv_300": { od: 32.5, mbr: 488, src: "Generic catalogue model" },
"sc_al_lv_400": { od: 36.5, mbr: 548, src: "Generic catalogue model" },
"sc_al_lv_500": { od: 40.5, mbr: 608, src: "Generic catalogue model" },
"sc_al_lv_630": { od: 45.5, mbr: 683, src: "Generic catalogue model" },
// 2-core Cu SWA
"2c_cu_lv_1.5": { od: 15.5, mbr: 186, src: "Generic catalogue model" },
"2c_cu_lv_2.5": { od: 16.5, mbr: 198, src: "Generic catalogue model" },
"2c_cu_lv_4": { od: 18.0, mbr: 216, src: "Generic catalogue model" },
"2c_cu_lv_6": { od: 19.5, mbr: 234, src: "Generic catalogue model" },
"2c_cu_lv_10": { od: 22.5, mbr: 270, src: "Generic catalogue model" },
"2c_cu_lv_16": { od: 25.5, mbr: 306, src: "Generic catalogue model" },
"2c_cu_lv_25": { od: 29.5, mbr: 354, src: "Generic catalogue model" },
"2c_cu_lv_35": { od: 32.5, mbr: 390, src: "Generic catalogue model" },
"2c_cu_lv_50": { od: 36.5, mbr: 438, src: "Generic catalogue model" },
"2c_cu_lv_70": { od: 42.0, mbr: 504, src: "Generic catalogue model" },
"2c_cu_lv_95": { od: 47.0, mbr: 564, src: "Generic catalogue model" },
"2c_cu_lv_120": { od: 52.0, mbr: 624, src: "Generic catalogue model" },
"2c_cu_lv_150": { od: 57.0, mbr: 684, src: "Generic catalogue model" },
"2c_cu_lv_185": { od: 63.0, mbr: 756, src: "Generic catalogue model" },
"2c_cu_lv_240": { od: 71.0, mbr: 852, src: "Generic catalogue model" },
// 3-core Cu SWA
"3c_cu_lv_1.5": { od: 16.5, mbr: 198, src: "Generic catalogue model" },
"3c_cu_lv_2.5": { od: 18.0, mbr: 216, src: "Generic catalogue model" },
"3c_cu_lv_4": { od: 19.5, mbr: 234, src: "Generic catalogue model" },
"3c_cu_lv_6": { od: 21.5, mbr: 258, src: "Generic catalogue model" },
"3c_cu_lv_10": { od: 25.0, mbr: 300, src: "Generic catalogue model" },
"3c_cu_lv_16": { od: 28.5, mbr: 342, src: "Generic catalogue model" },
"3c_cu_lv_25": { od: 33.5, mbr: 402, src: "Generic catalogue model" },
"3c_cu_lv_35": { od: 37.0, mbr: 444, src: "Generic catalogue model" },
"3c_cu_lv_50": { od: 42.0, mbr: 504, src: "Generic catalogue model" },
"3c_cu_lv_70": { od: 48.5, mbr: 582, src: "Generic catalogue model" },
"3c_cu_lv_95": { od: 55.0, mbr: 660, src: "Generic catalogue model" },
"3c_cu_lv_120": { od: 60.5, mbr: 726, src: "Generic catalogue model" },
"3c_cu_lv_150": { od: 66.5, mbr: 798, src: "Generic catalogue model" },
"3c_cu_lv_185": { od: 73.5, mbr: 882, src: "Generic catalogue model" },
"3c_cu_lv_240": { od: 83.0, mbr: 996, src: "Generic catalogue model" },
"3c_cu_lv_300": { od: 91.0, mbr:1092, src: "Generic catalogue model" },
// 4-core Cu SWA
"4c_cu_lv_1.5": { od: 18.0, mbr: 216, src: "Generic catalogue model" },
"4c_cu_lv_2.5": { od: 19.5, mbr: 234, src: "Generic catalogue model" },
"4c_cu_lv_4": { od: 21.5, mbr: 258, src: "Generic catalogue model" },
"4c_cu_lv_6": { od: 23.5, mbr: 282, src: "Generic catalogue model" },
"4c_cu_lv_10": { od: 27.5, mbr: 330, src: "Generic catalogue model" },
"4c_cu_lv_16": { od: 31.5, mbr: 378, src: "Generic catalogue model" },
"4c_cu_lv_25": { od: 37.0, mbr: 444, src: "Generic catalogue model" },
"4c_cu_lv_35": { od: 41.0, mbr: 492, src: "Generic catalogue model" },
"4c_cu_lv_50": { od: 46.5, mbr: 558, src: "Generic catalogue model" },
"4c_cu_lv_70": { od: 54.0, mbr: 648, src: "Generic catalogue model" },
"4c_cu_lv_95": { od: 61.0, mbr: 732, src: "Generic catalogue model" },
"4c_cu_lv_120": { od: 67.5, mbr: 810, src: "Generic catalogue model" },
"4c_cu_lv_150": { od: 74.5, mbr: 894, src: "Generic catalogue model" },
"4c_cu_lv_185": { od: 82.5, mbr: 990, src: "Generic catalogue model" },
"4c_cu_lv_240": { od: 93.5, mbr:1122, src: "Generic catalogue model" },
// 5-core Cu SWA
"5c_cu_lv_1.5": { od: 20.0, mbr: 240, src: "Generic catalogue model" },
"5c_cu_lv_2.5": { od: 21.5, mbr: 258, src: "Generic catalogue model" },
"5c_cu_lv_4": { od: 23.5, mbr: 282, src: "Generic catalogue model" },
"5c_cu_lv_6": { od: 26.0, mbr: 312, src: "Generic catalogue model" },
"5c_cu_lv_10": { od: 30.5, mbr: 366, src: "Generic catalogue model" },
"5c_cu_lv_16": { od: 35.0, mbr: 420, src: "Generic catalogue model" },
"5c_cu_lv_25": { od: 41.5, mbr: 498, src: "Generic catalogue model" },
"5c_cu_lv_35": { od: 46.0, mbr: 552, src: "Generic catalogue model" },
"5c_cu_lv_50": { od: 52.5, mbr: 630, src: "Generic catalogue model" },
"5c_cu_lv_70": { od: 60.5, mbr: 726, src: "Generic catalogue model" },
"5c_cu_lv_95": { od: 68.5, mbr: 822, src: "Generic catalogue model" },
"5c_cu_lv_120": { od: 76.0, mbr: 912, src: "Generic catalogue model" },
// 3-core Al SWA
"3c_al_lv_16": { od: 27.0, mbr: 324, src: "Generic catalogue model" },
"3c_al_lv_25": { od: 31.0, mbr: 372, src: "Generic catalogue model" },
"3c_al_lv_35": { od: 34.5, mbr: 414, src: "Generic catalogue model" },
"3c_al_lv_50": { od: 39.0, mbr: 468, src: "Generic catalogue model" },
"3c_al_lv_70": { od: 45.5, mbr: 546, src: "Generic catalogue model" },
"3c_al_lv_95": { od: 51.5, mbr: 618, src: "Generic catalogue model" },
"3c_al_lv_120": { od: 57.0, mbr: 684, src: "Generic catalogue model" },
"3c_al_lv_150": { od: 63.0, mbr: 756, src: "Generic catalogue model" },
"3c_al_lv_185": { od: 69.5, mbr: 834, src: "Generic catalogue model" },
"3c_al_lv_240": { od: 78.5, mbr: 942, src: "Generic catalogue model" },
"3c_al_lv_300": { od: 86.5, mbr:1038, src: "Generic catalogue model" },
// 4-core Al SWA
"4c_al_lv_16": { od: 29.5, mbr: 354, src: "Generic catalogue model" },
"4c_al_lv_25": { od: 34.5, mbr: 414, src: "Generic catalogue model" },
"4c_al_lv_35": { od: 38.5, mbr: 462, src: "Generic catalogue model" },
"4c_al_lv_50": { od: 43.5, mbr: 522, src: "Generic catalogue model" },
"4c_al_lv_70": { od: 50.5, mbr: 606, src: "Generic catalogue model" },
"4c_al_lv_95": { od: 57.5, mbr: 690, src: "Generic catalogue model" },
"4c_al_lv_120": { od: 63.5, mbr: 762, src: "Generic catalogue model" },
"4c_al_lv_150": { od: 70.0, mbr: 840, src: "Generic catalogue model" },
"4c_al_lv_185": { od: 77.5, mbr: 930, src: "Generic catalogue model" },
"4c_al_lv_240": { od: 87.5, mbr:1050, src: "Generic catalogue model" },
"4c_al_lv_300": { od: 96.5, mbr:1158, src: "Generic catalogue model" },
// 5-core Al SWA
"5c_al_lv_16": { od: 33.0, mbr: 396, src: "Generic catalogue model" },
"5c_al_lv_25": { od: 38.5, mbr: 462, src: "Generic catalogue model" },
"5c_al_lv_35": { od: 43.0, mbr: 516, src: "Generic catalogue model" },
"5c_al_lv_50": { od: 49.0, mbr: 588, src: "Generic catalogue model" },
"5c_al_lv_70": { od: 57.0, mbr: 684, src: "Generic catalogue model" },
"5c_al_lv_95": { od: 64.5, mbr: 774, src: "Generic catalogue model" },
"5c_al_lv_120": { od: 71.5, mbr: 858, src: "Generic catalogue model" },
"5c_al_lv_150": { od: 79.0, mbr: 948, src: "Generic catalogue model" },
"5c_al_lv_185": { od: 87.5, mbr:1050, src: "Generic catalogue model" },
"5c_al_lv_240": { od: 99.0, mbr:1188, src: "Generic catalogue model" },
// LV 0.6/1kV 3-core — H07RN-F
"3c_lv3_1.5": { od: 10.6, mbr: 53, src: "H07RN-F type" },
"3c_lv3_2.5": { od: 12.4, mbr: 62, src: "H07RN-F type" },
"3c_lv3_4": { od: 14.4, mbr: 72, src: "H07RN-F type" },
"3c_lv3_6": { od: 16.1, mbr: 80, src: "H07RN-F type" },
"3c_lv3_10": { od: 21.6, mbr: 108, src: "H07RN-F type" },
"3c_lv3_16": { od: 24.7, mbr: 124, src: "H07RN-F type" },
"3c_lv3_25": { od: 29.6, mbr: 148, src: "H07RN-F type" },
"3c_lv3_35": { od: 33.2, mbr: 166, src: "H07RN-F type" },
"3c_lv3_50": { od: 38.5, mbr: 193, src: "H07RN-F type" },
"3c_lv3_70": { od: 43.3, mbr: 217, src: "H07RN-F type" },
"3c_lv3_95": { od: 48.6, mbr: 243, src: "H07RN-F type" },
"3c_lv3_120": { od: 53.7, mbr: 269, src: "H07RN-F type" },
"3c_lv3_150": { od: 59.0, mbr: 295, src: "H07RN-F type" },
"3c_lv3_185": { od: 64.5, mbr: 323, src: "H07RN-F type" },
"3c_lv3_240": { od: 73.5, mbr: 368, src: "H07RN-F type" },
// PV DC STRING — BS EN 50618 H1Z2Z2-K
"sc_pv_string_1.5": { od: 4.0, mbr: 16, src: "BS EN 50618 (typical)" },
"sc_pv_string_2.5": { od: 4.7, mbr: 19, src: "BS EN 50618 (typical)" },
"sc_pv_string_4": { od: 5.4, mbr: 22, src: "BS EN 50618 (typical)" },
"sc_pv_string_6": { od: 6.2, mbr: 25, src: "BS EN 50618 (typical)" },
"sc_pv_string_10": { od: 7.5, mbr: 30, src: "BS EN 50618 (typical)" },
"sc_pv_string_16": { od: 9.0, mbr: 36, src: "BS EN 50618 (typical)" },
"sc_pv_string_25": { od: 10.8, mbr: 43, src: "BS EN 50618 (typical)" },
"sc_pv_string_35": { od: 12.3, mbr: 49, src: "BS EN 50618 (typical)" },
"sc_pv_string_50": { od: 14.2, mbr: 57, src: "BS EN 50618 (typical)" },
"sc_pv_string_70": { od: 16.8, mbr: 67, src: "BS EN 50618 (typical)" },
"sc_pv_string_95": { od: 19.2, mbr: 77, src: "BS EN 50618 (typical)" },
"sc_pv_string_120": { od: 21.2, mbr: 85, src: "BS EN 50618 (typical)" },
"sc_pv_string_150": { od: 23.5, mbr: 94, src: "BS EN 50618 (typical)" },
"sc_pv_string_185": { od: 26.1, mbr: 104, src: "BS EN 50618 (typical)" },
"sc_pv_string_240": { od: 29.5, mbr: 118, src: "BS EN 50618 (typical)" },
// ── FLEXIBLE SCREENED SOLAR MV ────────
"sc_flex_hv_ac_4": { od: 4.90, mbr: 15, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_6": { od: 5.80, mbr: 17, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_10": { od: 7.80, mbr: 23, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_16": { od: 9.30, mbr: 28, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_25": { od: 11.00, mbr: 33, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_35": { od: 12.90, mbr: 39, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_50": { od: 14.90, mbr: 45, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_70": { od: 17.00, mbr: 51, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_95": { od: 19.50, mbr: 59, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_120": { od: 22.60, mbr: 68, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_150": { od: 25.00, mbr: 75, src: "Manufacturer datasheet" },
"sc_flex_hv_ac_185": { od: 26.60, mbr: 80, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_4": { od: 4.90, mbr: 15, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_6": { od: 5.80, mbr: 17, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_10": { od: 7.80, mbr: 23, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_16": { od: 9.30, mbr: 28, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_25": { od: 11.00, mbr: 33, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_35": { od: 12.90, mbr: 39, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_50": { od: 14.90, mbr: 45, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_70": { od: 17.00, mbr: 51, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_95": { od: 19.50, mbr: 59, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_120": { od: 22.60, mbr: 68, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_150": { od: 25.00, mbr: 75, src: "Manufacturer datasheet" },
"sc_flex_hv_dc_185": { od: 26.60, mbr: 80, src: "Manufacturer datasheet" },
// RIGID AL SOLAR
"sc_al_ata_ac_50": { od: 17.10, mbr: 205, src: "Manufacturer datasheet" },
"sc_al_ata_ac_70": { od: 18.80, mbr: 226, src: "Manufacturer datasheet" },
"sc_al_ata_ac_95": { od: 20.90, mbr: 251, src: "Manufacturer datasheet" },
"sc_al_ata_ac_120": { od: 22.40, mbr: 269, src: "Manufacturer datasheet" },
"sc_al_ata_ac_150": { od: 24.10, mbr: 289, src: "Manufacturer datasheet" },
"sc_al_ata_ac_185": { od: 27.70, mbr: 332, src: "Manufacturer datasheet" },
"sc_al_ata_ac_240": { od: 29.90, mbr: 359, src: "Manufacturer datasheet" },
"sc_al_ata_ac_300": { od: 33.00, mbr: 396, src: "Manufacturer datasheet" },
"sc_al_ata_ac_400": { od: 37.40, mbr: 449, src: "Manufacturer datasheet" },
"sc_al_ata_ac_500": { od: 40.10, mbr: 481, src: "Manufacturer datasheet" },
"sc_al_ata_ac_630": { od: 44.80, mbr: 538, src: "Manufacturer datasheet" },
"sc_al_ata_dc_50": { od: 17.10, mbr: 205, src: "Manufacturer datasheet" },
"sc_al_ata_dc_70": { od: 18.80, mbr: 226, src: "Manufacturer datasheet" },
"sc_al_ata_dc_95": { od: 20.90, mbr: 251, src: "Manufacturer datasheet" },
"sc_al_ata_dc_120": { od: 22.40, mbr: 269, src: "Manufacturer datasheet" },
"sc_al_ata_dc_150": { od: 24.10, mbr: 289, src: "Manufacturer datasheet" },
"sc_al_ata_dc_185": { od: 27.70, mbr: 332, src: "Manufacturer datasheet" },
"sc_al_ata_dc_240": { od: 29.90, mbr: 359, src: "Manufacturer datasheet" },
"sc_al_ata_dc_300": { od: 33.00, mbr: 396, src: "Manufacturer datasheet" },
"sc_al_ata_dc_400": { od: 37.40, mbr: 449, src: "Manufacturer datasheet" },
"sc_al_ata_dc_500": { od: 40.10, mbr: 481, src: "Manufacturer datasheet" },
"sc_al_ata_dc_630": { od: 44.80, mbr: 538, src: "Manufacturer datasheet" },
};
// Voltage class definitions
const VOLTAGE_CLASSES = {
// ── LV POWER — 0.6/1kV XLPE ─────────────────────────────────────────
// Cu single core: AWA (Al wire armour) used for single-core AC buried
// (SWA must NOT be used on single-core AC — magnetic armour, eddy losses)
"lv_cu_sc": { label: "0.6/1kV Cu XLPE single core (fixed install.)", Uo: 0, mbr_factor: 15, cores: ["single"] },
"lv_al_sc": { label: "0.6/1kV Al XLPE single core (fixed install.)", Uo: 0, mbr_factor: 15, cores: ["single"] },
"lv_cu_2c": { label: "0.6/1kV Cu XLPE 2-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["two"] },
"lv_cu_3c": { label: "0.6/1kV Cu XLPE 3-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["three"] },
"lv_cu_4c": { label: "0.6/1kV Cu XLPE 4-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["four"] },
"lv_cu_5c": { label: "0.6/1kV Cu XLPE 5-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["five"] },
"lv_al_3c": { label: "0.6/1kV Al XLPE 3-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["three"] },
"lv_al_4c": { label: "0.6/1kV Al XLPE 4-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["four"] },
"lv_al_5c": { label: "0.6/1kV Al XLPE 5-core SWA (fixed install.)", Uo: 0, mbr_factor: 12, cores: ["five"] },
// ── LV flexible multicore ────────────────────────────
"lv3": { label: "LV 0.6/1kV 3-core (fixed install.)", Uo: 0, mbr_factor: 5, cores: ["three"] },
"pv_string": { label: "PV DC string — 1500V DC, Class II (flexible, fixed install.)", Uo: 0, mbr_factor: 4, cores: ["single"] },
"flex_hv_ac": { label: "Flexible screened — 1000/1000V AC, IT system (fixed/occasional)", Uo: 0, mbr_factor: 3, cores: ["single"] },
"flex_hv_dc": { label: "Flexible screened — 1500V DC (Um=1800V, fixed/occasional)", Uo: 0, mbr_factor: 3, cores: ["single"] },
"al_ata_ac": { label: "Rigid Al solar — 1000/1000V AC, Al tube armour (non-mag, fixed)", Uo: 0, mbr_factor: 12, cores: ["single"] },
"al_ata_dc": { label: "Rigid Al solar — 1500/1500V DC (Um=1800V), Al tube armour (fixed)", Uo: 0, mbr_factor: 12, cores: ["single"] },
"6": { label: "6 kV (3.6/6 kV)", Uo: 3.6, mbr_factor: 15, cores: ["single","three"] },
"10": { label: "10 kV (5.8/10 kV)", Uo: 5.8, mbr_factor: 15, cores: ["single","three"] },
"15": { label: "15 kV (8.7/15 kV)", Uo: 8.7, mbr_factor: 15, cores: ["single","three"] },
"20": { label: "20 kV (12/20 kV)", Uo: 12, mbr_factor: 15, cores: ["single","three"] },
"33": { label: "33 kV (19/33 kV) — Al", Uo: 18, mbr_factor: 15, cores: ["single","three"] },
"33cu": { label: "33 kV (19/33 kV) — Cu 3-core", Uo: 18, mbr_factor: 15, cores: ["three"] },
"66": { label: "66 kV (38/66 kV) ★", Uo: 38, mbr_factor: 15, cores: ["single"] },
"110": { label: "110 kV (64/110 kV) ★", Uo: 64, mbr_factor: 25, cores: ["single"] },
"132": { label: "132 kV (76/132 kV) ★", Uo: 76, mbr_factor: 15, cores: ["single"] },
};
const SC_CSAS_LV = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185, 240];
const TC_CSAS_LV = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185, 240];
const SC_CSAS_STR = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185, 240];
const SC_CSAS_FLX = [4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185];
const SC_CSAS_ATA = [50, 70, 95, 120, 150, 185, 240, 300, 400, 500, 630];
const SC_CSAS_MV = [35, 50, 70, 95, 120, 150, 185, 240, 300, 400, 500, 630];
const TC_CSAS_MV = [35, 50, 70, 95, 120, 150, 185, 240, 300, 400];
const SC_CSAS_HV = [300, 400, 500, 630, 800, 1000, 1200, 1600, 2000];
// LV power cable CSA ranges (0.6/1kV XLPE SWA/AWA)
const SC_CSAS_LV_CU_PWR = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185, 240, 300, 400, 500, 630];
const SC_CSAS_LV_AL_PWR = [16, 25, 35, 50, 70, 95, 120, 150, 185, 240, 300, 400, 500, 630];
const MC2_CSAS_CU_LV = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185, 240];
const MC_CSAS_CU_LV = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120, 150, 185, 240, 300];
const MC5_CSAS_CU_LV = [1.5, 2.5, 4, 6, 10, 16, 25, 35, 50, 70, 95, 120];
const MC_CSAS_AL_LV = [16, 25, 35, 50, 70, 95, 120, 150, 185, 240, 300];
const MC5_CSAS_AL_LV = [16, 25, 35, 50, 70, 95, 120, 150, 185, 240];
const SC_CSAS = [...new Set([...SC_CSAS_LV, ...SC_CSAS_MV, ...SC_CSAS_HV])];
const TC_CSAS = TC_CSAS_MV;
function lookupOD(voltageKey, csaMm2, isThreeCore) {
if (voltageKey === "33cu") {
if (!isThreeCore) return null;
const key = "3c_cu18_" + csaMm2;
if (OD_CONFIRMED[key]) return { ...OD_CONFIRMED[key], estimated: false };
return null;
}
if (!voltageKey || !csaMm2) return null;
const vc = VOLTAGE_CLASSES[voltageKey];
if (!vc) return null;
const prefix = isThreeCore ? "3c" : "sc";
const isLV = voltageKey.startsWith("lv");
const isLVpwr = ["lv_cu_sc","lv_al_sc","lv_cu_2c","lv_cu_3c","lv_cu_4c","lv_cu_5c",
"lv_al_3c","lv_al_4c","lv_al_5c"].includes(voltageKey);
const isSolar = ["pv_string","flex_hv_ac","flex_hv_dc","al_ata_ac","al_ata_dc"].includes(voltageKey);
const isMV_HV = !isLV && !isSolar;
let key;
if (isLVpwr) {
const coreMap = { "lv_cu_sc":"sc_cu_lv", "lv_al_sc":"sc_al_lv",
"lv_cu_2c":"2c_cu_lv", "lv_cu_3c":"3c_cu_lv",
"lv_cu_4c":"4c_cu_lv", "lv_cu_5c":"5c_cu_lv",
"lv_al_3c":"3c_al_lv", "lv_al_4c":"4c_al_lv",
"lv_al_5c":"5c_al_lv" };
key = `${coreMap[voltageKey]}_${csaMm2}`;
} else if (isLV) {
key = `${prefix}_${voltageKey}_${csaMm2}`;
} else if (isSolar) {
key = `sc_${voltageKey}_${csaMm2}`;
} else {
key = `${prefix}_${vc.Uo}_${csaMm2}`;
}
if (OD_CONFIRMED[key]) {
const isEstimated = key.includes("_cu_lv_") || key.includes("_al_lv_");
return { ...OD_CONFIRMED[key], estimated: isEstimated };
}
if (!isThreeCore && isMV_HV) {
const od = OD_A + OD_B * Math.sqrt(csaMm2) + OD_C * vc.Uo;
const od_r = Math.round(od / 2.5) * 2.5;
const mbr = vc.mbr_factor * od_r;
return { od: od_r, mbr: mbr, src: "catalogue model ±3mm", estimated: true };
}
return null;
}
const appState = {
inputs: null,
layout: null,
review: null,
snapshotText: "",
previousSpacing: { h: 150, v: 150 }
};
Export
A JavaScript file in the cable geometry visualiser folder of Cable Trench or Drill that works with copy snapshot (`copySnapshot`). It exports JSON (`exportJson`) and copies snapshot (`copySnapshot`).
rendercable-trench-or-drill / releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/export.js · lines 1–28 of 28 · version 2026-09-05 19:21 · Entry point · pattern copySnapshot (shared by 4 files)
- What it does
- It draws its content. Defines exportJson, copySnapshot. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'bess'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
- Downstream impact
- Used directly by 2 files: Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (cable-trench-or-drill); Solar Battery Energy Storage System (BESS) Topology V6 — Cable Geometry Visualiser Page (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v6/cable-geometry-visualiser/). Reached from 144 other entry points, including Iterations — 43 Registry Growth Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/43-registry-growth/); Iterations — 47 Federation Honesty Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/47-federation-honesty/); Demonstration Videos (globalgrid2050, https://globalgrid2050.com/solar-bess-topology-v7/docs/demonstration-videos.html).
- What it achieves
- Defines `exportJson` and `copySnapshot`.
- Why it matters
- Loaded by the Cable Geometry Visualiser page and 1 other page.
- Application
- cable-trench-or-drill · releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser · script
- Uses
- none found
- Used by
- loaded by Solar Battery Energy Storage System (BESS) Topology V7 — Cable Geometry Visualiser Page (script src), loaded by Solar Battery Energy Storage System (BESS) Topology V6 — Cable Geometry Visualiser Page (script src)
- Produces
- exportJson, copySnapshot
- Defines here
- exportJson, copySnapshot
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- cable-trench-or-drill@bf00f9503ff7a662933775a022557c4ca9d9880a releases/202609051921/solar-bess-topology-v7/cable-geometry-visualiser/export.js:1-28 · blob f77c50db7c4971dda0b6ee0fcd26575d3aff9bdc · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: unknown
function exportJson() {
if (!appState.snapshotText) return;
const base = (byId("route_name").value.trim() || "geometry_capture").replace(/[^a-z0-9_]/gi, "_");
const blob = new Blob([appState.snapshotText], { type: "application/json" });
const url = URL.createObjectURL(blob);
const a = document.createElement("a");
a.href = url;
a.download = `${base}_geometry_capture_NOT_FOR_CONSTRUCTION.json`;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
URL.revokeObjectURL(url);
}
async function copySnapshot() {
const btn = byId("copy_btn");
if (!appState.snapshotText) return;
try {
await navigator.clipboard.writeText(appState.snapshotText);
btn.textContent = "Copied";
setTimeout(() => { btn.textContent = "Copy Snapshot"; }, 1000);
} catch (_) {
btn.textContent = "Copy Failed";
setTimeout(() => { btn.textContent = "Copy Snapshot"; }, 1200);
}
}