PyTherm
2D Heat Conduction Simulator
v1.1.0  ·  Made by Craig “Duke” Smith  ·  2026
⌖  github.com/dukesmith0/pytherm
PyTherm is an interactive 2D heat conduction simulator for the desktop. Paint a grid of real engineering materials, set fixed-temperature heat sources or constant heat flux sources, and watch Fourier conduction propagate in real time. Built with Python, PyQt6, and NumPy for students, educators, and thermal engineers who want to explore thermal behavior without spinning up a full FEA suite.

Get It

Download v1.1.0 View on GitHub

Features

196
Built-in engineering materials
Metals, ceramics, polymers, construction, electronics, gases, liquids, minerals, and earth materials across 26+ subcategories. Create custom materials with your own properties.
CFL
Per-cell adaptive sub-stepping
Explicit FDM with harmonic-mean conductivity at interfaces. Per-cell CFL stability analysis is up to 2000x more efficient than global CFL for mixed-material grids.
Heat flow vectors
Per-cell arrows showing heat flow direction and magnitude. Auto-decimated by zoom level with two-pass rendering for contrast.
Three view modes
Material view, live temperature heatmap, and heat flow rate (W). Toggle with toolbar buttons or Q key.
Isotherms and hotspots
Temperature contour lines over the heatmap. Highlight cells above a threshold in red. Customizable colors and line width.
Fixed-T and heat flux sources
Pin cells to fixed temperatures or set constant flux (W/m² or W/m³). Negative flux for cooling. Volumetric or surface mode.
Energy conservation display
Real-time stored energy, reference energy, and conservation error. Confirms solver correctness at a glance.
Thermal resistance report
Compute R_th = dT/Q between source and sink cells. Copy results for engineering documentation.
Temperature vs. time plots
Dockable plot panels with synchronized crosshairs. Pin points, Shift+click for cross-panel sync. Save as .pythermplot.
Convergence graph
Log-scale dT/dt vs time. Threshold line shows when steady state is reached. Auto-pause on convergence.
Light and dark themes
QPalette-based theming. Canvas, sidebar, plots, legend, tooltips, and dialogs all adapt. Dark default.
15 example templates
From 1D conduction bars to nuclear fuel rods, thermos flasks, re-entry tiles, and thermoelectric coolers.
Draw, fill, and select tools
Paint cells, flood-fill regions, select and group-edit. Protected cells skip draw/fill/delete/paste.
Command palette
Ctrl+Shift+P opens fuzzy search for all actions and materials. 30+ keyboard shortcuts.
Four temperature units
Display in °C, K, °F, or Rankine. Type values with unit suffix (100C, 373K) to auto-convert.
Step history navigation
Browse past temperature snapshots with [ and ] keys. Escape returns to present state.

Technical Details

SolverExplicit forward Euler FDM with per-cell CFL sub-stepping
Interface modelHarmonic mean of k at cell interfaces (series resistance analogy)
Boundary conditionsInsulated (zero flux) or Fixed-T (ambient) per edge
Steady-stateRate-based detection: max |dT|/dt < 0.01 K/s (configurable)
Grid size1×1 to 200×200 cells, configurable cell size
Internal unitsKelvin (conversions at display layer only)
StackPython 3.10+, PyQt6, NumPy
Tests144 pytest tests (solver, grid, I/O, rendering, UI)
LicenseMIT

Getting Started

Option A: Standalone executable — no Python required

1
Download
Go to the latest release and download the executable for your platform (Windows, macOS, or Linux).
2
Run
Double-click the downloaded file. No installation needed.

Option B: From source — for development or customization

1
Clone and install
git clone https://github.com/dukesmith0/pytherm.git
cd pytherm
pip install -r requirements.txt
2
Run
python main.py

Attribution

Built by Craig “Duke” Smith. Released under the MIT License. Contributions and bug reports welcome on GitHub Issues.