Пример #1
0
import numpy as np
import scipy as sci
import matplotlib
#matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib import rc
from scipy.interpolate import interp1d
from scipy.optimize import brentq
#from pylab import figure, plot, xlabel, grid, hold, legend, title, savefig
from pylab import *
import FluidProperties as fp
import CorrelationFunctions as cf
import FlatPlateCollectorFunctions as FPCfns

print "Water:"
print "Thermal conductivity is ", fp.waterprops(300.0)[0]
print "Dynamic viscosity is ", fp.waterprops(300.0)[3]
print "Density is ", fp.waterprops(300.0)[1]
print "Kinematic viscosity is ", fp.waterprops(300.0)[4]
print "Thermal diffusivity is ", fp.waterprops(300.0)[5]

print "Air: "
print "Thermal conductivity is ", fp.airprops(300.0)[0]
print "Dynamic viscosity is ", fp.airprops(300.0)[3]
print "Density is ", fp.airprops(300.0)[1]
print "Kinematic viscosity is ", fp.airprops(300.0)[4]
print "Thermal diffusivity is ", fp.airprops(300.0)[5]
print "\n"

#Problem 1: Find loss from plate given following data
AbsPlateL1 = 1.9
while ((np.abs((Qin1-Qout1)/(0.5*(Qin1+Qout1)))>tol) or (np.abs((Qin2-Qout2)/(0.5*(Qin2+Qout2)))>tol) or (np.abs((Qinp-Qoutp)/(0.5*(Qinp+Qoutp)))>tol)):
    
    count+=1
    
    #Calculate h-conv due to wind
    hwind = cf.HTCTopCover(WindSpeed)
    
    #Calculate sky temperature
    tsky = AmbAirTemperature - 6
    
    #Calculate mean temperatures for calculating h-conv between 1. plate and tc1, and 2. tc1 and tc2
    Mean1 = (AbsPlateMeanTemp+tc1)/2
    Mean2 = (tc2+tc1)/2
    
    #Calculate air properties for both interfaces (between 1. plate and tc1, and 2. tc1 and tc2)
    airproperties1 = fp.airprops(Mean1+273)
    airproperties2 = fp.airprops(Mean2+273)
    
    #Calculate AirCTE for both interfaces (between 1. plate and tc1, and 2. tc1 and tc2)
    AirCTE1 = 1.0/(Mean1+273)
    AirCTE2 = 1.0/(Mean2+273)
    
    #Calculate Rayleigh Numbers for both interfaces (between 1. plate and tc1, and 2. tc1 and tc2)
    Ra1 = cf.RayleighNum(9.8, AirCTE1, np.abs(AbsPlateMeanTemp-Mean1),\
                        AbsCovGlassL,airproperties1[4],airproperties1[5])
    Ra2 = cf.RayleighNum(9.8, AirCTE2, np.abs(tc1-Mean2),\
                        AbsCovGlassL,airproperties2[4],airproperties2[5])
    
    #Calculate effective Rayleigh Numbers for both interfaces (between 1. plate and tc1, and 2. tc1 and tc2)
    EffRa1 = cf.EffectiveRayleighNum(Ra1, CollectorTilt)
    EffRa2 = cf.EffectiveRayleighNum(Ra2, CollectorTilt)