Skip to content

fix(thermal): correct semicon κ, add temp-dependent σ, fix RMS→peak current scaling#34

Merged
amaurigmartins merged 3 commits intoElecta-Git:dev/thermalfrom
MohamedNumair:debug/thermal
Mar 20, 2026
Merged

fix(thermal): correct semicon κ, add temp-dependent σ, fix RMS→peak current scaling#34
amaurigmartins merged 3 commits intoElecta-Git:dev/thermalfrom
MohamedNumair:debug/thermal

Conversation

@MohamedNumair
Copy link
Contributor

Summary

This PR fixes three interconnected bugs in the magneto-thermal FEM formulation that together were producing incorrect steady-state temperature and loss results.

Bug fixes

  • Semicon thermal conductivity: semicon1/semicon2 had κ = 148 W/(m·K) (silicon's value), corrected to 0.4 W/(m·K) per IEC 60287. Updated materials library and all test fixtures.

  • RMS → peak current conversion: GetDP's frequency-domain formulation uses peak amplitudes (A(t) = Re[·exp(jωt)]), so time-averaged Joule losses are P = ½σ|E|². User-supplied RMS currents are now scaled by √2 before being passed to the Current_2D constraint, ensuring losses match I_rms²·R.

  • Temperature-dependent conductivity σ(T): DefineMaterialProps now accepts a temp_dependent_sigma flag. When enabled (MagnetoThermal path), σ is emitted as the GetDP expression σ₀ / (1 + α·(T − T₀)) evaluated at the local temperature field, enabling true electro-thermal coupling.

Improvements

  • Earth-air Dirichlet BC: The earth-air interface is now registered as a physical group in space.jl and added to Sur_Dirichlet_The, correctly fixing ambient temperature at the top soil boundary instead of leaving it unconstrained.

  • Picard iteration for Mag↔The coupling: The MagnetoThermal resolution now uses a 10-step Picard loop (Mag → The → repeat), preceded by a zero-source thermal solve to initialize T = T_ambient everywhere and avoid σ(0 K) singularities.

…IEC 60287) from 148 W/(m·K) which was incorrect. Updated in materials library and all test files. Also added earth-air interface as physical group for thermal Dirichlet BC in space.jl.
…d register earth-air interface for thermal Dirichlet BC
@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (dev/thermal@c03f62b). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/engine/fem/solver.jl 0.00% 22 Missing ⚠️
src/engine/fem/space.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev/thermal     #34   +/-   ##
=============================================
  Coverage               ?   0.47%           
=============================================
  Files                  ?     100           
  Lines                  ?    7935           
  Branches               ?       0           
=============================================
  Hits                   ?      38           
  Misses                 ?    7897           
  Partials               ?       0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amaurigmartins amaurigmartins merged commit be9b6bd into Electa-Git:dev/thermal Mar 20, 2026
5 checks passed
@amaurigmartins amaurigmartins deleted the debug/thermal branch March 20, 2026 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants