From 32476c617b0ba216dc92ef90de5664f7d4221010 Mon Sep 17 00:00:00 2001 From: Peter Yefi Date: Tue, 16 Aug 2022 13:48:16 -0400 Subject: [PATCH] Adusted export to handle parallel simulations for both air source and water to water HPs --- exports/energy_systems/heat_pump_export.py | 40 ++++++++++++++++------ 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/exports/energy_systems/heat_pump_export.py b/exports/energy_systems/heat_pump_export.py index b1343c24..0c644777 100644 --- a/exports/energy_systems/heat_pump_export.py +++ b/exports/energy_systems/heat_pump_export.py @@ -72,17 +72,33 @@ class HeatPumpExport: Write headers to the various csv file generated by insel :return: """ + header = [ + 'Year', ' Month', ' Day', 'Hour', 'Minute', 'HP Heat Output (kW)', 'Heating Demand (kW)', 'HP output flow rate', + 'Building Required Flow Rate', 'TES Charging Rate (kg/s)', 'Water Flow Rate After Splitter', + 'water temperature after splitter', 'TES Discharging Rate (kg/s)', 'TES discharge temperature', + 'Mixer Outlet Flow Rate (kg/s)', 'Mixer outlet temperature', 'Auxiliary heater fuel flow rate', + 'Auxiliary heater energy input (kW)', 'Building Inlet Flow Rate (kg/s)', 'Building inlet temperature', + 'Building return temperature', 'TES Return Flow Rate (kg/s)', 'TES return temperature', + 'TES Bypass Line Flow Rate (kg/s)', 'TES bypass line temperature', 'Flow Rate from TES to mixer 2 (kg/s)', + 'Temperature from Tes to mixer', 'HP Inlet Flow Rate (kg/s)', 'HP Inlet temperature', 'TES Node 1 Temperature', + 'TES Node 2 Temperature', 'TES Node 3 Temperature', 'TES Node 4 Temperature', 'TES Energy Content (J)', + 'HP Electricity Consumption (kW)', 'HP COP', 'Ambient Temperature', 'HP Operational Cost (CAD)', + 'Auxiliary Heater Operational Cost (CAD)', 'Operational CO2 Emissions of HP (g)', + 'Operational CO2 Emissions of Auxiliary Heater (g)'] + if 'series' in str(self._template_path): + header = [ + 'Year', ' Month', ' Day', 'Hour', 'Minute', 'HP Heat Output (kW)', + 'HP Electricity Consumption (kW)', 'HP COP', 'TES Charging Rate (kg/s)', + 'TES Discharging Rate (kg/s)', 'TES Node 1 Temperature', 'TES Node 2 Temperature', + 'TES Node 3 Temperature', 'TES Node 4 Temperature', 'TES Energy Content (J)', + 'TES Energy Content (kWh)', 'TES Energy Content Variation (kWh)', + 'Auxiliary Heater Fuel Flow Rate (kg/s)', 'Auxiliary Heater Energy Input (kW)', + 'HP Operational Cost (CAD)', 'Auxiliary Heater Operational Cost (CAD)', + 'Operational CO2 Emissions of HP (g)', + 'Operational CO2 Emissions of Auxiliary Heater (g)', + 'Return Temperature', 'Demand (kW)'] header_data = { - self._input_data['fileOut1']: ['Year', ' Month', ' Day', 'Hour', 'Minute', 'HP Heat Output (kW)', - 'HP Electricity Consumption (kW)', 'HP COP', 'TES Charging Rate (kg/s)', - 'TES Discharging Rate (kg/s)', 'TES Node 1 Temperature', 'TES Node 2 Temperature', - 'TES Node 3 Temperature', 'TES Node 4 Temperature', 'TES Energy Content (J)', - 'TES Energy Content (kWh)', 'TES Energy Content Variation (kWh)', - 'Auxiliary Heater Fuel Flow Rate (kg/s)', 'Auxiliary Heater Energy Input (kW)', - 'HP Operational Cost (CAD)', 'Auxiliary Heater Operational Cost (CAD)', - 'Operational CO2 Emissions of HP (g)', - 'Operational CO2 Emissions of Auxiliary Heater (g)', - 'Return Temperature', 'Demand (kW)'], + self._input_data['fileOut1']: header, self._input_data['fileOut2']: ['Day', 'Operational Daily Emissions from Heat Pumps (g)', 'Operational Daily Emissions from Auxiliary Heater (g)'], self._input_data['fileOut3']: ['Month', 'Monthly Operational Costs of Heat Pumps (CAD)', @@ -102,7 +118,7 @@ class HeatPumpExport: file_path = file_path.strip("'") df = pd.read_csv(file_path, header=None, sep='\s+') # ignore ambient temperature for air source series run - if df.shape[1] > 25: + if df.shape[1] > 25 and 'series' in str(self._template_path): df.drop(columns=df.columns[-1], axis=1, inplace=True) @@ -161,6 +177,8 @@ class HeatPumpExport: with open(self._constants_path) as file: constants_dict = yaml.load(file, Loader=yaml.FullLoader) for key, value in constants_dict.items(): + if key in ['LowestPossibleLoadFlow', 'HighestPossibleLoadFlow'] and self._water_temp is None: + continue self._input_data[key] = value # compute water to water HP specific values if 55 <= self._input_data['HPSupTemp'] <= 60: