AlexDev

Join the Gang Gang and have the latest AI and Tech content.

Home page View on GitHub

GPU Heat Simulation

Posted on 11 October 2023.
cpp GPU parallel

About

In this project I implemented a GPU-accelerated application that simulates the heat propagation on a conductive metal plate. The progress of the simulation is displayed through a 2D thermal imaging animation.

Consider an environment which contains a 2D heat-conductive metal plate. The plate has an initial temperature and is surrounded by air. Then we can introduce a small constant heat source on the metal plate and observe how the heat progressively spreads on the surface.

Usage

The simulation parameters must be written in the config.in file, in the root directory. You can specify the platform of your preferred GPU, the width and height in pixels of the plate, its initial temperature, the air’s temperature and the source temperature.

platform:Intel
width:640
height:480
initial_temp:30.0
air_temp:40.0
point_temp:5500.0
Config file example (in Notepad, yes).

The heat source can be moved using the mouse. Also, some initial parameters, such as the point temperature and the air temperature, can be changed during the simulation. To prove that this simulation runs better using a GPU, I added the possibility to balance the load of computation between the GPU and the CPU. This can be done using the slider labeled “f” in the simulation. When f is equal to 100, the simulation is running only on the GPU, otherwise the CPU will use 4 threads to make some calculations as well.

Simulation Exmple of the Heat Transfer.

Conclusion