VoltKernel (volt-kernel)
Zero-dependency, pure safe Rust (#![forbid(unsafe_code)]) Industrial Power Systems Engineering Engine + WebAssembly Interactive Studio + Single-Source-of-Truth IEC 60617 CAD Compiler.
Solves 7 coupled industrial power-engineering studies from a single network topology model — compiled natively to Windows/Linux CLI (volt-kernel) and to a 386.89 KB (396,176 B) raw wasm32-unknown-unknown binary (volt_wasm.wasm, zero wasm-bindgen, zero external crates).
Verified Benchmarks & Quality Gates
- Native Release (
volt-kernel bench): Polar Newton-Raphson AC Load Flow 64,662 solves/s (15.46 µs/solve), IEC 60909 Sequence $Z_{\text{bus}}$ 49,264 solves/s (20.30 µs/solve), TCC Selectivity Sweep 59,825 sweeps/s (16.72 µs/sweep), Full 7-Study Suite 4,819 suites/s (207.53 µs/suite).
- Physics Invariants (
volt-kernel verify-invariants): 1,000 / 1,000 randomized trials PASS (Max NR mismatch 9.94e-11 p.u., Max P conservation 2.39e-6 kW, Ik2/Ik3 err 2.22e-16, monotonic $R_f$ & motor starting dip).
- Independent Python Oracle (
scripts/verify_oracle.py): 12 / 12 checks PASS (rel <= 1.9e-10, KCL/KVL residual 0.000007 kW, Cable $I^2t$ exact 0.00e+00, IEEE 519 $h_r$ 2.53e-09, 3D Switchroom 4/4 PASS).
- Custom Topology Editor: Zero-dependency recursive-descent JSON parser (
custom_json.rs) supporting arbitrary custom bus/feeder/transformer/breaker networks in CLI (--network) and live WASM Studio (vk_run_custom_study, vk_export_custom_dxf).
- Live Browser Studio: ardhyanovri.my.id/labs/volt-kernel (
COOP: same-origin + COEP: require-corp, 0 CDN dependencies, 0 console errors).
Core Solvers (crates/volt-core — 0 External Dependencies)
- Polar Newton-Raphson AC Power Flow (
loadflow.rs): Analytical Jacobian ($J_1…J_4$) with partial-pivoting LU solver, off-nominal transformer taps, shunt capacitor susceptance, convergence $< 10^{-10}$ p.u. in 3 iterations, active power conservation $< 10^{-5}$ kW, plant PF & PLN 0.95 compensation kVAR.
- IEC 60909-0:2016 Short-Circuit Engine (
short_circuit.rs): Positive/Negative/Zero sequence $Y_{\text{bus}}^{-1} = Z_{\text{bus}}$, transformer impedance correction $K_T$, generator $K_G$, exact Dyn11 zero-sequence isolation & LV ground return, $I’‘{k3}$ (max/min), $I’'{k2}$, $I’'_{k1}$, $\kappa = 1.02 + 0.98 e^{-3R/X}$, peak $i_p$, DC $\tau$, plus live fault-injection bus voltage collapse & branch current flow solver (3PH, L-L, SLG, custom $R_f$).
- Protection Coordination & TCC Engine (
tcc.rs): MCB B/C/D, MCCB/ACB LSIG electronic trip units, IEC 60255-151 IDMT (SI / VI / EI), cable adiabatic thermal damage curve ($I^2t = (n_\parallel k S)^2$), pairwise upstream/downstream Selectivity Matrix, $I_{cu}$ breaking-capacity audit, and millisecond event-driven Fault-Clearing Sequencer.
- PUIL 2020 / IEC 60364-5-52 Cable Sizing (
puil.rs): Cu/Al × XLPE 90°C / PVC 70°C × Methods B1/B2/C/D/E/F ampacity tables, temperature/grouping/soil derating, operating-temp AC impedance, IEC 60364-5-54 Table 54.2 minimum PE sizing.
- IEEE 1584-2018 Arc-Flash Hazard Engine (
arcflash.rs): VCB/VCBB/HCB/VOA/HOA enclosures, dual-pass 100% I_arc and 85% I_arc_min coupled directly to actual upstream TCC clearing times, incident energy ($\text{cal/cm}^2$), Arc-Flash Boundary (mm), and NFPA 70E PPE Category.
- Motor Starting Transient & IEEE 519-2022 Harmonics (
motor_harmonics.rs): Locked-rotor admittance injection into Newton-Raphson for DOL, STAR_DELTA, SOFT_STARTER, and VFD (terminal dip, shared bus dip, torque ratio) + 6-pulse/12-pulse harmonic distortion ($THD_V$, $TDD_I$) and parallel capacitor resonance order $h_r = \sqrt{X_c / (X_1 + p X_c)}$ detector.
- Single-Source-of-Truth IEC 60617 DXF SLD Compiler & 3D Switchroom Validator (
dxf_sld.rs): Emits layered AutoCAD R2000 .dxf (A1 841×594 mm) with restrained industrial TrueColor hierarchy + validates switchroom 3D enclosure bounds, IEC 61439 front maintenance aisles, and overhead Power vs Control cable tray Z-zone separation (0 clashes).
Quick Start
# 1. Run unit tests + release builds (CLI + wasm32)
cargo test --workspace
cargo build --release -p volt-cli
cargo build --release --target wasm32-unknown-unknown -p volt-wasm
# 2. Run native benchmark & 1,000-trial physics invariant verification
.\target\release\volt-kernel.exe bench
.\target\release\volt-kernel.exe verify-invariants
# 3. Generate study dossier + JSON + DXF shop drawing
.\target\release\volt-kernel.exe study --preset industrial-plant-1600 --out out\industrial-plant-1600
# 4. Independently cross-verify against Python numerical oracle
python scripts\verify_oracle.py out\industrial-plant-1600\study_report.json
# 5. Compile CAD pack (.dwg, .svg, .pdf, Paper/Dark PNGs + zero-drift roundtrip) via CADCraft
python scripts\compile_cad_pack.py out\industrial-plant-1600\sld_shop_drawing.dxf
# 6. Launch Interactive WASM & 3D Switchroom Studio (http://127.0.0.1:8780)
python scripts\serve_studio.py --port 8780
评论