A completed two-dimensional steady-state heat-conduction solver written in Rust using the cell-centered Finite Volume Method.
The project demonstrates the main numerical workflow directly: spatial discretization, boundary-condition treatment, iterative solution, convergence monitoring, structured output, and result visualization. The current stable snapshot is published as v1.0.0.
- cell-centered Finite Volume Method
- structured Cartesian mesh
- steady-state two-dimensional heat conduction
- fixed-temperature boundary conditions
- Gauss-Seidel iterative solution
- residual-based convergence monitoring
- CSV export for post-processing
- SVG temperature-field generation
- no external numerical or plotting libraries
- GitHub Actions build, execution, and output checks
The current case models heat conduction through a square plate. The west wall is heated, while the remaining walls are maintained at a lower fixed temperature.
| Property | Value |
|---|---|
| Domain | 0.5 m × 0.5 m |
| Grid | 80 × 80 control volumes |
| West wall temperature | 400 K |
| East wall temperature | 300 K |
| North wall temperature | 300 K |
| South wall temperature | 300 K |
| Thermal conductivity | 1000 W/(m·K) |
| Plate thickness | 0.01 m |
| Convergence tolerance | 1.0e-6 K |
The temperature difference produces a fully two-dimensional field inside the plate.
For steady heat conduction with constant thermal conductivity:
∇ · (k∇T) = 0
The equation is integrated over each control volume and written in finite-volume form:
aP TP = aE TE + aW TW + aN TN + aS TS + Su
The prescribed wall temperatures are introduced through finite-volume source terms. The algebraic equations are solved using Gauss-Seidel iteration until the maximum temperature change between consecutive iterations falls below the configured tolerance.
.
├── .github/
│ └── workflows/ci.yml
├── src/
│ └── main.rs
├── results/
│ ├── temperature.csv
│ ├── residuals.csv
│ ├── summary.txt
│ └── temperature.svg
├── Cargo.toml
├── Cargo.lock
├── CITATION.cff
├── LICENSE
└── README.md
Clone the repository and run the locked release build:
git clone https://github.com/Kandil2001/Rust-FVM-Heat-Conduction.git
cd Rust-FVM-Heat-Conduction
cargo run --release --lockedFor GitHub Codespaces, install Rust first when cargo is unavailable:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"
cargo run --release --lockedThe Rust CI workflow runs on pushes and pull requests to main. It:
- installs the stable Rust toolchain
- checks the locked Cargo project
- builds the release binary
- runs the default heat-conduction case
- verifies that the four expected result files were generated
This confirms that the tagged implementation builds and completes its default workflow. It is a software execution check, not an independent physical validation study.
Each successful run updates:
temperature.csv— temperature at every control-volume centerresiduals.csv— convergence historysummary.txt— simulation setup and final solver valuestemperature.svg— temperature-field visualization used in this README
The CSV files can be opened in Python, MATLAB, Excel, or another post-processing tool.
This completed project focuses on a clear and compact finite-volume treatment of one two-dimensional diffusion case. It exposes coefficient assembly, boundary source terms, iterative updates, convergence checks, and output generation without hiding the numerical steps behind an external CFD library.
The current scope is intentionally limited to:
- steady conduction
- constant material properties
- a uniform structured grid
- fixed-temperature boundaries
- one Gauss-Seidel solver
- one demonstration case
Validation against an independent analytical or numerical reference was not part of the completed baseline project. The output should therefore be treated as a numerical implementation demonstration rather than a formally validated research result.
- heat-flux and convection boundary conditions
- internal heat generation
- transient conduction
- nonuniform grids
- Jacobi and Successive Over-Relaxation comparisons
- grid-refinement and independent validation studies
- parallel implementations for larger cases
The first stable repository snapshot is v1.0.0. Use the metadata in CITATION.cff when citing the software.
Ahmed Kandil — Portfolio · LinkedIn · ORCID
Released under the MIT License.