main
John Lauer
Add explicit 3D solid thermal comparison for three compact coolers and parts review
e89f58d
"""Build explicit conductive volumes from the three concept mockups, not vendor CAD."""
from pathlib import Path
import json,sys,subprocess,hashlib
R=Path(__file__).resolve().parents[1];A=R/'analysis/cooling-volume';A.mkdir(exist_ok=True)
geo=json.loads((R/'analysis/cooling-3d/geometry.json').read_text())
exe=Path(sys.argv[1]).resolve()
rows=[]
for name,shapes in geo.items():
for pitch in [2.,1.]:
for h in ([5.,10.,50.,100.,150.] if pitch==2 else [5.,100.]):
bodies=[]
for label,k,match in [('Q1_case',385.,'Q1_drain_tab'),('AlN',170.,'AlN_insulator_nominal'),('spreader',385.,'Spreader_stack_RESERVATION'),('heatsink',200.,'Sink_base_CONCEPT')]:
selected=[s for s in shapes if s['name']==match or (label=='heatsink' and s['name']=='Fin_CONCEPT')]
boxes=[s['origin']+[s['origin'][i]+s['size'][i] for i in range(3)] for s in selected]
# Conservative: exposed underside and package/insulator edges insulated; only heatsink sides/top convect.
bodies.append(dict(name=label,boxesMm=boxes,conductivityWMk=k,convectionWM2k=[h,h,h,h,0,h] if label=='heatsink' else [0]*6,watts=5.5 if label=='Q1_case' else 0,provenance='Concept mockup geometry; constant nominal conductivity assumption, not measured material certificate. Q1 case is an equivalent copper heat-injection surface, not resolved die/package.'))
# Use the previous budget as a conservative contact-area resistance on each of three interfaces.
# 0.02 C-in^2/W per interface = 1.29032e-5 m^2 K/W. Additional unmodeled clamp/flatness allowance below.
# Preserve 0.673 K/W total nominal interface budget with area-specific effective interfaces,
# rather than silently claiming the thinner concept spacer eliminates the previous allowance.
rc=.6727626557059773/(1/200e-6+2/280e-6)
contacts=[dict(bodies=[a,b],resistanceM2kW=rc,provenance='Effective contact allowance distributing retained 0.6727626557 K/W budget over 200/280/280 mm2 interfaces. Solid conduction is additionally modeled; clamp unqualified.') for a,b in [('Q1_case','AlN'),('AlN','spreader'),('spreader','heatsink')]]
spec=dict(name=f'{name}: assumed h={h:g}, pitch={pitch:g}',ambientC=40.,pitchMm=pitch,bodies=bodies,contacts=contacts,assumptions=['CONCEPT screening only: fins/base are approximations, not vendor-confirmed geometry.','Prescribed h is a sensitivity input, not inferred fan RPM or CFD. h=5/10 represents fan-off assumptions; 50/100/150 moving-air assumptions.','No radiation, PCB cooling path, fan self-heat, recirculation, pressure curve, transient behavior or heat pipes.','5.5 W injected at equivalent Q1 copper case. Junction estimate adds 0.42 K/W to hottest case cell conservatively.','Retained 40 C ambient and 55 C case/junction screen ceiling, 10 percent power guard; no hardware rating.','Other PCB heat sources excluded from this cooler-only study; higher-power D1, shunt, traces and protections still require analysis.'])
tag=f'{name}-h{h:g}-p{pitch:g}';src=A/(tag+'.json');src.write_text(json.dumps(spec,indent=2));out=A/tag
subprocess.run([str(exe),'thermal3d','--spec',str(src),'--out',str(out)],check=True)
result=json.loads((out/'thermal3d.json').read_text());case=result['bodies'][0]['maxC'];tj=case+5.5*.42;rt=(tj-40)/5.5
row=dict(id=name,h=h,pitchMm=pitch,cells=result['cellCount'],caseC=case,junctionC=tj,sinkMinC=result['bodies'][3]['minC'],sinkMaxC=result['bodies'][3]['maxC'],conditionalLoadW=15/(1.1*rt),relativeEnergyError=result['relativeEnergyError'],residual=result['relativeResidual'],inputSha256=result['inputSha256'],qualified=False)
rows.append(row);print(json.dumps(row),flush=True)
(A/'summary.json').write_text(json.dumps({'solverSha256':hashlib.sha256(exe.read_bytes()).hexdigest(),'results':rows},indent=2))