Skip to content

Instantly share code, notes, and snippets.

@jabirjamal
Created July 20, 2021 16:27
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/67bca7b609f7e5c3eec59d55be5abb2d to your computer and use it in GitHub Desktop.
Save jabirjamal/67bca7b609f7e5c3eec59d55be5abb2d to your computer and use it in GitHub Desktop.
Radiation Calculator 2
import math
while True:
try:
b = float(input("Enter length of the emitting panel: "))
a = float(input("Enter width of the emitting panel: "))
c = float(input("Enter distance between the emitting panel and the plane element: "))
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")
X = a/b
Y = c/b
F = (0.5/math.pi)*((math.atan(1/Y))-((Y/((X**2+Y**2)**0.5))*(math.atan(1/((X**2+Y**2)**0.5)))))
print("View factor of the panel is " + str(F))
s = 5.670374*10**(-8)
print("The value of Stefan-Boltzman constant is: " + str(s) + "W/m²K\N{SUPERSCRIPT FOUR}")
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 = tot_rad_emitted * F
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