Skip to content

Commit

Permalink
Merge pull request #28 from parhamdee/main
Browse files Browse the repository at this point in the history
Length scale added as an input
  • Loading branch information
parhamdee authored Sep 19, 2024
2 parents 612d298 + 20439c2 commit d3169f9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Scripts/IHT.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from scipy.ndimage import gaussian_filter

DEFAULTS = {
"length scale": 1,
"initial temperature": 286.15,
"surface emissivity": 0.94,
"wall thickness": 0.000795,
Expand Down Expand Up @@ -92,7 +93,7 @@ def rho_metal(T_g):
return rho_metal

def Grashof(dT_w, T_film, T_amb):
L = 1
L = DEFAULTS['length scale']
return 9.81*(1/(T_film))*abs(dT_w)*L**3 /(nu_gas(T_film - 273.15))**2

def natural_conv_correlation(Gr):
Expand Down Expand Up @@ -165,12 +166,12 @@ def inverse_heat_transfer(time_series_data, element_width, element_height, time_
if convection_method == 'natural convection correlation':
#### exposed side
Grashov = Grashof (T - Tamb[k] , T_film[i, j, k] , Tamb[k])
DEFAULTS['convective hc exposed'] = natural_conv_correlation(Grashov) * k_gas((T + Tamb[k])/2)
DEFAULTS['convective hc exposed'] = natural_conv_correlation(Grashov) * k_gas((T + Tamb[k])/2) / DEFAULTS['length scale']
#### unexposed side
Grashov = Grashof (T - DEFAULTS['initial temperature'] ,\
(T + DEFAULTS['initial temperature'] )/2 ,\
DEFAULTS['initial temperature'] )
DEFAULTS['convective hc unexposed'] = natural_conv_correlation(Grashov) * k_gas((T + DEFAULTS['initial temperature'])/2)
DEFAULTS['convective hc unexposed'] = natural_conv_correlation(Grashov) * k_gas((T + DEFAULTS['initial temperature'])/2) / DEFAULTS['length scale']

hfc[i,j,k] = DEFAULTS['convective hc exposed']

Expand Down Expand Up @@ -737,7 +738,7 @@ def toggle_Tamb_button_state():

canvas.create_window((0, 0), window=scrollable_frame,anchor="nw")
canvas.configure(yscrollcommand=scrollbar.set, width=450, height=200)
units = ['(K)','','(m)','(m)','(m)','(W/m2-K)','(W/m2-K)','(K)','(kW/m2)','(s)','','']
units = ['(m)','(K)','','(m)','(m)','(m)','(W/m2-K)','(W/m2-K)','(K)','(kW/m2)','(s)','','']
# row += 1
unit_idx = 0
for key, value in DEFAULTS.items():
Expand Down
Binary file modified Scripts/__pycache__/IHT.cpython-311.pyc
Binary file not shown.

0 comments on commit d3169f9

Please sign in to comment.