kicad2ems.fem.elmer.thermal

The board's steady temperature with Elmer: heat conducted in all the copper,
the vias and the board material, given off by convection at the board's faces;
heated by parts and by the DC current of a net (as elmer/dc.py solves it), whose
copper's resistance follows its temperature.

    python -m kicad2ems.fem.elmer.thermal board.kicad_pcb \
        --heat Q1=0.3 --heat Q2=0.3 \
        --net VHB --source L3 --load Q1=3 --load Q2=3 --out th_vhb

--heat REF=WATTS puts a part's dissipation into the copper under its pads,
spread evenly (REF.PAD: under that pad only); REF=WATTS@DUTY is a part that
dissipates WATTS for that fraction of the time, heated by the mean. --heat-from
takes every part's dissipation from a circuit run: pcbqs's case.json
(pcbqs.circuit's parts: their power_W, a coupled winding's own loss_W, a
switch's gate drive with it), or any JSON {REF: watts}; FILE@DUTY for a
converter that runs part of the time. A --heat for the same part replaces the
file's figure. The temperature is the steady one for the mean power: right when
the on and off times are short beside the seconds a part's copper takes to warm.
--net, --source and --load are dc.py's: the current's own heat is added, and the
drops are those of the warm copper. Writes <out>/thermal.json (the hottest
point, each part's pad temperature, the drops, the heat balance),
<out>/thermal.png (the board's faces) and Elmer's case with a .vtu in
<out>/elmer.

    from kicad2ems.fem.elmer.thermal import solve
    r = solve(board, 'th', heat={'Q1': 0.3}, nets={'VHB'}, source='L3',
              loads={'Q1': 3.0})
    r['T_max'], r['parts']['Q1'], r['drop_mV']['Q1'], r['balance']

What is left out: the parts' own bodies (a part's heat all enters the board, its
case gives none to the air: the pad temperatures are upper bounds), solder mask,
heat taken by connectors and wires, and radiation and air flow other than as the
one coefficient --htc (W/m2/K; 10 is still air with radiation near 60 C).
kicad2ems.fem.elmer.thermal.circuit_heat(board, path, duty=1.0)[source]
The parts' dissipation from a circuit run, for solve(heat=): ({REF: W},
{name: W left out}). path: a case.json of pcbqs's (pcbqs.circuit's parts:
each one's power_W; a coupled winding's own loss_W, its V·I being the power
it passes on as well; a switch's gate_power_W with it) or a JSON {REF: W}.
Left out: what is not a part with copper pads on the board (the copper
model's ports, the source, the coil and what lies beyond it), what
dissipates nothing, and a coupled winding whose own loss the run did not
measure.
kicad2ems.fem.elmer.thermal.part_pads(board, spec)[source]
[(layer, polygon)] of a part's pads that are copper ('REF'), or of one
pad ('REF.PAD').
kicad2ems.fem.elmer.thermal.picture(path, m, T, result, board=None)[source]
The temperature of the board's top and bottom faces, one scale.
kicad2ems.fem.elmer.thermal.read_vtu(path, name)[source]
A nodal field of an ASCII .vtu, and the points.
kicad2ems.fem.elmer.thermal.sif(m, heat=None, loads=None, htc=10.0, ambient=25.0, k_board=(0.8, 0.3), plating=0.025, max_iterations=20, transient=None)[source]
The .sif. m: layered_mesh's description, its boundaries named 'P:<part>'
(heated), 'I:source' and 'I:<load>'. heat: {part: W}; loads: {ref: A} (None:
no current). transient (s): the board heating from the ambient over that
long instead (R-E21; heat only), BDF2 on steps(), the hottest point and each
part's pads saved each step.
kicad2ems.fem.elmer.thermal.solve(board, out='thermal', heat=None, nets=None, source=None, loads=None, copper=None, htc=10.0, ambient=25.0, h=0.3, hmax=2.0, crop=None, k_board=(0.8, 0.3), plating=0.025, log=<built-in function print>, transient=0.0)[source]
The board's temperatures. heat: {REF or REF.PAD: W}; nets, source, loads:
the net that carries current (as dc.solve), or none; copper: the other nets
kept (None: all the board's). transient (s): also the heating from the
ambient over that long (heat only; R-E21), <out>/thermal-transient.json, and
its summary in the result's `transient`. Returns the dict written to
<out>/thermal.json.
kicad2ems.fem.elmer.thermal.steps(seconds)[source]
A transient's time steps (s): DECADES decades to `seconds`, STEPS equal
steps in each, the first from 0 (as pcbqs's grid transient takes them, so
the two compare step for step).
kicad2ems.fem.elmer.thermal.transient_picture(path, tr, ambient)[source]
Each part's pads and the hottest point against time (log), the steady
values dashed.