Dragonfly extension for energy simulation.
Project description
dragonfly-energy
Dragonfly extension for energy simulation.
Installation
pip install dragonfly-energy
QuickStart
import dragonfly_energy
API Documentation
Usage
Since the building geometry in dragonfly is fundamentally 2D, creating a model of a building and assigning energy model properties can be done with a few lines of code. Here is an example:
from dragonfly.model import Model
from dragonfly.building import Building
from dragonfly.story import Story
from dragonfly.room2d import Room2D
from dragonfly.windowparameter import SimpleWindowRatio
from honeybee_energy.lib.programtypes import office_program
# create the Building object
pts_1 = (Point3D(0, 0, 3), Point3D(0, 10, 3), Point3D(10, 10, 3), Point3D(10, 0, 3))
pts_2 = (Point3D(10, 0, 3), Point3D(10, 10, 3), Point3D(20, 10, 3), Point3D(20, 0, 3))
pts_3 = (Point3D(0, 10, 3), Point3D(0, 20, 3), Point3D(10, 20, 3), Point3D(10, 10, 3))
pts_4 = (Point3D(10, 10, 3), Point3D(10, 20, 3), Point3D(20, 20, 3), Point3D(20, 10, 3))
room2d_1 = Room2D('Office1', Face3D(pts_1), 3)
room2d_2 = Room2D('Office2', Face3D(pts_2), 3)
room2d_3 = Room2D('Office3', Face3D(pts_3), 3)
room2d_4 = Room2D('Office4', Face3D(pts_4), 3)
story = Story('OfficeFloor', [room2d_1, room2d_2, room2d_3, room2d_4])
story.solve_room_2d_adjacency(0.01)
story.set_outdoor_window_parameters(SimpleWindowRatio(0.4))
story.multiplier = 4
building = Building('OfficeBuilding', [story])
# assign energy properties
for room in story.room_2ds:
room.properties.energy.program_type = office_program
room.properties.energy.add_default_ideal_air()
# create the Model object
model = Model('NewDevelopment', [building])
Once a Dragonfly Model has been created, it can be converted to a honeybee Model, which can then be converted to IDF format like so:
# create the dragonfly Model object
model = Model('NewDevelopment', [building])
# serialize the dragonfly Model to Honeybee Models and convert them to IDF
hb_models = model.to_honeybee('Building', use_multiplier=False, tolerance=0.01)
idfs = [hb_model.to.idf(hb_model) for hb_model in hb_models]
The dragonfly model can also be serialized to a geoJSON to be simulated with URBANopt.
from ladybug.location import Location
# create the dragonfly Model object
model = Model('NewDevelopment', [building])
# create a location for the geoJSON and write it to a folder
location = Location('Boston', 'MA', 'USA', 42.366151, -71.019357)
sim_folder = './tests/urbanopt_model'
geojson, hb_model_jsons, hb_models = model.to.urbanopt(model, location, folder=sim_folder)
Local Development
- Clone this repo locally
git clone git@github.com:ladybug-tools/dragonfly-energy
# or
git clone https://github.com/ladybug-tools/dragonfly-energy
- Install dependencies:
cd dragonfly-energy
pip install -r dev-requirements.txt
pip install -r requirements.txt
- Run Tests:
python -m pytest tests/
- Generate Documentation:
sphinx-apidoc -f -e -d 4 -o ./docs ./dragonfly_energy
sphinx-build -b html ./docs ./docs/_build/docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dragonfly-energy-1.22.108.tar.gz
(92.9 kB
view hashes)
Built Distribution
Close
Hashes for dragonfly-energy-1.22.108.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ffc4842740b87711b3fcbc957106f8fbff6f6561537b250e0d10c3086fb9b6a5 |
|
MD5 | c7bd817fead7f7fe3e81d65824bdcb6f |
|
BLAKE2b-256 | 96384dbd7969f66fc50de6c31fc15b5d64c383cc25f9ecc228b605a9718f632e |
Close
Hashes for dragonfly_energy-1.22.108-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0f3c3bbb1da4fbad4fea426fa789266f5494afb0c7f46298fc546fed969f189 |
|
MD5 | 05c1ea79b759bc526041a8501b52e187 |
|
BLAKE2b-256 | 4a2e6a64ab4ec78e026fb7b02c3f1eec9261e98e9a6c99406d41222935de86c8 |