Simulation Bridge Skill
Note: This skill generates simulation INPUT files. The skill does not execute simulations. Users run the generated files in their local OpenFOAM, ngspice, or FreeCAD installations. All simulation results must be interpreted by qualified engineers before use in design decisions.
Summary (always loaded — ~2K tokens)
The simulation bridge translates verified engineering calculations into simulation-ready inputs across three fidelity levels:
| Level | Tools | Purpose | Time to Run | |-------|-------|---------|-------------| | 1 — Game-based | Minecraft Redstone, Factorio, React artifacts | Intuition building, parameter exploration | Seconds (interactive) | | 2 — Simplified | Hardy-Cross (pipes), Nodal (circuits), thermal balance | Engineering estimation | Minutes (in-browser) | | 3 — Professional | OpenFOAM, ngspice, FreeCAD FEM | Rigorous verification | Hours (local install required) |
When to use this skill:
- Calculations are complete and verified by domain skills
- User wants to visualize behavior before committing to construction
- User needs professional simulation evidence for code compliance or peer review
- User is learning — wants to build intuition from game mechanics up to CFD
Output format: All outputs are SimulationPackage objects:
import { SimulationPackage } from '../../types/infrastructure';
type SimulationPackage = {
type: 'openfoam' | 'ngspice' | 'freecad-fem' | 'react-artifact';
description: string;
files: Record<string, string>; // filename → file content
runInstructions: string;
};
Quick start:
User: "Generate an OpenFOAM case for the data center cooling system"
→ This skill | type: openfoam | template: data-center-airflow | Depends on: fluid-systems calculations
Active Tier (loaded when simulation tasks are active — ~10K tokens)
Simulation Hierarchy
Level 1: GAME-BASED (Intuition)
├── Minecraft Redstone → Logic circuits, signal propagation, spatial reasoning
├── Factorio → Fluid networks, throughput optimization, logistics
└── React artifacts → Interactive parameter exploration (this skill generates these)
Level 2: SIMPLIFIED ANALYSIS (Engineering Estimation)
├── Pipe network solver (Hardy-Cross method) — embedded in React artifact
├── DC circuit solver (nodal analysis) — embedded in React artifact
└── Steady-state thermal balance — embedded in React artifact
Level 3: PROFESSIONAL SIMULATION (Verification)
├── OpenFOAM → CFD for airflow, liquid cooling, heat transfer
├── ngspice → Circuit simulation for power distribution
└── FreeCAD FEM → Structural loads, thermal conduction
Progressive fidelity path:
- Start with game analogy (understand the concept)
- Build interactive React artifact (explore parameters)
- Generate OpenFOAM/ngspice input (validate with professional tool)
- Run solver locally (obtain rigorous results)
- Return results to design (close the verification loop)
OpenFOAM Case Generation (SIM-01, SIM-06)
OpenFOAM uses a structured case directory with required files. This skill generates all required files.
Case directory structure:
case-name/
system/
controlDict <- Solver settings, time step, write frequency
fvSchemes <- Numerical discretization schemes
fvSolution <- Linear solver settings and convergence criteria
blockMeshDict <- Structured mesh definition
snappyHexMeshDict <- (Optional) Unstructured mesh from STL geometry
constant/
physicalProperties <- Fluid properties (density, viscosity, thermal conductivity)
turbulenceProperties <- Turbulence model selection (k-e, k-w SST, etc.)
0/
U <- Initial velocity field (m/s)
p <- Initial pressure field (Pa or relative)
T <- Initial temperature field (K) — thermal cases only
k <- Turbulent kinetic energy (k-e/k-w models)
epsilon <- Turbulent dissipation (k-e model)
omega <- Specific dissipation (k-w model)
Three pre-configured templates (full content in references/openfoam-templates/):
Template 1: data-center-airflow
- Solver:
buoyantSimpleFoam(buoyancy-driven steady-state) - Turbulence: k-e standard
- Geometry: Raised-floor plenum with perforated tiles, rack heat sources, CRAC units
- Parametric inputs: room dimensions, rack heat loads, CRAC supply temperature and flow rate, tile open area
- Key output: Temperature distribution, velocity vectors, hot spot identification
Template 2: pipe-flow-pressure-drop
- Solver:
simpleFoam(incompressible steady-state) - Turbulence: k-w SST (preferred for pipe flow with fittings)
- Geometry: Pipe with fittings (elbow, tee, valve)
- Parametric inputs: pipe diameter, flow velocity, fluid viscosity
- Key output: Pressure drop validation against Darcy-Weisbach calculation
Template 3: heat-exchanger-performance
- Solver:
chtMultiRegionFoam(conjugate heat transfer) - Turbulence: k-w SST
- Geometry: Counter-flow or parallel-flow geometry
- Parametric inputs: inlet temperatures and flow rates for both fluids
- Key output: Heat transfer coefficient, LMTD comparison to analytical result
Generating a case from design data:
Inputs from fluid-systems skill:
pipe_diameter: 100mm, flow_rate: 3.5 L/s, fluid: water at 15C
Generated controlDict (excerpt):
application simpleFoam;
startTime 0;
endTime 500;
deltaT 1;
writeInterval 50;
Generated 0/U boundary conditions:
inlet: fixedValue uniform (0.447 0 0); // Re-calculated: v = Q/A
outlet: zeroGradient;
walls: noSlip;
Run instructions template:
# Run OpenFOAM case
cd case-name/
blockMesh # Generate the mesh
checkMesh # Verify mesh quality
simpleFoam # Run the solver (or buoyantSimpleFoam, chtMultiRegionFoam)
paraFoam # Visualize results in ParaView
ngspice Netlist Generation (SIM-02)
ngspice uses SPICE netlist syntax. Generated netlists describe circuit topology and component models.
SPICE netlist structure:
* Title (first line, always comment)
* Component syntax: <type><name> <node+> <node-> <value/model>
* Voltage sources
V<name> <+node> <-node> <DC|AC|PULSE> <amplitude>
* Passive components
R<name> <node1> <node2> <ohms> ; Resistor
L<name> <node1> <node2> <henries> ; Inductor
C<name> <node1> <node2> <farads> ; Capacitor
* Transformers (using coupled inductors)
L1 primary 0 1e-3
L2 secondary 0 (turns_ratio^2 * 1e-3)
K12 L1 L2 0.99 ; Coupling coefficient
* Analysis commands
.OP ; DC operating point
.AC DEC 100 1 1MEG ; AC sweep (decade, 100pts, 1Hz to 1MHz)
.TRAN 10u 100m ; Transient (step=10us, stop=100ms)
.PRINT AC V(output_node)
.END
Data center power distribution netlist pattern:
* 480V Three-Phase Data Center Power Distribution
* Phase-to-neutral analysis (480Y/277V system)
*
V_utility line_A 0 AC 277 0 ; Phase A, 277V RMS
*
* Step-down transformer (480V -> 208V/120V)
* Modeled as ideal transformer with series resistance
V_xfmr_sec sec_bus 0 AC 120 0 ; Secondary voltage source (simplified)
R_xfmr_imp sec_bus xfmr_out 0.02 ; Transformer impedance (2%)
*
* UPS input
R_ups_in xfmr_out ups_node 0.005 ; UPS input cable
C_ups_in ups_node 0 0.001 ; UPS input filter
*
* PDU distribution
R_pdu_feeder ups_node pdu_a 0.003
R_branch_1 pdu_a load_1 0.01 ; Branch circuit 1
R_branch_2 pdu_a load_2 0.01 ; Branch circuit 2
*
* Server load models (constant power, linearized)
R_load_1 load_1 0 2.88 ; 5kW at 120V = 2.88 ohm (P = V^2/R)
R_load_2 load_2 0 2.88
*
.OP ; Calculate DC operating point
.PRINT DC V(load_1) V(load_2) I(R_load_1) I(R_load_2)
.END
Generating netlist from power-systems calculations:
- Cable resistance: R = rho*L/A (copper: rho = 1.72e-8 ohm*m)
- Transformer impedance: 2-5% typical for dis