final_energy_system_model #60

Merged
g_gutierrez merged 113 commits from final_energy_system_model into main 2024-03-14 09:13:21 -04:00
2 changed files with 13 additions and 6 deletions
Showing only changes of commit cbda6ce13d - Show all commits

View File

@ -744,15 +744,18 @@ class Building(CityObject):
if self.energy_systems is None:
return None
for energy_system in self.energy_systems:
generation_systems = energy_system.generation_system
for demand_type in energy_system.demand_types:
if demand_type.lower() == consumption_type.lower():
if consumption_type in (cte.HEATING, cte.DOMESTIC_HOT_WATER):
coefficient_of_performance = energy_system.generation_system.generic_generation_system.heat_efficiency
for generation_system in generation_systems:
coefficient_of_performance = generation_system.generic_generation_system.heat_efficiency
elif consumption_type == cte.COOLING:
coefficient_of_performance = energy_system.generation_system.generic_generation_system.cooling_efficiency
for generation_system in generation_systems:
coefficient_of_performance = generation_system.generic_generation_system.cooling_efficiency
elif consumption_type == cte.ELECTRICITY:
coefficient_of_performance = \
energy_system.generation_system.generic_generation_system.electricity_efficiency
for generation_system in generation_systems:
coefficient_of_performance = generation_system.generic_generation_system.electricity_efficiency
if coefficient_of_performance == 0:
values = [0]*len(demand)
final_energy_consumed = values

View File

@ -161,16 +161,20 @@ class TestSystemsFactory(TestCase):
_building_distribution_system = DistributionSystem()
_building_distribution_system.generic_distribution_system = (
copy.deepcopy(_generic_building_energy_system.distribution_systems)
copy.deepcopy(_generic_building_energy_system.distribution_system)
)
_building_emission_system = EmissionSystem()
_building_emission_system.generic_emission_system = (
copy.deepcopy(_generic_building_energy_system.emission_systems)
copy.deepcopy(_generic_building_energy_system.emission_system)
)
_building_generation_system = GenerationSystem()
_building_generation_system.generic_generation_system = (
copy.deepcopy(_generic_building_energy_system.generation_system)
)
_building_storage_system = ThermalStorageSystem()
_building_storage_system.generic_storage_system = \
copy.deepcopy(_generic_building_energy_system.energy_storage_system)
if cte.HEATING in _building_energy_equipment.demand_types:
_building_generation_system.heat_power = building.heating_peak_load[cte.YEAR][0]
if cte.COOLING in _building_energy_equipment.demand_types: