Code Monkey home page Code Monkey logo

tempdist's Introduction

TempDist: A Scientific Software For Thermal Simulations

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.


Badges


Contents

Installation

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.


Usage

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.


° Prerequisites

TempDist demands the following:

  • Python 3 (made in v3.10.6)

  • Numpy

  • Matplotlib

  • Flet

  • Sys (standart)

  • Pickle (standart)

  • Time (standart)


° Files

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.


Suggested Tests

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.

  1. 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;

Result:

  1. 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;

Result:

  1. 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;

Result:


Author

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.

Gmail Badge instagram Badge

tempdist's People

Contributors

iluminnatti avatar

Watchers

James Cloos avatar  avatar

tempdist's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.