Skip to content
Snippets Groups Projects
Commit 7188e57d authored by Yi Nie's avatar Yi Nie
Browse files

Merge branch 'dev_th_demand_yni' into 'main'

modify generator tool for hot water in non residential building

See merge request ineed-dc/tooling!4
parents be7a001b b8e6992e
Branches
No related tags found
No related merge requests found
...@@ -24,7 +24,9 @@ building_typ_list = ["Verwaltungsgebäude", ...@@ -24,7 +24,9 @@ building_typ_list = ["Verwaltungsgebäude",
"Beherbergen und Verpflegen", "Beherbergen und Verpflegen",
"Gewerbliche und industrielle", "Gewerbliche und industrielle",
"Verkaufsstätten", "Verkaufsstätten",
"Technikgebäude"] "Technikgebäude",
"Wohngebäude",
"Wohngebäude (MFH)"]
energy_typ_list = ["sehr hoch", "hoch", "mittel", "gering", "sehr gering"] energy_typ_list = ["sehr hoch", "hoch", "mittel", "gering", "sehr gering"]
# ============================================================================== # ==============================================================================
...@@ -82,12 +84,13 @@ def gen_heat_profile(building_typ, ...@@ -82,12 +84,13 @@ def gen_heat_profile(building_typ,
def gen_hot_water_profile(building_typ, area, year=2021, energy_typ="mittel"): def gen_hot_water_profile(building_typ, area, year=2021, energy_typ="mittel"):
new_zone_df = analysis_bld_zone(building_typ, area) # new_zone_df = analysis_bld_zone(building_typ, area)
for row in range(len(new_zone_df)): # for row in range(len(new_zone_df)):
zone = new_zone_df.loc[row, 'DIN_Zone'] # zone = new_zone_df.loc[row, 'DIN_Zone']
bld_hot_water_demand = calc_bld_demand(building_typ, area, 'hot_water', bld_hot_water_demand = calc_bld_demand(building_typ, area, 'hot_water',
energy_typ) energy_typ)
if building_typ == "Wohngebäude" or building_typ == "Wohngebäude (MFH)":
hot_water_heating_demand_df = pd.read_excel(input_dhw_path, hot_water_heating_demand_df = pd.read_excel(input_dhw_path,
sheet_name='DHW', sheet_name='DHW',
header=None, header=None,
...@@ -99,8 +102,8 @@ def gen_hot_water_profile(building_typ, area, year=2021, energy_typ="mittel"): ...@@ -99,8 +102,8 @@ def gen_hot_water_profile(building_typ, area, year=2021, energy_typ="mittel"):
# hot water with 12 grade Celsius inlet water. # hot water with 12 grade Celsius inlet water.
hot_water_heating_demand_df['Aktueller Wärmebedarf für ' \ hot_water_heating_demand_df['Aktueller Wärmebedarf für ' \
'Trinkwassererwärmung (kWh)'] = \ 'Trinkwassererwärmung (kWh)'] = \
hot_water_heating_demand_df['Wärmebedarf für Trinkwassererwärmung (' \ hot_water_heating_demand_df['Wärmebedarf für ' \
'kWh)'].map( 'Trinkwassererwärmung (kWh)'].map(
lambda x: x / (4180 * 300 * (60 - 12) / 3600 / 1000 * 365) * lambda x: x / (4180 * 300 * (60 - 12) / 3600 / 1000 * 365) *
bld_hot_water_demand) bld_hot_water_demand)
...@@ -108,10 +111,12 @@ def gen_hot_water_profile(building_typ, area, year=2021, energy_typ="mittel"): ...@@ -108,10 +111,12 @@ def gen_hot_water_profile(building_typ, area, year=2021, energy_typ="mittel"):
hot_water_heating_demand_df['Aktueller Wärmebedarf für ' hot_water_heating_demand_df['Aktueller Wärmebedarf für '
'Trinkwassererwärmung (kWh)']) 'Trinkwassererwärmung (kWh)'])
if building_typ == 'Verwaltungsgebäude': elif building_typ in building_typ_list and building_typ != "Wohngebäude" \
hour_status_array = np.array(op_time_status(year, zone)) or building_typ != "Wohngebäude (MFH)":
hot_water_heating_demand_array = np.multiply(hour_status_array, bld_occupancy = calc_bld_occupancy(building_typ, area, year)
hot_water_heating_demand_array) hot_water_heating_demand_array = bld_hot_water_demand / sum(
bld_occupancy) * np.array(bld_occupancy)
# print(hot_water_heating_demand_array)
return hot_water_heating_demand_array return hot_water_heating_demand_array
...@@ -277,6 +282,49 @@ def calc_zone_demand(demand_df, demand_typ, zone_typ, zone_area): ...@@ -277,6 +282,49 @@ def calc_zone_demand(demand_df, demand_typ, zone_typ, zone_area):
return total_demand return total_demand
def calc_bld_occupancy(building_typ,
area,
year):
"""According to standard SIA2024, the occupancy for each hour are given
for each thermal zone"""
din_table = pd.read_excel(input_profile_path, sheet_name='DIN V 18599')
sia_table = pd.read_excel(input_profile_path, sheet_name='SIA2024')
bld_occupancy = [0] * 8760
new_zone_df = analysis_bld_zone(building_typ, area)
# print(new_zone_df)
for row in range(len(new_zone_df)):
din_zone = new_zone_df.loc[row, 'DIN_Zone']
sia_zone = din_table.loc[
din_table['Raumtyp'] == din_zone, 'Raumtyp_SIA'].values[0]
hour_status = op_time_status(year, din_zone)
# print(sia_zone)
zone_area = new_zone_df.loc[row, 'new_area']
sia_pers = sia_table.loc[
sia_table['Raumtyp'] == sia_zone, 'Personenfläche'].values[0]
# print(sia_pers)
sia_pers_profile = sia_table.loc[
sia_table['Raumtyp'] == sia_zone, 'Personenbelegung'].values[0]
sia_pers_profile = sia_pers_profile.split(', ')
sia_pers_profile = list(map(float, sia_pers_profile))
# print(sia_pers_profile)
if not np.isnan(sia_pers):
zone_pers = zone_area / sia_pers
# print(zone_pers)
zone_pers_profile = zone_pers * np.array(sia_pers_profile)
zone_occupancy = [0] * 8760
for day in range(365):
for hour in range(24):
if hour_status[day*24+hour] == 1:
zone_occupancy[day*24+hour] = zone_pers_profile[hour]
# print(zone_pers_profile)
bld_occupancy += np.array(zone_occupancy)
# print(bld_occupancy)
return bld_occupancy
def degree_day(zone_typ, annual_value, profile_df, temperature_profile, def degree_day(zone_typ, annual_value, profile_df, temperature_profile,
status_list): status_list):
heat_profile = [] heat_profile = []
...@@ -347,7 +395,9 @@ if __name__ == "__main__": ...@@ -347,7 +395,9 @@ if __name__ == "__main__":
input_temp_path = os.path.join(base_path, 'tek_data', 'temperature.csv') input_temp_path = os.path.join(base_path, 'tek_data', 'temperature.csv')
temperature = pd.read_csv(input_temp_path)['temperature'].values temperature = pd.read_csv(input_temp_path)['temperature'].values
# gen_heat_profile("Wohngebäude", 300, temperature, plot=True) # gen_heat_profile("Wohngebäude", 300, temperature, plot=True)
print('Space heating demand profile:') # print('Space heating demand profile:')
print(gen_heat_profile("Verwaltungsgebäude", 300, temperature)) # print(gen_heat_profile("Wohngebäude (MFH)", 300, temperature))
print('Hot water demand profile:') print('Hot water demand profile:')
print(gen_hot_water_profile("Verwaltungsgebäude", 300)) print(gen_hot_water_profile("Verwaltungsgebäude", 300))
# calc_bld_occupancy("Verwaltungsgebäude", 300, year=2021)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment