Jelajahi Sumber

docs(thermal): record coupled-vs-steady benchmark + executor enable_thermal plumbing + git recovery

carlin 21 jam lalu
induk
melakukan
a9738cd75a
3 mengubah file dengan 54 tambahan dan 0 penghapusan
  1. 25 0
      docs/CONVERSATION_LOG.md
  2. 16 0
      docs/KNOWLEDGE_BASE.md
  3. 13 0
      docs/TEST_RECORDS.md

+ 25 - 0
docs/CONVERSATION_LOG.md

@@ -1056,3 +1056,28 @@ bearing_temp_c 映射到后轴承(轴向磁通电机热风险侧,前轴承
 导致温升/热阻为负值。热仿真前需把环境温度修正为 25~40°C。
 导致温升/热阻为负值。热仿真前需把环境温度修正为 25~40°C。
 
 
 **待办**:磁热耦合 do_magnetic_thermal_calculation 待实测;热仿真接入执行器 enable_thermal 全链路待验证。
 **待办**:磁热耦合 do_magnetic_thermal_calculation 待实测;热仿真接入执行器 enable_thermal 全链路待验证。
+
+## 2026-09-04 — 磁热耦合实测 + 执行器 enable_thermal 全链路 + git 对象库损坏恢复
+
+**磁热耦合实测**(run_thermal.py --mode coupled):`do_magnetic_thermal_calculation` 耗时 474.2s
+(分离式 134s 的 ~3.5 倍)。磁钢 110.68°C(vs 分离 118.15°C,迭代收敛更低)、绕组热点 76.43°C、
+转矩 0.515 Nm(vs 0.566,温度反馈致剩磁下降)、脉动 2.78%(vs 5.45%)、损耗 42.57W(vs 49.92W)。
+**结论**:磁热耦合更准确但更慢;"电磁+热省时间"应选分离式(先电磁后热,损耗自动传递),
+磁热耦合仅用于温度敏感场景最终复算。
+
+**执行器 enable_thermal 全链路**:5 处透传打通——motorcad.py(adapter 参数)→ task_executor.py
+(MotorCADTaskExecutor 参数)→ run_task_executor.py(build_executors)→ executor_config.py
+(默认值+校验+EXECUTOR_THERMAL env)→ executor_config.json(enable_thermal:false)。默认关闭,
+`EXECUTOR_THERMAL=true` 环境变量可开启。test_executor_config 20 项 + test_adapters 22 项 +
+test_executor_p5m2 8 项全通过。
+
+**⚠ git 对象库损坏事故(已恢复)**:为验证 test_executor_m3 失败是否为既有问题,执行
+`git stash` 时触发了 git 自动 gc,被 shell 超时 SIGTERM 中断,导致 `.git/objects` 的 pack 文件
+与几乎所有 loose 对象被删(仅剩 1 个 commit 对象 `06a99b9`,且其 tree 也丢)。remote 亦不可达。
+**工作区文件全部完整无损**(逐一 grep 校验)。恢复:备份损坏 `.git`→`.git.corrupted.bak`,
+重新 `git init`,恢复 config(remote/user),`.gitignore` 补忽略规则(.git.corrupted.bak、
+.workbuddy、*.png、*.docx、第三方评审、超长文件名论文目录),`git add -A` + 重建提交
+`b8dab74`(244 文件)。**教训:git stash 在中文仓库根路径会触发 gc,切勿在仿真/长任务进行时执行**。
+
+**test_executor_m3 失败定性**:该测试用 TaskExecutor 基类测"claim 拒绝→跳过"逻辑,与本次
+enable_thermal 改动(仅在 MotorCADTaskExecutor 子类)无关,为既有失败,非本次引入。

+ 16 - 0
docs/KNOWLEDGE_BASE.md

@@ -142,6 +142,22 @@ mc.export_results("SteadyState", r"output\raw\thermal.csv")  # 导出热结果
 (绕组 74.6°C 比环境 125°C 还低)。热仿真前应将 `Ambient_Temperature` 设为合理值
 (绕组 74.6°C 比环境 125°C 还低)。热仿真前应将 `Ambient_Temperature` 设为合理值
 (如 25~40°C),否则温升/热阻指标无意义。
 (如 25~40°C),否则温升/热阻指标无意义。
 
 
+**磁热耦合 vs 分离式(2026-09-04 实测对比,TEST-060 续)**:
+
+| 项 | 分离式(先电磁后热) | 磁热耦合 `do_magnetic_thermal_calculation` |
+|---|---|---|
+| 耗时 | 127.8s + 6.0s ≈ 134s | 474.2s(含温度迭代) |
+| 磁钢 active | 118.15°C | 110.68°C(迭代收敛,更低) |
+| 绕组热点 | 74.59°C | 76.43°C |
+| 平均转矩 | 0.566 Nm | 0.515 Nm(温度反馈致剩磁下降) |
+| 转矩脉动 | 5.45% | 2.78% |
+| 总损耗 | 49.92 W | 42.57 W |
+
+**结论**:磁热耦合更准确(磁钢剩磁随温度迭代反馈,磁钢温度低 ~7.5°C),但耗时是
+分离式的 **~3.5 倍**。用户要"电磁+热一起做省时间"应选**分离式**(先
+`do_magnetic_calculation` 拿损耗 → 再 `do_steady_state_analysis`,损耗自动传递,
+已由 `enable_thermal` 实现);磁热耦合仅用于对温度敏感场景的最终复算。
+
 ---
 ---
 
 
 ## 3. .mot 参数语义(AFM 模板,易错!)
 ## 3. .mot 参数语义(AFM 模板,易错!)

+ 13 - 0
docs/TEST_RECORDS.md

@@ -2181,3 +2181,16 @@ P5-M6 引入的 `enable_thermal` 开关使用了两个**不存在的 API**,从
 ### 结论
 ### 结论
 
 
 热仿真链路首次真实跑通,API 与字段名已核实登记。剩余阻塞:模型环境温度异常待确认。
 热仿真链路首次真实跑通,API 与字段名已核实登记。剩余阻塞:模型环境温度异常待确认。
+
+### 补充实测(磁热耦合 vs 分离式,同日)
+
+| 项 | 分离式(先电磁后热) | 磁热耦合 do_magnetic_thermal_calculation |
+|---|---|---|
+| 耗时 | 134s | 474.2s(~3.5×) |
+| 磁钢 active | 118.15°C | 110.68°C |
+| 绕组热点 | 74.59°C | 76.43°C |
+| 平均转矩 | 0.566 Nm | 0.515 Nm |
+| 转矩脉动 | 5.45% | 2.78% |
+| 总损耗 | 49.92W | 42.57W |
+
+**结论**:磁热耦合更准确(温度反馈迭代)但更慢。"省时间"选分离式(enable_thermal 已实现)。