honeybee_energy.writer module

Methods to write to idf.

honeybee_energy.writer.aperture_to_idf(aperture)[source]

Generate an IDF string representation of an Aperture.

Note that the resulting string does not include full construction definitions but it will include a WindowShadingControl definition if a WindowConstructionShade is assigned to the aperture. It will also include a ventilation object if the aperture has a VentilationOpening object assigned to it.

Also note that shades assigned to the Aperture are not included in the resulting string. To write these objects into a final string, you must loop through the Aperture.shades, and call the to.idf method on each one.

Parameters

aperture – A honeybee Aperture for which an IDF representation will be returned.

honeybee_energy.writer.door_to_idf(door)[source]

Generate an IDF string representation of a Door.

Note that the resulting string does not include full construction definitions but it will include a WindowShadingControl definition if a WindowConstructionShade is assigned to the door. It will also include a ventilation object if the door has a VentilationOpening object assigned to it.

Also note that shades assigned to the Door are not included in the resulting string. To write these objects into a final string, you must loop through the Door.shades, and call the to.idf method on each one.

Parameters

door – A honeybee Door for which an IDF representation will be returned.

honeybee_energy.writer.energyplus_idf_version(version_array=None)[source]

Get IDF text for the version of EnergyPlus.

This will match the version of EnergyPlus found in the config if it it exists. It will be None otherwise.

Parameters

version_array – An array of up to 3 integers for the version of EnergyPlus for which an IDF string should be generated. If None, the energyplus_version from the config will be used if it exists.

honeybee_energy.writer.face_to_idf(face)[source]

Generate an IDF string representation of a Face.

Note that the resulting string does not include full construction definitions.

Also note that this does not include any of the shades assigned to the Face in the resulting string. Nor does it include the strings for the apertures or doors. To write these objects into a final string, you must loop through the Face.shades, Face.apertures, and Face.doors and call the to.idf method on each one.

Parameters

face – A honeybee Face for which an IDF representation will be returned.

honeybee_energy.writer.generate_idf_string(object_type, values, comments=None)[source]

Get an IDF string representation of an EnergyPlus object.

Parameters
  • object_type – Text representing the expected start of the IDF object. (ie. WindowMaterial:Glazing).

  • values – A list of values associated with the EnergyPlus object in the order that they are supposed to be written to IDF format.

  • comments – A list of text comments with the same length as the values. If None, no comments will be written into the object.

Returns

ep_str – Am EnergyPlus IDF string representing a single object.

honeybee_energy.writer.model_to_idf(model, schedule_directory=None, use_ideal_air_equivalent=True, patch_missing_adjacencies=False)[source]

Generate an IDF string representation of a Model.

The resulting string will include all geometry (Rooms, Faces, Shades, Apertures, Doors), all fully-detailed constructions + materials, all fully-detailed schedules, and the room properties (loads, thermostats with setpoints, and HVAC).

Essentially, the string includes everything needed to simulate the model except the simulation parameters. So joining this string with the output of SimulationParameter.to_idf() should create a simulate-able IDF.

Parameters
  • model – A honeybee Model for which an IDF representation will be returned.

  • schedule_directory – An optional file directory to which all file-based schedules should be written to. If None, all ScheduleFixedIntervals will be translated to Schedule:Compact and written fully into the IDF string instead of to Schedule:File. (Default: None).

  • use_ideal_air_equivalent – Boolean to note whether any detailed HVAC system templates should be converted to an equivalent IdealAirSystem upon export. If False and the Model contains detailed systems, a ValueError will be raised since this method does not support the translation of detailed systems. (Default:True).

  • patch_missing_adjacencies – Boolean to note whether any missing adjacencies in the model should be replaced with Adiabatic boundary conditions. This is useful when the input model is only a portion of a much larger model. (Default: False).

Usage:

import os
from ladybug.futil import write_to_file
from honeybee.model import Model
from honeybee.room import Room
from honeybee.config import folders
from honeybee_energy.lib.programtypes import office_program
from honeybee_energy.hvac.idealair import IdealAirSystem
from honeybee_energy.simulation.parameter import SimulationParameter

# Get input Model
room = Room.from_box('Tiny House Zone', 5, 10, 3)
room.properties.energy.program_type = office_program
room.properties.energy.add_default_ideal_air()
model = Model('Tiny House', [room])

# Get the input SimulationParameter
sim_par = SimulationParameter()
sim_par.output.add_zone_energy_use()
ddy_file = 'C:/EnergyPlusV9-0-1/WeatherData/USA_CO_Golden-NREL.724666_TMY3.ddy'
sim_par.sizing_parameter.add_from_ddy_996_004(ddy_file)

# create the IDF string for simulation parameters and model
idf_str = '\n\n'.join((sim_par.to_idf(), model.to.idf(model)))

# write the final string into an IDF
idf = os.path.join(folders.default_simulation_folder, 'test_file', 'in.idf')
write_to_file(idf, idf_str, True)
honeybee_energy.writer.orphaned_aperture_to_idf(aperture)[source]

Generate an IDF string representation of an orphaned Aperture.

The resulting string will possess both the Shading object as well as a ShadingProperty:Reflectance that aligns with the Aperture’s exterior construction properties. However, a transmittance schedule that matches the transmittance of the window construction will only be referenced and not included in the resulting string. All transmittance schedules follow the format of ‘Constant %.3f Transmittance’.

Parameters

aperture – An orphaned Aperture for which an IDF shade representation will be returned.

honeybee_energy.writer.orphaned_door_to_idf(door)[source]

Generate an IDF string representation of an orphaned Door.

The resulting string will possess both the Shading object as well as a ShadingProperty:Reflectance that aligns with the Door’s exterior construction properties. However, a transmittance schedule that matches the transmittance of a window construction will only be referenced and not included in the resulting string.

Parameters

door – An orphaned Door for which an IDF shade representation will be returned.

honeybee_energy.writer.orphaned_face_to_idf(face)[source]

Generate an IDF string representation of an orphaned Face.

The resulting string will possess both the Shading object as well as a ShadingProperty:Reflectance that aligns with the Face’s exterior construction properties.

Parameters

face – An orphaned Face for which an IDF representation will be returned.

honeybee_energy.writer.room_to_idf(room)[source]

Generate an IDF string representation of a Room.

The resulting string will include all internal gain definitions for the Room (people, lights, equipment), infiltration definitions, ventilation requirements, and thermostat objects. However, complete schedule definitions assigned to these objects are excluded and the Room’s hvac is also excluded.

Also note that this method does not write any of the geometry of the Room into the resulting string. To represent the Room geometry, you must loop through the Room.shades and Room.faces and call the to.idf method on each one. Note that you will likely also need to call to.idf on the apertures, doors and shades of each face as well as the shades on each aperture.

Parameters

room – A honeybee Room for which an IDF representation will be returned.

honeybee_energy.writer.shade_mesh_to_idf(shade_mesh)[source]

Generate an IDF string representation of a ShadeMesh.

Note that the resulting string will possess both the Shading object as well as a ShadingProperty:Reflectance if the Shade’s construction is not in line with the EnergyPlus default of 0.2 reflectance.

Parameters

shade_mesh – A honeybee ShadeMesh for which an IDF representation will be returned.

honeybee_energy.writer.shade_to_idf(shade)[source]

Generate an IDF string representation of a Shade.

Note that the resulting string will possess both the Shading object as well as a ShadingProperty:Reflectance if the Shade’s construction is not in line with the EnergyPlus default of 0.2 reflectance.

Parameters

shade – A honeybee Shade for which an IDF representation will be returned.