def alpha(p, Cp, k):
a=k/(p*Cp); #[m^2/s]
return a;
p = 2702.; #[Kg/m^3] - Density Of Material
Cp = 903.; #[J/kg.K] - Specific heat of Material
k = 237.; #[W/m.k] - Thermal Conductivity of Material
print '%s %.2e %s' %("\n (a) Thermal Diffuisivity of Pure Aluminium at 300K = ",alpha(p, Cp, k)," m^2/s\n");
#(b) Pure Aluminium at 700K
# From Appendix A, Table A.1
p = 2702.; #[Kg/m^3] - Density Of Material
Cp = 1090.; #[J/kg.K] - Specific heat of Material
k = 225.; #[W/m.k] - Thermal Conductivity of Material
print '%s %.2e %s' %("\n (b) Thermal Diffuisivity of Pure Aluminium at 700K =",alpha(p, Cp, k)," m^2/s\n");
#(c) Silicon Carbide at 1000K
# From Appendix A, Table A.2
p = 3160.; #[Kg/m^3] - Density Of Material
Cp = 1195.; #[J/kg.K] - Specific heat of Material
k = 87.; #[W/m.k] - Thermal Conductivity of Material
print '%s %.2e %s' %("\n (c) Thermal Diffuisivity of Silicon Carbide at 1000K =",alpha(p, Cp, k)," m^2/s\n");
#(d) Paraffin at 300K
# From Appendix A, Table A.3
p = 900.; #[Kg/m^3] - Density Of Material
Cp = 2890.; #[J/kg.K] - Specific heat of Material
k = .24; #[W/m.k] - Thermal Conductivity of Material
print '%s %.2e %s' %("\n (d) Thermal Diffuisivity of Paraffin at 300K = ",alpha(p, Cp, k),"m^2/s");
#END
a = 900.; #[degC]
b = -300.; #[degC/m]
c = -50.; #[degC/m^2]
q = 1000.; #[W/m^2.K] - Uniform heat Generation
A = 10. ; #[m^2] - Wall Area
#Properties of Wall
p = 1600.; #[kg/m^3] - Density
k = 40.; #[W/m] - Thermal Conductivity
Cp = 4000.; #[J/kg.K] - Specific Heat
L = 1; #[m] - Length of wall
#calculations and results
#(i) Rate of Heat Transfer entering the wall and leaving the wall
# From Eqn 2.1
# qin = -kA(dT/dx)|x=0 = -kA(b)
qin= - b*k*A;
# Similarly
# qout = -kA(dT/dx)|x=L = -kA(b+2cx)|x=L
qout= - k*A*(b+2*c*L);
print '%s %d %s' %("\n (i) Rate of Heat Transfer entering the wall =",qin," W ");
print '%s %d %s' %("\n And leaving the wall =",qout,"W ");
#(ii) Rate of change Of Energy Storage in Wall E`st
# Applying Overall Energy Balance across the Wall
#E`st = E`in + E`g + E`out = qin + q`AL - qout
Est = qin + q*A*L - qout;
print '%s %d %s' %("\n (ii) Rate of change Of Energy Storage in Wall =",Est," W\n");
#(iii) Time rate of Temperature change at x= 0, 0.25 and .5m
#Using Eqn 2.19
# T`= dT/dt = (k/p*Cp)*d(dT/dx)/dx + q`/p*Cp
#As d(dT/dx)/dx = d(b + 2cx)/dx = 2c - Independent of x
T = (k/(p*Cp))*(2*c)+ q/(p*Cp);
print '%s %.6f %s' %("\n (iii) Time rate of Temperature change independent of x =",T," degC/s\n");
#END