Skip to content

Commit

Permalink
add example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
gituser789 committed Aug 7, 2024
1 parent 4a5d8e4 commit ed757b6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ cd HCT_heat_sink_computation_toolbox/
pip install -e .
```

## Usage and examples
Check out the examples in [this directory](examples/).


## Literature
This toolbox implements the thermal basics according to the following paper:
```
Expand Down
21 changes: 21 additions & 0 deletions examples/heat_sink_fan_calculation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Example for a R_th calculation for a given heat sink geometry and a single fan."""
# import 3rd party libraries
import numpy as np

# import own libraries
import hct

constants = hct.init_constants()
t_ambient = 40

geometry = hct.Geometry(length_l=100e-3, width_b=40e-3, height_d=3e-3, height_c=30e-3, number_fins_n=5,
thickness_fin_t=1e-3, fin_distance_s=0, alpha_rad=np.deg2rad(40), l_duct_min=5e-3)
geometry.fin_distance_s = hct.calc_fin_distance_s(geometry)

fan_name = 'orion_od4010m.csv'

volume_flow, pressure = hct.calc_volume_flow(fan_name, geometry, plot=True)

r_th_sa = hct.calc_final_r_th_s_a(geometry, constants, t_ambient, volume_flow)

print(f"{r_th_sa=}")
1 change: 1 addition & 0 deletions hct/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
from hct.hydrodynamic import *
from hct.optimization import *
from hct.heat_spreading import *
from hct.generalplotsettings import *
11 changes: 7 additions & 4 deletions hct/hydrodynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# hct libraries
from hct.thermal_dataclasses import *
from hct.cooling_system import *
from hct.generalplotsettings import *

def calc_delta_p_heat_sink(f_app: float, k_se, k_sc, constants: Constants, geometry: Geometry, d_h: float, mean_u_hs: float):
"""
Expand Down Expand Up @@ -279,11 +280,11 @@ def calc_volume_flow(fan_name: str, geometry: Geometry, plot: bool = False):
fan_cubic_meter_second, result_list_delta_p_total, fan_pressure_drop_pascal)

if plot:
plt.plot(fan_cubic_meter_second, np.array(result_list_delta_p_total), label='delta p total')
plt.plot(fan_cubic_meter_second, fan_pressure_drop_pascal, label=f'{fan_name}')
plt.plot(fan_cubic_meter_second, np.array(result_list_delta_p_total), label=r'Heat sink')
plt.plot(fan_cubic_meter_second, fan_pressure_drop_pascal, label=f'Fan: {fan_name.replace('.csv', '')}')
plt.plot(intersection_volume_flow, intersection_pressure, 'ro')
plt.xlabel('volume flow im m³/s')
plt.ylabel('pressure drop delta p in Pa')
plt.xlabel('Volume flow im m³/s')
plt.ylabel(r'Pressure drop $\Delta p$ in Pa')
plt.grid()
plt.legend()
plt.show()
Expand Down Expand Up @@ -320,6 +321,8 @@ def calculate_intersection(x_list, y1_list, y2_list):

if __name__ == '__main__':

# global_plot_settings_font_latex()

compare_fan_data()

geometry = Geometry(length_l=100e-3, width_b=40e-3, height_d=3e-3, height_c=30e-3, number_fins_n=5, thickness_fin_t=1e-3,
Expand Down

0 comments on commit ed757b6

Please sign in to comment.