How to use the teaser.examples.verification.vdi6007_testcases.vdi6007shared.hourly_average function in teaser

To help you get started, we’ve selected a few teaser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case03_new_core.py View on Github external
calc.t_set_heating = np.zeros(timesteps)  # in Kelvin
    calc.t_set_cooling = np.zeros(timesteps) + 600  # in Kelvin

    calc.heater_limit = np.zeros((timesteps, 3)) + 1e10
    calc.cooler_limit = np.zeros((timesteps, 3)) - 1e10

    q_ig = np.zeros(timesteps_day)
    for q in range(int(6 * timesteps_day / 24), int(18 * timesteps_day / 24)):
        q_ig[q] = 1000
    q_ig = np.tile(q_ig, 60)

    calc.internal_gains = q_ig

    t_air, q_air_hc = calc.simulate()

    T_air_mean = hourly_average(data=t_air-273.15, times_per_hour=times_per_hour)

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    this_path = os.path.dirname(os.path.abspath(__file__))
    ref_file = 'case03_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (T_air_ref_1, T_air_ref_10, T_air_ref_60) = vdic.load_res(ref_path)
    T_air_ref_1 = T_air_ref_1[:, 0]
    T_air_ref_10 = T_air_ref_10[:, 0]
    T_air_ref_60 = T_air_ref_60[:, 0]

    if plot_res:
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case10_new_core.py View on Github external
calc.heater_limit = np.zeros((timesteps, 3)) + 1e10
    calc.cooler_limit = np.zeros((timesteps, 3)) - 1e10

    calc.internal_gains_rad = source_igRad
    calc.internal_gains = Q_ig

    calc.solar_rad_in = solarRad_win_in

    calc.equal_air_temp = weatherTemperature

    calc.equal_air_temp = calc._eq_air_temp(
        h_sol=solarRad_wall, t_black_sky=t_black_sky)

    t_air, q_air_hc = calc.simulate()

    T_air_mean = hourly_average(data=t_air-273.15, times_per_hour=times_per_hour)

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    ref_file = 'case10_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (T_air_ref_1, T_air_ref_10, T_air_ref_60) = vdic.load_res(ref_path)
    T_air_ref_1 = T_air_ref_1[:, 0]
    T_air_ref_10 = T_air_ref_10[:, 0]
    T_air_ref_60 = T_air_ref_60[:, 0]

    if plot_res:
        plot_result(T_air_1, T_air_ref_1, "Results day 1", "temperature")
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case01_new_core.py View on Github external
calc.t_set_heating = np.zeros(timesteps)  # in Kelvin
    calc.t_set_cooling = np.zeros(timesteps) + 600  # in Kelvin

    calc.heater_limit = np.zeros((timesteps, 3)) + 1e10
    calc.cooler_limit = np.zeros((timesteps, 3)) - 1e10

    q_ig = np.zeros(timesteps_day)
    for q in range(int(6 * timesteps_day / 24), int(18 * timesteps_day / 24)):
        q_ig[q] = 1000
    q_ig = np.tile(q_ig, 60)

    calc.internal_gains = q_ig

    t_air, q_air_hc = calc.simulate()

    T_air_mean = hourly_average(data=t_air-273.15, times_per_hour=times_per_hour)

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    this_path = os.path.dirname(os.path.abspath(__file__))
    ref_file = 'case01_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (T_air_ref_1, T_air_ref_10, T_air_ref_60) = load_res(ref_path)

    T_air_ref_1 = T_air_ref_1[:, 0]
    T_air_ref_10 = T_air_ref_10[:, 0]
    T_air_ref_60 = T_air_ref_60[:, 0]
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case07_new_core.py View on Github external
calc.equal_air_temp = np.zeros(timesteps) + 295.15
    calc.solar_rad_in = np.zeros((timesteps, 1))

    calc.t_set_heating = prepare_set_temperature(timesteps_day)
    calc.t_set_cooling = prepare_set_temperature(timesteps_day)

    calc.heater_limit = np.zeros((timesteps, 3))
    calc.heater_limit[:, 0] = 500
    calc.cooler_limit = np.zeros((timesteps, 3))
    calc.cooler_limit[:, 0] = - 500

    calc.internal_gains_rad = prepare_internal_gains_rad(timesteps_day)

    t_air, q_air_hc = calc.simulate()

    Q_hc_mean = hourly_average(data=q_air_hc, times_per_hour=times_per_hour)

    Q_hc_1 = Q_hc_mean[0:24]
    Q_hc_10 = Q_hc_mean[216:240]
    Q_hc_60 = Q_hc_mean[1416:1440]

    this_path = os.path.dirname(os.path.abspath(__file__))
    ref_file = 'case07_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (Q_hc_ref_1, Q_hc_ref_10, Q_hc_ref_60) = vdic.load_res(ref_path)
    Q_hc_ref_1 = Q_hc_ref_1[:, 0]
    Q_hc_ref_10 = Q_hc_ref_10[:, 0]
    Q_hc_ref_60 = Q_hc_ref_60[:, 0]

    if plot_res:
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case09_new_core.py View on Github external
calc.heater_limit = np.zeros((timesteps, 3)) + 1e10
    calc.cooler_limit = np.zeros((timesteps, 3)) - 1e10

    calc.internal_gains_rad = source_igRad
    calc.internal_gains = Q_ig

    calc.solar_rad_in = solarRad_win_in

    calc.equal_air_temp = calc._eq_air_temp(
        h_sol=solarRad_wall_tiled,
        t_black_sky=t_black_sky)

    t_air, q_air_hc = calc.simulate()

    T_air_mean = hourly_average(data=t_air-273.15, times_per_hour=times_per_hour)

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    ref_file = 'case09_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (T_air_ref_1, T_air_ref_10, T_air_ref_60) = vdic.load_res(ref_path)
    T_air_ref_1 = T_air_ref_1[:, 0]
    T_air_ref_10 = T_air_ref_10[:, 0]
    T_air_ref_60 = T_air_ref_60[:, 0]

    if plot_res:
        plot_result(T_air_1, T_air_ref_1, "Results day 1", "temperature")
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case11_new_core.py View on Github external
calc.t_set_heating = prepare_set_temperature(timesteps_day)
    calc.t_set_cooling = prepare_set_temperature(timesteps_day)

    calc.heater_limit = np.zeros((timesteps, 3))
    calc.heater_limit[:, 0] = 500
    calc.heater_order = np.array([1, 2, 3])
    calc.cooler_limit = np.zeros((timesteps, 3))
    calc.cooler_limit[:, 0] = -500
    calc.cooler_order = [2, 1, 3]

    calc.internal_gains_rad = prepare_internal_gains_rad(timesteps_day)

    calc.debug = True
    t_air, q_air_hc, data_debug = calc.simulate()

    T_air_mean = hourly_average(data=t_air - 273.15, times_per_hour=times_per_hour)
    Q_hc_mean = hourly_average(data=q_air_hc, times_per_hour=times_per_hour)

    Q_hc_1 = Q_hc_mean[0:24]
    Q_hc_10 = Q_hc_mean[216:240]
    Q_hc_60 = Q_hc_mean[1416:1440]

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    this_path = os.path.dirname(os.path.abspath(__file__))
    ref_file = "case11_res.csv"
    ref_path = os.path.join(this_path, "inputs", ref_file)

    # Load reference results
    (load_res_1, load_res_10, load_res_60) = vdic.load_res(ref_path)
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case12_new_core.py View on Github external
calc.t_set_heating = np.zeros(timesteps)  # in Kelvin
    calc.t_set_cooling = np.zeros(timesteps) + 600  # in Kelvin

    calc.heater_limit = np.zeros((timesteps, 3)) + 1e10
    calc.cooler_limit = np.zeros((timesteps, 3)) - 1e10

    calc.internal_gains_rad = source_igRad
    calc.internal_gains = Q_ig

    calc.equal_air_temp = equalAirTemp
    calc.solar_rad_in = solarRad_in
    calc.vent_rate = ventRate

    t_air, q_air_hc = calc.simulate()

    T_air_mean = hourly_average(data=t_air - 273.15, times_per_hour=times_per_hour)

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    ref_file = 'case12_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (T_air_ref_1, T_air_ref_10, T_air_ref_60) = vdic.load_res(ref_path)
    T_air_ref_1 = T_air_ref_1[:,0]
    T_air_ref_10 = T_air_ref_10[:,0]
    T_air_ref_60 = T_air_ref_60[:,0]

    if plot_res:
        plot_result(T_air_1, T_air_ref_1, "Results day 1", "temperature")
github RWTH-EBC / TEASER / teaser / examples / verification / vdi6007_testcases / vdi6007_case04_new_core.py View on Github external
calc = VDICore(tz)
    calc.equal_air_temp = np.zeros(timesteps) + 295.15
    calc.solar_rad_in = np.zeros((timesteps, 1))

    calc.t_set_heating = np.zeros(timesteps)  # in Kelvin
    calc.t_set_cooling = np.zeros(timesteps) + 600  # in Kelvin

    calc.heater_limit = np.zeros((timesteps, 3)) + 1e10
    calc.cooler_limit = np.zeros((timesteps, 3)) - 1e10

    calc.internal_gains_rad = prepare_internal_gains_rad(timesteps_day)

    t_air, q_air_hc = calc.simulate()

    T_air_mean = hourly_average(data=t_air-273.15, times_per_hour=times_per_hour)

    T_air_1 = T_air_mean[0:24]
    T_air_10 = T_air_mean[216:240]
    T_air_60 = T_air_mean[1416:1440]

    this_path = os.path.dirname(os.path.abspath(__file__))
    ref_file = 'case04_res.csv'
    ref_path = os.path.join(this_path, 'inputs', ref_file)

    # Load reference results
    (T_air_ref_1, T_air_ref_10, T_air_ref_60) = vdic.load_res(ref_path)
    T_air_ref_1 = T_air_ref_1[:, 0]
    T_air_ref_10 = T_air_ref_10[:, 0]
    T_air_ref_60 = T_air_ref_60[:, 0]

    if plot_res: