# SmartTools — Engineering Calculators for International Projects

Offline, browser-based calculation tools for bridge / post-tensioning works on overseas projects.

**Key principles**

- **No server, no installation, no build step** — open the files directly, works offline.
- **Data never leaves your computer** — all calculations run locally in the browser.
- **English UI and deliverables** — **SI units only** (kN, mm, N/mm², mm²).
- **Traceable output** — every result shows the formula, the substitution and the code reference;
  the deliverable sheet can be printed to PDF or exported to Excel.

## Tools

| # | Tool | Status |
|---|---|---|
| 1 | Anchorage Spiral Reinforcement — **BS 5400 + CIRIA Guide 1** | ✅ Available (v0.2) |
| 1b | Same tool — **EN 1992-1-1** framework | ⚠️ Materials + §6.7 bearing check; bursting/spalling pending |
| 1c | Same tool — **AASHTO LRFD** | Planned |
| 2 | Prestress Elongation | Planned (after tool 1 stabilises) |
| 3 | Bearing Pad Stone (local compression) | Planned |

## Tool 1 workflow (v0.2)

- **Left — Cases**: one row per calculation case (e.g. per anchorage type or tendon group).
  Add / duplicate / rename / delete. Each case keeps its own inputs, results and PASS/FAIL status.
  Compute one case or all cases. On first open the tool ships with four default cases —
  **Blister Type A, B, C, D** (standard defaults, ready to be filled in); further cases are named
  **Blister Type E, F, …** automatically.
- **Centre — Inputs**: design code, material grades (concrete / reinforcement / strand), prestress &
  geometry (defaults follow the **OVM circular anchorage**, φs15.2/1860; tendon designation n–Ø,
  total strand area, jacking force from ratio or stress — two-way linked; then, after the jacking
  force: no. of anchorages in the calc. zone + anchorage direction (horizontal / vertical); duct
  material HDPE / corrugated steel (HDPE default) and duct diameter; anchor plate size and shape
  (circular — Ø — default, or square; the EN loaded-area check follows the shape); tendon-centre
  distances yo,a → yo,b → yo,c (member surfaces / adjacent tendon) — the schematic below re-draws
  live from these values),
  bursting & spiral reinforcement (primary — with its own live schematic of the spiral coil,
  pitch, effective length and placement zone), spalling reinforcement (live spalling
  mesh schematic — λ from the anchorage count; bar counts derived from the section, cover,
  stirrup Ø and bar spacing), lateral reinforcement — deviation at the davit/blister (own
  section: deviation angle β, deviation zone L_dev = yo,c / tan β, lateral force
  `Fr = 2·Ptot·sin(β/2)`, tie-bar `Ttb,d = 0.2·Ptot` with the davit-connection count basis, live blister schematic), factors.
- **Project information** (the 4-row header block of every calculation sheet — project, doc. ref.,
  revision, designed by / checked by with dates to the month) is set once on the main page (hub)
  and saved with **Set as default** — tools read it automatically.
- **Right — Deliverable**: live A4-preview of the calculation sheet exactly as it will be printed —
  4-row title block repeated on every printed page, grouped design data, narrative calculation
  chapters (one per check item: formula → substitution → result with the clause reference in brackets,
  closing in a Demand / Capacity / Checked — OK / NOT OK — verdict strip; the input schematics are
  embedded in the corresponding chapters).
  Buttons: **Export Excel**, **Batch template**, **Import**, **Print / PDF**.

### BS 5400 + CIRIA Guide 1 method

The BS engine implements *CIRIA Guide 1 — A guide to the design of anchor blocks for
post-tensioned prestressed concrete members* (June 1976, reprinted 1984):

| Check | Reference |
|---|---|
| Primary prism dimension 2·yo = 2 × min(surface distance, half neighbour spacing) — checked separately in **both** principal planes; circular plates as equivalent squares (same bearing area) | §3.2 / §3.3 |
| Bursting force `Fbst = γ·(1/K)·(Fbst/Pk)·Pk` with the §3.3 table (0.23→0.11) and the K factor (1.0 / 1.5 / 2.0) — governing direction sets the force | §3.3 |
| Steel limits: stress ≤ 0.87·fy **and** strain ≤ 0.001; governing area = max of both criteria | §3.3 |
| Spiral placement zone 0.2·yo…2·yo (governing plane); coil diameter ≥ 2·ypo + 50 mm; (turns−1)·pitch ≥ 1.8·yo; provided steel = 2·(turns−1) legs per spiral | §3.3 / §6.2 |
| Spalling force γ·λ·0.04·Ptot per direction (Ptot = nAnch·Pk zone total; λ = 1.0 / 1.5 by anchorage count) + unsymmetrical prism term 0.2·[(d1−d2)/(d1+d2)]³·Pk (per anchorage; d1 > 2·d2) | §3.5 |
| Lateral component of deviated tendons `Fr = 2·Ptot·sin(β/2)` — bars distributed over the deviation zone `L_dev = yo,c / tan β` (one blister edge runs parallel to the tendon): `n = ⌈L_dev / s_lat⌉`, spanning the full depth | §5.1 |
| Blister root tension — parallel to the blister surface `Ts,d = 0.04·Ptot` (zone total) → `As = Ts,d/(0.87 fy)`, carried by the surface/spalling steel (which continues through the root) | project rule (workbook 3#) |
| Tie-bar — additional longitudinal reinforcement below the anchorage `Ttb,d = 0.2·Ptot` (zone total; bars at the inner face of the adjacent section, extended beyond the junction; count from the davit connection: one face `⌈b/s⌉`, two faces `⌈(b+h)/s⌉`) | project rule (workbook 4#/6#) |
| Bearing stress behind the plate (limit factor k·fcu, default 0.4, project-configurable) | common BS practice — confirm |
| Minimum equilibrium steel 0.3 %·b·h (informational; full §3.4 equilibrium check not included) | §6.3 |

Table-reading conventions — two are provided because they exist in practice:

- **Linear interpolation** (default; convention used by the project's *Appendix D* workbook);
- **Conservative step** (convention used by the CIRIA design example: 0.32 → 0.23).

Formula basis and the verification cases are documented in `docs/bs5400-ciria-guide1.md`.

### Batch calculation via Excel

1. Press **Batch template** — you get an `.xlsx` with one row per case (SI units).
2. Fill in / bulk-edit rows in Excel (keep the `Case name` column filled; add rows for new cases).
3. Press **Import** and select the file — the cases are loaded back (replace-all prompt), then
   press **Compute all**.
4. **Export Excel** produces a results workbook: `Inputs` sheet (re-importable) + `Results` summary
   (Fbst, As required/provided, FoS, strain, spalling, bearing, overall verdict).

The template and results sheets follow the structure of the project's existing workbook
(header block with Project / Section / Designed / Checked / File Ref., one row per case,
size / spacing / count per reinforcement group).

## Running the tests

- Terminal: `node tests/run-node.js` (Node ≥ 18, no packages needed) or `npm test`.
- Browser: open `tests/index.html`.

Verification cases include the **CIRIA Guide 1 official design example** (1170 kN tendons,
160 mm plates), the **Appendix D workbook regression** (TYPE-A1: Fbst = 340.86 kN, As = 783.59 mm²),
the EN §6.7 bearing hand-check and an Excel import/export round-trip.

## Project layout

```
SmartTools_V1.0/
├─ index.html                       # Tool hub
├─ tools/spiral-reinforcement/
│  ├─ index.html                    # Tool page (3-pane layout)
│  ├─ app.js                        # Page logic (cases, inputs, preview, import/export)
│  ├─ calc-bs5400.js                # BS 5400 + CIRIA Guide 1 engine (full method)
│  ├─ calc-en1992.js                # EN 1992-1-1 engine (framework; §6.7 bearing)
│  └─ calc.js                       # Engine facade
├─ shared/
│  ├─ css/app.css                   # Styles (screen + print)
│  ├─ js/meta.js · units.js · ui.js # Version, formatting, DOM helpers
│  ├─ js/materials.js               # Material grade libraries (BS / EN)
│  ├─ js/preview.js                 # Deliverable sheet renderer
│  ├─ js/excel.js                   # Excel batch export/import
│  ├─ js/report.js                  # JSON save/load helpers
│  └─ vendor/xlsx.full.min.js       # SheetJS (Apache-2.0) — local copy for offline use
├─ tests/                           # Test cases + Node runner + browser test page
├─ docs/bs5400-ciria-guide1.md      # Formula basis, assumptions, verification cases
├─ scratch/                         # Reference extracts (CIRIA pages, workbook dumps, v0.1 backup)
└─ package.json                     # Only for `npm test` — no dependencies
```

## Deployment / sharing

- **Use locally / offline:** open `index.html` (or a tool page) directly — everything works from disk.
- **Share by link (recommended):** private GitHub repo → **Cloudflare Pages** auto-deploy at
  `smartbridgetools.com`, with a **Cloudflare Access** e-mail-code gate. Full step-by-step runbook
  (Chinese): [`docs/deployment.md`](docs/deployment.md).
- **Other static hosts:** upload the folder to any static host (GitHub Pages, Netlify…).
- Note: unattended static hosting is publicly reachable by URL — keep confidential use behind an
  access layer (e.g. Cloudflare Access) or on the company network.

## Roadmap

- EN 1992 bursting/spalling checks; AASHTO LRFD material library and method.
- Full §3.4 equilibrium (out-of-balance moment) check with stressing-sequence combinations.
- Tool 2 — Prestress Elongation; Tool 3 — Bearing Pad Stone.
- Single-file offline build; optional PWA packaging.

## Disclaimer

Results must be reviewed and approved by a qualified engineer before use in design or construction.
Coefficients and limits are project-configurable; the defaults shipped with the tools are indicative only.
CIRIA Guide 1 © CIRIA — this tool implements its published design method; the original document
(licensed copy) remains the governing reference.
