コード例 #1
0
def test_thermal_condition_check():
    """Test the thermal condition check on AdaptiveParameter."""
    comf_result = adaptive_comfort_ashrae55(24, 28)
    adaptive_par = AdaptiveParameter()
    condition_test = adaptive_par.thermal_condition(comf_result)
    assert condition_test == 1

    comf_result = adaptive_comfort_ashrae55(24, 28)
    adaptive_par = AdaptiveParameter()
    condition_test = adaptive_par.thermal_condition(comf_result, 3)
    assert condition_test == 0
コード例 #2
0
def test_comfort_check():
    """Test comfort check on AdaptiveParameter."""
    comf_result = adaptive_comfort_ashrae55(24, 28)
    adaptive_par = AdaptiveParameter()
    comf_test = adaptive_par.is_comfortable(comf_result)
    assert comf_test == 0

    comf_result = adaptive_comfort_ashrae55(24, 28)
    adaptive_par = AdaptiveParameter()
    comf_test = adaptive_par.is_comfortable(comf_result, 3)
    assert comf_test == 1
コード例 #3
0
def test_adaptive_comfort_ashrae55():
    """Test the adaptive_comfort_ashrae55 function"""
    # test typical condition
    comf_result = adaptive_comfort_ashrae55(22, 25)
    assert comf_result['to'] == 25
    assert comf_result['t_comf'] == pytest.approx(24.62, rel=1e-2)
    assert comf_result['deg_comf'] == pytest.approx(0.3799, rel=1e-2)
    assert comf_result['deg_comf'] == comf_result['to'] - comf_result['t_comf']

    # test a cooler outdoor case
    comf_result = adaptive_comfort_ashrae55(16, 25)
    assert comf_result['to'] == 25
    assert comf_result['t_comf'] == pytest.approx(22.76, rel=1e-2)
    assert comf_result['deg_comf'] == pytest.approx(2.23999, rel=1e-2)
    assert comf_result['deg_comf'] == comf_result['to'] - comf_result['t_comf']

    # test a very cold outdoor case
    comf_result = adaptive_comfort_ashrae55(5, 23)
    assert comf_result['to'] == 23
    assert comf_result['t_comf'] == pytest.approx(20.900, rel=1e-2)
    assert comf_result['deg_comf'] == pytest.approx(2.0999, rel=1e-2)

    # testa a very hot outdoor case
    comf_result = adaptive_comfort_ashrae55(35, 28)
    assert comf_result['to'] == 28
    assert comf_result['t_comf'] == pytest.approx(28.185, rel=1e-2)
    assert comf_result['deg_comf'] == pytest.approx(-0.185, rel=1e-2)

    # test a fully conditioned case
    comf_result = adaptive_comfort_conditioned(24, 23, 1, 'ASHRAE-55')
    assert comf_result['to'] == 23
    assert comf_result['t_comf'] == pytest.approx(24.76, rel=1e-2)
    assert comf_result['deg_comf'] == pytest.approx(-1.76, rel=1e-2)

    # test a partially conditioned case
    comf_result = adaptive_comfort_conditioned(24, 23, 0.5, 'ASHRAE-55')
    assert comf_result['to'] == 23
    assert comf_result['t_comf'] == pytest.approx(25.0, rel=1e-2)
    assert comf_result['deg_comf'] == pytest.approx(-2.0, rel=1e-2)

    # test a air speed cooling effect function
    assert cooling_effect_ashrae55(1.5, 26) == 2.2
    assert cooling_effect_ashrae55(1.0, 26) == 1.8
    assert cooling_effect_ashrae55(0.7, 26) == 1.2
コード例 #4
0
    input_list = [_out_temp, _air_temp, _mrt_, _air_speed_]
    input, data_colls = extract_collections(input_list)
    adapt_par = adapt_par_ or AdaptiveParameter()

    if data_colls == []:
        # The inputs are all individual values.
        prevail_temp = input[0]
        to = t_operative(input[1], float(input[2]))

        # Determine the ralationship to the neutral temperature
        if adapt_par.conditioning != 0:
            comf_result = adaptive_comfort_conditioned(prevail_temp, to,
                                                       adapt_par.conditioning,
                                                       adapt_par.standard)
        elif adapt_par.ashrae55_or_en15251 is True:
            comf_result = adaptive_comfort_ashrae55(prevail_temp, to)
        else:
            comf_result = adaptive_comfort_en15251(prevail_temp, to)

        # Determine the cooling effect
        if adapt_par.discrete_or_continuous_air_speed is True:
            ce = cooling_effect_ashrae55(input[3], to)
        else:
            ce = cooling_effect_en15251(input[3], to)

        # Output results
        neutral_temp = comf_result['t_comf']
        deg_neutral = comf_result['deg_comf']
        comfort = adapt_par.is_comfortable(comf_result, ce)
        condition = adapt_par.thermal_condition(comf_result, ce)
    else: