UrbanHeatPro.Classes.Simulation

Simulation.py A. Molar-Cruz @ TUM ENS

Module Contents

Classes

Simulation

Initialize the UrbanHeatPro Simulation object.

class UrbanHeatPro.Classes.Simulation.Simulation(NAME, SIMULATION, CITY, SPACE_HEATING, HOT_WATER, REPORTING)[source]

Initialize the UrbanHeatPro Simulation object.

Parameters:
  • NAME (str) – The name of the simulation.

  • SIMULATION (list) – A list containing the simulation parameters.

  • CITY (list) – A list containing the city parameters.

  • SPACE_HEATING (list) – A list containing the space heating parameters.

  • HOT_WATER (list) – A list containing the hot water parameters.

  • REPORTING (list) – A list containing the reporting options.

run(include_date=True)[source]

Runs a complete simulation of N runs of the city heat demand.

create_city_object(run, result_dir_run)[source]

Creates instance of class City

read_input_data_csv()[source]

Returns input data in csv files as numpy arrays.

read_raw_building_data()[source]

Reads building data from csv file. Returns a pd.DataFrame. Columns are renamed to variables in UrbanHeatPro.

read_syn_city(filename)[source]

Reads existing syn city file

read_Tamb()[source]

Reads Tamb data from csv file. The file contains the Tamb values for the whole year in simulation resolution. Only the simulation timesteps are extracted.

read_I()[source]

Reads solar radiation data from csv file. The file contains I values [W/m2] for the whole year in simulation resolution in the form [I_Gh, I_Dh, I_ex, hs]. Only the simulation timesteps are extracted.

filter_weather_data()[source]

Filter weather data with timesteps vector with typical days

update_Tamb()[source]

Updates Tamb of City object according to the scenario to simulate

read_refurbishment_matrices()[source]

Reads refurbishment matrix for residential and non residential buildings for scenario simulated.

prepare_result_directory(include_date=True)[source]

Creates a time stamped directory within the result folder. Returns path as string.

read_data_from_csv(my_file, usecols=None)[source]

Uses numpy to read csv file and returns content as numpy array. Two rows of header are always skipped.

calculate_typical_days()[source]

Calculates typical days based on Tamb timeseries. Based on Nahmmacher et al. (2016), Carpe diem: A novel approach to select representative days for long-term power system modeling.

calculate_dt_vector()[source]

Calculates a vector of datetime objects based on the raw dt_matrix of the form [Y, M, D, h, m] and the simulation time steps.

Returns:

self.dt_vector <list> List of datetime objects

convert_datetime_to_excel_date(dt)[source]

Converts a datetime object to an excel date

plot_power(space_heating=True, hot_water=True, total=True)[source]

Plot min, max, and mean power values for each time step.

plot_energy(space_heating=True, hot_water=True, total=True)[source]

Plots histogram of aggregated heat demand for all simulations

save_csv_power()[source]

Saves heat demand timeseries in csv files (space heating, hot water and total).

save_csv_energy()[source]

Saves key building parameters and heat energy demand (space heating, hot water and total).