Beispiel #1
0
def test_from_dict_vent_opening():
    """Test the Room2D from_dict method with ventilation opening energy properties."""
    pts = (Point3D(0, 0, 3), Point3D(10, 0, 3), Point3D(10, 10,
                                                        3), Point3D(0, 10, 3))
    ashrae_base = SimpleWindowRatio(0.4)
    room = Room2D('SquareShoebox', Face3D(pts), 3)
    room.set_outdoor_window_parameters(ashrae_base)

    ventilation = VentilationControl()
    ventilation.min_indoor_temperature = 22
    ventilation.max_indoor_temperature = 28
    ventilation.min_outdoor_temperature = 12
    ventilation.max_outdoor_temperature = 32
    ventilation.delta_temperature = 0

    opening = VentilationOpening()
    opening.fraction_area_operable = 0.25
    opening.fraction_height_operable = 0.5
    opening.wind_cross_vent = True

    room.properties.energy.window_vent_control = ventilation
    room.properties.energy.window_vent_opening = opening

    rd = room.to_dict()
    new_room = Room2D.from_dict(rd)
    assert new_room.to_dict() == rd
Beispiel #2
0
def test_set_window_opening():
    """Test the setting of window openings on a Room2D."""
    pts = (Point3D(0, 0, 3), Point3D(10, 0, 3), Point3D(10, 10,
                                                        3), Point3D(0, 10, 3))
    ashrae_base = SimpleWindowRatio(0.4)
    room = Room2D('SquareShoebox', Face3D(pts), 3)
    room.set_outdoor_window_parameters(ashrae_base)

    ventilation = VentilationControl()
    ventilation.min_indoor_temperature = 22
    ventilation.max_indoor_temperature = 28
    ventilation.min_outdoor_temperature = 12
    ventilation.max_outdoor_temperature = 32
    ventilation.delta_temperature = 0

    opening = VentilationOpening()
    opening.fraction_area_operable = 0.25
    opening.fraction_height_operable = 0.5
    opening.wind_cross_vent = True

    room.properties.energy.window_vent_control = ventilation
    room.properties.energy.window_vent_opening = opening

    hb_room, adj = room.to_honeybee()
    assert hb_room.properties.energy.window_vent_control == ventilation
    assert hb_room[1].apertures[0].properties.energy.vent_opening == opening
Beispiel #3
0
def test_ventilation_opening_init():
    """Test the initialization of VentilationOpening and basic properties."""
    ventilation = VentilationOpening()
    str(ventilation)  # test the string representation

    assert ventilation.fraction_area_operable == 0.5
    assert ventilation.fraction_height_operable == 1.0
    assert ventilation.discharge_coefficient == 0.45
    assert not ventilation.wind_cross_vent
    assert not ventilation.has_parent
    assert ventilation.parent is None

    ventilation.fraction_area_operable = 0.25
    ventilation.fraction_height_operable = 0.5
    ventilation.discharge_coefficient = 0.25
    ventilation.wind_cross_vent = True

    assert ventilation.fraction_area_operable == 0.25
    assert ventilation.fraction_height_operable == 0.5
    assert ventilation.discharge_coefficient == 0.25
    assert ventilation.wind_cross_vent