Skip to content

Instantly share code, notes, and snippets.

@jabirjamal
Created July 20, 2021 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jabirjamal/a5f813b6df8f9a8fd6ed0c32285a7186 to your computer and use it in GitHub Desktop.
Save jabirjamal/a5f813b6df8f9a8fd6ed0c32285a7186 to your computer and use it in GitHub Desktop.
Radiation Calculator 3
import math
while True:
try:
f1b = float(input("Enter height of the emitting panel F1, F_1b: "))
f1a = float(input("Enter length of the emitting panel F1, F_1a: "))
f2b = float(input("Enter height of the emitting panel F2, F_2b: "))
f2a = float(input("Enter length of the emitting panel F2, F_2a: "))
f3b = float(input("Enter height of the emitting panel F3, F_3b: "))
f3a = float(input("Enter length of the emitting panel F3, F_3a: "))
f4b = float(input("Enter height of the emitting panel F4, F_4b: "))
f4a = float(input("Enter length of the emitting panel F4, F_4a: "))
c = float(input("Enter distance of the plane element dA1 from the radiating plane parallel element F: "))
break
except:
print("Error! Enter a valid number")
while True:
e = float(input("Enter emissivity of emitter (0 < e <= 1): "))
if 0 < e <= 1:
break
print("Error! Enter a valid number between 0 and 1")
while True:
t = float(input("Enter temperature of the emitter in Kelvin: "))
if t>273.15:
break
print("Enter a value greater than 273.15 K")
s = 5.670374*10**(-8)
print("The value of Stefan-Boltzman constant is: " + str(s) + "W/m²K\N{SUPERSCRIPT FOUR}")
X1 = f1b/c
Y1 = f1a/c
F1 = (0.5/math.pi)*(((X1/((1+X1**2)**0.5))*(math.atan(Y1/((1+X1**2)**0.5))))+\
((Y1/((1+Y1**2)**0.5))*(math.atan(X1/((1+Y1**2)**0.5)))))
print("View factor of panel F1 is " + str(F1))
X2 = f2a/c
Y2 = f2b/c
F2 = (0.5/math.pi)*(((X2/((1+X2**2)**0.5))*(math.atan(Y2/((1+X2**2)**0.5))))+\
((Y2/((1+Y2**2)**0.5))*(math.atan(X2/((1+Y2**2)**0.5)))))
print("View factor of panel F2 is " + str(F2))
X3 = f3a/c
Y3 = f3b/c
F3 = (0.5/math.pi)*(((X3/((1+X3**2)**(0.5)))*(math.atan(Y3/((1+X3**2)**(0.5)))))+\
((Y3/((1+Y3**2)**(0.5)))*(math.atan(X3/((1+Y3**2)**(0.5))))))
print("View factor of panel F3 is " + str(F3))
X4 = f4b/c
Y4 = f4a/c
F4 = (0.5/math.pi)*(((X4/((1+X4**2)**0.5))*(math.atan(Y4/((1+X4**2)**0.5))))+\
((Y4/((1+Y4**2)**0.5))*(math.atan(X4/((1+Y4**2)**0.5)))))
print("View factor of panel F4 is " + str(F4))
F = F1+F2+F3+F4
print("Combined view factor of the emitter panel F is " + str(F))
tot_rad_emitted = e*s*t**4
print("Total radiant heat emitted from the radiating panel is: " + str(round(tot_rad_emitted,2)) + " kW/m²")
rad_heat_received = F*tot_rad_emitted
print("Total radiant heat received at the plane element is: " + str(round(rad_heat_received,2)) + " kW/m²")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment