MICROCRE · RESEARCH SCIENCE
1D heat diffusion: explicit finite differences

Translation pending review.
Description
真正逐时间步求解一维热方程。两端固定为基温,初始温差为正弦模态;同时绘制可直接验证的解析解。输入时间步不满足稳定条件时拒绝运行。
Equation
∂T/∂t=α∂²T/∂x²;Tᵢⁿ⁺¹=Tᵢⁿ+r(Tᵢ₋₁ⁿ−2Tᵢⁿ+Tᵢ₊₁ⁿ);r=αΔt/Δx²≤1/2
Input parameters
- key
length
label计算域长度
Unitmm
Value10
min0.1
max1000
stepany
- key
diffusivity
label热扩散率 α
Unitmm²/s
Value1
min0.001
max1000
stepany
- key
base
label两端基温
Unit°C
Value20
min-200
max1500
stepany
- key
amplitude
label初始正弦温差
UnitK
Value100
min0
max2000
stepany
- key
time
label终止时间
Units
Value5
min0
max1000
stepany
- key
nodes
label空间节点数
Unit1
Value41
min11
max201
step1
- key
dt
label时间步 Δt
Units
Value0.01
min1.0E-6
max10
stepany
Outputs
- key
stability_number
label稳定性数 r
Unit1
- key
time_steps
label时间步数
Unit1
- key
max_error
label对解析解最大绝对误差
UnitK
- key
center_temperature
label中心温度
Unit°C
- key
dx
label空间步长
Unitmm
Assumptions and limits
常热扩散率、无热源、无对流;两端Dirichlet定温。
初始T=T_base+ΔT sin(πx/L);解析解温差乘exp(−απ²t/L²)。
最多20,000时间步;尾步自动截短以恰好到达终止时间。
Limitations
这是有限差分,不是有限元;不含温度相关参数、接触热阻或辐射。
输入上下限仅为计算保护,不是任何设备温度/性能范围。
Model method
FTCS显式Euler时间推进和中心空间差分;21/41/81节点按Δt∝Δx²细化。
Validation
对解析特征模态求L∞误差并验证网格细化约二阶收敛;检查边界和稳定性拒绝逻辑。
Execution and reproduction
python
已实际运行,详见验证报告
matlab
提供可复现源码;当前环境无MATLAB/Octave,未执行
