- TypeScript 80.4%
- Go 6.9%
- Makefile 4.3%
- Dockerfile 3%
- SCSS 2.1%
- Other 3.3%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| .forgejo/workflows | ||
| server/frontend | ||
| src | ||
| .gitignore | ||
| Containerfile | ||
| eslint.config.js | ||
| go.mod | ||
| index.html | ||
| main.go | ||
| Makefile | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| screenshot.png | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vite.config.ts | ||
Sand Battery Thermal Simulation
A browser-based simulator for residential sand battery thermal energy storage. Models a full year of charging and discharging using real solar production and weather data, helping you evaluate whether a sand battery could store summer solar surplus to heat your home in winter.
How it works
The simulator uses real 2023 hourly data from PVGIS (EU Joint Research Centre) for a 19 kWp solar installation near Basel, Switzerland. Hourly PV output and ERA5 reanalysis temperature are aggregated into 365 daily records.
Starting from a configurable month (default: April), the simulation runs day by day:
- Charging — On days where solar production exceeds a threshold (default: 15 kWh), excess energy heats the sand via a resistive heater (capped by heater power)
- Draining — On days where ambient temperature drops below a threshold (default: 10°C), heat is extracted from the battery for space heating
- Heat loss — Calculated continuously based on insulation properties, box geometry, and the temperature difference between sand and ambient air
The result is a year-long temperature profile showing how the battery charges through summer, stores heat through autumn, and drains through winter.
Configurable parameters
| Section | Parameters |
|---|---|
| Box & Insulation | Dimensions (L x W x H), insulation thickness and conductivity |
| Fill Material | Choice of 6 materials (playground sand, silica, olivine, magnetite, soapstone, steel shot) with real thermal properties |
| Solar & Heating | Solar excess threshold, drain rate, drain temperature threshold, heater power, start month |
| Heat Exchange & Water | Exchanger efficiency, water flow rate, input/output temperatures |
Quick start
make dev # Start dev server with hot reload
Available commands
make help Show all targets
make dev Start Vite dev server
make build Build frontend for production
make fetch-solar Fetch PVGIS solar data into src/data/solarData.json
make server Build Go server with embedded frontend
make container-build Build container image
make container-run Run container on port 8080
Tech stack
- Frontend: React 19, TypeScript, Carbon Design System, Carbon Charts
- Server: Go with embedded SPA (single binary, ~15 MB container)
- Data: PVGIS v5.3 hourly time series, aggregated to daily records
- Build: Vite, multi-arch container via Kaniko
Refreshing solar data
The solar data is committed as src/data/solarData.json and imported statically. To regenerate it from PVGIS:
make fetch-solar
This fetches hourly data for 2023, aggregates to daily solar production (kWh), average temperature (°C), and sun hours, and writes the JSON file.
