diff --git a/Model_Library b/Model_Library index eedf77f1e62b29c8ffbf012f6d9b634d155efdaf..464d488d4660999a14542f1c636825c3b28fc2ab 160000 --- a/Model_Library +++ b/Model_Library @@ -1 +1 @@ -Subproject commit eedf77f1e62b29c8ffbf012f6d9b634d155efdaf +Subproject commit 464d488d4660999a14542f1c636825c3b28fc2ab diff --git a/README.md b/README.md index a0d07a9dfdb56d09cb50ecb26ebfba45a22cc46d..c80186675aa656fc9151086b4448ffc01d1af2b9 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ The ineed-dc-framework repository is the framework's main repository. It contain The sub-repository Model_Libary contains the mathematical models of component, prosumer, quarter, and city levels. - `Components/` : Contains all component models and initialized pre-configured components - - `Prosumer/` : Includes BaseProsumer model whhich allows to flexibily model any Prosumer application + - `Prosumer/` : Includes Prosumer model whhich allows to flexibily model any Prosumer application - `District/` : Will contain district level model (implementation in progress). - `City/` : Will contain city level model (implementation in progress). diff --git a/Tooling b/Tooling index 0c0e53de7c208ec319d660072c45e3e206f801b5..ba6b26e2db1c800c5d0f77b56efbff0bf7161333 160000 --- a/Tooling +++ b/Tooling @@ -1 +1 @@ -Subproject commit 0c0e53de7c208ec319d660072c45e3e206f801b5 +Subproject commit ba6b26e2db1c800c5d0f77b56efbff0bf7161333 diff --git a/input_files/convert_input_files_released_focused_refactoring.py b/input_files/convert_input_files_released_focused_refactoring.py new file mode 100644 index 0000000000000000000000000000000000000000..876de61f5c8d091a3a26cc45ae78c4b506c4ff47 --- /dev/null +++ b/input_files/convert_input_files_released_focused_refactoring.py @@ -0,0 +1,127 @@ +""" +This script inspects the input files and modifies them such that they adhere to the new input file specification used by the framework after merge of merge request !13 Release focused refactoring. +""" + +import os.path +import pandas as pd + +def component_to_commodities(type): + if type == "AbsorptionChiller": + return "heat", None, "cold", None + if type == "CompressorChiller": + return "electricity", None, "cold", None + if type == "CoolConsumption": + return "cold", None, None, None + if type == "CoolGrid": + return "cold", None, "cold", None + if type == "ChargingInfrastructure": + return "electricity", None, None, None + if type == "ElectricalBusBar": + return "electricity", None, "electricity", None + if type == "ElectricalConsumption": + return "electricity", None, None, None + if type == "ElectricalGrid": + return "electricity", None, "electricity", None + if type == "PVGenerator": + return None, None, "electricity", None + if type == "DynamicInverter": + return "electricity", None, "electricity", None + if type == "StaticInverter": + return "electricity", None, "electricity", None + if type == "LiionBattery": + return "electricity", None, "electricity", None + if type == "BHKW": + return "gas", None, "heat", "electricity" + if type == "CHP": + return "gas", None, "heat", "electricity" + if type == "GasGrid": + return "gas", None, "gas", None + if type == "ElectricBoiler": + return "electricity", None, "heat", None + if type == "GasBoiler": + return "gas", None, "heat", None + if type == "HeatGrid": + return "heat", None, "heat", None + if type == "ElectricRadiator": + return "electricity", None, "heat", None + if type == "HeatConsumption": + return "heat", None, None, None + if type == "Radiator": + return "heat", None, None, None + if type == "UnderfloorHeat": + return "heat", None, "heat", None + if type == "HeatExchanger": + return "heat", None, "heat", None + if type == "GasHeatPump": + return "gas", None, "heat", None + if type == "HeatPump": + return "electricity", None, "heat", None + if type == "HotWaterConsumption": + return "heat", None, None, None + if type == "SolarThermalCollector": + return None, None, "heat", None + if type == "HotWaterStorage": + return "heat", None, "heat", None + if type == "PEMElectrolyzer": + return "electricity", None, "hydrogen", None + if type == "PEMFuelCell": + return "hydrogen", None, "electricity", "heat" + if type == "PEMElectrolyzer": + return "electricity", None, "hydrogen", None + if type == "PressureStorage": + return "hydrogen", None, "hydrogen", None + raise KeyError + +changed_topologies = [] +invalid_topologies = [] +for dirpath, dirnames, filenames in os.walk(".\\input_files"): + components_here = False + connections_here = False + for filename in filenames: + if filename == "components.csv": + components_file = filename + components_here = True + elif filename == "connections.csv": + connections_file = filename + connections_here = True + + if components_here and connections_here: + try: + print(f"Inspecting topology {dirpath}") + components_df = pd.read_csv(os.path.join(dirpath, components_file)) + components = {} + for i in components_df.index: + components[components_df["name"][i]] = components_df.loc[i] + connections = pd.read_csv(os.path.join(dirpath, connections_file)) + connections['output'] = pd.Series("", index = connections.index) + connections['input'] = pd.Series("", index = connections.index) + for i in connections.index: + commodity = connections['sector'][i] + connection_from = connections['from'][i] + connection_to = connections['to'][i] + from_type = components[connection_from]['type'] + input_commodity_1, input_commodity_2, output_commodity_1, output_commodity_2 = component_to_commodities(from_type) + if commodity == output_commodity_1: + connections['output'][i] = "1" + elif commodity == output_commodity_2: + connections['output'][i] = "2" + else: + raise KeyError + to_type = components[connection_to]['type'] + input_commodity_1, input_commodity_2, output_commodity_1, output_commodity_2 = component_to_commodities(to_type) + if commodity == input_commodity_1: + connections['input'][i] = "1" + elif commodity == input_commodity_2: + connections['input'][i] = "2" + else: + raise KeyError + connections.drop("sector", axis = 1) + connections = connections[["from", "output", "to", "input"]] + changed_topologies.append(dirpath) + connections.to_csv(os.path.join(dirpath, "connections.csv"), index = False) + except: + invalid_topologies.append(dirpath) +for directory in changed_topologies: + print(f"Modified topology {directory}!") +for file in invalid_topologies: + print(f"Topology {file} breaks some part of the input file specification!") diff --git a/input_files/models/district_models/example_CA/connections.csv b/input_files/models/district_models/example_CA/connections.csv index 792c8b1f4fc0c752ba922b7fa195867470bc8ccc..460b1cd9c2881d454b8a33fe706d01636fd84dff 100644 --- a/input_files/models/district_models/example_CA/connections.csv +++ b/input_files/models/district_models/example_CA/connections.csv @@ -1,7 +1,7 @@ -sector,from,to -electricity,inv_pv_bat,battery -electricity,inv_pv_bat,grd -electricity,inv_pv_bat,elec_cns -electricity,battery,inv_pv_bat -electricity,grd,inv_pv_bat -electricity,grd,elec_cns +from,output,to,input +inv_pv_bat,1,battery,1 +inv_pv_bat,1,grd,1 +inv_pv_bat,1,elec_cns,1 +battery,1,inv_pv_bat,1 +grd,1,inv_pv_bat,1 +grd,1,elec_cns,1 diff --git a/input_files/models/district_models/example_community/connections.csv b/input_files/models/district_models/example_community/connections.csv index d63037e151876506cae26e672ae1687d659d48d7..fced4f72023e4e4bc430aec80753671b0d5480e8 100644 --- a/input_files/models/district_models/example_community/connections.csv +++ b/input_files/models/district_models/example_community/connections.csv @@ -1,8 +1,8 @@ -sector,from,to -electricity,pv_roof,inv_pv_bat -electricity,inv_pv_bat,battery -electricity,inv_pv_bat,grd -electricity,inv_pv_bat,elec_cns -electricity,battery,inv_pv_bat -electricity,grd,inv_pv_bat -electricity,grd,elec_cns +from,output,to,input +pv_roof,1,inv_pv_bat,1 +inv_pv_bat,1,battery,1 +inv_pv_bat,1,grd,1 +inv_pv_bat,1,elec_cns,1 +battery,1,inv_pv_bat,1 +grd,1,inv_pv_bat,1 +grd,1,elec_cns,1 diff --git a/input_files/models/district_models/jbr_test_ca/connections.csv b/input_files/models/district_models/jbr_test_ca/connections.csv index d63037e151876506cae26e672ae1687d659d48d7..fced4f72023e4e4bc430aec80753671b0d5480e8 100644 --- a/input_files/models/district_models/jbr_test_ca/connections.csv +++ b/input_files/models/district_models/jbr_test_ca/connections.csv @@ -1,8 +1,8 @@ -sector,from,to -electricity,pv_roof,inv_pv_bat -electricity,inv_pv_bat,battery -electricity,inv_pv_bat,grd -electricity,inv_pv_bat,elec_cns -electricity,battery,inv_pv_bat -electricity,grd,inv_pv_bat -electricity,grd,elec_cns +from,output,to,input +pv_roof,1,inv_pv_bat,1 +inv_pv_bat,1,battery,1 +inv_pv_bat,1,grd,1 +inv_pv_bat,1,elec_cns,1 +battery,1,inv_pv_bat,1 +grd,1,inv_pv_bat,1 +grd,1,elec_cns,1 diff --git a/input_files/models/district_models/jbr_test_comm/connections.csv b/input_files/models/district_models/jbr_test_comm/connections.csv index d63037e151876506cae26e672ae1687d659d48d7..fced4f72023e4e4bc430aec80753671b0d5480e8 100644 --- a/input_files/models/district_models/jbr_test_comm/connections.csv +++ b/input_files/models/district_models/jbr_test_comm/connections.csv @@ -1,8 +1,8 @@ -sector,from,to -electricity,pv_roof,inv_pv_bat -electricity,inv_pv_bat,battery -electricity,inv_pv_bat,grd -electricity,inv_pv_bat,elec_cns -electricity,battery,inv_pv_bat -electricity,grd,inv_pv_bat -electricity,grd,elec_cns +from,output,to,input +pv_roof,1,inv_pv_bat,1 +inv_pv_bat,1,battery,1 +inv_pv_bat,1,grd,1 +inv_pv_bat,1,elec_cns,1 +battery,1,inv_pv_bat,1 +grd,1,inv_pv_bat,1 +grd,1,elec_cns,1 diff --git a/input_files/models/prosumer_models/SCN0_CAT1/connections.csv b/input_files/models/prosumer_models/SCN0_CAT1/connections.csv index f911b10874d9f6ebe55ee5525ffe45638bdc258a..dbfe4b050cf08b6c72a40bde54198c026cc687a8 100644 --- a/input_files/models/prosumer_models/SCN0_CAT1/connections.csv +++ b/input_files/models/prosumer_models/SCN0_CAT1/connections.csv @@ -1,8 +1,8 @@ -sector,from,to -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV11/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV11/connections.csv index 07be821df10b12425e1874ef03d8cd624fd2f00a..29dd4e9de59d29d5045f4b11602ae54208ad6cfa 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV11/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV11/connections.csv @@ -1,11 +1,11 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/connections.csv index 907c9e7e18816817dd11611659105994e0026cc7..e1ac16fb043e46f95c946d86e111b51dfa2e3db1 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV12_BA/connections.csv @@ -1,17 +1,17 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,elec_cns -electricity,grd,inv_bat -electricity,inv_bat,battery -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,elec_cns,1 +grd,1,inv_bat,1 +inv_bat,1,battery,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/connections.csv index c82fe1d4ec799d877bb423124caebc1e8dd84053..b868a18efbd476fdfc3e68a7097cc7dcf0156dc8 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV13_BA_HP/connections.csv @@ -1,22 +1,22 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,heat_pump -electricity,grd,elec_cns -electricity,inv_bat,battery -electricity,inv_bat,heat_pump -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +inv_bat,1,battery,1 +inv_bat,1,heat_pump,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/connections.csv index 4048376f0e1f750128105af3c99da1f68d5c6591..ceb46125766b01ae11f0dc18c82ac8034c8b2d9d 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV14_HP/connections.csv @@ -1,16 +1,16 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,heat_pump -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV31/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV31/connections.csv index 07be821df10b12425e1874ef03d8cd624fd2f00a..29dd4e9de59d29d5045f4b11602ae54208ad6cfa 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV31/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV31/connections.csv @@ -1,11 +1,11 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/connections.csv index aedf9635c2d6cb19efa6ffae675a58c55a5a7c48..c459e9455f4378a562f9176f83648d0324e698c4 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV32_BA/connections.csv @@ -1,16 +1,16 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,elec_cns -electricity,inv_bat,battery -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,elec_cns,1 +inv_bat,1,battery,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/connections.csv index c82fe1d4ec799d877bb423124caebc1e8dd84053..b868a18efbd476fdfc3e68a7097cc7dcf0156dc8 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV33_BA_HP/connections.csv @@ -1,22 +1,22 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,heat_pump -electricity,grd,elec_cns -electricity,inv_bat,battery -electricity,inv_bat,heat_pump -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +inv_bat,1,battery,1 +inv_bat,1,heat_pump,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/connections.csv b/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/connections.csv index 4048376f0e1f750128105af3c99da1f68d5c6591..ceb46125766b01ae11f0dc18c82ac8034c8b2d9d 100644 --- a/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN2_CAT1_PV34_HP/connections.csv @@ -1,16 +1,16 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,heat_pump -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1/connections.csv index f911b10874d9f6ebe55ee5525ffe45638bdc258a..dbfe4b050cf08b6c72a40bde54198c026cc687a8 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1/connections.csv @@ -1,8 +1,8 @@ -sector,from,to -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV11/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV11/connections.csv index 07be821df10b12425e1874ef03d8cd624fd2f00a..29dd4e9de59d29d5045f4b11602ae54208ad6cfa 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV11/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV11/connections.csv @@ -1,11 +1,11 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/connections.csv index 907c9e7e18816817dd11611659105994e0026cc7..e1ac16fb043e46f95c946d86e111b51dfa2e3db1 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV12_BA/connections.csv @@ -1,17 +1,17 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,elec_cns -electricity,grd,inv_bat -electricity,inv_bat,battery -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,elec_cns,1 +grd,1,inv_bat,1 +inv_bat,1,battery,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/connections.csv index 14d304ec74d8ef0f33505e4fef9eafbc0d93b405..7e6ca7c5f888d21cc56e5a39d682ab8a54d26964 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV13_BA_HP/connections.csv @@ -1,23 +1,23 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,heat_pump -electricity,grd,elec_cns -electricity,grd,inv_bat -electricity,inv_bat,battery -electricity,inv_bat,heat_pump -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +grd,1,inv_bat,1 +inv_bat,1,battery,1 +inv_bat,1,heat_pump,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/connections.csv index 4048376f0e1f750128105af3c99da1f68d5c6591..ceb46125766b01ae11f0dc18c82ac8034c8b2d9d 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV14_HP/connections.csv @@ -1,16 +1,16 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,heat_pump -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV31/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV31/connections.csv index 07be821df10b12425e1874ef03d8cd624fd2f00a..29dd4e9de59d29d5045f4b11602ae54208ad6cfa 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV31/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV31/connections.csv @@ -1,11 +1,11 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/connections.csv index 907c9e7e18816817dd11611659105994e0026cc7..e1ac16fb043e46f95c946d86e111b51dfa2e3db1 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV32_BA/connections.csv @@ -1,17 +1,17 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,elec_cns -electricity,grd,inv_bat -electricity,inv_bat,battery -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,elec_cns,1 +grd,1,inv_bat,1 +inv_bat,1,battery,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/connections.csv index 14d304ec74d8ef0f33505e4fef9eafbc0d93b405..7e6ca7c5f888d21cc56e5a39d682ab8a54d26964 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV33_BA_HP/connections.csv @@ -1,23 +1,23 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,inv_pv,inv_bat -electricity,battery,inv_bat -electricity,grd,heat_pump -electricity,grd,elec_cns -electricity,grd,inv_bat -electricity,inv_bat,battery -electricity,inv_bat,heat_pump -electricity,inv_bat,grd -electricity,inv_bat,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +inv_pv,1,inv_bat,1 +battery,1,inv_bat,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +grd,1,inv_bat,1 +inv_bat,1,battery,1 +inv_bat,1,heat_pump,1 +inv_bat,1,grd,1 +inv_bat,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/connections.csv b/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/connections.csv index 4048376f0e1f750128105af3c99da1f68d5c6591..ceb46125766b01ae11f0dc18c82ac8034c8b2d9d 100644 --- a/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/connections.csv +++ b/input_files/models/prosumer_models/SCN3_CAT1_PV34_HP/connections.csv @@ -1,16 +1,16 @@ -sector,from,to -electricity,pv_roof,inv_pv -electricity,inv_pv,heat_pump -electricity,inv_pv,grd -electricity,inv_pv,elec_cns -electricity,grd,heat_pump -electricity,grd,elec_cns -gas,gas_grd,gas_boi -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,gas_boi,water_tes -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd -heat,gas_boi,therm_cns -heat,gas_boi,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv,1 +inv_pv,1,heat_pump,1 +inv_pv,1,grd,1 +inv_pv,1,elec_cns,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +gas_grd,1,gas_boi,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +gas_boi,1,water_tes,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 +gas_boi,1,therm_cns,1 +gas_boi,1,dhw_dmd,1 diff --git a/input_files/models/prosumer_models/jbr_test/connections.csv b/input_files/models/prosumer_models/jbr_test/connections.csv index d63037e151876506cae26e672ae1687d659d48d7..fced4f72023e4e4bc430aec80753671b0d5480e8 100644 --- a/input_files/models/prosumer_models/jbr_test/connections.csv +++ b/input_files/models/prosumer_models/jbr_test/connections.csv @@ -1,8 +1,8 @@ -sector,from,to -electricity,pv_roof,inv_pv_bat -electricity,inv_pv_bat,battery -electricity,inv_pv_bat,grd -electricity,inv_pv_bat,elec_cns -electricity,battery,inv_pv_bat -electricity,grd,inv_pv_bat -electricity,grd,elec_cns +from,output,to,input +pv_roof,1,inv_pv_bat,1 +inv_pv_bat,1,battery,1 +inv_pv_bat,1,grd,1 +inv_pv_bat,1,elec_cns,1 +battery,1,inv_pv_bat,1 +grd,1,inv_pv_bat,1 +grd,1,elec_cns,1 diff --git a/input_files/models/prosumer_models/mfh_quartal/connections.csv b/input_files/models/prosumer_models/mfh_quartal/connections.csv index 24fbbcbe2b387b1c2e48527a1eed199904fcc49b..0416b8eae930a195328ae32c779d86790430738a 100644 --- a/input_files/models/prosumer_models/mfh_quartal/connections.csv +++ b/input_files/models/prosumer_models/mfh_quartal/connections.csv @@ -1,35 +1,35 @@ -sector,from,to -electricity,grd,ecns1 -electricity,grd,ecns2 -electricity,grd,ecns3 -electricity,grd,ecns4 -electricity,grd,ecns5 -electricity,grd,ecns6 -electricity,pv,grd -electricity,pv,bat -electricity,pv,ecns1 -electricity,pv,ecns2 -electricity,pv,ecns3 -electricity,pv,ecns4 -electricity,pv,ecns5 -electricity,pv,ecns6 -electricity,bat,ecns1 -electricity,bat,ecns2 -electricity,bat,ecns3 -electricity,bat,ecns4 -electricity,bat,ecns5 -electricity,bat,ecns6 -electricity,chp,grd -electricity,chp,ecns1 -electricity,chp,ecns2 -electricity,chp,ecns3 -electricity,chp,ecns4 -electricity,chp,ecns5 -electricity,chp,ecns6 -gas,gas_grd,chp -heat,chp,tcns1 -heat,chp,tcns2 -heat,chp,tcns3 -heat,chp,tcns4 -heat,chp,tcns5 -heat,chp,tcns6 +from,output,to,input +grd,1,ecns1,1 +grd,1,ecns2,1 +grd,1,ecns3,1 +grd,1,ecns4,1 +grd,1,ecns5,1 +grd,1,ecns6,1 +pv,1,grd,1 +pv,1,bat,1 +pv,1,ecns1,1 +pv,1,ecns2,1 +pv,1,ecns3,1 +pv,1,ecns4,1 +pv,1,ecns5,1 +pv,1,ecns6,1 +bat,1,ecns1,1 +bat,1,ecns2,1 +bat,1,ecns3,1 +bat,1,ecns4,1 +bat,1,ecns5,1 +bat,1,ecns6,1 +chp,2,grd,1 +chp,2,ecns1,1 +chp,2,ecns2,1 +chp,2,ecns3,1 +chp,2,ecns4,1 +chp,2,ecns5,1 +chp,2,ecns6,1 +gas_grd,1,chp,1 +chp,1,tcns1,1 +chp,1,tcns2,1 +chp,1,tcns3,1 +chp,1,tcns4,1 +chp,1,tcns5,1 +chp,1,tcns6,1 diff --git a/input_files/models/prosumer_models/office_pv_heatpump/connections.csv b/input_files/models/prosumer_models/office_pv_heatpump/connections.csv index 2648881f72c712482bc13125ef1170dbd0a38ee6..84ee2b5bdfe592ebadd5f1eba58fb2b8edea8a5d 100644 --- a/input_files/models/prosumer_models/office_pv_heatpump/connections.csv +++ b/input_files/models/prosumer_models/office_pv_heatpump/connections.csv @@ -1,15 +1,15 @@ -sector,from,to -electricity,pv_roof,inv_pv_bat -electricity,inv_pv_bat,battery -electricity,inv_pv_bat,heat_pump -electricity,inv_pv_bat,grd -electricity,inv_pv_bat,elec_cns -electricity,battery,inv_pv_bat -electricity,grd,inv_pv_bat -electricity,grd,heat_pump -electricity,grd,elec_cns -heat,heat_pump,water_tes -heat,water_tes,therm_cns -heat,water_tes,dhw_dmd -heat,heat_pump,therm_cns -heat,heat_pump,dhw_dmd +from,output,to,input +pv_roof,1,inv_pv_bat,1 +inv_pv_bat,1,battery,1 +inv_pv_bat,1,heat_pump,1 +inv_pv_bat,1,grd,1 +inv_pv_bat,1,elec_cns,1 +battery,1,inv_pv_bat,1 +grd,1,inv_pv_bat,1 +grd,1,heat_pump,1 +grd,1,elec_cns,1 +heat_pump,1,water_tes,1 +water_tes,1,therm_cns,1 +water_tes,1,dhw_dmd,1 +heat_pump,1,therm_cns,1 +heat_pump,1,dhw_dmd,1 diff --git a/runme.py b/runme.py index 29ac2e8040ccc4fbdaf8af134c4585f1116b55ce..9f92ff7b955bb457e939dd3506cae04fe98b5d62 100644 --- a/runme.py +++ b/runme.py @@ -1,14 +1,14 @@ import pandas as pd import Tooling.input_profile_processor.input_profile_processor -import Model_Library.Prosumer.main as main -import Model_Library.District.main_district as main_district +import Model_Library.Prosumer.main as main_prosumer +import Model_Library.District.main as main_district from enum import Enum class SimulationScope(Enum): PROSUMER = 1 - COMMUNITY = 2 + DISTRICT = 2 -simulation_scope = SimulationScope.COMMUNITY +simulation_scope = SimulationScope.DISTRICT t_start = pd.Timestamp("2019-05-10 00:00:00") # start time of simulation t_horizon = 240 # number of time steps to be simulated t_step = 1 # length of a time step in hours @@ -46,7 +46,7 @@ prosumer_dict = {'SCN2_CAT1_PV11_3000_6000':{'config_path': 'input_files/models/ 'therm_cns': 'demand_heat_2', 'dhw_dmd': 'demand_hot_water_2'}}} -prosumer_main = main.Main(prosumer_dict, input_profiles, t_horizon, t_step) +prosumer_main = main_prosumer.ProsumerMain(prosumer_dict, input_profiles, t_horizon, t_step) prosumer_sizing_strategy = 'annuity' prosumer_main.optimize_sizing(prosumer_sizing_strategy) @@ -58,21 +58,21 @@ prosumers = prosumer_main.prosumers if simulation_scope == SimulationScope.PROSUMER: exit() -community_assets_dict = {'ca_bat': {'config_path': 'input_files/models/district_models/example_CA/config.csv', - 'topology_path': 'input_files/models/district_models/example_CA', - 'profiles': {'elec_cns': 'demand_electric_3'}}} +district_assets_dict = {'da_bat': {'config_path': 'input_files/models/district_models/example_CA/config.csv', + 'topology_path': 'input_files/models/district_models/example_CA', + 'profiles': {'elec_cns': 'demand_electric_3'}}} -community_assets = main.Main_CA(community_assets_dict, input_profiles, t_horizon, t_step).community_assets +district_assets = main_prosumer.DistrictAssetMain(district_assets_dict, input_profiles, t_horizon, t_step).district_assets -community_dict = {'community': {'config_path': 'input_files/models/district_models/example_community/config.csv', - 'profiles': {'elec_price': 'elec_price_1'}}} +district_dict = {'community': {'config_path': 'input_files/models/district_models/example_community/config.csv', + 'profiles': {'elec_price': 'elec_price_1'}}} -community_main = main_district.MainDistrict(community_dict, prosumers, community_assets, input_profiles, t_horizon, t_step) +district_main = main_district.DistrictMain(district_dict, prosumers, district_assets, input_profiles, t_horizon, t_step) -community_sizing_strategy = 'max_operational_profit' -community_main.optimize_sizing(community_sizing_strategy) +district_sizing_strategy = 'max_operational_profit' +district_main.optimize_sizing(district_sizing_strategy) -community_operation_strategy = 'max_operational_profit' -community_main.optimize_operation(t_horizon, community_operation_strategy) +district_operation_strategy = 'max_operational_profit' +district_main.optimize_operation(district_operation_strategy) -community_main.save_results() +district_main.save_results()