semi random project to test out carbondesign charting capabilities and dream about having a sand battery https://sand-battery.teixos.net/
  • TypeScript 80.4%
  • Go 6.9%
  • Makefile 4.3%
  • Dockerfile 3%
  • SCSS 2.1%
  • Other 3.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yannick Koechlin d29435591f
All checks were successful
Build Container Image / build-arm64 (push) Successful in 1m9s
Build Container Image / build-amd64 (push) Successful in 1m14s
Build Container Image / manifest (push) Successful in 10s
Add project README with screenshot
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 23:38:17 +01:00
.forgejo/workflows Use ref-sha-epoch container tags for sortable versioning 2026-03-04 22:38:26 +01:00
server/frontend Add Go server, container build, Forgejo CI, and localStorage persistence 2026-03-04 22:25:49 +01:00
src Fix °C symbol rendering, split charts, update insulation default 2026-03-04 23:35:07 +01:00
.gitignore Add Go server, container build, Forgejo CI, and localStorage persistence 2026-03-04 22:25:49 +01:00
Containerfile Add Go server, container build, Forgejo CI, and localStorage persistence 2026-03-04 22:25:49 +01:00
eslint.config.js Initial commit: sand battery thermal simulation 2026-03-04 22:12:21 +01:00
go.mod Add Go server, container build, Forgejo CI, and localStorage persistence 2026-03-04 22:25:49 +01:00
index.html Initial commit: sand battery thermal simulation 2026-03-04 22:12:21 +01:00
main.go Add Go server, container build, Forgejo CI, and localStorage persistence 2026-03-04 22:25:49 +01:00
Makefile Replace 3-phase simulation with year-long model using real PVGIS weather data 2026-03-04 23:26:25 +01:00
package-lock.json Replace 3-phase simulation with year-long model using real PVGIS weather data 2026-03-04 23:26:25 +01:00
package.json Replace 3-phase simulation with year-long model using real PVGIS weather data 2026-03-04 23:26:25 +01:00
README.md Add project README with screenshot 2026-03-04 23:38:17 +01:00
screenshot.png Add project README with screenshot 2026-03-04 23:38:17 +01:00
tsconfig.app.json Replace 3-phase simulation with year-long model using real PVGIS weather data 2026-03-04 23:26:25 +01:00
tsconfig.json Initial commit: sand battery thermal simulation 2026-03-04 22:12:21 +01:00
tsconfig.node.json Initial commit: sand battery thermal simulation 2026-03-04 22:12:21 +01:00
vite.config.ts Initial commit: sand battery thermal simulation 2026-03-04 22:12:21 +01:00

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.

Screenshot

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.