Comparative finite-difference study of the transient 1D heat equation using Python, NumPy and Matplotlib.
The repository investigates numerical stability, transient diffusion behavior and solution accuracy across multiple finite-difference schemes through comparison with the analytical solution.
∂T/∂t = α ∂²T/∂x²
where:
T(x,t)→ temperature distributionα = 0.02 m²/hr→ thermal diffusivity
Initial condition:
- triangular temperature profile
T = 0 Katx = 0andx = 1 mT = 100 Katx = 0.5 m
Boundary condition:
T(0,t) = T(1,t) = 0 K
The following finite-difference schemes are implemented and compared:
-
Explicit FTCS
- forward-time centered-space formulation
- conditionally stable
-
Implicit Laasonen
- implicit tridiagonal formulation
- unconditionally stable
-
Crank–Nicolson
- second-order implicit scheme
- improved transient accuracy
All numerical schemes are benchmarked against the analytical solution for multiple test cases involving varying:
- mesh sizes
- timestep values
- Fourier number conditions
Current investigations include:
- timestep sensitivity
- numerical stability behavior
- transient diffusion response
- explicit scheme instability
- comparative scheme accuracy
project/
│
├── core/
│ ├── analytical_solution.py
│ └── intial_comditions.py
│
├── plots/
│ ├── test_case_1.png
│ ├── test_case_2.png
│ ├── test_case_3.png
│ ├── test_case_4.png
│ ├── test_case_5.png
│ ├── test_case_6.1.png
│ ├── test_case_6.2.png
│ └── test_case_6.png
│
├── solvers/
│ ├── crank_nicolson.py
│ ├── explicit_ftcs.py
│ └── implicit_laasonen.py
│
├── studies/
│ ├── case_1.py
│ ├── case_2.py
│ ├── case_3.py
│ ├── case_4.py
│ └── case_5&6.py
│
├── LICENSE
└──README.md
- restricted to one-dimensional conduction
- constant thermal diffusivity assumption
- no multidimensional extension
- no adaptive meshing
- convergence study not yet implemented
This study investigates foundational numerical behaviors that appear throughout computational heat transfer and broader PDE-based simulation methods.
⭐ If you found this project interesting, consider giving it a star.