Beispiel #1
0
def test_ventilation_control_lockability():
    """Test the lockability of Ventilation objects."""
    ventilation = VentilationControl(20)

    ventilation.delta_temperature = -2
    ventilation.lock()
    with pytest.raises(AttributeError):
        ventilation.min_indoor_temperature = 22
    ventilation.unlock()
    ventilation.min_indoor_temperature = 22
Beispiel #2
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 #3
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 #4
0
def test_ventilation_control_init():
    """Test the initialization of VentilationControl and basic properties."""
    ventilation = VentilationControl()
    str(ventilation)  # test the string representation

    assert ventilation.min_indoor_temperature == -100
    assert ventilation.max_indoor_temperature == 100
    assert ventilation.min_outdoor_temperature == -100
    assert ventilation.max_outdoor_temperature == 100
    assert ventilation.delta_temperature == -100
    assert ventilation.schedule == always_on

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

    assert ventilation.min_indoor_temperature == 22
    assert ventilation.max_indoor_temperature == 28
    assert ventilation.min_outdoor_temperature == 12
    assert ventilation.max_outdoor_temperature == 32
    assert ventilation.delta_temperature == 0