PCB thermal analysis revisited

About the development of the FEM module/workbench.

Moderator: bernd

kamocat
Posts: 17
Joined: Mon Jul 11, 2022 10:39 pm

PCB thermal analysis revisited

Post by kamocat »

Having read the previous PCB thermal FEM thread, I thought I would try with a real PCB.
I am testing with a simple GaN FET and driver, a minimal sort of thing where I am still interested in heat dissipation. You can see the KiCAD project here: https://github.com/kamocat/gan_fet
I plan to keep this updated with challenges (and solutions) as they arise.

Meshing
All the solids need to be in a single object to allow a conformal mesh. Boolean Fragments seems to be the best way to do this. (Other options are Fusion and Union, but they are awkward for assigning materials)

Materials
PCB materials aren't in the default database, and most of the default materials don't have thermal properties defined.
I have attached cards for Copper, FR4, and Silicon. I haven't decided what to do for the chip packages, as they aren't homogeneous. Usually the datasheets specify the thermal resistance from the junction to the case. Is there a logical way to model that in FreeCAD?

Copper and Vias
Since FR-4 has such poor thermal conduction, adding copper with pours and thermal vias is a common way to increase heat conduction away from a chip.
Rather than using KicadStepUpMod for this, use the fcad_pcb macro from realthunder.

Code: Select all

import sys,os
import fcad_pcb
from fcad_pcb import kicad
import importlib
importlib.reload(kicad)
from kicad_parser import KicadPCB

filename= "your/file/name"

pcb = kicad.KicadFcad(filename,via_skip_hole=False,via_bound=1)
coppers = pcb.makeCoppers(shape_type='solid', holes=True, fuse=True)
pcb.makeBoard()
Surfaces
Complex PCBs have a lot of surfaces to select, which is tedious in FreeCAD. For now I'm only dissipating heat from the PCB, not the other components.

Radiation and convection
The simplest method of simulating convection is to increase the radiation coefficient. But this doesn't account for the air heating up as it passes. I believe Elmer has convection in its Navier-Stokes algorithm, although I haven't tried this yet.
Attachments
Materials.zip
Copper, FR4, Silicon
(1.62 KiB) Downloaded 8 times
Last edited by kamocat on Tue Jul 19, 2022 11:56 pm, edited 2 times in total.
User avatar
easyw-fc
Veteran
Posts: 3248
Joined: Thu Jul 09, 2015 9:34 am

Re: PCB thermal analysis revisited

Post by easyw-fc »

@kamocat
please keep us updated ... if you nave some intermediate file and screenshot, just post it here...
It is such a long time I'm looking for seeing something in thermal design between kicad and freecad :D
kamocat
Posts: 17
Joined: Mon Jul 11, 2022 10:39 pm

Re: PCB thermal analysis revisited

Post by kamocat »

Here's a really basic thermal analysis:
thermal distribution 2022-07-13_13-53.png
thermal distribution 2022-07-13_13-53.png (57.59 KiB) Viewed 1007 times
Here's what I mean by really basic:
  • Components other than the mosfet are removed to simplify meshing
  • All materials are FR4
  • PCB uniformly radiates at 20W / m^2. This seems reasonable according to one source
  • 5W of power are applied to the top of the mosfet. I think it should actually be applied to the bottom since the solder balls are directly attached to the silicon
Now, heating up the PCB to 438K with only 5W applied seems pretty extreme. However, the PCB is only 10mm x 22mm, so with a radiating area of 0.000450 m^2 it should reach 11000K. Clearly most of the heat isn't even reaching the PCB. Also I need a better heatsink. Maybe some copper will help?

I think the color gradient would be more helpful with a logarithmic scale.
kamocat
Posts: 17
Joined: Mon Jul 11, 2022 10:39 pm

Re: PCB thermal analysis revisited

Post by kamocat »

So I added copper, and got a very weird result: Everything is at absolute zero.
I think I need to double-check the material properties.
thermal distribution 2022-07-13_17-24.png
thermal distribution 2022-07-13_17-24.png (83.86 KiB) Viewed 973 times
User avatar
easyw-fc
Veteran
Posts: 3248
Joined: Thu Jul 09, 2015 9:34 am

Re: PCB thermal analysis revisited

Post by easyw-fc »

kamocat wrote: Thu Jul 14, 2022 12:30 am So I added copper, and got a very weird result: Everything is at absolute zero.
I think I need to double-check the material properties.
if you have used kicaStepUp to add traces, the tool will add traces and pads slightly over the pcb and detached... so it is not really suited for thermal analysis.
You may consider to use fcad_pcb (which library is used inside kSU)
User avatar
Kunda1
Veteran
Posts: 13022
Joined: Thu Jan 05, 2017 9:03 pm

Re: PCB thermal analysis revisited

Post by Kunda1 »

Oooh, really cool topic being discussed here!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
easyw-fc
Veteran
Posts: 3248
Joined: Thu Jul 09, 2015 9:34 am

Re: PCB thermal analysis revisited

Post by easyw-fc »

kamocat wrote: Thu Jul 14, 2022 12:30 am So I added copper, and got a very weird result: Everything is at absolute zero.
I think I need to double-check the material properties.
you may try with this (obtained mixing kSU and fcad_pcb):
gan-fet-fcad-pcb.png
gan-fet-fcad-pcb.png (610 KiB) Viewed 873 times
gan-fet-fcad-pcb.FCStd

Code: Select all

import sys,os
import fcad_pcb
from fcad_pcb import kicad
import importlib
importlib.reload(kicad)
from kicad_parser import KicadPCB

filename= "Your-full-path-to-kicad-pcbnew-file"

pcb = kicad.KicadFcad(filename,via_skip_hole=False,via_bound=1)
coppers = pcb.makeCoppers(shape_type='solid', holes=True, fuse=True)
pcb.makeBoard()
kamocat
Posts: 17
Joined: Mon Jul 11, 2022 10:39 pm

Re: PCB thermal analysis revisited

Post by kamocat »

Wow, this is cool! I can even control the stackup thickness from KiCAD settings!
Simulation took 10 minutes this time, but I am very suspicious of the results.
To avoid crazy temperatures, I set the mosfet to 400K and the back of the PCB to 300K. How then did it end up at 120K??
thermal distribution 2022-07-14_10-26.png
thermal distribution 2022-07-14_10-26.png (71.07 KiB) Viewed 834 times
Also, I did check my material properties for Copper and FR4. Both conduction and specific heat appear correct.
User avatar
easyw-fc
Veteran
Posts: 3248
Joined: Thu Jul 09, 2015 9:34 am

Re: PCB thermal analysis revisited

Post by easyw-fc »

we could ping some FEM gurus
@bernd @HarryvL @thschrader
does mention code work? @easyw-fc
Last edited by easyw-fc on Sat Jul 16, 2022 9:17 am, edited 1 time in total.
NewJoker
Veteran
Posts: 1333
Joined: Sun Oct 11, 2020 7:49 pm

Re: PCB thermal analysis revisited

Post by NewJoker »

A few remarks:
- this geometry is quite complex and mesh should be created carefully and more refined, Netgen might be better in this case
- try using CalculiX solver instead of Elmer
- apart from temperature BCs, you may need some convection fluxes defined for parts being cooled by air (radiation may also be necessary at further stages of the study but convection might already be needed to obtain meaningful results)
Post Reply