djsilva99 / heatrapy

Python library for simulating heat transfer processes
https://djsilva99.github.io/heatrapy
MIT License
72 stars 14 forks source link

Shape with inner and outer radius #39

Closed AsimAl-Sofi closed 2 days ago

AsimAl-Sofi commented 2 weeks ago

hi I would like to use the package to calculate the underground cable heat distribution. However, I was not able to build the cable layers, i.e., how to create a shape with inner and outer radius? Is that possible?

djsilva99 commented 2 weeks ago

Hello

As far as I understand, you can change the material in two stages. Let's say that the 2D object is made of material_1. Then you can define the outer radius:

>>> example.change_material(
...     material='material_2',
...     shape='circle',
...     initial_point=(5, 5),
...     length=5
... )

and then the inner radius:

>>> example.change_material(
...     material='material_1',
...     shape='circle',
...     initial_point=(5, 5),
...     length=2
... )

This gives you a shell of thickness = 3.

AsimAl-Sofi commented 1 week ago

Thanks for the explanation In the tutorial on the site, the circle does not look smooth. Is it also possible to increase the resolution of the added shapes?

djsilva99 commented 1 week ago

Yes. When you instantiate a SingleObject2D you define the size attribute. There, you can increase it, e.g., from the default value of (10, 10) to (100, 100). However, note that:

AsimAl-Sofi commented 2 days ago

Thank you for your explanation