kicad2ems.pcbqs.electrothermal

python -m kicad2ems.pcbqs.electrothermal: a rail's DC drop with its copper at
the temperature it runs at, and the board's temperature from the copper's own
loss and the parts'.

    python -m kicad2ems.pcbqs.electrothermal board.kicad_pcb --rail +5V \
        --volts 5 --load J2=6 --heat U3=1.2 --out et
    python -m kicad2ems.pcbqs.electrothermal board.kicad_pcb --rail +5V \
        --volts 5 --load J2=6 --transient 600 --current-profile pulse:30,90
        # also its temperature over 10 minutes of 30 s bursts
    python -m kicad2ems.pcbqs.electrothermal --describe --json

The DC drop (pcbqs.pdn's: the rail tree and its return, each layer's copper a
sheet, the vias' barrels) puts its loss, each triangle's and each barrel's, into
the thermal model (pcbqs.thermal's grid: the copper and the laminate of every
layer, all nets, the films and the edges) as heat at the triangles' edge
midpoints and at the vias, beside the parts' losses (--heat; --loads-heat: each
load's V x I on its pads). The temperature there sets each triangle's and each
barrel's resistivity,

    rho(T) = rho_20 (1 + alpha (T - 20 C)),  alpha = 0.00393 / K (copper),

and the drop is solved again, until no triangle's temperature moves by more than
--tolerance (K) between two passes (--passes at most; electrothermal.json says
whether it settled). The thermal system is factored once; each pass is a DC
solve and a thermal back-substitution. With --alpha 0 it is the two tools
apart: the DC drop at 20 C and the temperature of its loss.

With --transient SECONDS, the temperature over that long, from cold (or from the
steady state of the profiles' values before t = 0, --start steady): the loads'
current by --current-profile (a share of their DC current; the copper's loss
goes as its square) and each part's loss by --profile REF=SHAPE (pcbqs.thermal.
transient: step, off, pulse, a file). The copper's loss follows its temperature
there too, each point's I^2 R (1 + alpha (T - 20)) / (1 + alpha (T_hot - 20))
about the steady state's current pattern: exact while the current keeps that
pattern (a load current scaled up and down does), the pattern's own shift as the
copper warms left out (the steady passes have it: electrothermal.json gives the
difference at the end).

It writes <out>/electrothermal.json (each load's drop hot and cold, the loss
hot and cold, the copper's hottest point, each part's temperature, the passes),
the figures thermal.png (each layer's temperature) and dc_power_<layer>.png,
dc_ground_<layer>.png (the drop at temperature), electrothermal-transient.json
and .png with --transient, and the temperature and the drop where kicad2ems's
viewer reads results (thermal/viewer.py, pdn/viewer.py).

What it leaves out: the parts' own resistances' temperature (a series part's R
is its value), the current's shift between parallel paths as the copper warms
in the transient (above), and what thermal.py leaves out (air one part warms
reaching another, the film's change with temperature).
kicad2ems.pcbqs.electrothermal.copper_heat(result)[source]
{layer: (x, y, W, tri)} of a DCResult's loss: each triangle's at its
three edge midpoints, a third at each (tri: its triangle's index, -1 for a
barrel's), and each via barrel's at its via, half on each of its two
layers.
kicad2ems.pcbqs.electrothermal.couple(rail, volts, problem, alpha=0.00393, t_sigma=20.0, dmax=1.0, plating=0.025, pitch=0.5, passes=20, tolerance=0.05, log=<function say>, board=None)[source]
The rail's DC drop (pdn.dc.solve_rail's, a rail.Rail at `volts`) and
the problem's temperature solved together (iterate; the module's
docstring); cold and hot are solve_rail's answers. The series parts'
losses (a sense resistor's, a bead's: the cold solve's I^2 R at their
value) heat the board at their pads (board: the thermal problem's board,
default the rail's), unless the problem has a loss for them already.
kicad2ems.pcbqs.electrothermal.iterate(nets, solve_dc, problem, alpha=0.00393, t_sigma=20.0, pitch=0.5, passes=20, tolerance=0.05, log=<function say>, prepare=None)[source]
The DC networks (nets: [pdn.dc.Network]) and the problem's temperature
(thermal.Problem: the board's, with the parts' losses) solved together:
solve_dc() -> (answer, [DCResult]) solves the networks at their present
conductivity, answer a dict with 'loads' ({ref: dict(drop)}). Returns
dict(cold, hot: the answers at t_sigma and at the temperature, cold_dc,
hot_dc: their DCResults, thermal: the grid's Result with the copper's
heat, grid, passes: [dict(largest_change_K, hottest_C, loss_W,
worst_drop_V)], settled, previous: the Result hot was solved at (None:
at t_sigma), seconds). prepare(cold answer): called before the thermal
system is built (the series parts' losses into the problem).
kicad2ems.pcbqs.electrothermal.resistivity(res, nets, alpha, t_sigma=20.0)[source]
Each network's conductivity factor, 1 / (1 + alpha (T - t_sigma)), at a
thermal Result's temperature: [(sheets {layer: (M,)}, vias [one each])],
one for each Network of `nets`; and the triangles' temperatures {id(net):
{layer: (M,) C}} (to compare passes).
kicad2ems.pcbqs.electrothermal.spots(problem, dcs, alpha=0.0, t_sigma=20.0, at=None, name='copper')[source]
The DC results' (dcs: [DCResult]) copper loss as the problem's spots
(Problem.heat_points, in place of any of that name). With alpha and a
thermal Result `at` (the temperature the loss was solved at), each point's
loss is referred to the ambient with its self-heating slope: W' (1 + alpha
(T_a - t_sigma)) and alpha W', W' = W / (1 + alpha (T - t_sigma)), so that
it follows the copper's resistance about this current pattern (the
transient's). Returns the total W (at the ambient).
kicad2ems.pcbqs.electrothermal.thermal_problem(a, board, losses)[source]
thermal.Problem of the board (all its copper) with the parts' losses and
the air's and the parts' options, as the thermal tool builds it.