Fixed issue with additional column for tech performance during series air source run

This commit is contained in:
Peter Yefi 2022-03-11 10:18:33 -05:00
parent 380c6644a3
commit a8e44d5e30

View File

@ -71,6 +71,17 @@ class HeatPumpExport:
Write headers to the various csv file generated by insel
:return:
"""
file_one_headers = ['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)', 'Test Column']
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)',
@ -81,7 +92,7 @@ class HeatPumpExport:
'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)', 'Test Column'],
'Return Temperature', 'Demand (kW)'],
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)',
@ -100,6 +111,11 @@ class HeatPumpExport:
for file_path, header in header_data.items():
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:
df.drop(columns=df.columns[-1],
axis=1,
inplace=True)
df.to_csv(file_path, header=header)
def _update_input_data_with_files(self):
@ -167,8 +183,8 @@ class HeatPumpExport:
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 3
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 8
elif 35 <= self._input_data["HPSupTemp"] < 40:
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 2
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 4
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 2
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 4
# compute maximum demand. TODO: This should come from catalog in the future
max_demand = self._compute_max_demand()
@ -215,4 +231,3 @@ class HeatPumpExport:
s = pd.Series(["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec", "Total"])
df = df.set_index([s])
df.to_csv(self._output_path)