Quick Start#
This page walks through a minimal thermal model to get you up and running.
A two-node thermal model and how to solve it with pycanha:#
The simplest possible thermal model has two nodes connected by a conductive coupling. One node is diffusive (its temperature is computed) and the other is at a fixed-temperature boundary.
from pycanha.tmm import Node, NodeType, ThermalMathematicalModel
from pycanha.solvers import SSLU
# 1. Create the model
tmm = ThermalMathematicalModel("QuickStart")
# 2. Add nodes
node1 = Node(1) # diffusive by default
node1.C = 100.0 # thermal capacity [J/K] (not needed for steady-state analysis)
node1.qi = 10.0 # internal heat dissipation [W]
node2 = Node(2)
node2.type = NodeType.BOUNDARY
node2.T = 300.0 # fixed temperature [K]
tmm.add_node(node1)
tmm.add_node(node2)
# 3. Add a conductive coupling GL(1,2) = 0.5 W/K
tmm.conductive_couplings.add_coupling(1, 2, 0.5)
# 4. Solve
solver = SSLU(tmm)
solver.initialize()
solver.solve()
# 5. Read results
T1 = tmm.nodes.get_T(1)
print(f"Node 1 temperature: {T1:.2f} K") # 320.00 K
Key concepts#
- Nodes
Thermal nodes have a defined temperature and a thermal capacity (lumped model). Each node has additional attributes like heat loads (
qi,qs,qa,qe,qr). Nodes are either diffusive (temperature computed by the solver) or boundary (temperature fixed).- Couplings
Thermal couplings define the heat exchange between two nodes. Conductive couplings (
GL) model linear heat transfer, while radiative couplings (GR) model radiative heat flow.- Solvers
- Parameters & Formulas
The parameter system lets you link model quantities (node attributes, coupling values, etc.) to named parameters so you can do parametric analysis easily. See the User Guide for details.
Next steps#
Browse the User Guide for in-depth tutorials
Explore the Examples Gallery gallery
Consult the API Reference for the full class reference