Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iammohith/heat-conduction-in-a-cylinder
This repository contains Python codes for analyzing heat conduction in a cylinder, focusing on analytical solutions for temperature distribution under various one-dimensional heat flow conditions. The scripts illustrate how temperature changes over space within the cylinder based on different boundary conditions and initial temperatures.
https://github.com/iammohith/heat-conduction-in-a-cylinder
analytical-solution heat-transfer python
Last synced: about 2 months ago
JSON representation
This repository contains Python codes for analyzing heat conduction in a cylinder, focusing on analytical solutions for temperature distribution under various one-dimensional heat flow conditions. The scripts illustrate how temperature changes over space within the cylinder based on different boundary conditions and initial temperatures.
- Host: GitHub
- URL: https://github.com/iammohith/heat-conduction-in-a-cylinder
- Owner: iammohith
- License: mit
- Created: 2020-04-15T13:33:24.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T11:13:27.000Z (3 months ago)
- Last Synced: 2024-11-16T00:13:35.340Z (about 2 months ago)
- Topics: analytical-solution, heat-transfer, python
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Heat Conduction in a Cylinder
This repository contains Python code for simulating heat conduction in a long cylinder with various boundary conditions, thermal properties, and heat generation. The temperature distribution is calculated and visualized based on the governing heat conduction equations.
## Project Overview
This project explores the thermal behavior of a cylinder with radius $R$, subject to internal heat generation $Q_g$ and external thermal conditions. The wall temperature $T_w$ and the effect of thermal conductivity $K$ are taken into account to calculate the temperature distribution across the cylinder.
### Key Features:
- Solves heat conduction problems with heat generation within the cylinder.
- Visualizes temperature distribution using Python's `matplotlib` library.
- Supports various thermal boundary conditions and parameters like cylinder radius, heat generation, and thermal conductivity.## Formulas Used
### 1. **Temperature Distribution with Heat Generation**
For a long cylinder with radius $R$ and wall temperature $T_w$, the temperature distribution is given by:
$$
T(r) = \frac{Q_g \cdot R^2}{4 \cdot K} \cdot \left(1 - \left(\frac{r}{R}\right)^2\right) + T_w
$$Where:
- $T(r)$ is the temperature at radial distance \( r \) from the center.
- $Q_g$ is the heat generation per unit volume (W/m³).
- $K$ is the thermal conductivity of the cylinder material (W/m·K).### 2. **Temperature Distribution with Fluid Interaction**
When the cylinder is immersed in a fluid with temperature $T_{\infty}$ and heat transfer coefficient $h_c$, the temperature distribution becomes:
$$
T(r) = \frac{Q_g \cdot R^2}{4 \cdot K} \cdot \left(1 - \left(\frac{r}{R}\right)^2\right) + T_{\infty} + \frac{Q_g \cdot R}{2 \cdot h_c}
$$Where:
- $T_{\infty}$ is the surrounding fluid temperature (°C).
- $h_c$ is the convective heat transfer coefficient.### 3. **Convective Heat Transfer Coefficient**
The heat transfer coefficient $h_c$ can be calculated as:
$$
h_c = \frac{Q_g \cdot R}{2 \cdot \theta}
$$Where:
- $\theta = |T_w - T_{\infty}|$ is the absolute temperature difference between the wall and the fluid.## Usage
1. **Clone the repository**:
```bash
git clone https://github.com/iammohith/Heat-Conduction-in-a-Cylinder.git
```2. **Install dependencies**:
Make sure you have Python installed, and then install the required packages:
```bash
pip install numpy matplotlib
```3. **Run the simulations**:
The Python scripts simulate different cases of heat conduction through the cylinder. To run a script, execute:
```bash
python script_name.py
```4. **Modify Parameters**:
You can change parameters such as $T_w$, $T_{\infty}$, $R$, $Q_g$, and $K$ in the scripts to test different thermal scenarios.## Visualizations
The temperature distributions are plotted using `matplotlib`. Each script generates a plot showing the temperature across the cylinder. Here's an example of a typical temperature distribution graph:
- **X-axis**: Distance from the center of the cylinder.
- **Y-axis**: Temperature at that distance.## References
1. **Heat and Mass Transfer: Fundamentals & Applications**
*Afshin J. Ghajar and Yunus A Çengel*2. **Heat and Mass Transfer**
*R.K. Rajput*3. **Python Documentation**
Official Python documentation for libraries like `numpy` and `matplotlib`:
[Python Documentation](https://docs.python.org/3/)## License
This project is open source and available under the [MIT License](LICENSE).