Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Returns
-------
result_tuple : tuple (of floats)
Results tuple with maximal temperature deviations
(max_dev_1, max_dev_10, max_dev_60)
"""
# Definition of time horizon
times_per_hour = 60
timesteps = 24 * 60 * times_per_hour # 60 days
timesteps_day = int(24 * times_per_hour)
tz = prepare_thermal_zone(timesteps, room="L")
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]
this_path = os.path.dirname(os.path.abspath(__file__))
ref_file = 'case05_t_amb.csv'
ref_path = os.path.join(this_path, 'inputs', ref_file)
t_outside_raw = np.loadtxt(ref_path, delimiter=",")
t_outside = ([t_outside_raw[2 * i, 1] for i in range(24)])
t_outside_adj = np.repeat(t_outside, times_per_hour)
weatherTemperature = np.tile(t_outside_adj, 60)
equalAirTemp = weatherTemperature
tz = prepare_thermal_zone(timesteps, room="S1")
tz.model_attr.transparent_areas = [7] # Adjust setting for this test case
calc = VDICore(tz)
calc.equal_air_temp = np.zeros(timesteps) + 295.15
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
t_air, q_air_hc = calc.simulate()
Defines, if results should be plotted (default: False)
Returns
-------
result_tuple : tuple (of floats)
Results tuple with maximal temperature deviations
(max_dev_1, max_dev_10, max_dev_60)
"""
# Definition of time horizon
times_per_hour = 60
timesteps = 24 * 60 * times_per_hour # 60 days
timesteps_day = int(24 * times_per_hour)
tz = prepare_thermal_zone(timesteps, room="S1")
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]
"""
# Definition of time horizon
times_per_hour = 60
timesteps = 24 * 60 * times_per_hour # 60 days
timesteps_day = int(24 * times_per_hour)
tz = prepare_thermal_zone(timesteps, room="S1")
tz.volume = 0 # Seems to have no effect on results
tz.model_attr.alpha_comb_inner_iw = 3 # Improvement, see doc-string
# tz.model_attr.alpha_conv_outer_ow = 25 # No effect because only used in equalAirTemp
# tz.model_attr.alpha_comb_outer_ow = 10.5 * 25 # Partial improvement, overall worse
tz.model_attr.ratio_conv_rad_inner_win = 0 # No effect
tz.infiltration_rate = 0 # No effect
calc = VDICore(tz)
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.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
weatherTemperature = np.tile(t_outside_adj, 60)
weather = WeatherData()
weather.air_temp = weatherTemperature
tz = prepare_thermal_zone(timesteps, room="S2", weather=weather)
# Adjust settings for this test case
tz.t_ground = 285.15
tz.model_attr.solar_absorp_ow = 0.7
tz.model_attr.ir_emissivity_outer_ow = 0.9
tz.model_attr.weightfactor_ow = [0.05796831135677373, 0.13249899738691134]
tz.model_attr.weightfactor_win = [0.4047663456281575, 0.4047663456281575]
tz.model_attr.weightfactor_ground = 0
calc = VDICore(tz)
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.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)
# alpha_conv_outer_ow needs to be area weighted for groundfloor ((1.7 *
# 17.5 + 20* 3.5)/21)=4.75
model_data.alpha_conv_outer_ow = 4.75
model_data.alpha_rad_outer_ow = 5
model_data.alpha_comb_outer_ow = 9.75
model_data.alpha_rad_inner_mean = 5
model_data.solar_absorp_ow = 0.7
model_data.ir_emissivity_outer_ow = 0.9
model_data.weightfactor_ow = [0.04646093176283288]
model_data.weightfactor_win = [0.32441554918476245]
model_data.weightfactor_ground = 0.6291235190524047
tz.model_attr = model_data
calc = VDICore(tz)
calc.initial_air_temp = 273.15 + 17.6
calc.initial_outer_wall_temp = 273.15 + 17.6
calc.initial_inner_wall_temp = 273.15 + 17.6
calc.equal_air_temp = np.zeros(timesteps) + 295.15
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
Returns
-------
result_tuple : tuple (of floats)
Results tuple with maximal temperature deviations
(max_dev_1, max_dev_10, max_dev_60)
"""
# Definition of time horizon
times_per_hour = 60 # 60 minutes per hour
timesteps = 24 * 60 * times_per_hour # 60 days (with minute timestep)
timesteps_day = int(
24 * times_per_hour) # 24 * 60 minute timesteps per day
tz = prepare_thermal_zone(timesteps, room="S1")
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
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