TempDist is a python-based software that uses the finite-difference method and the Gauss-Seidel's method to find and plot the temperature distribution in a conducting material.
Firt, you must install git in your device. Get the latest version here or, in ubuntu/debian, you can open terminal and type the following commands
$ apt-get install git
For Ubuntu, this PPA provides the latest stable upstream Git version
$ add-apt-repository ppa:git-core/ppa
$ apt update
$ apt install git
In a folder on your device, open powershell/terminal and type the following command:
$ git clone https://www.github.com/iluminnatti/TempDist.git
Once the files have been downloaded, you must install python and the python libraries used in this project. Get python here for Windows. For ubuntu, do the following in terminal (OBS: make sure you are logged in as a user with sudo privileges):
$ sudo apt update
#Update your local system's repository list
$ sudo apt install python3
#Download the latest version of Python:
$ sudo apt install python3-pip
#install pip3 to manage libraries
Look in your editor for the python library download tool and install:
- numpy
- matplotlib
- flet
In ubuntu, you can do the following:
$ pip install numpy
#installs numpy
$ pip install matplotlib
#installs matplotlib
$ pip install flet
#installs flet
After this, TempDist is ready to work.
The root of TempDist is the main.py file. Execute it in your code interpreter.
Once executed, it will open a user interface, in which the user can enter the simulation boundary conditions.
Fill in all the fields, click the `submit` button and then close the window, as shown in the image.
When sending the data and closing the window, the software will operate the data and, finally, return the plotted graph of the temperature distribution of the analyzed system on the folder "FigFinal", as in the following.
TempDist demands the following:
-
Python 3 (made in v3.10.6)
-
Numpy
-
Matplotlib
-
Flet
-
Sys (standart)
-
Pickle (standart)
-
Time (standart)
The role of each file in TempDist is descibed below.
MeshF.py: Responsible for generating the nodal network, dividing the conductor dimensions into an nxn nodal mesh and generating the coordinate matrix of the nodes. In addition, it is also responsible for identifying neighboring nodes to a given node given as a parameter, also identifying which of them are on any of the borders and on which of the borders it is located. The scientific library for Python Numpy is used for this module. In addition, an object-oriented system works here to define the “mesh” class that represents the field of nodes, which has attributes that identify the number of nodes, the dimensions of the network, etc.
plots.py: Responsible, since we already have the final temperature matrix for each node, for building the temperature field graph using the scientific library for Python Matplotlib and the Numpy library for organizing the base data.
interface.py: Responsible for receiving input data. It is necessary to insert the boundary conditions of the system and the dimensions/characteristics of the conductor, which will be key to obtain the temperature distribution. Therefore, such a module is responsible for data entry, using the `flet` module, wich enables to easily build realtime web, mobile and desktop apps in Python. You can find more here.
main.py: As the name says, it is the root of the application, responsible for treating the inserted boundary conditions, applying the finite difference method to identify the coefficients of the matrices related to the phenomenon, and then using the Gauss-Seidel Method to solve the linear equations created from the matrices found.
Here are some suggestions of tests, based on real-world data, such as thermal conductivity of some metals, conduction heat transfer coefficient of real fluids, etc.
- Base case
- North boundary:
- Convective;
- Fluid temperature: 300 K (room temperature);
- Convection heat transfer coefficient: 5-25 W/m².K (natural convection of the air);
- East boundary:
- Conductive;
- Temperature: 500 K (~227°C);
- South boundary:
- Conductive;
- Temperature: 500 K (~227°C);
- West boundary:
- Conductive;
- Temperature: 500 K (~227°C);
- Thermal conductivity: 69.4-54.7 W/m.K(iron at 500 K);
- Conductor Dimensions: 1m x 1m;
- Mesh size: 50 x 50;
- North boundary:
Result:
- Two convective borders
- North boundary:
- Convective;
- Fluid temperature: 327 K (~54°C);
- Convection heat transfer coefficient: 5-25 W/m².K (natural convection of the air);
- East boundary:
- Conductive;
- Temperature: 594 K (~321°C);
- South boundary:
- Convective;
- Fluid temperature: 297 K (~24°C);
- Convection heat transfer coefficient: 5-25 W/m².K (natural convection of the air);
- West boundary:
- Conductive;
- Temperature: 671 K (~398°C);
- Thermal conductivity: 33-36 W/m.K(Steel - Carbon 1.5% C at nearly 673 K);
- Conductor Dimensions: 2m x 5m;
- Mesh size: 60 x 60;
- North boundary:
Result:
- Three convective borders
- North boundary:
- Convective;
- Fluid temperature: 297 K (~24°C);
- Convection heat transfer coefficient: 300-6000 W/m².K (forced convection of the water);
- East boundary:
- Convective;
- Fluid temperature: 345 K (~72°C);
- Convection heat transfer coefficient: 300-6000 W/m².K (forced convection of the water);
- South boundary:
- Conductive;
- Temperature: 593 K (~320°C);
- West boundary:
- Convective;
- Fluid temperature: 276 K (~3°C);
- Convection heat transfer coefficient: 300-6000 W/m².K (forced convection of the water);
- Thermal conductivity: ~35 W/m.K(Steel - Carbon 1.5% C at nearly 600 K);
- Conductor Dimensions: 20m x 20m;
- Mesh size: 60 x 60;
- North boundary:
Result:
This entire project was made by myself, Marcos Túlio Barbosa Abreu, Physics student at UFMG, Minas Gerais, Brazil. If you want to contact me, here are my social media and emails.