python code heat transfer

python code to solve heat transfer numericals

DETERMINE THE STEADY STATE HEAT TRANSFER TO DUBLE PLANE WINDOW 0.8m HIGH 1.5m WIDE, CONSISTING OF TWO 4mm THICK GLASS LAYER K=0.78 WATTS/m C . SEPERATED BY 10mm THICK STAGNENT LAYER OF AIR (K=0.026WATT/m C) INSIDE TEMPERATURE OF ROOM AIR IS MAINTAINED AT 20C WITH A CONVECTIVE HEAT TRANSFER CO-EFFICIENT OF 10WATT/m2 C. OUTSIDE AIR TEMPERATURE IS -10C  AND CONVECTIVE HEAT TRANSFER COEFFICIENT ON THE OUTSIDE IS 40 WATT/m2 C ALSO DETERMINE THE OVERALL HEAT TRANSFER COEFFICIENT

 

 

 

 

import math

 

Lp=float(input("THICKNESS OF FIRST LAYER(m):"))

Lq=float(input("THICKNESS OF SECOND LAYER(m):"))

Lr=float(input("THICKNESS OF THIRD LAYER(m):"))

Kp=float (input("VALUE OF K FOR FIRST LAYER(W/m"u"\N{DEGREE SIGN}C):"))

Kq=float(input("VALUE OF K FOR SECOND LAYER(W/m"u"\N{DEGREE SIGN}C)):"))

Kr=float (input("VALUE OF K FOR THIRD LAYER(W/m"u"\N{DEGREE SIGN}C):"))       

A= float(input("AREA OF WALL(m2):"))                          

Ta= int(input("inside temperature("u"\N{DEGREE SIGN}C):"))

Tb= int(input("outside temperature("u"\N{DEGREE SIGN}C):"))                  

Ha=int(input("INSIDE HEAT TRANSFER COEFFICIENT(W/m2" u"\N{DEGREE SIGN}C):"))   

Hb=int(input("OUTSIDE HEAT TRANSFER COEFFICIENT(W/m2" u"\N{DEGREE SIGN}C):"))     

 

#for RESISTANCE Ra

 

Ra = (1/(Ha*A))

formated_string="{:.4f}".format(Ra)

float_Ra=float(formated_string)

 

print("VALUE OF RESISTANCE  Ra",(float_Ra),"k/W")

 

 

#for RESISTANCE Rp

 

Rp = (Lp/(Kp*A))

formated_string="{:.4f}".format(Rp)

float_Rp=float(formated_string)

 

 

print("VALUE OF RESISTANCE  Rp",(float_Rp),"k/W")

 

#for RESISTANCE Rq

 

Rq = (Lq/(Kq*A))

formated_string="{:.4f}".format(Rq)

float_Rq=float(formated_string)

 

 

print("VALUE OF RESISTANCE  Rq",(float_Rq),"k/W")

 

#for RESISTANCE Rq

 

Rr = (Lr/(Kr*A))

formated_string="{:.4f}".format(Rr)

float_Rr=float(formated_string)

 

 

print("VALUE OF RESISTANCE Rr",(float_Rr),"k/W")

 

#for RESISTANCE Rb

 

Rb = (1/(Hb*A))

formated_string="{:.4f}".format(Rb)

float_Rb=float(formated_string)

 

 

print("VALUE OF RESISTANCE  Rb",(float_Rb),"k/W")

 

#for TOTAL RESISTANCE Rtot

 

Rtot =(float_Ra+float_Rp+float_Rq+float_Rr+float_Rb)

formated_string="{:.4f}".format(Rtot)

float_Rtot=float(formated_string)

 

 

print(" VALUE OF TOTAL RESISTANCE Rtot",(float_Rtot),"k/W")

 

#for TEMPERATURE Q

 

Q = ((Ta-Tb)/float_Rtot)

formated_string="{:.2f}".format(Q)

float_Q=float(formated_string)

 

 

print("VALUE OF HEAT TRANSFER Q",(float_Q),"W")

 

#for OVERALL HEAT TRANSFER COEFFICIENT

 

U =(1/(A*float_Rtot))

formated_string="{:.2f}".format(U)

float_U=float(formated_string)

 

 

print("OVERALL HEAT TRANSFER COEFFICIENT",(float_U),"W/m2" u"\N{DEGREE SIGN}C")

 

 

#for FIRST INTERMEDIATE TEMPERATURE

 

Tp = ((-float_Q*float_Ra)+Ta)

formated_string="{:.2f}".format(Tp)

float_Tp=float(formated_string)

 

print("FIRST INTERMEDIATE TEMPERATURE",(float_Tp),(u"\N{DEGREE SIGN}C"))

 

#for SECOND INTERMEDIATE TEMPERATURE

 

Tq = ((-float_Q*float_Rp)+float_Tp)

formated_string="{:.2f}".format(Tq)

float_Tq=float(formated_string)

 

print("SECOND INTERMEDIATE TEMPERATURE",(float_Tq),(u"\N{DEGREE SIGN}C"))

 

#for THIRD INTERMEDIATE TEMPERATURE

 

Tr = ((-float_Q*float_Rq)+float_Tq)

formated_string="{:.2f}".format(Tr)

float_Tr=float(formated_string)

 

 

print("THIRD INTERMEDIATE TEMPERATURE",(float_Tr),(u"\N{DEGREE SIGN}C"))

 

#for FORTH INTERMEDIATE TEMPERATURE

 

Ts = ((-float_Q*float_Rr)+float_Tr)

formated_string="{:.2f}".format(Ts)

float_Ts=float(formated_string)

 

 

print("FORTH INTERMEDIATE TEMPERATURE",(float_Ts),(u"\N{DEGREE SIGN}C"))

 

Suggestions 0

No comments found