dragonfly-doe2 0.11.3__py2.py3-none-any.whl → 0.12.1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dragonfly_doe2/__init__.py +1 -1
- dragonfly_doe2/__main__.py +0 -1
- dragonfly_doe2/_extend_dragonfly.py +33 -0
- dragonfly_doe2/cli/__init__.py +4 -4
- dragonfly_doe2/cli/translate.py +142 -47
- dragonfly_doe2/properties/__init__.py +1 -0
- dragonfly_doe2/properties/model.py +255 -0
- dragonfly_doe2/properties/room2d.py +298 -0
- dragonfly_doe2/writer.py +120 -23
- {dragonfly_doe2-0.11.3.dist-info → dragonfly_doe2-0.12.1.dist-info}/METADATA +12 -11
- dragonfly_doe2-0.12.1.dist-info/RECORD +15 -0
- {dragonfly_doe2-0.11.3.dist-info → dragonfly_doe2-0.12.1.dist-info}/WHEEL +1 -1
- {dragonfly_doe2-0.11.3.dist-info → dragonfly_doe2-0.12.1.dist-info}/entry_points.txt +0 -1
- dragonfly_doe2/doe/__init__.py +0 -0
- dragonfly_doe2/doe/blocks.py +0 -141
- dragonfly_doe2/doe/compliance.py +0 -32
- dragonfly_doe2/doe/construction.py +0 -115
- dragonfly_doe2/doe/floor_space.py +0 -406
- dragonfly_doe2/doe/glass_types.py +0 -44
- dragonfly_doe2/doe/hvac.py +0 -96
- dragonfly_doe2/doe/material.py +0 -84
- dragonfly_doe2/doe/model.py +0 -276
- dragonfly_doe2/doe/polygon.py +0 -59
- dragonfly_doe2/doe/run_period.py +0 -41
- dragonfly_doe2/doe/shades.py +0 -120
- dragonfly_doe2/doe/sitebldg.py +0 -21
- dragonfly_doe2/doe/title.py +0 -17
- dragonfly_doe2/doe/utils.py +0 -66
- dragonfly_doe2-0.11.3.dist-info/RECORD +0 -26
- {dragonfly_doe2-0.11.3.dist-info → dragonfly_doe2-0.12.1.dist-info}/LICENSE +0 -0
- {dragonfly_doe2-0.11.3.dist-info → dragonfly_doe2-0.12.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
# coding=utf-8
|
|
2
|
+
"""Room2D DOE-2 Properties."""
|
|
3
|
+
from honeybee.typing import float_in_range, float_positive
|
|
4
|
+
from honeybee.altnumber import autocalculate
|
|
5
|
+
from honeybee_doe2.properties.room import RoomDoe2Properties
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Room2DDoe2Properties(object):
|
|
9
|
+
"""DOE-2 Properties for Dragonfly Room2D.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
host: A dragonfly_core Room2D object that hosts these properties.
|
|
13
|
+
assigned_flow: A number for the design supply air flow rate for the zone
|
|
14
|
+
the Room2D is assigned to (cfm). This establishes the minimum allowed
|
|
15
|
+
design air flow. Note that the actual design flow may be larger. If
|
|
16
|
+
None, this parameter will not be written into the INP. (Default: None).
|
|
17
|
+
flow_per_area: A number for the design supply air flow rate to
|
|
18
|
+
the zone per unit floor area (cfm/ft2). If None, this parameter
|
|
19
|
+
will not be written into the INP. (Default: None).
|
|
20
|
+
min_flow_ratio: A number between 0 and 1 for the minimum allowable zone
|
|
21
|
+
air supply flow rate, expressed as a fraction of design flow rate.
|
|
22
|
+
Applicable to variable-volume type systems only. If None, this parameter
|
|
23
|
+
will not be written into the INP. (Default: None).
|
|
24
|
+
min_flow_per_area: A number for the minimum air flow per square foot of
|
|
25
|
+
floor area (cfm/ft2). This is an alternative way of specifying the
|
|
26
|
+
min_flow_ratio. If None, this parameter will not be written into
|
|
27
|
+
the INP. (Default: None).
|
|
28
|
+
hmax_flow_ratio: A number between 0 and 1 for the ratio of the maximum
|
|
29
|
+
(or fixed) heating airflow to the cooling airflow. The specific
|
|
30
|
+
meaning varies according to the type of zone terminal. If None, this
|
|
31
|
+
parameter will not be written into the INP. (Default: None).
|
|
32
|
+
|
|
33
|
+
Properties:
|
|
34
|
+
* host
|
|
35
|
+
* assigned_flow
|
|
36
|
+
* flow_per_area
|
|
37
|
+
* min_flow_ratio
|
|
38
|
+
* min_flow_per_area
|
|
39
|
+
* hmax_flow_ratio
|
|
40
|
+
"""
|
|
41
|
+
__slots__ = (
|
|
42
|
+
'_host', '_assigned_flow', '_flow_per_area', '_min_flow_ratio',
|
|
43
|
+
'_min_flow_per_area', '_hmax_flow_ratio',
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
def __init__(
|
|
47
|
+
self, host, assigned_flow=None, flow_per_area=None, min_flow_ratio=None,
|
|
48
|
+
min_flow_per_area=None, hmax_flow_ratio=None
|
|
49
|
+
):
|
|
50
|
+
"""Initialize Room2D DOE-2 properties."""
|
|
51
|
+
# set the main properties of the Room2D
|
|
52
|
+
self._host = host
|
|
53
|
+
self.assigned_flow = assigned_flow
|
|
54
|
+
self.flow_per_area = flow_per_area
|
|
55
|
+
self.min_flow_ratio = min_flow_ratio
|
|
56
|
+
self.min_flow_per_area = min_flow_per_area
|
|
57
|
+
self.hmax_flow_ratio = hmax_flow_ratio
|
|
58
|
+
|
|
59
|
+
@property
|
|
60
|
+
def host(self):
|
|
61
|
+
"""Get the Room2D object hosting these properties."""
|
|
62
|
+
return self._host
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def assigned_flow(self):
|
|
66
|
+
"""Get or set the design supply air flow rate for the zone (cfm)."""
|
|
67
|
+
return self._assigned_flow
|
|
68
|
+
|
|
69
|
+
@assigned_flow.setter
|
|
70
|
+
def assigned_flow(self, value):
|
|
71
|
+
if value is not None:
|
|
72
|
+
value = float_positive(value, 'zone assigned flow')
|
|
73
|
+
self._assigned_flow = value
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def flow_per_area(self):
|
|
77
|
+
"""Get or set the design supply air flow rate per unit floor area (cfm/ft2).
|
|
78
|
+
"""
|
|
79
|
+
return self._flow_per_area
|
|
80
|
+
|
|
81
|
+
@flow_per_area.setter
|
|
82
|
+
def flow_per_area(self, value):
|
|
83
|
+
if value is not None:
|
|
84
|
+
value = float_positive(value, 'zone flow per area')
|
|
85
|
+
self._flow_per_area = value
|
|
86
|
+
|
|
87
|
+
@property
|
|
88
|
+
def min_flow_ratio(self):
|
|
89
|
+
"""Get or set the the min supply airflow rate as a fraction of design flow rate.
|
|
90
|
+
"""
|
|
91
|
+
return self._min_flow_ratio
|
|
92
|
+
|
|
93
|
+
@min_flow_ratio.setter
|
|
94
|
+
def min_flow_ratio(self, value):
|
|
95
|
+
if value is not None:
|
|
96
|
+
value = float_in_range(value, 0.0, 1.0, 'zone min flow ratio')
|
|
97
|
+
self._min_flow_ratio = value
|
|
98
|
+
|
|
99
|
+
@property
|
|
100
|
+
def min_flow_per_area(self):
|
|
101
|
+
"""Get or set the minimum air flow per square foot of floor area (cfm/ft2)."""
|
|
102
|
+
return self._min_flow_per_area
|
|
103
|
+
|
|
104
|
+
@min_flow_per_area.setter
|
|
105
|
+
def min_flow_per_area(self, value):
|
|
106
|
+
if value is not None:
|
|
107
|
+
value = float_positive(value, 'zone min flow per area')
|
|
108
|
+
self._min_flow_per_area = value
|
|
109
|
+
|
|
110
|
+
@property
|
|
111
|
+
def hmax_flow_ratio(self):
|
|
112
|
+
"""Get or set the ratio of the maximum heating airflow to the cooling airflow.
|
|
113
|
+
"""
|
|
114
|
+
return self._hmax_flow_ratio
|
|
115
|
+
|
|
116
|
+
@hmax_flow_ratio.setter
|
|
117
|
+
def hmax_flow_ratio(self, value):
|
|
118
|
+
if value is not None:
|
|
119
|
+
value = float_in_range(value, 0.0, 1.0, 'zone heating max flow ratio')
|
|
120
|
+
self._hmax_flow_ratio = value
|
|
121
|
+
|
|
122
|
+
def check_floor_plate_vertex_count(self, raise_exception=True, detailed=False):
|
|
123
|
+
"""Check whether the Room2D's floor geometry exceeds the maximum vertex count.
|
|
124
|
+
|
|
125
|
+
The DOE-2 engine currently does not support such rooms and limits the
|
|
126
|
+
total number of vertices to 120.
|
|
127
|
+
|
|
128
|
+
Args:
|
|
129
|
+
raise_exception: If True, a ValueError will be raised if the Room2D
|
|
130
|
+
floor plate exceeds the maximum number of vertices supported by
|
|
131
|
+
DOE-2. (Default: True).
|
|
132
|
+
detailed: Boolean for whether the returned object is a detailed list of
|
|
133
|
+
dicts with error info or a string with a message. (Default: False).
|
|
134
|
+
|
|
135
|
+
Returns:
|
|
136
|
+
A string with the message or a list with a dictionary if detailed is True.
|
|
137
|
+
"""
|
|
138
|
+
if len(self.host.floor_geometry.boundary) > 120:
|
|
139
|
+
msg = 'Room2D "{}" has a floor plate with {} vertices, which is more ' \
|
|
140
|
+
'than the maximum 120 vertices supported by DOE-2.'.format(
|
|
141
|
+
self.host.display_name, len(self.host.floor_geometry.boundary))
|
|
142
|
+
if raise_exception:
|
|
143
|
+
raise ValueError(msg)
|
|
144
|
+
full_msg = self.host._validation_message_child(
|
|
145
|
+
msg, self.host, detailed, '030101', extension='DOE2',
|
|
146
|
+
error_type='Room Exceeds Maximum Vertex Count')
|
|
147
|
+
if detailed:
|
|
148
|
+
return [full_msg]
|
|
149
|
+
if raise_exception:
|
|
150
|
+
raise ValueError(full_msg)
|
|
151
|
+
return full_msg
|
|
152
|
+
return [] if detailed else ''
|
|
153
|
+
|
|
154
|
+
def check_no_floor_plate_holes(self, raise_exception=True, detailed=False):
|
|
155
|
+
"""Check whether the Room2D's floor geometry has holes.
|
|
156
|
+
|
|
157
|
+
EQuest currently has no way to represent such rooms so, if the issue
|
|
158
|
+
is not addressed, the hole will simply be removed as part of the
|
|
159
|
+
process of exporting to an INP file.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
raise_exception: If True, a ValueError will be raised if the Room2D
|
|
163
|
+
floor plate has one or more holes. (Default: True).
|
|
164
|
+
detailed: Boolean for whether the returned object is a detailed list of
|
|
165
|
+
dicts with error info or a string with a message. (Default: False).
|
|
166
|
+
|
|
167
|
+
Returns:
|
|
168
|
+
A string with the message or a list with a dictionary if detailed is True.
|
|
169
|
+
"""
|
|
170
|
+
if self.host.floor_geometry.has_holes:
|
|
171
|
+
hole_count = len(self.host.floor_geometry.holes)
|
|
172
|
+
hole_msg = 'a hole' if hole_count == 1 else '{} holes'.format(hole_count)
|
|
173
|
+
msg = 'Room2D "{}" has a floor plate with {}, which the eQuest ' \
|
|
174
|
+
'interface cannot represent.'.format(self.host.display_name, hole_msg)
|
|
175
|
+
if raise_exception:
|
|
176
|
+
raise ValueError(msg)
|
|
177
|
+
full_msg = self.host._validation_message_child(
|
|
178
|
+
msg, self.host, detailed, '030102', extension='DOE2',
|
|
179
|
+
error_type='Room Contains Holes')
|
|
180
|
+
if detailed:
|
|
181
|
+
return [full_msg]
|
|
182
|
+
if raise_exception:
|
|
183
|
+
raise ValueError(full_msg)
|
|
184
|
+
return full_msg
|
|
185
|
+
return [] if detailed else ''
|
|
186
|
+
|
|
187
|
+
@classmethod
|
|
188
|
+
def from_dict(cls, data, host):
|
|
189
|
+
"""Create Room2DDoe2Properties from a dictionary.
|
|
190
|
+
|
|
191
|
+
Args:
|
|
192
|
+
data: A dictionary representation of Room2DDoe2Properties with the
|
|
193
|
+
format below.
|
|
194
|
+
host: A Room2D object that hosts these properties.
|
|
195
|
+
|
|
196
|
+
.. code-block:: python
|
|
197
|
+
|
|
198
|
+
{
|
|
199
|
+
"type": 'Room2DDoe2Properties',
|
|
200
|
+
"assigned_flow": 100, # number in cfm
|
|
201
|
+
"flow_per_area": 1, # number in cfm/ft2
|
|
202
|
+
"min_flow_ratio": 0.3, # number between 0 and 1
|
|
203
|
+
"min_flow_per_area": 0.3, # number in cfm/ft2
|
|
204
|
+
"hmax_flow_ratio": 0.3 # number between 0 and 1
|
|
205
|
+
}
|
|
206
|
+
"""
|
|
207
|
+
assert data['type'] == 'Room2DDoe2Properties', \
|
|
208
|
+
'Expected Room2DDoe2Properties. Got {}.'.format(data['type'])
|
|
209
|
+
new_prop = cls(host)
|
|
210
|
+
auto_dict = autocalculate.to_dict()
|
|
211
|
+
if 'assigned_flow' in data and data['assigned_flow'] != auto_dict:
|
|
212
|
+
new_prop.assigned_flow = data['assigned_flow']
|
|
213
|
+
if 'flow_per_area' in data and data['flow_per_area'] != auto_dict:
|
|
214
|
+
new_prop.flow_per_area = data['flow_per_area']
|
|
215
|
+
if 'min_flow_ratio' in data and data['min_flow_ratio'] != auto_dict:
|
|
216
|
+
new_prop.min_flow_ratio = data['min_flow_ratio']
|
|
217
|
+
if 'min_flow_per_area' in data and data['min_flow_per_area'] != auto_dict:
|
|
218
|
+
new_prop.min_flow_per_area = data['min_flow_per_area']
|
|
219
|
+
if 'hmax_flow_ratio' in data and data['hmax_flow_ratio'] != auto_dict:
|
|
220
|
+
new_prop.hmax_flow_ratio = data['hmax_flow_ratio']
|
|
221
|
+
return new_prop
|
|
222
|
+
|
|
223
|
+
def apply_properties_from_dict(self, data):
|
|
224
|
+
"""Apply properties from a Room2DDoe2Properties dictionary.
|
|
225
|
+
|
|
226
|
+
Args:
|
|
227
|
+
data: A Room2DDoe2Properties dictionary (typically coming from a Model).
|
|
228
|
+
"""
|
|
229
|
+
auto_dict = autocalculate.to_dict()
|
|
230
|
+
if 'assigned_flow' in data and data['assigned_flow'] != auto_dict:
|
|
231
|
+
self.assigned_flow = data['assigned_flow']
|
|
232
|
+
if 'flow_per_area' in data and data['flow_per_area'] != auto_dict:
|
|
233
|
+
self.flow_per_area = data['flow_per_area']
|
|
234
|
+
if 'min_flow_ratio' in data and data['min_flow_ratio'] != auto_dict:
|
|
235
|
+
self.min_flow_ratio = data['min_flow_ratio']
|
|
236
|
+
if 'min_flow_per_area' in data and data['min_flow_per_area'] != auto_dict:
|
|
237
|
+
self.min_flow_per_area = data['min_flow_per_area']
|
|
238
|
+
if 'hmax_flow_ratio' in data and data['hmax_flow_ratio'] != auto_dict:
|
|
239
|
+
self.hmax_flow_ratio = data['hmax_flow_ratio']
|
|
240
|
+
|
|
241
|
+
def to_dict(self, abridged=False):
|
|
242
|
+
"""Return Room2D Doe2 properties as a dictionary."""
|
|
243
|
+
base = {'doe2': {}}
|
|
244
|
+
base['doe2']['type'] = 'Room2DDoe2Properties'
|
|
245
|
+
if self.assigned_flow is not None:
|
|
246
|
+
base['doe2']['assigned_flow'] = self.assigned_flow
|
|
247
|
+
if self.flow_per_area is not None:
|
|
248
|
+
base['doe2']['flow_per_area'] = self.flow_per_area
|
|
249
|
+
if self.min_flow_ratio is not None:
|
|
250
|
+
base['doe2']['min_flow_ratio'] = self.min_flow_ratio
|
|
251
|
+
if self.min_flow_per_area is not None:
|
|
252
|
+
base['doe2']['min_flow_per_area'] = self.min_flow_per_area
|
|
253
|
+
if self.hmax_flow_ratio is not None:
|
|
254
|
+
base['doe2']['hmax_flow_ratio'] = self.hmax_flow_ratio
|
|
255
|
+
return base
|
|
256
|
+
|
|
257
|
+
def to_honeybee(self, new_host):
|
|
258
|
+
"""Get a honeybee version of this object.
|
|
259
|
+
|
|
260
|
+
Args:
|
|
261
|
+
new_host: A honeybee-core Room object that will host these properties.
|
|
262
|
+
"""
|
|
263
|
+
return RoomDoe2Properties(
|
|
264
|
+
new_host, self.assigned_flow, self.flow_per_area, self.min_flow_ratio,
|
|
265
|
+
self.min_flow_per_area, self.hmax_flow_ratio
|
|
266
|
+
)
|
|
267
|
+
|
|
268
|
+
def from_honeybee(self, hb_properties):
|
|
269
|
+
"""Transfer Doe-2 attributes from a Honeybee Room to Dragonfly Room2D.
|
|
270
|
+
|
|
271
|
+
Args:
|
|
272
|
+
hb_properties: The RoomDoe2Properties of the honeybee Room that is being
|
|
273
|
+
translated to a Dragonfly Room2D.
|
|
274
|
+
"""
|
|
275
|
+
self._assigned_flow = hb_properties._assigned_flow
|
|
276
|
+
self._flow_per_area = hb_properties._flow_per_area
|
|
277
|
+
self._min_flow_ratio = hb_properties._min_flow_ratio
|
|
278
|
+
self._min_flow_per_area = hb_properties._min_flow_per_area
|
|
279
|
+
self._hmax_flow_ratio = hb_properties._hmax_flow_ratio
|
|
280
|
+
|
|
281
|
+
def duplicate(self, new_host=None):
|
|
282
|
+
"""Get a copy of this object.
|
|
283
|
+
|
|
284
|
+
Args:
|
|
285
|
+
new_host: A new Room2D object that hosts these properties.
|
|
286
|
+
If None, the properties will be duplicated with the same host.
|
|
287
|
+
"""
|
|
288
|
+
_host = new_host or self._host
|
|
289
|
+
new_room = Room2DDoe2Properties(
|
|
290
|
+
_host, self.assigned_flow, self.flow_per_area, self.min_flow_ratio,
|
|
291
|
+
self.min_flow_per_area, self.hmax_flow_ratio)
|
|
292
|
+
return new_room
|
|
293
|
+
|
|
294
|
+
def ToString(self):
|
|
295
|
+
return self.__repr__()
|
|
296
|
+
|
|
297
|
+
def __repr__(self):
|
|
298
|
+
return 'Room2D DOE2 Properties: [host: {}]'.format(self.host.display_name)
|
dragonfly_doe2/writer.py
CHANGED
|
@@ -1,32 +1,129 @@
|
|
|
1
|
+
# coding: utf-8
|
|
1
2
|
"""Write an inp file from a Dragonfly model."""
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
from .
|
|
3
|
+
from __future__ import division
|
|
4
|
+
|
|
5
|
+
from honeybee_doe2.writer import model_to_inp as hb_model_to_inp
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
def model_to_inp(
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
model, use_multiplier=True, exclude_plenums=False, solve_ceiling_adjacencies=True,
|
|
10
|
+
simulation_par=None, hvac_mapping='Story',
|
|
11
|
+
exclude_interior_walls=False, exclude_interior_ceilings=False, equest_version=None
|
|
12
|
+
):
|
|
13
|
+
"""Generate an INP string from a Dragonfly Model.
|
|
14
|
+
|
|
15
|
+
The resulting string will include all geometry, all fully-detailed constructions
|
|
16
|
+
and materials, all fully-detailed schedules, and the room properties. It will
|
|
17
|
+
also include the simulation parameters. Essentially, the string includes
|
|
18
|
+
everything needed to simulate the model.
|
|
10
19
|
|
|
11
20
|
Args:
|
|
12
|
-
model: A
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
be
|
|
21
|
+
model: A dragonfly Model for which an INP representation will be returned.
|
|
22
|
+
use_multiplier: Boolean to note if the multipliers on each Building
|
|
23
|
+
story will be passed along to the generated Honeybee Room objects
|
|
24
|
+
or if full geometry objects should be written for each story in the
|
|
25
|
+
building. (Default: True).
|
|
26
|
+
exclude_plenums: Boolean to indicate whether ceiling/floor plenum depths
|
|
27
|
+
assigned to Room2Ds should generate distinct 3D Rooms in the
|
|
28
|
+
translation. (Default: False).
|
|
29
|
+
solve_ceiling_adjacencies: Boolean to indicate whether adjacencies should
|
|
30
|
+
be solved between interior stories when Room2Ds perfectly match one
|
|
31
|
+
another in their floor plate. This ensures that Surface boundary
|
|
32
|
+
conditions are used instead of Adiabatic ones. (Default: True).
|
|
33
|
+
simulation_par: A honeybee-doe2 SimulationPar object to specify how the
|
|
34
|
+
DOE-2 simulation should be run. If None, default simulation
|
|
35
|
+
parameters will be generated, which will run the simulation for the
|
|
36
|
+
full year. (Default: None).
|
|
37
|
+
hvac_mapping: Text to indicate how HVAC systems should be assigned to the
|
|
38
|
+
exported model. Story will assign one HVAC system for each distinct
|
|
39
|
+
level polygon, Model will use only one HVAC system for the whole model
|
|
40
|
+
and AssignedHVAC will follow how the HVAC systems have been assigned
|
|
41
|
+
to the Rooms.properties.energy.hvac. Choose from the options
|
|
42
|
+
below. (Default: Story).
|
|
43
|
+
|
|
44
|
+
* Room
|
|
45
|
+
* Story
|
|
46
|
+
* Model
|
|
47
|
+
* AssignedHVAC
|
|
48
|
+
|
|
49
|
+
exclude_interior_walls: Boolean to note whether interior wall Faces
|
|
50
|
+
should be excluded from the resulting string. (Default: False).
|
|
51
|
+
exclude_interior_ceilings: Boolean to note whether interior ceiling
|
|
52
|
+
Faces should be excluded from the resulting string. (Default: False).
|
|
53
|
+
equest_version: An optional text string to denote the version of eQuest
|
|
54
|
+
for which the INP definition will be generated. If unspecified
|
|
55
|
+
or unrecognized, the latest version of eQuest will be used.
|
|
56
|
+
|
|
57
|
+
Usage:
|
|
58
|
+
|
|
59
|
+
.. code-block:: python
|
|
16
60
|
|
|
17
|
-
|
|
18
|
-
|
|
61
|
+
import os
|
|
62
|
+
from ladybug.futil import write_to_file
|
|
63
|
+
from ladybug_geometry.geometry3d import Point3D, Face3D
|
|
64
|
+
from dragonfly.model import Model
|
|
65
|
+
from dragonfly.building import Building
|
|
66
|
+
from dragonfly.story import Story
|
|
67
|
+
from dragonfly.room2d import Room2D
|
|
68
|
+
from dragonfly.roof import RoofSpecification
|
|
69
|
+
from dragonfly.windowparameter import SimpleWindowRatio
|
|
70
|
+
from honeybee.config import folders
|
|
71
|
+
|
|
72
|
+
# Crate an input Model
|
|
73
|
+
pts1 = (Point3D(0, 0, 0), Point3D(10, 0, 0),
|
|
74
|
+
Point3D(10, 10, 0), Point3D(0, 10, 0))
|
|
75
|
+
pts2 = (Point3D(10, 0, 0), Point3D(20, 0, 0),
|
|
76
|
+
Point3D(20, 10, 0), Point3D(10, 10, 0))
|
|
77
|
+
pts3 = (Point3D(0, 0, 3.25), Point3D(20, 0, 3.25),
|
|
78
|
+
Point3D(20, 5, 5), Point3D(0, 5, 5))
|
|
79
|
+
pts4 = (Point3D(0, 5, 5), Point3D(20, 5, 5),
|
|
80
|
+
Point3D(20, 10, 3.25), Point3D(0, 10, 3.25))
|
|
81
|
+
room2d_full = Room2D(
|
|
82
|
+
'R1-full', floor_geometry=Face3D(pts1), floor_to_ceiling_height=4,
|
|
83
|
+
is_ground_contact=True, is_top_exposed=True)
|
|
84
|
+
room2d_plenum = Room2D(
|
|
85
|
+
'R2-plenum', floor_geometry=Face3D(pts2), floor_to_ceiling_height=4,
|
|
86
|
+
is_ground_contact=True, is_top_exposed=True)
|
|
87
|
+
room2d_plenum.ceiling_plenum_depth = 1.0
|
|
88
|
+
roof = RoofSpecification([Face3D(pts3), Face3D(pts4)])
|
|
89
|
+
story = Story('S1', [room2d_full, room2d_plenum])
|
|
90
|
+
story.roof = roof
|
|
91
|
+
story.solve_room_2d_adjacency(0.01)
|
|
92
|
+
story.set_outdoor_window_parameters(SimpleWindowRatio(0.4))
|
|
93
|
+
building = Building('Office_Building_1234', [story])
|
|
94
|
+
model = Model('NewDevelopment1', [building])
|
|
95
|
+
|
|
96
|
+
# create the INP string for the model
|
|
97
|
+
inp_str = model.to.inp(model)
|
|
98
|
+
|
|
99
|
+
# write the final string into an INP
|
|
100
|
+
inp = os.path.join(folders.default_simulation_folder, 'test_file', 'in.inp')
|
|
101
|
+
write_to_file(inp, inp_str, True)
|
|
19
102
|
"""
|
|
103
|
+
# convert the Dragonfly Model to Honeybee
|
|
104
|
+
hb_model = model.to_honeybee(
|
|
105
|
+
'District', use_multiplier=use_multiplier, exclude_plenums=exclude_plenums,
|
|
106
|
+
solve_ceiling_adjacencies=solve_ceiling_adjacencies,
|
|
107
|
+
enforce_adj=False, enforce_solid=True)[0]
|
|
108
|
+
|
|
109
|
+
# assign the space polygon geometry to the Honeybee Rooms from Dragonfly
|
|
110
|
+
df_flr_geos = {} # dictionary to hold the DOE-2 space polygon geometry
|
|
111
|
+
for df_room in model.room_2ds:
|
|
112
|
+
df_flr_geos[df_room.identifier] = df_room.floor_geometry
|
|
113
|
+
for hb_room in hb_model.rooms:
|
|
114
|
+
try:
|
|
115
|
+
hb_room.properties.doe2.space_polygon_geometry = \
|
|
116
|
+
df_flr_geos[hb_room.identifier]
|
|
117
|
+
except KeyError: # possibly a 3D Room that has no Room2D geometry
|
|
118
|
+
pass
|
|
119
|
+
|
|
120
|
+
# patch missing adjacencies to adiabatic in case the models is a sub-selection
|
|
121
|
+
hb_model.properties.energy.missing_adjacencies_to_adiabatic()
|
|
20
122
|
|
|
21
|
-
#
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
out_folder = pathlib.Path(folder)
|
|
29
|
-
out_folder.mkdir(parents=True, exist_ok=True)
|
|
30
|
-
out_file = out_folder.joinpath(name)
|
|
31
|
-
out_file.write_text(inp_model.to_inp())
|
|
32
|
-
return out_file
|
|
123
|
+
# translate the Honeybee Model to INP
|
|
124
|
+
inp_str = hb_model_to_inp(
|
|
125
|
+
hb_model, simulation_par=simulation_par, hvac_mapping=hvac_mapping,
|
|
126
|
+
exclude_interior_walls=exclude_interior_walls,
|
|
127
|
+
exclude_interior_ceilings=exclude_interior_ceilings,
|
|
128
|
+
equest_version=equest_version)
|
|
129
|
+
return inp_str
|
|
@@ -1,38 +1,41 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dragonfly-doe2
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.12.1
|
|
4
4
|
Summary: Dragonfly extension for the DOE-2 energy simulation engine.
|
|
5
5
|
Home-page: https://github.com/ladybug-tools/dragonfly-doe2
|
|
6
6
|
Author: Ladybug Tools
|
|
7
7
|
Author-email: info@ladybug.tools
|
|
8
8
|
License: AGPL-3.0
|
|
9
|
-
Platform: UNKNOWN
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.6
|
|
11
9
|
Classifier: Programming Language :: Python :: 3.7
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
12
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
13
13
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
|
14
14
|
Classifier: Operating System :: OS Independent
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist:
|
|
17
|
+
Requires-Dist: honeybee-doe2==0.22.4
|
|
18
|
+
Requires-Dist: dragonfly-energy>=1.34.2
|
|
18
19
|
|
|
19
|
-

|
|
20
|
+
  
|
|
20
21
|
|
|
21
|
-
[](https://coveralls.io/github/ladybug-tools/dragonfly-doe2)
|
|
22
|
+
[](https://github.com/ladybug-tools/dragonfly-doe2/actions)
|
|
23
23
|
|
|
24
|
-
[](https://www.python.org/downloads/release/python-370/)
|
|
24
|
+
[](https://www.python.org/downloads/release/python-3100/) [](https://www.python.org/downloads/release/python-370/) [](https://www.python.org/downloads/release/python-270/) [](https://github.com/IronLanguages/ironpython2/releases/tag/ipy-2.7.8/)
|
|
25
25
|
|
|
26
26
|
# dragonfly-doe2
|
|
27
27
|
|
|
28
28
|
Dragonfly extension for energy modeling with the DOE-2 engine.
|
|
29
29
|
|
|
30
|
-
[DOE-2](https://www.doe2.com/) is a widely used and accepted freeware building energy analysis program that can predict the energy use and cost for all types of buildings.
|
|
30
|
+
[DOE-2](https://www.doe2.com/) is a widely used and accepted freeware building energy analysis program that can predict the energy use and cost for all types of buildings. It is the engine under the hood of the [eQuest](https://www.doe2.com/equest/) interface.
|
|
31
31
|
|
|
32
32
|
## Installation
|
|
33
33
|
|
|
34
34
|
`pip install -U dragonfly-doe2`
|
|
35
35
|
|
|
36
|
+
To check if the command line interface is installed correctly
|
|
37
|
+
use `dragonfly-doe2 --help`.
|
|
38
|
+
|
|
36
39
|
## QuickStart
|
|
37
40
|
|
|
38
41
|
```console
|
|
@@ -68,5 +71,3 @@ python -m pytest tests/
|
|
|
68
71
|
sphinx-apidoc -f -e -d 4 -o ./docs ./dragonfly_doe2
|
|
69
72
|
sphinx-build -b html ./docs ./docs/_build/docs
|
|
70
73
|
```
|
|
71
|
-
|
|
72
|
-
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
dragonfly_doe2/__init__.py,sha256=Fg3aP_2h6-UD4bqHbFJ3tMbA_ZED5uDGjDedY4XJp8g,40
|
|
2
|
+
dragonfly_doe2/__main__.py,sha256=3FrW6CO-CPoGSXn73hLWCejb0d-qnit6ga_565z49uY,75
|
|
3
|
+
dragonfly_doe2/_extend_dragonfly.py,sha256=_3XebNYHxG__7wxLOtW-aqPV-OIkplvVXgnBEDgrcS0,996
|
|
4
|
+
dragonfly_doe2/writer.py,sha256=Yfs9fEEhX8WrDqhy4nIxeOwMPDKHvu3RoeInz94pGO8,6224
|
|
5
|
+
dragonfly_doe2/cli/__init__.py,sha256=OwTHSsOOEoJjbw5CqPig8Yo7jk1f6m53OFnhuZgPthE,391
|
|
6
|
+
dragonfly_doe2/cli/translate.py,sha256=3aIXgAmZGUivktxNLT30r5iip9-msD-zm2SxBXkzzMo,7834
|
|
7
|
+
dragonfly_doe2/properties/__init__.py,sha256=h-O2WRFI5r12owvSQUrSgdLmlhM7shJAvzLFGryG3rk,37
|
|
8
|
+
dragonfly_doe2/properties/model.py,sha256=8zkiPVYjPKXLUr6_M4WRCJ-WJh20xE3mgyVjjpnpeuQ,11699
|
|
9
|
+
dragonfly_doe2/properties/room2d.py,sha256=ghKKhcX2TSgPUAdcQk-PPHo_5AilSmTiLElxb8--dkE,12773
|
|
10
|
+
dragonfly_doe2-0.12.1.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
|
11
|
+
dragonfly_doe2-0.12.1.dist-info/METADATA,sha256=TfEcjsAjSW2ISQg6wlRQoi1ZZ-IR4nIsMYTyWSimSFg,2690
|
|
12
|
+
dragonfly_doe2-0.12.1.dist-info/WHEEL,sha256=AHX6tWk3qWuce7vKLrj7lnulVHEdWoltgauo8bgCXgU,109
|
|
13
|
+
dragonfly_doe2-0.12.1.dist-info/entry_points.txt,sha256=oBzZOsc8Bs40iHKtuyWGrz_nfLZu1-6cHrBej05ZqrY,59
|
|
14
|
+
dragonfly_doe2-0.12.1.dist-info/top_level.txt,sha256=6CLCvUyl1H2vrbXmeA0ND_znFz4a2oOclc7NMBZxR6c,15
|
|
15
|
+
dragonfly_doe2-0.12.1.dist-info/RECORD,,
|
dragonfly_doe2/doe/__init__.py
DELETED
|
File without changes
|