kicad2ems.pcbqs.thermal.problem¶
The steady temperature of a board as one problem, which grid.py solves.
The board is a stack of sheets, one per copper layer. A sheet conducts along the
board: its copper (k x thickness where there is copper) and its share of the
laminate (half of the dielectric on each side of it). Sheets next to each other
exchange heat through the dielectric between them (k_z / its thickness, per
area) and through the vias (the plated barrel). The two outer sheets lose heat
to the air through a film coefficient (convection and radiation together,
W/m2/K), and every sheet through the board's edges (the outline and its
cut-outs) over the height of the board it stands for, with the edge's own
coefficient. Heat comes in over the pads of the parts that dissipate: each
part's loss, shared over its pads by their area.
p = Problem.of(board, {'Q1': 0.35, 'D1': 0.5}) # board.json's dict (mm),
# watts per footprint
p.theta = {'Q1': 2.0} # K/W from each part's pads
# to the part itself
# (optional)
A part's temperature is the mean temperature of the copper under its pads plus
its loss times its theta.
Beyond the films (R-E13): a part may have its own path to the air (p.air {part:
K/W}: its body's, or a heatsink's on it), which makes it a node of its own,
joined to its pads through its theta and to the air through that, so its heat
splits between the two; a footprint may be held at a temperature (p.hold(board,
{ref: C}): bolted to a cold plate or a chassis), its pads tied to it.
forced_film gives the faces' coefficient in moving air. grid.py also gives the
heating from cold (its transient), from the board's own heat capacity.
What this leaves out: air warmed by one part reaching another, any change of the
film with temperature, and the heat the parts' bodies hold (a transient's first
seconds). The first makes it read high, never low.
- class kicad2ems.pcbqs.thermal.problem.Held(name: str, layer: int, geom: object, temperature: float)[source]¶
- class kicad2ems.pcbqs.thermal.problem.Layer(name: str, z: float, t: float, copper: object, laminate: float, edge: float = 0.0)[source]¶
- class kicad2ems.pcbqs.thermal.problem.Problem(outline: object, layers: list, gaps: list, vias: list, sources: list = <factory>, powers: dict = <factory>, theta: dict = <factory>, tmax: dict = <factory>, air: dict = <factory>, held: list = <factory>, spots: list = <factory>, film: tuple = (10.0, 10.0), edge_film: float = 10.0, ambient: float = 25.0, k_cu: float = 390.0, plating: float = 0.025, notes: list = <factory>)[source]¶
- barrel(via, gap)[source]¶
A via's conductance across gap `gap` (between layers gap and gap + 1), W/K.
- edges()[source]¶
The board's edges as segments: (a, b) arrays (n, 2) mm, the board on the left going from a to b (the outline anticlockwise, its cut-outs clockwise).
- extend(A, q, covers, spot)[source]¶
The surroundings beyond the films added to a solver's system A x = q (x: the rise over ambient of its n unknowns): each part of self.air a node of its own (n, n + 1, ...), its heat put there rather than on its pads, joined to its pads through its theta (by their shares of its heat) and to the air through its own resistance; each held footprint's pads tied to their temperature by HOLD. covers {id(source): (unknowns, weights summing to 1) or None}: where the solver put each source's heat; spot(layer, geom) -> the same for a held pad. Returns (A, q, read): read(x) -> dict(parts={part: rise of its node}, air_W={part: W}, held_W={footprint: W out through it}).
- heat(name, pads, watts)[source]¶
`watts` into the board over `pads` [(layer name, shapely polygon mm)], shared by area.
- heat_points(name, layer, x, y, W, slope=None)[source]¶
Heat W (watts, at the ambient) at the points x, y (mm) of a layer (its name), each into the cell it lies in; slope: dW/dK at each, its growth with the temperature (the copper's resistance: electrothermal.py).
- hold(board, temperatures)[source]¶
Each footprint's pads {reference: C} held at that temperature (a cold plate, a chassis screw).
- classmethod of(board, losses=None, film=10.0, ambient=25.0, k_cu=390.0, k_xy=0.8, k_z=0.3, plating=0.025, theta=None, edge_film=None)[source]¶
The problem of a board (board.json's dict) with `losses` {footprint reference: W}. film: one value for both faces or (bottom, top). edge_film: the edges' coefficient (default: the mean of the faces'; 0: none).
- class kicad2ems.pcbqs.thermal.problem.Result(method: str, problem: ~kicad2ems.pcbqs.thermal.problem.Problem, T: ~numpy.ndarray, parts: dict, unknowns: int, seconds: dict, out_W: float, size: float, x0: float = 0.0, y0: float = 0.0, notes: list = <factory>, edge_W: float = 0.0, extra: dict = None, transient: dict = None, in_W: float = None)[source]¶
Temperatures, C: T (layers, ny, nx), NaN off the board, cell centres at x0 + (i + 0.5) pitch.
- class kicad2ems.pcbqs.thermal.problem.Source(name: str, layer: int, geom: object, watts: float)[source]¶
- class kicad2ems.pcbqs.thermal.problem.Spot(name: str, layer: int, x: ndarray, y: ndarray, W: ndarray, slope: ndarray = None)[source]¶
Heat at points (a copper's loss map: electrothermal.py), each into the grid's cell it lies in. slope: dW/dK at each point, the loss's growth with the temperature (its copper's resistance), or None.
- kicad2ems.pcbqs.thermal.problem.factor_spd(A)[source]¶
The factor of the symmetric positive definite A (sparse): SuperLU ordered for a symmetric matrix, which on these sheets is two to three times quicker than its default ordering.
- kicad2ems.pcbqs.thermal.problem.forced_film(speed, length_mm, still=10.0)[source]¶
W/m2/K off a face in air moving at `speed` m/s along `length_mm` of board: radiation (RADIATION) and the convection of a laminar flat plate, 3.84 sqrt(v / L) (Nu = 0.664 Re^1/2 Pr^1/3, air near 40 C), joined to the still air's (`still` less its radiation) as assisting flows join, (h_n^3 + h_f^3)^(1/3).
- kicad2ems.pcbqs.thermal.problem.losses_of(case, model)[source]¶
A circuit run's losses as heat per footprint: ({footprint reference: W}, [what was left out and why]). `case` is one case of circuit.json, `model` the circuit model it ran. A source and a load are not on the board; nor is a part bound to a connector (a transformer on flying leads), one board.parts puts off it (null), or one whose pins are on two footprints (a winding between two test points: its loss is its own, not either's). Parts bound to one footprint (the windings of a transformer; a part with one pin off the board) are summed. A coupled winding's V·I is the power it passes to the others as well as its loss: its own loss is its resistances' (loss_W, which the run measures). A switch's gate drive is dissipated in its gate resistance: counted on the switch. An inductor's losses worked out after the run (added_loss_W: circuit/windings.py) are its too.
- kicad2ems.pcbqs.thermal.problem.part_temperatures(problem, board_of, extra=None)[source]¶
{part: dict(power_W, board_C, part_C)} from board_of(source) -> the mean temperature under that source; extra (Problem.extend's read): a part with its own path to the air at its node's temperature, with the heat that path takes (to_air_W).