name: thermal-analysis description: 电子系统热建模与分析技能,用于结温计算、散热器选择、热阻网络和安全工作区验证。 allowed-tools: Read, Grep, Write, Bash, Edit, Glob category: 热管理 backlog-id: SK-025 metadata: author: babysitter-sdk version: “1.0.0”
热分析技能
用于电子系统可靠组件运行的热建模与分析。
目的
本技能为电子系统提供全面的热分析能力,从组件级结温计算到系统级热管理设计。它支持散热器选择、热界面材料评估和安全工作区验证。
能力
结到环境热阻
- 热阻网络建模
- 结到外壳(theta_jc)计算
- 外壳到散热器(theta_cs)与TIM分析
- 散热器到环境(theta_sa)特性分析
- 总热路径分析
散热器选择与优化
- 自然对流散热器尺寸确定
- 强制对流性能估算
- 给定约束下的翅片优化
- 散热器比较与选择
- 定制散热器规格
- 安装和界面考虑
强制对流分析
- 风扇气流需求计算
- 通过外壳的压降
- 流动阻抗匹配
- 热阻与气流曲线
- 风扇工作点确定
PCB热分析
- 铜扩散电阻计算
- 过孔热导率
- 多层板热建模
- 热点识别
- 热缓解焊盘分析
热界面材料选择
- TIM热导率要求
- 接触电阻估算
- 相变材料 vs 导热硅脂 vs 间隙填充垫
- 粘合线厚度影响
- 长期可靠性考虑
瞬态热分析
- 热时间常数确定
- 脉冲功率处理
- Foster和Cauer RC网络模型
- 瞬态热阻抗曲线
- 峰值温度预测
安全工作区验证
- SOA曲线解读
- 直流和脉冲操作限制
- 二次击穿考虑
- 热失控检测
- 可靠性降额
降额曲线应用
- 基于温度的功率降额
- 最大结温限制
- 可靠性与性能权衡
- 组件特定降额指南
CFD仿真设置指导
- 边界条件定义
- 电子设备网格要求
- 湍流模型选择
- 辐射建模考虑
- 结果验证方法
先决条件
安装
pip install numpy scipy matplotlib pandas
可选依赖项
# 用于高级热建模
pip install CoolProp # 流体属性
# 用于优化
pip install scipy
# 用于可视化
pip install plotly
使用模式
热阻网络分析
import numpy as np
from dataclasses import dataclass
from typing import List, Optional
@dataclass
class ThermalComponent:
"""表示热阻元件"""
name: str
theta: float # 热阻 (C/W)
power: float = 0.0 # 功耗 (W)
class ThermalNetwork:
"""用于电子设备的1D热阻网络"""
def __init__(self):
self.components: List[ThermalComponent] = []
self.ambient_temp = 25.0 # 摄氏度
def add_resistance(self, name: str, theta: float, power: float = 0.0):
self.components.append(ThermalComponent(name, theta, power))
def calculate_temperatures(self, total_power: float) -> dict:
"""计算每个节点的温度"""
temperatures = {'ambient': self.ambient_temp}
current_temp = self.ambient_temp
# 从环境温度反向计算到结温
for comp in reversed(self.components):
delta_t = total_power * comp.theta
current_temp += delta_t
temperatures[comp.name] = current_temp
return temperatures
def total_thermal_resistance(self) -> float:
return sum(c.theta for c in self.components)
def max_power_for_tj(self, tj_max: float) -> float:
"""计算给定结温下的最大功率"""
theta_ja = self.total_thermal_resistance()
return (tj_max - self.ambient_temp) / theta_ja
# 示例:MOSFET热分析
network = ThermalNetwork()
network.ambient_temp = 40.0 # 升高的环境温度
# 添加热路径组件
network.add_resistance('theta_jc', 0.5) # 结到外壳
network.add_resistance('theta_cs', 0.2) # 外壳到散热器 (TIM)
network.add_resistance('theta_sa', 2.0) # 散热器到环境
# 计算温度
power = 50.0 # 瓦特
temps = network.calculate_temperatures(power)
print(f"结温: {temps['theta_jc']:.1f}C")
print(f"外壳温度: {temps['theta_cs']:.1f}C")
print(f"散热器温度: {temps['theta_sa']:.1f}C")
# 最大功率计算
tj_max = 150.0 # 数据表中的最大结温
max_power = network.max_power_for_tj(tj_max)
print(f"在Tambient={network.ambient_temp}C时的最大功率: {max_power:.1f}W")
散热器选择
import numpy as np
class HeatSinkCalculator:
"""散热器热计算"""
@staticmethod
def natural_convection_theta(length_mm: float, width_mm: float,
height_mm: float, num_fins: int,
fin_thickness_mm: float = 1.5) -> float:
"""使用自然对流关联式估算挤压铝散热器的热阻"""
# 转换为米
L = length_mm / 1000
W = width_mm / 1000
H = height_mm / 1000
t_fin = fin_thickness_mm / 1000
# 基座面积
A_base = L * W
# 翅片间距
s = (W - num_fins * t_fin) / (num_fins - 1) if num_fins > 1 else W
# 翅片表面积(两侧)
A_fins = 2 * num_fins * L * H
# 总表面积
A_total = A_base + A_fins
# 自然对流系数估算(垂直翅片的典型值)
h = 10 # W/(m^2*K) 自然对流的典型值
# 翅片效率(简化)
k_al = 200 # W/(m*K) 铝的导热系数
m = np.sqrt(2 * h / (k_al * t_fin))
eta_fin = np.tanh(m * H) / (m * H)
# 有效面积
A_eff = A_base + eta_fin * A_fins
# 热阻
theta_sa = 1 / (h * A_eff)
return theta_sa
@staticmethod
def forced_convection_theta(theta_natural: float, velocity_m_s: float) -> float:
"""基于自然对流值和风速估算强制对流热阻"""
# 经验关联式:强制对流比自然对流好得多
# 典型改进因子
velocity_factor = np.sqrt(velocity_m_s / 0.25) # 归一化到典型自然对流
improvement = min(velocity_factor * 3, 10) # 改进上限为10倍
return theta_natural / improvement
# 示例:为75W功耗选择散热器
calculator = HeatSinkCalculator()
# 散热器候选
candidates = [
{'name': '小型', 'L': 50, 'W': 50, 'H': 25, 'fins': 10},
{'name': '中型', 'L': 75, 'W': 75, 'H': 35, 'fins': 15},
{'name': '大型', 'L': 100, 'W': 100, 'H': 50, 'fins': 20},
]
power = 75 # 瓦特
tj_max = 125
ta = 40
theta_jc = 0.3
theta_cs = 0.15
required_theta_sa = (tj_max - ta) / power - theta_jc - theta_cs
print(f"所需theta_sa: {required_theta_sa:.2f} C/W")
print("
散热器比较(自然对流):")
for hs in candidates:
theta = calculator.natural_convection_theta(
hs['L'], hs['W'], hs['H'], hs['fins']
)
tj = ta + power * (theta_jc + theta_cs + theta)
status = "通过" if tj <= tj_max else "失败"
print(f"{hs['name']}: theta_sa={theta:.2f} C/W, Tj={tj:.1f}C [{status}]")
瞬态热分析
import numpy as np
import matplotlib.pyplot as plt
class TransientThermal:
"""使用Foster RC网络进行瞬态热分析"""
def __init__(self, tau_values: List[float], r_values: List[float]):
"""
使用Foster网络参数初始化
tau_values: 时间常数(秒)
r_values: 热阻贡献(C/W)
"""
self.tau = np.array(tau_values)
self.r = np.array(r_values)
def thermal_impedance(self, time: float) -> float:
"""计算给定时间的Zth(t)"""
zth = np.sum(self.r * (1 - np.exp(-time / self.tau)))
return zth
def temperature_rise(self, power: float, time: float) -> float:
"""计算恒定功率下的温升"""
return power * self.thermal_impedance(time)
def pulsed_power_analysis(self, power: float, t_on: float, t_off: float,
num_pulses: int) -> np.ndarray:
"""分析脉冲功率下的温度"""
dt = min(t_on, t_off) / 100
total_time = num_pulses * (t_on + t_off)
time = np.arange(0, total_time, dt)
temp_rise = np.zeros_like(time)
for i, t in enumerate(time):
# 脉冲响应的叠加
for pulse in range(num_pulses):
pulse_start = pulse * (t_on + t_off)
pulse_end = pulse_start + t_on
if t > pulse_start:
# 添加脉冲开始的加热
temp_rise[i] += power * self.thermal_impedance(t - pulse_start)
if t > pulse_end:
# 减去脉冲结束的冷却
temp_rise[i] -= power * self.thermal_impedance(t - pulse_end)
return time, temp_rise
# 示例:MOSFET瞬态热分析
# 来自数据表的Foster网络参数
tau = [0.001, 0.01, 0.1, 1.0] # 秒
r = [0.05, 0.1, 0.15, 0.2] # C/W
thermal = TransientThermal(tau, r)
# 单脉冲分析
pulse_power = 100 # 瓦特
pulse_duration = 0.05 # 50毫秒
temp_rise = thermal.temperature_rise(pulse_power, pulse_duration)
print(f"{pulse_power}W, {pulse_duration*1000}毫秒脉冲的温升: {temp_rise:.1f}C")
# 稳态
temp_steady = thermal.temperature_rise(pulse_power, 10.0)
print(f"稳态温升: {temp_steady:.1f}C")
安全工作区检查
class SOAChecker:
"""安全工作区验证"""
def __init__(self, vds_max: float, id_max: float, pd_max: float,
tj_max: float, theta_jc: float):
self.vds_max = vds_max
self.id_max = id_max
self.pd_max = pd_max
self.tj_max = tj_max
self.theta_jc = theta_jc
def check_dc_operation(self, vds: float, id: float, tc: float) -> dict:
"""检查工作点是否在直流SOA内"""
power = vds * id
tj = tc + power * self.theta_jc
checks = {
'vds_ok': vds <= self.vds_max,
'id_ok': id <= self.id_max,
'power_ok': power <= self.pd_max,
'tj_ok': tj <= self.tj_max,
}
checks['all_ok'] = all(checks.values())
checks['power'] = power
checks['tj'] = tj
return checks
def max_current_at_voltage(self, vds: float, tc: float) -> float:
"""计算给定电压和外壳温度下的最大电流"""
# 基于Tj的功率限制
max_power_thermal = (self.tj_max - tc) / self.theta_jc
max_power = min(max_power_thermal, self.pd_max)
# 功率限制的电流
id_power = max_power / vds if vds > 0 else self.id_max
# 取最严格的限制
return min(id_power, self.id_max)
# 示例:MOSFET SOA检查
soa = SOAChecker(
vds_max=100, # V
id_max=50, # A
pd_max=200, # W
tj_max=150, # C
theta_jc=0.5 # C/W
)
# 检查工作点
result = soa.check_dc_operation(vds=40, id=4, tc=80)
print(f"工作点检查: {result}")
# 生成SOA曲线
vds_points = np.logspace(0, 2, 50) # 1V到100V
id_curve = [soa.max_current_at_voltage(v, 80) for v in vds_points]
print(f"在Vds=40V, Tc=80C时的最大电流: {soa.max_current_at_voltage(40, 80):.1f}A")
使用指南
何时使用此技能
- 设计期间的组件热验证
- 散热器选择和规格制定
- 热界面材料选择
- PCB热管理设计
- 过热组件的故障分析
最佳实践
- 使用制造商的热数据(如果可用)
- 为热计算添加余量(通常为10-20%)
- 考虑最坏情况的环境温度
- 考虑TIM和风扇的老化
- 通过热测量验证计算
- 在设计评审中记录热假设
流程集成
- ee-switching-power-supply-design(热管理)
- ee-motor-drive-design(功率级热管理)
- ee-hardware-validation(热特性分析)
- ee-dfm-review(热设计评审)
依赖项
- numpy: 数值计算
- scipy: 散热器选择的优化
- matplotlib: 热可视化
参考文献
- Ellison, G. “电子设备热计算”
- Sergent & Krum, “热管理手册”
- Infineon、ON Semi、TI的应用笔记