Added additional parameter to method for running insel

This commit is contained in:
Peter Yefi 2022-01-29 09:42:34 -05:00
parent 34fbd393aa
commit 81bb8a1795
3 changed files with 6 additions and 4 deletions

View File

@ -48,4 +48,4 @@ class AirSourceHPExport(HeatPumpExport):
:return:
"""
capacity_coeff, power_coeff = self._extract_model_coff(hp_model, data_type)
super(AirSourceHPExport, self)._run_insel(user_input, capacity_coeff, power_coeff)
super(AirSourceHPExport, self)._run_insel(user_input, capacity_coeff, power_coeff, 'air_source.insel')

View File

@ -27,13 +27,14 @@ class HeatPumpExport:
self._base_path = base_path
self._output_path = output_path
def _run_insel(self, user_input: Dict, capacity_coeff: List, power_coeff: List) -> None:
def _run_insel(self, user_input: Dict, capacity_coeff: List, power_coeff: List, filename: str) -> None:
"""
Runs insel and write the necessary files
:param user_input: a dictionary containing the user
values necessary to run insel
:param capacity_coeff: a list containing capacity coefficients
:param power_coeff: a list containing power demand coefficients
:param filename: the name of the insel file to be created
:return:
"""
self._input_data = user_input
@ -50,7 +51,7 @@ class HeatPumpExport:
insel_template_content = insel_template_handler.read()
insel_template = Template(insel_template_content).substitute(self._input_data)
# create the insel file and write the template with substituted values into it
insel_file = (self._base_path / 'heat_pumps/dompark_heat_pump.insel')
insel_file = (self._base_path / 'heat_pumps' / filename)
insel_file_handler = open(insel_file, "w")
insel_file_handler.write(insel_template)
# Now run insel
@ -156,6 +157,7 @@ class HeatPumpExport:
constants_dict = yaml.load(file, Loader=yaml.FullLoader)
for key, value in constants_dict.items():
self._input_data[key] = value
# compute maximum demand. TODO: This should come from catalog in the future
max_demand = self._compute_max_demand()
# compute TESCapacity

View File

@ -47,7 +47,7 @@ class WaterToWaterHPExport(HeatPumpExport):
:return:
"""
pow_demand_coeff, heat_output_coeff = self._extract_model_coff(hp_model, data_type)
super(WaterToWaterHPExport, self)._run_insel(user_input, pow_demand_coeff, heat_output_coeff)
super(WaterToWaterHPExport, self)._run_insel(user_input, pow_demand_coeff, heat_output_coeff, 'w2w.insel')