honeybee_doe2.writer module

Methods to write to inp.

honeybee_doe2.writer.aperture_to_inp(aperture)[source]

Generate an INP string representation of a Aperture.

Apertures assigned to a parent Face will use the parent Face plane in order to determine their XY coordinates. Otherwise, the Aperture’s own plane will be used.

Note that the resulting string does not include full construction definitions. 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.inp method on each one.

Parameters:

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

Returns:

Text string for the INP definition of the Aperture.

honeybee_doe2.writer.door_to_inp(door)[source]

Generate an INP string representation of a Door.

Doors assigned to a parent Face will use the parent Face plane in order to determine their XY coordinates. Otherwise, the Door’s own plane will be used.

Note that the resulting string does not include full construction definitions. 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.inp method on each one.

Parameters:

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

Returns:

Text string for the INP definition of the Door.

honeybee_doe2.writer.face_3d_to_inp(face_3d, parent_name='HB object')[source]

Convert a Face3D into a DOE-2 POLYGON string and info to position it in space.

In this operation, all holes in the Face3D are ignored since they are not supported by DOE-2. Collapsing the boundary and holes into a single list that winds inward to cut out the holes will cause eQuest to raise an error.

Parameters:
  • face_3d – A ladybug-geometry Face3D object for which a INP POLYGON string will be generated.

  • parent_name – The name of the parent object that will reference this POLYGON. This will be used to generate a name for the polygon. Note that this should ideally have 24 characters or less so that the result complies with the strict 32 character limit of DOE-2 identifiers.

Returns:

A tuple with two elements.

  • polygon_str: Text string for the INP polygon.

  • position_info: A tuple of values used to locate the Polygon in 3D space. The order of properties in the tuple is as follows: (ORIGIN, TILT, AZIMUTH).

honeybee_doe2.writer.face_3d_to_inp_rectangle(face_3d)[source]

Convert a Face3D into parameters needed to represent it as a rectangle in INP.

The output of this function will be None if the Face3D cannot be represented as an INP rectangle without alteration of the geometry.

Parameters:

face_3d – A ladybug-geometry Face3D object which will be tested for whether it can be represented as a rectangle in INP.

Returns:

Will be None if the Face3D cannot be translated to a WIDTH and HEIGHT without alteration of the geometry. If the geometry can be successfully translated, this will be a tuple with five elements.

  • width: A number for the width of the rectangle.

  • height: A number for the height of the rectangle.

  • llc_origin: A Point3D for the lower-left corner of the Shade geometry origin.

  • tilt: A number for the tilt of the rectangle in degrees.

  • azimuth: A number for the azimuth of the rectangle in degrees.

honeybee_doe2.writer.face_to_inp(face, space_origin=Point3D(0.00, 0.00, 0.00), location=None)[source]

Generate an INP 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.apertures, and Face.doors and call the to.inp method on each one.

Parameters:
  • face – A honeybee Face for which an INP representation will be returned.

  • space_origin – A ladybug-geometry Point3D for the origin of the space to which the Face is assigned. (Default: (0, 0, 0)).

  • location – An optional text string to note the DOE-2 LOCATION of the Face on the parent Room. When this is specified, the Face will be written without using a POLYGON. (Default: None).

Returns:

A tuple with two elements.

  • face_polygon: Text string for the INP polygon for the Face.

  • face_def: Text string for the INP definition of the Face.

honeybee_doe2.writer.model_to_inp(model, simulation_par=None, hvac_mapping='Story', exclude_interior_walls=False, exclude_interior_ceilings=False, equest_version=None)[source]

Generate an INP string representation of a Model.

The resulting string will include all geometry (Rooms, Faces, Apertures, Doors, Shades), all fully-detailed constructions + materials, all fully-detailed schedules, and the room properties. It will also include the simulation parameters. Essentially, the string includes everything needed to simulate the model.

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

  • simulation_par – A honeybee-doe2 SimulationPar object to specify how the DOE-2 simulation should be run. If None, default simulation parameters will be generated, which will run the simulation for the full year. (Default: None).

  • hvac_mapping

    Text to indicate how HVAC systems should be assigned to the exported model. Story will assign one HVAC system for each distinct level polygon, Model will use only one HVAC system for the whole model and AssignedHVAC will follow how the HVAC systems have been assigned to the Rooms.properties.energy.hvac. Choose from the options below. (Default: Story).

    • Room

    • Story

    • Model

    • AssignedHVAC

  • exclude_interior_walls – Boolean to note whether interior wall Faces should be excluded from the resulting string. (Default: False).

  • exclude_interior_ceilings – Boolean to note whether interior ceiling Faces should be excluded from the resulting string. (Default: False).

  • equest_version – An optional text string to denote the version of eQuest for which the INP definition will be generated. If unspecified or unrecognized, the latest version of eQuest will be used.

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

# Crate an 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])

# create the INP string for the model
inp_str = model.to.inp(model)

# write the final string into an INP
inp = os.path.join(folders.default_simulation_folder, 'test_file', 'in.inp')
write_to_file(inp, inp_str, True)
honeybee_doe2.writer.room_doe2_conditioning_type(room)[source]

Get the DOE-2 conditioning type to be assigned to both the Space and Zone.

Parameters:

room – A Honeybee Room for which the conditioning type will be returned.

honeybee_doe2.writer.room_to_inp(room, floor_origin=Point3D(0.00, 0.00, 0.00), floor_height=None, exclude_interior_walls=False, exclude_interior_ceilings=False)[source]

Generate an INP string representation of a Room.

This will include the Room’s constituent Faces, Apertures and Doors with each of these elements being a separate item in the list of strings returned. However, any shades assigned to the Room or its constituent elements are excluded and should be written by looping through the shades on the parent model.

The resulting string will also 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 load objects are excluded as well as any construction or material definitions.

Parameters:
  • floor_origin – A ladybug-geometry Point3D for the origin of the floor (aka. story) to which the Room is a part of. (Default: (0, 0, 0)).

  • floor_height – An optional number for the parent story SPACE-HEIGHT, which will be used to check the Room geometry to determine if it must be written using POLYGONs. If None, no check will be performed. (Default: None)

  • exclude_interior_walls – Boolean to note whether interior wall Faces should be excluded from the resulting string. (Default: False).

  • exclude_interior_ceilings – Boolean to note whether interior ceiling Faces should be excluded from the resulting string. (Default: False).

Returns:

A tuple with two elements.

  • room_polygons: A list of text strings for the INP polygons needed to represent the Room and all of its constituent Faces.

  • room_defs: A list of text strings for the INP definitions needed to represent the Room and all of its constituent Faces, Apertures and Doors.

honeybee_doe2.writer.shade_mesh_to_inp(shade_mesh, equest_version=None)[source]

Generate an INP string representation of a ShadeMesh.

Parameters:
  • shade_mesh – A honeybee ShadeMesh for which an INP representation will be returned.

  • equest_version – An optional text string to denote the version of eQuest for which the Shade INP definition will be generated. If unspecified or unrecognized, the latest version of eQuest will be used.

Returns:

A tuple with two elements.

  • shade_polygons: A list of text strings for the INP polygons needed to represent the ShadeMesh.

  • shade_defs: A list of text strings for the INP definitions needed to represent the ShadeMesh.

honeybee_doe2.writer.shade_to_inp(shade, equest_version=None)[source]

Generate an INP string representation of a Shade.

Parameters:
  • shade – A honeybee Shade for which an INP representation will be returned.

  • equest_version – An optional text string to denote the version of eQuest for which the Shade INP definition will be generated. If unspecified or unrecognized, the latest version of eQuest will be used.

Returns:

A tuple with two elements.

  • shade_polygon: Text string for the INP polygon for the Shade.

  • shade_def: Text string for the INP definition of the Shade.