Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 70d9bdf

Browse files
author
zha
committed
update
1 parent 1ec346f commit 70d9bdf

3 files changed

Lines changed: 114 additions & 6 deletions

File tree

honeybee_energy/construction/opaque.py

Lines changed: 106 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def materials(self, mats):
5353
'Got {}'.format(type(mats)))
5454
for mat in mats:
5555
assert isinstance(mat, _EnergyMaterialOpaqueBase), 'Expected opaque energy' \
56-
' material for construction. Got {}.'.format(type(mat))
56+
' material for construction. Got {}.'.format(type(mat))
5757
assert len(mats) > 0, 'Construction must possess at least one material.'
5858
assert len(mats) <= 10, 'Opaque Construction cannot have more than 10 materials.'
5959
self._materials = mats
@@ -133,9 +133,9 @@ def temperature_profile(self, outside_temperature=-18, inside_temperature=21,
133133
angle = abs(180 - angle)
134134
in_r_init = 1 / self.in_h_simple()
135135
r_values = [1 / self.out_h(outside_wind_speed, outside_temperature + 273.15)] + \
136-
[mat.r_value for mat in self.materials] + [in_r_init]
136+
[mat.r_value for mat in self.materials] + [in_r_init]
137137
in_delta_t = (in_r_init / sum(r_values)) * \
138-
(outside_temperature - inside_temperature)
138+
(outside_temperature - inside_temperature)
139139
r_values[-1] = 1 / self.in_h(inside_temperature - (in_delta_t / 2) + 273.15,
140140
in_delta_t, height, angle, pressure)
141141
temperatures = self._temperature_profile_from_r_values(
@@ -256,7 +256,7 @@ def extract_all_from_idf_file(idf_file):
256256
mat_pattern2 = re.compile(r"(?i)(Material:NoMass,[\s\S]*?;)")
257257
mat_pattern3 = re.compile(r"(?i)(Material:AirGap,[\s\S]*?;)")
258258
material_str = mat_pattern1.findall(file_contents) + \
259-
mat_pattern2.findall(file_contents) + mat_pattern3.findall(file_contents)
259+
mat_pattern2.findall(file_contents) + mat_pattern3.findall(file_contents)
260260
materials_dict = OpaqueConstruction._idf_materials_dictionary(material_str)
261261
materials = list(materials_dict.values())
262262
# extract all of the construction objects
@@ -289,3 +289,105 @@ def _idf_materials_dictionary(ep_mat_strings):
289289
def __repr__(self):
290290
"""Represent opaque energy construction."""
291291
return self._generate_idf_string('opaque', self.name, self.materials)
292+
293+
294+
@lockable
295+
class OpaqueConstruction_mod(object): # For simple use of RAS model
296+
# NOTE: THE FOLLOWING VALUES ARE OBTAINED FROM Commercial Prototype Building Models
297+
# https://www.energycodes.gov/development/commercial/prototype_models
298+
# ANSI/ASHRAE/IES Standard 90.1 -- 2019
299+
def __init__(self, wall_type):
300+
self._wall_type = wall_type
301+
302+
@property
303+
def name(self):
304+
if self._wall_type == 'extwall': return 'nonres_ext_wall'
305+
elif self._wall_type == 'ceiling' or self._wall_type == 'floor': return 'floor_ceiling'
306+
elif self._wall_type == 'intwall': return 'int_wall'
307+
308+
def to_idf(self):
309+
310+
if self._wall_type == 'extwall':
311+
return '''Construction,
312+
nonres_ext_wall, !- Name
313+
F07 25mm stucco, !- Outside Layer
314+
G01 16mm gypsum board, !- Layer #2
315+
Nonres_Exterior_Wall_Insulation, !- Layer #3
316+
G01 16mm gypsum board; !- Layer #4
317+
318+
Material,
319+
F07 25mm stucco, !- Name
320+
Smooth, !- Roughness
321+
0.0254, !- Thickness {m}
322+
0.72, !- Conductivity {W/m-K}
323+
1856, !- Density {kg/m3}
324+
840, !- Specific Heat {J/kg-K}
325+
0.9, !- Thermal Absorptance
326+
0.7, !- Solar Absorptance
327+
0.7; !- Visible Absorptance
328+
Material,
329+
G01 16mm gypsum board, !- Name
330+
MediumSmooth, !- Roughness
331+
0.0159, !- Thickness {m}
332+
0.16, !- Conductivity {W/m-K}
333+
800, !- Density {kg/m3}
334+
1090; !- Specific Heat {J/kg-K}
335+
Material:NoMass,
336+
Nonres_Exterior_Wall_Insulation, !- Name
337+
MediumSmooth, !- Roughness
338+
1.71282848878858,
339+
!- Thermal Resistance {m2-K/W}
340+
0.9, !- Thermal Absorptance
341+
0.7, !- Solar Absorptance
342+
0.7; !- Visible Absorptance
343+
'''
344+
elif self._wall_type == 'intwall':
345+
return ''' Construction,
346+
int_wall, !- Name
347+
G01 13mm gypsum board, !- Outside Layer
348+
G01 13mm gypsum board; !- Layer 2
349+
Material,
350+
G01 13mm gypsum board, !- Name
351+
Smooth, !- Roughness
352+
0.0127, !- Thickness {m}
353+
0.1600, !- Conductivity {W/m-K}
354+
800.0000, !- Density {kg/m3}
355+
1090.0000, !- Specific Heat {J/kg-K}
356+
0.9000, !- Absorptance:Thermal
357+
0.7000, !- Absorptance:Solar
358+
0.5000; !- Absorptance:Visible
359+
'''
360+
if self._wall_type == 'ceiling' or self._wall_type == 'floor':
361+
return ''' Construction,
362+
floor_ceiling, !- Name
363+
Insulation, !- Outside Layer
364+
100mm Normalweight concrete floor, !- Layer #1
365+
CP02 CARPET PAD; !- Layer #2
366+
367+
Material:NoMass,
368+
Insulation, !- Name
369+
MediumSmooth, !- Roughness
370+
371+
0.0299387330245182,
372+
!- Thermal Resistance {m2-K/W}
373+
0.9, !- Thermal Absorptance
374+
0.7, !- Solar Absorptance
375+
0.7; !- Visible Absorptance
376+
377+
Material,
378+
100mm Normalweight concrete floor, !- Name - based on 90.1-2004 Appendix-Table A3-1B
379+
MediumRough, !- Roughness
380+
0.1016, !- Thickness {m}
381+
2.31, !- Conductivity {W/m-K}
382+
2322, !- Density {kg/m3}
383+
832; !- Specific Heat {J/kg-K}
384+
385+
Material:NoMass,
386+
CP02 CARPET PAD, !- Name
387+
VeryRough, !- Roughness
388+
0.21648, !- Thermal Resistance {m2-K/W}
389+
0.9, !- Thermal Absorptance
390+
0.7, !- Solar Absorptance
391+
0.8; !- Visible Absorptance'''
392+
393+

honeybee_energy/properties/face.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# coding=utf-8
22
"""Face Energy Properties."""
33
from ..construction.opaque import OpaqueConstruction
4+
from ..construction.opaque import OpaqueConstruction_mod
5+
46
from ..lib.constructionsets import generic_construction_set
57

68

@@ -55,7 +57,7 @@ def construction(self):
5557
@construction.setter
5658
def construction(self, value):
5759
if value is not None:
58-
assert isinstance(value, OpaqueConstruction), \
60+
assert isinstance(value, (OpaqueConstruction, OpaqueConstruction_mod)), \
5961
'Expected Opaque Construction for face. Got {}'.format(type(value))
6062
value.lock() # lock editing in case construction has multiple references
6163
self._construction = value

honeybee_energy/writer.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,11 @@ def model_to_idf(model, schedule_directory=None,
409409
materials.extend(constr.materials)
410410
construction_strs.append(constr.to_idf())
411411
except AttributeError:
412-
pass # ShadeConstruction; No need to write to IDF
412+
try:
413+
construction_strs.append(constr.to_idf())
414+
415+
except:
416+
pass # ShadeConstruction; No need to write to IDF
413417
model_str.append('!- ============== MATERIALS ==============\n')
414418
model_str.extend([mat.to_idf() for mat in set(materials)])
415419
model_str.append('!- ============ CONSTRUCTIONS ============\n')

0 commit comments

Comments
 (0)