Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,D_ins,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Insulation,Gypsum]
else:
#if it's less then 1 cm don't include in layers
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Gypsum]
wall = Element(0.08,0.92,thickness,layers,0.,293.,0.,"MassWall")
# If mass wall, assume mass floor (4" concrete)
# Mass (assume 4" concrete);
alb = 0.2
emis = 0.9
thickness = [0.054,0.054]
concrete = Material (1.31, 2240.0*836.8)
mass = Element(alb,emis,thickness,[concrete,concrete],0,293,1,"MassFloor")
elif TypeWall[j][k] == "WoodFrame":
# 0.01m wood siding, tbd insulation, 1/2" gypsum
Rbase = 0.170284091 # based on wood siding, gypsum
Rins = RvalWall[j][k] - Rbase
D_ins = Rins * Insulation.thermalCond #depth of insulatino
if D_ins > 0.01:
thickness = [0.01,D_ins,0.0127]
layers = [Wood,Insulation,Gypsum]
else:
thickness = [0.01,0.0127]
layers = [Wood,Gypsum]
wall = Element(0.22,0.92,thickness,layers,0.,293.,0.,"WoodFrameWall")
# Defining road
emis = 0.93
asphalt = Material(self.kRoad, self.cRoad, 'asphalt')
road_T_init = 293.
road_horizontal = 1
# fraction of surface vegetation coverage
road_veg_coverage = min(self.vegCover/(1-self.bldDensity), 1.)
# define road layers
road_layer_num = int(math.ceil(self.d_road/0.05))
# 0.5/0.05 ~ 10 x 1 matrix of 0.05 thickness
thickness_vector = [0.05 for r in range(road_layer_num)]
material_vector = [asphalt for r in range(road_layer_num)]
self.road = Element(self.alb_road, emis, thickness_vector, material_vector, road_veg_coverage,
road_T_init, road_horizontal, name="urban_road")
self.rural = copy.deepcopy(self.road)
self.rural.vegCoverage = self.rurVegCover
self.rural._name = "rural_road"
# Reference site class (also include VDM)
self.RSM = RSMDef(self.lat, self.lon, self.GMT, self.h_obs,
self.weather.staTemp[0], self.weather.staPres[0], self.geoParam, self.z_meso_dir_path)
self.USM = RSMDef(self.lat, self.lon, self.GMT, self.bldHeight/10.,
self.weather.staTemp[0], self.weather.staPres[0], self.geoParam, self.z_meso_dir_path)
T_init = self.weather.staTemp[0]
H_init = self.weather.staHum[0]
self.UCM = UCMDef(self.bldHeight, self.bldDensity, self.verToHor, self.treeCoverage, self.sensAnth, self.latAnth, T_init, H_init,
# If mass wall, assume mass foor
# Mass (assume 4" concrete),
alb = 0.2
emis = 0.93
thickness = [0.05,0.05]
mass = Element(alb,emis,thickness,[Concrete,Concrete],0.,293.,1.,"MassFloor")
elif TypeWall[j][k] == "MetalWall":
# metal siding, insulation, 1/2" gypsum
alb = 0.2
emis = 0.9
D_ins = max((RvalWall[j][k] * Insulation.thermalCond)/2, 0.01) #use derived insul thickness or 0.01 based on max
thickness = [D_ins,D_ins,0.0127]
materials = [Insulation,Insulation,Gypsum]
wall = Element(alb,emis,thickness,materials,0,293,0,"MetalWall")
# Mass (assume 4" concrete);
alb = 0.2
emis = 0.9
thickness = [0.05, 0.05]
concrete = Material(1.31, 2240.0*836.8)
mass = Element(alb,emis,thickness,[concrete,concrete],0.,293.,1.,"MassFloor")
# Roof
if TypeRoof[j][k] == "IEAD": #Insulation Entirely Above Deck
# IEAD-> membrane, insulation, decking
alb = 0.2
emis = 0.93
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01);
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"IEAD")
Rins = RvalWall[j][k] - Rbase
D_ins = Rins * Insulation.thermalCond
if D_ins > 0.01:
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,D_ins,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Insulation,Gypsum]
else: # If insulation is too thin, assume no insulation
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Gypsum]
wall = Element(0.15,0.92,thickness,layers,0.,293.,0.,"SteelFrame")
# If mass wall, assume mass foor
# Mass (assume 4" concrete),
alb = 0.2
emis = 0.93
thickness = [0.05,0.05]
mass = Element(alb,emis,thickness,[Concrete,Concrete],0.,293.,1.,"MassFloor")
elif TypeWall[j][k] == "MetalWall":
# metal siding, insulation, 1/2" gypsum
alb = 0.2
emis = 0.9
D_ins = max((RvalWall[j][k] * Insulation.thermalCond)/2, 0.01) #use derived insul thickness or 0.01 based on max
thickness = [D_ins,D_ins,0.0127]
materials = [Insulation,Insulation,Gypsum]
wall = Element(alb,emis,thickness,materials,0,293,0,"MetalWall")
# Mass (assume 4" concrete);
alb = 0.2
emis = 0.9
thickness = [0.05, 0.05]
concrete = Material(1.31, 2240.0*836.8)
mass = Element(alb,emis,thickness,[concrete,concrete],0.,293.,1.,"MassFloor")
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01);
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"IEAD")
elif TypeRoof[j][k] == "Attic":
# IEAD-> membrane, insulation, decking
alb = 0.2
emis = 0.9
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01)
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"Attic")
elif TypeRoof[j][k] == "MetalRoof":
# IEAD-> membrane, insulation, decking
alb = 0.2
emis = 0.9
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01)
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"MetalRoof")
# Define bulding energy model, set fraction of the urban floor space of this typology to zero
refBEM[i][j][k] = BEMDef(B, mass, wall, roof, 0.0)
refBEM[i][j][k].building.FanMax = FanFlow[j][k] # max fan flow rate (m^3/s) per DOE
Schedule[i][j][k] = SchDef()
Schedule[i][j][k].Elec = SchEquip # 3x24 matrix of schedule for fraction electricity (WD,Sat,Sun)
Schedule[i][j][k].Light = SchLight # 3x24 matrix of schedule for fraction light (WD,Sat,Sun)
Schedule[i][j][k].Gas = SchGas # 3x24 matrix of schedule for fraction gas (WD,Sat,Sun)
Schedule[i][j][k].Occ = SchOcc # 3x24 matrix of schedule for fraction occupancy (WD,Sat,Sun)
Schedule[i][j][k].Cool = SetCool # 3x24 matrix of schedule for fraction cooling temp (WD,Sat,Sun)
Schedule[i][j][k].Heat = SetHeat # 3x24 matrix of schedule for fraction heating temp (WD,Sat,Sun)
Schedule[i][j][k].SWH = SchSWH # 3x24 matrix of schedule for fraction SWH (WD,Sat,Sun
Schedule[i][j][k].Qelec = Elec[j] # W/m^2 (max) for electrical plug process
if D_ins > 0.01:
thickness = [0.01,D_ins,0.0127]
layers = [Wood,Insulation,Gypsum]
else:
thickness = [0.01,0.0127]
layers = [Wood,Gypsum]
wall = Element(0.22,0.92,thickness,layers,0.,293.,0.,"WoodFrameWall")
# If wood frame wall, assume wooden floor
alb = 0.2
emis = 0.9
thickness = [0.05,0.05]
wood = Material(1.31, 2240.0*836.8)
mass = Element(alb,emis,thickness,[wood,wood],0.,293.,1.,"WoodFloor")
elif TypeWall[j][k] == "SteelFrame":
# 1" stucco, 8" concrete, tbd insulation, 1/2" gypsum
Rbase = 0.271087 # based on stucco, concrete, gypsum
Rins = RvalWall[j][k] - Rbase
D_ins = Rins * Insulation.thermalCond
if D_ins > 0.01:
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,D_ins,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Insulation,Gypsum]
else: # If insulation is too thin, assume no insulation
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Gypsum]
wall = Element(0.15,0.92,thickness,layers,0.,293.,0.,"SteelFrame")
# If mass wall, assume mass foor
# Mass (assume 4" concrete),
mass = Element(alb,emis,thickness,[concrete,concrete],0.,293.,1.,"MassFloor")
# Roof
if TypeRoof[j][k] == "IEAD": #Insulation Entirely Above Deck
# IEAD-> membrane, insulation, decking
alb = 0.2
emis = 0.93
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01);
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"IEAD")
elif TypeRoof[j][k] == "Attic":
# IEAD-> membrane, insulation, decking
alb = 0.2
emis = 0.9
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01)
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"Attic")
elif TypeRoof[j][k] == "MetalRoof":
# IEAD-> membrane, insulation, decking
alb = 0.2
emis = 0.9
D_ins = max(RvalRoof[j][k] * Insulation.thermalCond/2.,0.01)
roof = Element(alb,emis,[D_ins,D_ins],[Insulation,Insulation],0.,293.,0.,"MetalRoof")
# Define bulding energy model, set fraction of the urban floor space of this typology to zero
refBEM[i][j][k] = BEMDef(B, mass, wall, roof, 0.0)
refBEM[i][j][k].building.FanMax = FanFlow[j][k] # max fan flow rate (m^3/s) per DOE
Schedule[i][j][k] = SchDef()
Schedule[i][j][k].Elec = SchEquip # 3x24 matrix of schedule for fraction electricity (WD,Sat,Sun)
Schedule[i][j][k].Light = SchLight # 3x24 matrix of schedule for fraction light (WD,Sat,Sun)
for i in range(self.nSoil):
# if soil depth is greater then the thickness of the road
# we add new slices of soil at max thickness until road is greater or equal
is_soildepth_equal = self.is_near_zero(self.depth_soil[i][0] - sum(newthickness), 1e-15)
if is_soildepth_equal or (self.depth_soil[i][0] > sum(newthickness)):
while self.depth_soil[i][0] > sum(newthickness):
newthickness.append(self.MAXTHICKNESS)
ruralMat.append(self.SOIL)
self.soilindex2 = i
break
self.rural = Element(self.rural.albedo, self.rural.emissivity, newthickness,
ruralMat, self.rural.vegCoverage, self.rural.layerTemp[0], self.rural.horizontal, self.rural._name)
thickness = [0.05,0.05]
wood = Material(1.31, 2240.0*836.8)
mass = Element(alb,emis,thickness,[wood,wood],0.,293.,1.,"WoodFloor")
elif TypeWall[j][k] == "SteelFrame":
# 1" stucco, 8" concrete, tbd insulation, 1/2" gypsum
Rbase = 0.271087 # based on stucco, concrete, gypsum
Rins = RvalWall[j][k] - Rbase
D_ins = Rins * Insulation.thermalCond
if D_ins > 0.01:
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,D_ins,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Insulation,Gypsum]
else: # If insulation is too thin, assume no insulation
thickness = [0.0254,0.0508,0.0508,0.0508,0.0508,0.0127]
layers = [Stucco,Concrete,Concrete,Concrete,Concrete,Gypsum]
wall = Element(0.15,0.92,thickness,layers,0.,293.,0.,"SteelFrame")
# If mass wall, assume mass foor
# Mass (assume 4" concrete),
alb = 0.2
emis = 0.93
thickness = [0.05,0.05]
mass = Element(alb,emis,thickness,[Concrete,Concrete],0.,293.,1.,"MassFloor")
elif TypeWall[j][k] == "MetalWall":
# metal siding, insulation, 1/2" gypsum
alb = 0.2
emis = 0.9
D_ins = max((RvalWall[j][k] * Insulation.thermalCond)/2, 0.01) #use derived insul thickness or 0.01 based on max
thickness = [D_ins,D_ins,0.0127]
materials = [Insulation,Insulation,Gypsum]
wall = Element(alb,emis,thickness,materials,0,293,0,"MetalWall")