mabuseif commited on
Commit
18324cd
·
verified ·
1 Parent(s): dfc6c05

Update app/hvac_loads.py

Browse files
Files changed (1) hide show
  1. app/hvac_loads.py +6 -6
app/hvac_loads.py CHANGED
@@ -492,7 +492,7 @@ class TFMCalculations:
492
  return 0.0
493
 
494
  @staticmethod
495
- def calculate_ventilation_load(internal_loads: Dict, outdoor_temp: float, indoor_temp: float, area: float, building_info: Dict, mode: str = "none") -> tuple[float, float]:
496
  """Calculate ventilation load for heating and cooling in kW based on mode."""
497
  if mode == "none":
498
  return 0, 0
@@ -554,7 +554,7 @@ class TFMCalculations:
554
  return 0, 0
555
 
556
  @staticmethod
557
- def calculate_infiltration_load(internal_loads: Dict, outdoor_temp: float, indoor_temp: float, area: float, building_info: Dict, mode: str = "none") -> tuple[float, float]:
558
  """Calculate infiltration load for heating and cooling in kW based on mode."""
559
  if mode == "none":
560
  return 0, 0
@@ -761,16 +761,16 @@ class TFMCalculations:
761
  logger.info(f"Component {comp.get('name', 'Unknown')} ({TFMCalculations.get_component_type(comp).value}) solar load: {component_solar_load:.3f} kW, accumulated solar: {solar:.3f} kW")
762
 
763
  internal = TFMCalculations.calculate_internal_load(internal_loads, hour, max([p["end"] - p["start"] for p in operating_periods]), area)
764
- ventilation_cooling, _ = TFMCalculations.calculate_ventilation_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, mode="cooling")
765
- infiltration_cooling, _ = TFMCalculations.calculate_infiltration_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, mode="cooling")
766
  elif is_operating and mode == "heating":
767
  for comp_list in components.values():
768
  for comp in comp_list:
769
  _, heat_load = TFMCalculations.calculate_conduction_load(comp, outdoor_temp, indoor_temp, hour, mode="heating")
770
  conduction_heating += heat_load
771
  internal = TFMCalculations.calculate_internal_load(internal_loads, hour, max([p["end"] - p["start"] for p in operating_periods]), area)
772
- _, ventilation_heating = TFMCalculations.calculate_ventilation_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, mode="heating")
773
- _, infiltration_heating = TFMCalculations.calculate_infiltration_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, mode="heating")
774
  else:
775
  internal = 0
776
 
 
492
  return 0.0
493
 
494
  @staticmethod
495
+ def calculate_ventilation_load(internal_loads: Dict, outdoor_temp: float, indoor_temp: float, area: float, building_info: Dict, hour: int, mode: str = "none") -> tuple[float, float]:
496
  """Calculate ventilation load for heating and cooling in kW based on mode."""
497
  if mode == "none":
498
  return 0, 0
 
554
  return 0, 0
555
 
556
  @staticmethod
557
+ def calculate_infiltration_load(internal_loads: Dict, outdoor_temp: float, indoor_temp: float, area: float, building_info: Dict, hour: int, mode: str = "none") -> tuple[float, float]:
558
  """Calculate infiltration load for heating and cooling in kW based on mode."""
559
  if mode == "none":
560
  return 0, 0
 
761
  logger.info(f"Component {comp.get('name', 'Unknown')} ({TFMCalculations.get_component_type(comp).value}) solar load: {component_solar_load:.3f} kW, accumulated solar: {solar:.3f} kW")
762
 
763
  internal = TFMCalculations.calculate_internal_load(internal_loads, hour, max([p["end"] - p["start"] for p in operating_periods]), area)
764
+ ventilation_cooling, _ = TFMCalculations.calculate_ventilation_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, hour, mode="cooling")
765
+ infiltration_cooling, _ = TFMCalculations.calculate_infiltration_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, hour, mode="cooling")
766
  elif is_operating and mode == "heating":
767
  for comp_list in components.values():
768
  for comp in comp_list:
769
  _, heat_load = TFMCalculations.calculate_conduction_load(comp, outdoor_temp, indoor_temp, hour, mode="heating")
770
  conduction_heating += heat_load
771
  internal = TFMCalculations.calculate_internal_load(internal_loads, hour, max([p["end"] - p["start"] for p in operating_periods]), area)
772
+ _, ventilation_heating = TFMCalculations.calculate_ventilation_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, hour, mode="heating")
773
+ _, infiltration_heating = TFMCalculations.calculate_infiltration_load(internal_loads, outdoor_temp, indoor_temp, area, building_info, hour, mode="heating")
774
  else:
775
  internal = 0
776