Compare commits
7 Commits
main
...
create_ret
Author | SHA1 | Date | |
---|---|---|---|
|
d44a1d47b4 | ||
|
03a6dbb9c6 | ||
|
6419ac3dc6 | ||
|
935be00794 | ||
|
bfd20ac986 | ||
|
f350813e5d | ||
|
292da03940 |
|
@ -1,187 +0,0 @@
|
|||
|
||||
RetrofitFactory Documentation
|
||||
|
||||
Overview
|
||||
RetrofitFactory is a tool designed to apply energy efficiency retrofits to buildings within a city model. It supports multiple retrofit types, including construction improvements, infiltration reduction, and window upgrades.
|
||||
|
||||
Usage
|
||||
|
||||
Basic Implementation
|
||||
```python
|
||||
from hub.imports.retrofit_factory import RetrofitFactory
|
||||
|
||||
# Load retrofit data from JSON file
|
||||
with open('retrofit_scenarios.json', 'r') as f:
|
||||
retrofit_data = json.load(f)
|
||||
|
||||
# Apply retrofits to a city
|
||||
retrofit_factory = RetrofitFactory(retrofit_data, city)
|
||||
retrofit_factory.enrich()
|
||||
```
|
||||
|
||||
Retrofit Data Structure
|
||||
The retrofit data is stored as a JSON object where building IDs serve as keys and retrofit specifications as values:
|
||||
```json
|
||||
{
|
||||
"building_id": {
|
||||
"retrofit_types": ["construction", "infiltration", "windows"],
|
||||
"wall_u_value": 0.3,
|
||||
"roof_u_value": 0.2,
|
||||
"ground_u_value": 0.25,
|
||||
"infiltration_reduction": 30,
|
||||
"window_u_value": 1.5,
|
||||
"window_g_value": 0.6
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Supported Retrofit Types
|
||||
RetrofitFactory supports the following types of retrofits:
|
||||
|
||||
1. Construction Retrofits
|
||||
Modifies U-values for walls, roofs, and ground surfaces, but only if the new U-value is lower than the existing one. The retrofit improves thermal resistance of building materials.
|
||||
|
||||
Parameters:
|
||||
- wall_u_value: Target U-value for walls (W/m²K)
|
||||
- roof_u_value: Target U-value for roofs (W/m²K)
|
||||
- ground_u_value: Target U-value for ground surfaces (W/m²K)
|
||||
|
||||
2. Infiltration Retrofits
|
||||
Reduces air infiltration rate as a percentage, applied to the ventilation system when off.
|
||||
|
||||
Parameters:
|
||||
- infiltration_reduction: Percentage reduction in infiltration rate (0-100)
|
||||
|
||||
3. Window Retrofits
|
||||
Updates window thermal properties by modifying the U-value and solar heat gain coefficient (g-value).
|
||||
|
||||
Parameters:
|
||||
- window_u_value: Target U-value for windows (W/m²K)
|
||||
- window_g_value: Target solar heat gain coefficient (0-1)
|
||||
|
||||
Implementation Details
|
||||
|
||||
Class Structure
|
||||
```python
|
||||
class RetrofitFactory:
|
||||
def __init__(self, retrofit_data: dict, city: City):
|
||||
self._retrofit_data = retrofit_data
|
||||
self._city = city
|
||||
```
|
||||
|
||||
Main Methods
|
||||
|
||||
1. enrich()
|
||||
Applies retrofits to all buildings in the city. It iterates over each building, retrieves its corresponding retrofit data, and applies the specified retrofits.
|
||||
|
||||
```python
|
||||
def enrich(self):
|
||||
for building in self._city.buildings:
|
||||
building_id = str(building.name)
|
||||
if building_id in self._retrofit_data:
|
||||
building_retrofit_data = self._retrofit_data[building_id]
|
||||
retrofit_types = building_retrofit_data.get('retrofit_types', [])
|
||||
self._apply_retrofits_to_building(building, retrofit_types, building_retrofit_data)
|
||||
```
|
||||
|
||||
2. _apply_retrofits_to_building()
|
||||
Handles applying the specified retrofits to an individual building based on its retrofit data.
|
||||
|
||||
3. _apply_construction_retrofit_to_building()
|
||||
Applies construction retrofits by modifying U-values for walls, roofs, and ground surfaces. Only updates if the new U-value is lower than the existing value.
|
||||
|
||||
```python
|
||||
def _apply_construction_retrofit_to_building(self, building: Building, retrofit_params):
|
||||
wall_u_value = retrofit_params.get('wall_u_value')
|
||||
roof_u_value = retrofit_params.get('roof_u_value')
|
||||
ground_u_value = retrofit_params.get('ground_u_value')
|
||||
```
|
||||
|
||||
Thermal resistance is calculated as:
|
||||
ΔR = (1 / U_new) - (1 / U_old)
|
||||
|
||||
```python
|
||||
def _change_thermal_resistance(self, thermal_boundary, new_u_value):
|
||||
old_u_value = thermal_boundary.u_value
|
||||
if new_u_value < old_u_value:
|
||||
delta_r = (1 / new_u_value) - (1 / old_u_value)
|
||||
```
|
||||
|
||||
4. _reduce_infiltration_rate_by_percentage()
|
||||
Reduces the infiltration rate by the specified percentage.
|
||||
|
||||
```python
|
||||
def _reduce_infiltration_rate_by_percentage(self, building: Building, retrofit_params):
|
||||
percentage = retrofit_params.get('infiltration_reduction')
|
||||
if percentage is not None:
|
||||
new_rate = old_rate * (1 - percentage / 100)
|
||||
```
|
||||
|
||||
5. _apply_window_retrofit_to_building()
|
||||
Updates the overall U-value and g-value of windows.
|
||||
|
||||
```python
|
||||
def _apply_window_retrofit_to_building(self, building: Building, retrofit_params):
|
||||
overall_u_value = retrofit_params.get('window_u_value')
|
||||
g_value = retrofit_params.get('window_g_value')
|
||||
```
|
||||
|
||||
Error Handling
|
||||
RetrofitFactory includes various error prevention mechanisms:
|
||||
- Building ID Validation: Logs missing retrofit data for buildings not found in the input.
|
||||
- U-value Validation: Only applies if the new U-value is lower than the old one.
|
||||
- Null Checks: Ensures that parameters like infiltration_reduction are not null.
|
||||
- Type Validation: Checks for required attributes, such as thermal boundaries and openings.
|
||||
|
||||
Data Validation
|
||||
|
||||
1. Building ID Validation
|
||||
```python
|
||||
building_id = str(building.name)
|
||||
if building_id in self._retrofit_data:
|
||||
# Process building
|
||||
else:
|
||||
print(f"No retrofit data for building ID {building_id}")
|
||||
```
|
||||
|
||||
2. U-value and Window Value Validation
|
||||
```python
|
||||
if new_u_value < old_u_value:
|
||||
# Apply change
|
||||
else:
|
||||
print(f"New U-value {new_u_value} is not less than old U-value {old_u_value}")
|
||||
|
||||
if overall_u_value is not None and overall_u_value != 0:
|
||||
# Apply change
|
||||
```
|
||||
|
||||
Building Model Integration
|
||||
RetrofitFactory relies on the city model to access thermal zones, boundaries, and construction properties of buildings. For example:
|
||||
- Thermal Zone Access:
|
||||
```python
|
||||
for thermal_zone in building.thermal_zones_from_internal_zones:
|
||||
thermal_archetype = thermal_zone.parent_internal_zone.thermal_archetype
|
||||
```
|
||||
|
||||
- Construction Properties Access:
|
||||
```python
|
||||
construction_archetype = thermal_boundary._construction_archetype
|
||||
construction_archetype.window_overall_u_value = overall_u_value
|
||||
construction_archetype.window_g_value = g_value
|
||||
```
|
||||
|
||||
Logging and Debugging
|
||||
RetrofitFactory includes detailed logging for tracking the progress and results of retrofits:
|
||||
- Logs retrofit application: print(f"Applying retrofits to building ID {building_id}")
|
||||
- Logs property updates: print(f"Updated wall U-value to {wall_u_value} in building {building.name}")
|
||||
- Logs missing data: print(f"No retrofit data for building ID {building_id}")
|
||||
|
||||
Performance Considerations
|
||||
- Memory Efficiency: Directly modifies existing objects instead of creating new copies.
|
||||
- Computational Efficiency: Only processes buildings with available retrofit data and skips unnecessary thermal boundaries.
|
||||
|
||||
Integration Requirements
|
||||
To function correctly, the city model must provide:
|
||||
- Unique building names convertible to strings.
|
||||
- Buildings with thermal zones and boundaries that contain layers for construction retrofits.
|
||||
- Access to thermal zone properties and boundary layers.
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,8 @@
|
|||
"""
|
||||
Cerc construction catalog (Copy of Nrcan catalog)
|
||||
Catlog Coder Mohamed Osman mohamed.osman@mail.concordia.ca
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
"""
|
||||
|
||||
import json
|
||||
|
@ -22,7 +24,7 @@ class CercCatalog(Catalog):
|
|||
"""
|
||||
def __init__(self, path):
|
||||
_path_archetypes = Path(path / 'cerc_archetypes.json').resolve()
|
||||
_path_constructions = Path(path / 'cerc_constructions.json').resolve()
|
||||
_path_constructions = (path / 'cerc_constructions.json').resolve()
|
||||
with open(_path_archetypes, 'r', encoding='utf-8') as file:
|
||||
self._archetypes = json.load(file)
|
||||
with open(_path_constructions, 'r', encoding='utf-8') as file:
|
||||
|
@ -126,12 +128,6 @@ class CercCatalog(Catalog):
|
|||
infiltration_rate_for_ventilation_system_on = (
|
||||
archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_off = (
|
||||
archetype['infiltration_rate_area_for_ventilation_system_off'] * 1
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_on = (
|
||||
archetype['infiltration_rate_area_for_ventilation_system_on'] * 1
|
||||
)
|
||||
|
||||
archetype_constructions = []
|
||||
for archetype_construction in archetype['constructions']:
|
||||
|
@ -169,9 +165,7 @@ class CercCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
None,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on))
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -22,7 +22,6 @@ class EilatCatalog(Catalog):
|
|||
"""
|
||||
Eilat catalog class
|
||||
"""
|
||||
|
||||
def __init__(self, path):
|
||||
_path_archetypes = Path(path / 'eilat_archetypes.json').resolve()
|
||||
_path_constructions = (path / 'eilat_constructions.json').resolve()
|
||||
|
@ -122,14 +121,8 @@ class EilatCatalog(Catalog):
|
|||
construction_period = archetype['period_of_construction']
|
||||
average_storey_height = archetype['average_storey_height']
|
||||
extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_thermal_bridges']
|
||||
infiltration_rate_for_ventilation_system_off = archetype[
|
||||
'infiltration_rate_for_ventilation_system_off'] / cte.HOUR_TO_SECONDS
|
||||
infiltration_rate_for_ventilation_system_on = archetype[
|
||||
'infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
|
||||
infiltration_rate_area_for_ventilation_system_off = archetype[
|
||||
'infiltration_rate_area_for_ventilation_system_off']
|
||||
infiltration_rate_area_for_ventilation_system_on = archetype[
|
||||
'infiltration_rate_area_for_ventilation_system_on']
|
||||
infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off'] / cte.HOUR_TO_SECONDS
|
||||
infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
|
||||
|
||||
archetype_constructions = []
|
||||
for archetype_construction in archetype['constructions']:
|
||||
|
@ -167,9 +160,7 @@ class EilatCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
None,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on))
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -128,12 +128,6 @@ class NrcanCatalog(Catalog):
|
|||
infiltration_rate_for_ventilation_system_on = (
|
||||
archetype['infiltration_rate_for_ventilation_system_on'] / cte.HOUR_TO_SECONDS
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_off = (
|
||||
archetype['infiltration_rate_area_for_ventilation_system_off'] * 1
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_on = (
|
||||
archetype['infiltration_rate_area_for_ventilation_system_on'] * 1
|
||||
)
|
||||
|
||||
archetype_constructions = []
|
||||
for archetype_construction in archetype['constructions']:
|
||||
|
@ -159,6 +153,7 @@ class NrcanCatalog(Catalog):
|
|||
_window)
|
||||
archetype_constructions.append(_construction)
|
||||
break
|
||||
|
||||
_catalog_archetypes.append(Archetype(archetype_id,
|
||||
name,
|
||||
function,
|
||||
|
@ -170,10 +165,7 @@ class NrcanCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
None,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on
|
||||
))
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -129,12 +129,6 @@ class NrelCatalog(Catalog):
|
|||
infiltration_rate_for_ventilation_system_on = float(
|
||||
archetype['infiltration_rate_for_ventilation_system_on']['#text']
|
||||
) / cte.HOUR_TO_SECONDS
|
||||
infiltration_rate_area_for_ventilation_system_off = float(
|
||||
archetype['infiltration_rate_area_for_ventilation_system_on']['#text']
|
||||
)
|
||||
infiltration_rate_area_for_ventilation_system_on = float(
|
||||
archetype['infiltration_rate_area_for_ventilation_system_on']['#text']
|
||||
)
|
||||
|
||||
archetype_constructions = []
|
||||
for archetype_construction in archetype['constructions']['construction']:
|
||||
|
@ -168,9 +162,7 @@ class NrelCatalog(Catalog):
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
indirect_heated_ratio,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on))
|
||||
infiltration_rate_for_ventilation_system_on))
|
||||
return _catalog_archetypes
|
||||
|
||||
def names(self, category=None):
|
||||
|
|
|
@ -23,10 +23,7 @@ class Archetype:
|
|||
extra_loses_due_to_thermal_bridges,
|
||||
indirect_heated_ratio,
|
||||
infiltration_rate_for_ventilation_system_off,
|
||||
infiltration_rate_for_ventilation_system_on,
|
||||
infiltration_rate_area_for_ventilation_system_off,
|
||||
infiltration_rate_area_for_ventilation_system_on
|
||||
):
|
||||
infiltration_rate_for_ventilation_system_on):
|
||||
self._id = archetype_id
|
||||
self._name = name
|
||||
self._function = function
|
||||
|
@ -39,8 +36,6 @@ class Archetype:
|
|||
self._indirect_heated_ratio = indirect_heated_ratio
|
||||
self._infiltration_rate_for_ventilation_system_off = infiltration_rate_for_ventilation_system_off
|
||||
self._infiltration_rate_for_ventilation_system_on = infiltration_rate_for_ventilation_system_on
|
||||
self._infiltration_rate_area_for_ventilation_system_off = infiltration_rate_area_for_ventilation_system_off
|
||||
self._infiltration_rate_area_for_ventilation_system_on = infiltration_rate_area_for_ventilation_system_on
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
@ -138,22 +133,6 @@ class Archetype:
|
|||
"""
|
||||
return self._infiltration_rate_for_ventilation_system_on
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_off(self):
|
||||
"""
|
||||
Get archetype infiltration rate for ventilation system off in m3/sm2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_area_for_ventilation_system_off
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_on(self):
|
||||
"""
|
||||
Get archetype infiltration rate for ventilation system on in m3/sm2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_for_ventilation_system_on
|
||||
|
||||
def to_dictionary(self):
|
||||
"""Class content to dictionary"""
|
||||
_constructions = []
|
||||
|
@ -170,8 +149,6 @@ class Archetype:
|
|||
'indirect heated ratio': self.indirect_heated_ratio,
|
||||
'infiltration rate for ventilation off [1/s]': self.infiltration_rate_for_ventilation_system_off,
|
||||
'infiltration rate for ventilation on [1/s]': self.infiltration_rate_for_ventilation_system_on,
|
||||
'infiltration rate area for ventilation off [m3/sm2]': self.infiltration_rate_area_for_ventilation_system_off,
|
||||
'infiltration rate area for ventilation on [m3/sm2]': self.infiltration_rate_area_for_ventilation_system_on,
|
||||
'constructions': _constructions
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,20 +15,11 @@ class Archetype:
|
|||
"""
|
||||
Archetype class
|
||||
"""
|
||||
def __init__(self, name, systems):
|
||||
|
||||
def __init__(self, name, systems, archetype_cluster_id=None):
|
||||
self._cluster_id = archetype_cluster_id
|
||||
self._name = name
|
||||
self._systems = systems
|
||||
|
||||
@property
|
||||
def cluster_id(self):
|
||||
"""
|
||||
Get id
|
||||
:return: string
|
||||
"""
|
||||
return self._cluster_id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""
|
||||
|
@ -52,9 +43,8 @@ class Archetype:
|
|||
_systems.append(_system.to_dictionary())
|
||||
content = {
|
||||
'Archetype': {
|
||||
'cluster_id': self.cluster_id,
|
||||
'name': self.name,
|
||||
'systems': _systems
|
||||
}
|
||||
}
|
||||
}
|
||||
return content
|
||||
|
|
|
@ -20,7 +20,7 @@ class GenerationSystem(ABC):
|
|||
"""
|
||||
|
||||
def __init__(self, system_id, name, model_name=None, manufacturer=None, fuel_type=None,
|
||||
distribution_systems=None, energy_storage_systems=None, number_of_units=None):
|
||||
distribution_systems=None, energy_storage_systems=None):
|
||||
self._system_id = system_id
|
||||
self._name = name
|
||||
self._model_name = model_name
|
||||
|
@ -28,7 +28,6 @@ class GenerationSystem(ABC):
|
|||
self._fuel_type = fuel_type
|
||||
self._distribution_systems = distribution_systems
|
||||
self._energy_storage_systems = energy_storage_systems
|
||||
self._number_of_units = number_of_units
|
||||
|
||||
@property
|
||||
def id(self):
|
||||
|
|
|
@ -17,9 +17,8 @@ class PvGenerationSystem(GenerationSystem):
|
|||
def __init__(self, system_id, name, system_type, model_name=None, manufacturer=None, electricity_efficiency=None,
|
||||
nominal_electricity_output=None, nominal_ambient_temperature=None, nominal_cell_temperature=None,
|
||||
nominal_radiation=None, standard_test_condition_cell_temperature=None,
|
||||
standard_test_condition_maximum_power=None, standard_test_condition_radiation=None,
|
||||
cell_temperature_coefficient=None, width=None, height=None, distribution_systems=None,
|
||||
energy_storage_systems=None):
|
||||
standard_test_condition_maximum_power=None, cell_temperature_coefficient=None, width=None, height=None,
|
||||
distribution_systems=None, energy_storage_systems=None):
|
||||
super().__init__(system_id=system_id, name=name, model_name=model_name,
|
||||
manufacturer=manufacturer, fuel_type='renewable', distribution_systems=distribution_systems,
|
||||
energy_storage_systems=energy_storage_systems)
|
||||
|
@ -31,7 +30,6 @@ class PvGenerationSystem(GenerationSystem):
|
|||
self._nominal_radiation = nominal_radiation
|
||||
self._standard_test_condition_cell_temperature = standard_test_condition_cell_temperature
|
||||
self._standard_test_condition_maximum_power = standard_test_condition_maximum_power
|
||||
self._standard_test_condition_radiation = standard_test_condition_radiation
|
||||
self._cell_temperature_coefficient = cell_temperature_coefficient
|
||||
self._width = width
|
||||
self._height = height
|
||||
|
@ -100,15 +98,6 @@ class PvGenerationSystem(GenerationSystem):
|
|||
"""
|
||||
return self._standard_test_condition_maximum_power
|
||||
|
||||
@property
|
||||
def standard_test_condition_radiation(self):
|
||||
"""
|
||||
Get standard test condition cell temperature of PV panels in W/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._standard_test_condition_radiation
|
||||
|
||||
|
||||
@property
|
||||
def cell_temperature_coefficient(self):
|
||||
"""
|
||||
|
@ -154,7 +143,6 @@ class PvGenerationSystem(GenerationSystem):
|
|||
'nominal radiation [W/m2]': self.nominal_radiation,
|
||||
'standard test condition cell temperature [Celsius]': self.standard_test_condition_cell_temperature,
|
||||
'standard test condition maximum power [W]': self.standard_test_condition_maximum_power,
|
||||
'standard test condition radiation [W/m2]': self.standard_test_condition_radiation,
|
||||
'cell temperature coefficient': self.cell_temperature_coefficient,
|
||||
'width': self.width,
|
||||
'height': self.height,
|
||||
|
|
|
@ -193,7 +193,6 @@ class MontrealFutureSystemCatalogue(Catalog):
|
|||
nominal_radiation = pv['nominal_radiation']
|
||||
standard_test_condition_cell_temperature = pv['standard_test_condition_cell_temperature']
|
||||
standard_test_condition_maximum_power = pv['standard_test_condition_maximum_power']
|
||||
standard_test_condition_radiation = pv['standard_test_condition_radiation']
|
||||
cell_temperature_coefficient = pv['cell_temperature_coefficient']
|
||||
width = pv['width']
|
||||
height = pv['height']
|
||||
|
@ -216,7 +215,6 @@ class MontrealFutureSystemCatalogue(Catalog):
|
|||
standard_test_condition_cell_temperature=
|
||||
standard_test_condition_cell_temperature,
|
||||
standard_test_condition_maximum_power=standard_test_condition_maximum_power,
|
||||
standard_test_condition_radiation=standard_test_condition_radiation,
|
||||
cell_temperature_coefficient=cell_temperature_coefficient,
|
||||
width=width,
|
||||
height=height,
|
||||
|
@ -381,7 +379,6 @@ class MontrealFutureSystemCatalogue(Catalog):
|
|||
_system_archetypes = []
|
||||
system_clusters = self._archetypes['EnergySystemCatalog']['system_archetypes']['system_archetype']
|
||||
for system_cluster in system_clusters:
|
||||
archetype_id = system_cluster['@cluster_id']
|
||||
name = system_cluster['name']
|
||||
systems = system_cluster['systems']['system_id']
|
||||
integer_system_ids = [int(item) for item in systems]
|
||||
|
@ -389,7 +386,7 @@ class MontrealFutureSystemCatalogue(Catalog):
|
|||
for system_archetype in self._systems:
|
||||
if int(system_archetype.id) in integer_system_ids:
|
||||
_systems.append(system_archetype)
|
||||
_system_archetypes.append(Archetype(archetype_cluster_id=archetype_id, name=name, systems=_systems))
|
||||
_system_archetypes.append(Archetype(name=name, systems=_systems))
|
||||
return _system_archetypes
|
||||
|
||||
def _load_materials(self):
|
||||
|
|
|
@ -92,7 +92,7 @@ class Building(CityObject):
|
|||
logging.error('Building %s [%s] has an unexpected surface type %s.', self.name, self.aliases, surface.type)
|
||||
self._domestic_hot_water_peak_load = None
|
||||
self._fuel_consumption_breakdown = {}
|
||||
self._systems_archetype_cluster_id = None
|
||||
self._pv_generation = {}
|
||||
|
||||
@property
|
||||
def shell(self) -> Polyhedron:
|
||||
|
@ -880,8 +880,8 @@ class Building(CityObject):
|
|||
storage_systems = generation_system.energy_storage_systems
|
||||
if storage_systems:
|
||||
for storage_system in storage_systems:
|
||||
if storage_system.type_energy_stored == 'thermal' and storage_system.heating_coil_capacity is not None:
|
||||
fuel_breakdown[cte.ELECTRICITY][f'{demand_type}'] += storage_system.heating_coil_energy_consumption[f'{demand_type}'][cte.YEAR][0]
|
||||
if storage_system.type_energy_stored == 'thermal' and storage_system.heating_coil_energy_consumption:
|
||||
fuel_breakdown[cte.ELECTRICITY][f'{demand_type}'] += storage_system.heating_coil_energy_consumption[cte.YEAR][0]
|
||||
#TODO: When simulation models of all energy system archetypes are created, this part can be removed
|
||||
heating_fuels = []
|
||||
dhw_fuels = []
|
||||
|
@ -913,19 +913,3 @@ class Building(CityObject):
|
|||
self._fuel_consumption_breakdown = fuel_breakdown
|
||||
return self._fuel_consumption_breakdown
|
||||
|
||||
@property
|
||||
def energy_systems_archetype_cluster_id(self):
|
||||
"""
|
||||
Get energy systems archetype id
|
||||
:return: str
|
||||
"""
|
||||
return self._systems_archetype_cluster_id
|
||||
|
||||
@energy_systems_archetype_cluster_id.setter
|
||||
def energy_systems_archetype_cluster_id(self, value):
|
||||
"""
|
||||
Set energy systems archetype id
|
||||
:param value: str
|
||||
"""
|
||||
self._systems_archetype_cluster_id = value
|
||||
|
||||
|
|
|
@ -157,7 +157,6 @@ class Surface:
|
|||
if self._inclination is None:
|
||||
self._inclination = np.arccos(self.perimeter_polygon.normal[2])
|
||||
return self._inclination
|
||||
|
||||
@property
|
||||
def type(self):
|
||||
"""
|
||||
|
@ -181,7 +180,7 @@ class Surface:
|
|||
@property
|
||||
def global_irradiance(self) -> dict:
|
||||
"""
|
||||
Get global irradiance on surface in W/m2
|
||||
Get global irradiance on surface in J/m2
|
||||
:return: dict
|
||||
"""
|
||||
return self._global_irradiance
|
||||
|
@ -189,7 +188,7 @@ class Surface:
|
|||
@global_irradiance.setter
|
||||
def global_irradiance(self, value):
|
||||
"""
|
||||
Set global irradiance on surface in W/m2
|
||||
Set global irradiance on surface in J/m2
|
||||
:param value: dict
|
||||
"""
|
||||
self._global_irradiance = value
|
||||
|
@ -391,7 +390,7 @@ class Surface:
|
|||
@property
|
||||
def global_irradiance_tilted(self) -> dict:
|
||||
"""
|
||||
Get global irradiance on a tilted surface in W/m2
|
||||
Get global irradiance on a tilted surface in J/m2
|
||||
:return: dict
|
||||
"""
|
||||
return self._global_irradiance_tilted
|
||||
|
@ -399,7 +398,7 @@ class Surface:
|
|||
@global_irradiance_tilted.setter
|
||||
def global_irradiance_tilted(self, value):
|
||||
"""
|
||||
Set global irradiance on a tilted surface in W/m2
|
||||
Set global irradiance on a tilted surface in J/m2
|
||||
:param value: dict
|
||||
"""
|
||||
self._global_irradiance_tilted = value
|
||||
|
|
|
@ -20,8 +20,6 @@ class ThermalArchetype:
|
|||
self._indirect_heated_ratio = None
|
||||
self._infiltration_rate_for_ventilation_system_off = None
|
||||
self._infiltration_rate_for_ventilation_system_on = None
|
||||
self._infiltration_rate_area_for_ventilation_system_off = None
|
||||
self._infiltration_rate_area_for_ventilation_system_on = None
|
||||
|
||||
@property
|
||||
def constructions(self) -> [Construction]:
|
||||
|
@ -134,35 +132,3 @@ class ThermalArchetype:
|
|||
:param value: float
|
||||
"""
|
||||
self._infiltration_rate_for_ventilation_system_on = value
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_off(self):
|
||||
"""
|
||||
Get infiltration rate for ventilation system off in l/s/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_area_for_ventilation_system_off
|
||||
|
||||
@infiltration_rate_area_for_ventilation_system_off.setter
|
||||
def infiltration_rate_area_for_ventilation_system_off(self, value):
|
||||
"""
|
||||
Set infiltration rate for ventilation system off in l/s/m2
|
||||
:param value: float
|
||||
"""
|
||||
self._infiltration_rate_area_for_ventilation_system_off = value
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_for_ventilation_system_on(self):
|
||||
"""
|
||||
Get infiltration rate for ventilation system on in l/s/m2
|
||||
:return: float
|
||||
"""
|
||||
return self._infiltration_rate_area_for_ventilation_system_on
|
||||
|
||||
@infiltration_rate_area_for_ventilation_system_on.setter
|
||||
def infiltration_rate_area_for_ventilation_system_on(self, value):
|
||||
"""
|
||||
Set infiltration rate for ventilation system on in l/s/m2
|
||||
:param value: float
|
||||
"""
|
||||
self._infiltration_rate_area_for_ventilation_system_on = value
|
||||
|
|
|
@ -44,8 +44,6 @@ class ThermalZone:
|
|||
self._indirectly_heated_area_ratio = None
|
||||
self._infiltration_rate_system_on = None
|
||||
self._infiltration_rate_system_off = None
|
||||
self._infiltration_rate_area_system_on = None
|
||||
self._infiltration_rate_area_system_off = None
|
||||
self._volume = volume
|
||||
self._ordinate_number = None
|
||||
self._view_factors_matrix = None
|
||||
|
@ -168,24 +166,6 @@ class ThermalZone:
|
|||
self._infiltration_rate_system_off = self._parent_internal_zone.thermal_archetype.infiltration_rate_for_ventilation_system_off
|
||||
return self._infiltration_rate_system_off
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_system_on(self):
|
||||
"""
|
||||
Get thermal zone infiltration rate system on in air changes per second (1/s)
|
||||
:return: None or float
|
||||
"""
|
||||
self._infiltration_rate_area_system_on = self._parent_internal_zone.thermal_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
return self._infiltration_rate_area_system_on
|
||||
|
||||
@property
|
||||
def infiltration_rate_area_system_off(self):
|
||||
"""
|
||||
Get thermal zone infiltration rate system off in air changes per second (1/s)
|
||||
:return: None or float
|
||||
"""
|
||||
self._infiltration_rate_area_system_off = self._parent_internal_zone.thermal_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
return self._infiltration_rate_area_system_off
|
||||
|
||||
@property
|
||||
def volume(self):
|
||||
"""
|
||||
|
|
|
@ -11,7 +11,6 @@ from abc import ABC
|
|||
from typing import Union, List
|
||||
|
||||
from hub.city_model_structure.energy_systems.distribution_system import DistributionSystem
|
||||
from hub.city_model_structure.energy_systems.energy_storage_system import EnergyStorageSystem
|
||||
from hub.city_model_structure.energy_systems.thermal_storage_system import ThermalStorageSystem
|
||||
from hub.city_model_structure.energy_systems.electrical_storage_system import ElectricalStorageSystem
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ class ThermalStorageSystem(EnergyStorageSystem):
|
|||
self._maximum_operating_temperature = None
|
||||
self._heating_coil_capacity = None
|
||||
self._temperature = None
|
||||
self._heating_coil_energy_consumption = {}
|
||||
self._heating_coil_energy_consumption = None
|
||||
|
||||
@property
|
||||
def volume(self):
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -8,8 +8,6 @@
|
|||
"extra_loses_due_thermal_bridges": 0.1,
|
||||
"infiltration_rate_for_ventilation_system_on": 0,
|
||||
"infiltration_rate_for_ventilation_system_off": 0.9,
|
||||
"infiltration_rate_area_for_ventilation_system_on": 0,
|
||||
"infiltration_rate_area_for_ventilation_system_off": 0.006,
|
||||
"constructions": {
|
||||
"OutdoorsWall": {
|
||||
"opaque_surface_name": "residential_1000_1980_BWh",
|
||||
|
@ -44,8 +42,6 @@
|
|||
"extra_loses_due_thermal_bridges": 0.1,
|
||||
"infiltration_rate_for_ventilation_system_on": 0,
|
||||
"infiltration_rate_for_ventilation_system_off": 0.31,
|
||||
"infiltration_rate_area_for_ventilation_system_on": 0,
|
||||
"infiltration_rate_area_for_ventilation_system_off": 0.002,
|
||||
"constructions": {
|
||||
"OutdoorsWall": {
|
||||
"opaque_surface_name": "dormitory_2011_3000_BWh",
|
||||
|
@ -80,8 +76,6 @@
|
|||
"extra_loses_due_thermal_bridges": 0.09,
|
||||
"infiltration_rate_for_ventilation_system_on": 0,
|
||||
"infiltration_rate_for_ventilation_system_off": 0.65,
|
||||
"infiltration_rate_area_for_ventilation_system_on": 0,
|
||||
"infiltration_rate_area_for_ventilation_system_off": 0.004,
|
||||
"constructions": {
|
||||
"OutdoorsWall": {
|
||||
"opaque_surface_name": "hotel_employees_1981_2010_BWh",
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,8 +21,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.5</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="2" building_type="medium office" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -46,8 +44,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="3" building_type="large office" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -71,8 +67,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="4" building_type="primary school" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -95,8 +89,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="5" building_type="secondary school" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -119,8 +111,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="6" building_type="stand-alone retail" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -143,8 +133,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="7" building_type="strip mall" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -167,8 +155,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="8" building_type="supermarket" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -191,8 +177,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="9" building_type="quick service restaurant" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -215,8 +199,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="10" building_type="full service restaurant" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -239,8 +221,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="11" building_type="small hotel" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -263,8 +243,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="12" building_type="large hotel" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -287,8 +265,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="13" building_type="hospital" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -311,8 +287,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="14" building_type="outpatient healthcare" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -335,8 +309,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="15" building_type="warehouse" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -359,8 +331,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="16" building_type="midrise apartment" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -383,8 +353,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="17" building_type="high-rise apartment" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -407,8 +375,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="18" building_type="small office" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -431,8 +397,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="19" building_type="medium office" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -455,8 +419,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="20" building_type="large office" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -479,8 +441,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="21" building_type="primary school" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -503,8 +463,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="22" building_type="secondary school" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -527,8 +485,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="23" building_type="stand-alone retail" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -551,8 +507,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="24" building_type="strip mall" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -575,8 +529,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.1</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="25" building_type="supermarket" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -599,8 +551,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="26" building_type="quick service restaurant" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -623,8 +573,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="27" building_type="full service restaurant" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -647,8 +595,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="28" building_type="small hotel" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -671,8 +617,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="29" building_type="large hotel" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -695,8 +639,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="30" building_type="hospital" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -719,8 +661,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="31" building_type="outpatient healthcare" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -743,8 +683,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="32" building_type="warehouse" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -767,8 +705,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="33" building_type="midrise apartment" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -791,8 +727,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="34" building_type="high-rise apartment" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -815,8 +749,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="35" building_type="residential" reference_standard="ASHRAE 189.1_2009" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -839,8 +771,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="36" building_type="residential" reference_standard="ASHRAE 90.1_2004" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -863,8 +793,6 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.003</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
<archetype id="37" building_type="industry" reference_standard="non_standard_dompark" climate_zone="ASHRAE_2004:4A">
|
||||
<constructions>
|
||||
|
@ -887,7 +815,5 @@
|
|||
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
|
||||
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
|
||||
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
|
||||
<infiltration_rate_area_for_ventilation_system_off units="ACH">0.0005</infiltration_rate_area_for_ventilation_system_off>
|
||||
<infiltration_rate_area_for_ventilation_system_on units="ACH">0</infiltration_rate_area_for_ventilation_system_on>
|
||||
</archetype>
|
||||
</archetypes>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</equipment>
|
||||
<equipment id="5" type="cooler" fuel_type="electricity">
|
||||
<name>Air cooled DX with external condenser</name>
|
||||
<cooling_efficiency>2.5</cooling_efficiency>
|
||||
<cooling_efficiency>3.23</cooling_efficiency>
|
||||
<storage>false</storage>
|
||||
</equipment>
|
||||
<equipment id="6" type="electricity generator" fuel_type="renewable">
|
||||
|
@ -32,8 +32,8 @@
|
|||
</equipment>
|
||||
<equipment id="7" type="heat pump" fuel_type="electricity">
|
||||
<name>Heat Pump</name>
|
||||
<heating_efficiency>2.5</heating_efficiency>
|
||||
<cooling_efficiency>3</cooling_efficiency>
|
||||
<heating_efficiency>2.79</heating_efficiency>
|
||||
<cooling_efficiency>3.23</cooling_efficiency>
|
||||
<storage>false</storage>
|
||||
</equipment>
|
||||
</generation_equipments>
|
||||
|
@ -198,7 +198,7 @@
|
|||
<equipments>
|
||||
<generation_id>3</generation_id>
|
||||
<distribution_id>8</distribution_id>
|
||||
</equipments>
|
||||
g </equipments>
|
||||
</system>
|
||||
<system id="5">
|
||||
<name>Single zone packaged rooftop unit with electrical resistance furnace and baseboards and fuel boiler for acs</name>
|
||||
|
|
|
@ -911,7 +911,7 @@
|
|||
<nominal_cooling_output/>
|
||||
<minimum_cooling_output/>
|
||||
<maximum_cooling_output/>
|
||||
<cooling_efficiency>4</cooling_efficiency>
|
||||
<cooling_efficiency>4.5</cooling_efficiency>
|
||||
<electricity_efficiency/>
|
||||
<source_temperature/>
|
||||
<source_mass_flow/>
|
||||
|
@ -1411,7 +1411,7 @@
|
|||
</demands>
|
||||
<components>
|
||||
<generation_id>23</generation_id>
|
||||
<generation_id>17</generation_id>
|
||||
<generation_id>16</generation_id>
|
||||
</components>
|
||||
</system>
|
||||
<system>
|
||||
|
|
|
@ -392,9 +392,9 @@ class Idf:
|
|||
thermostat = self._add_thermostat(thermal_zone)
|
||||
self._idf.newidfobject(self._IDEAL_LOAD_AIR_SYSTEM,
|
||||
Zone_Name=zone_name,
|
||||
System_Availability_Schedule_Name=f'Thermostat_availability schedules {thermal_zone.usage_name}',
|
||||
Heating_Availability_Schedule_Name=f'Thermostat_availability schedules {thermal_zone.usage_name}',
|
||||
Cooling_Availability_Schedule_Name=f'Thermostat_availability schedules {thermal_zone.usage_name}',
|
||||
System_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}',
|
||||
Heating_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}',
|
||||
Cooling_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage_name}',
|
||||
Template_Thermostat_Name=thermostat.Name)
|
||||
|
||||
def _add_occupancy(self, thermal_zone, zone_name):
|
||||
|
@ -454,7 +454,7 @@ class Idf:
|
|||
)
|
||||
|
||||
def _add_infiltration(self, thermal_zone, zone_name):
|
||||
schedule = f'INF_CONST schedules {thermal_zone.usage_name}'
|
||||
schedule = f'Infiltration schedules {thermal_zone.usage_name}'
|
||||
_infiltration = thermal_zone.infiltration_rate_system_off * cte.HOUR_TO_SECONDS
|
||||
self._idf.newidfobject(self._INFILTRATION,
|
||||
Name=f'{zone_name}_infiltration',
|
||||
|
@ -464,17 +464,6 @@ class Idf:
|
|||
Air_Changes_per_Hour=_infiltration
|
||||
)
|
||||
|
||||
def _add_infiltration_surface(self, thermal_zone, zone_name):
|
||||
schedule = f'INF_CONST schedules {thermal_zone.usage_name}'
|
||||
_infiltration = thermal_zone.infiltration_rate_area_system_off*cte.INFILTRATION_75PA_TO_4PA
|
||||
self._idf.newidfobject(self._INFILTRATION,
|
||||
Name=f'{zone_name}_infiltration',
|
||||
Zone_or_ZoneList_or_Space_or_SpaceList_Name=zone_name,
|
||||
Schedule_Name=schedule,
|
||||
Design_Flow_Rate_Calculation_Method='Flow/ExteriorWallArea',
|
||||
Flow_Rate_per_Exterior_Surface_Area=_infiltration
|
||||
)
|
||||
|
||||
def _add_ventilation(self, thermal_zone, zone_name):
|
||||
schedule = f'Ventilation schedules {thermal_zone.usage_name}'
|
||||
_air_change = thermal_zone.mechanical_air_change * cte.HOUR_TO_SECONDS
|
||||
|
@ -560,12 +549,9 @@ class Idf:
|
|||
self._add_schedules(usage, 'DHW_prof', thermal_zone.domestic_hot_water.schedules)
|
||||
_new_schedules = self._create_yearly_values_schedules('cold_temp', building.cold_water_temperature[cte.HOUR])
|
||||
self._add_schedules(usage, 'cold_temp', _new_schedules)
|
||||
|
||||
_new_schedules = self._create_constant_value_schedules('DHW_temp', service_temperature)
|
||||
self._add_schedules(usage, 'DHW_temp', _new_schedules)
|
||||
_new_schedules = self._create_constant_value_schedules('INF_CONST', 1)
|
||||
self._add_schedules(usage, 'INF_CONST', _new_schedules)
|
||||
_new_schedules = self._create_constant_value_schedules('Thermostat_availability', 1)
|
||||
self._add_schedules(usage, 'Thermostat_availability', _new_schedules)
|
||||
_occ = thermal_zone.occupancy
|
||||
if _occ.occupancy_density == 0:
|
||||
_total_heat = 0
|
||||
|
@ -576,7 +562,7 @@ class Idf:
|
|||
self._add_schedules(usage, 'Activity Level', _new_schedules)
|
||||
self._add_zone(thermal_zone, building.name)
|
||||
self._add_heating_system(thermal_zone, building.name)
|
||||
self._add_infiltration_surface(thermal_zone, building.name)
|
||||
self._add_infiltration(thermal_zone, building.name)
|
||||
self._add_ventilation(thermal_zone, building.name)
|
||||
self._add_occupancy(thermal_zone, building.name)
|
||||
self._add_lighting(thermal_zone, building.name)
|
||||
|
@ -625,18 +611,6 @@ class Idf:
|
|||
Reporting_Frequency="Hourly",
|
||||
)
|
||||
|
||||
self._idf.newidfobject(
|
||||
"OUTPUT:VARIABLE",
|
||||
Variable_Name="Zone Air Temperature",
|
||||
Reporting_Frequency="Hourly",
|
||||
)
|
||||
|
||||
self._idf.newidfobject(
|
||||
"OUTPUT:VARIABLE",
|
||||
Variable_Name="Zone Air Relative Humidity",
|
||||
Reporting_Frequency="Hourly",
|
||||
)
|
||||
|
||||
# post-process to erase windows associated to adiabatic walls
|
||||
windows_list = []
|
||||
for window in self._idf.idfobjects[self._WINDOW]:
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
!IDD_Version 24.1.0
|
||||
!IDD_Version 23.2.0
|
||||
!IDD_BUILD 7636e6b3e9
|
||||
! ***************************************************************************
|
||||
! This file is the Input Data Dictionary (IDD) for EnergyPlus.
|
||||
|
@ -30002,10 +30002,10 @@ People,
|
|||
A7 , \field Mean Radiant Temperature Calculation Type
|
||||
\note optional (only required for thermal comfort runs)
|
||||
\type choice
|
||||
\key EnclosureAveraged
|
||||
\key ZoneAveraged
|
||||
\key SurfaceWeighted
|
||||
\key AngleFactor
|
||||
\default EnclosureAveraged
|
||||
\default ZoneAveraged
|
||||
A8 , \field Surface Name/Angle Factor List Name
|
||||
\type object-list
|
||||
\object-list AllHeatTranAngFacNames
|
||||
|
|
|
@ -20,10 +20,9 @@ class EnergyBuildingsExportsFactory:
|
|||
"""
|
||||
Energy Buildings exports factory class
|
||||
"""
|
||||
def __init__(self, handler, city, path, custom_insel_block='d18599', target_buildings=None, weather_file=None):
|
||||
def __init__(self, handler, city, path, custom_insel_block='d18599', target_buildings=None):
|
||||
self._city = city
|
||||
self._export_type = '_' + handler.lower()
|
||||
self._weather_file = weather_file
|
||||
validate_import_export_type(EnergyBuildingsExportsFactory, handler)
|
||||
if isinstance(path, str):
|
||||
path = Path(path)
|
||||
|
@ -54,13 +53,12 @@ class EnergyBuildingsExportsFactory:
|
|||
"""
|
||||
idf_data_path = (Path(__file__).parent / './building_energy/idf_files/').resolve()
|
||||
url = wh().epw_file(self._city.region_code)
|
||||
if self._weather_file is None:
|
||||
self._weather_file = (Path(__file__).parent.parent / f'data/weather/epw/{url.rsplit("/", 1)[1]}').resolve()
|
||||
if not self._weather_file.exists():
|
||||
with open(self._weather_file, 'wb') as epw_file:
|
||||
weather_path = (Path(__file__).parent.parent / f'data/weather/epw/{url.rsplit("/", 1)[1]}').resolve()
|
||||
if not weather_path.exists():
|
||||
with open(weather_path, 'wb') as epw_file:
|
||||
epw_file.write(requests.get(url, allow_redirects=True).content)
|
||||
return Idf(self._city, self._path, (idf_data_path / 'Minimal.idf'), (idf_data_path / 'Energy+.idd'),
|
||||
self._weather_file, target_buildings=self._target_buildings)
|
||||
return Idf(self._city, self._path, (idf_data_path / 'Minimal.idf'), (idf_data_path / 'Energy+.idd'), weather_path,
|
||||
target_buildings=self._target_buildings)
|
||||
|
||||
@property
|
||||
def _insel_monthly_energy_balance(self):
|
||||
|
|
|
@ -24,8 +24,6 @@ BTU_H_TO_WATTS = 0.29307107
|
|||
KILO_WATTS_HOUR_TO_JULES = 3600000
|
||||
WATTS_HOUR_TO_JULES = 3600
|
||||
GALLONS_TO_QUBIC_METERS = 0.0037854117954011185
|
||||
INFILTRATION_75PA_TO_4PA = (4/75)**0.65
|
||||
|
||||
|
||||
# time
|
||||
SECOND = 'second'
|
||||
|
@ -312,8 +310,7 @@ LATENT = 'Latent'
|
|||
LITHIUMION = 'Lithium Ion'
|
||||
NICD = 'NiCd'
|
||||
LEADACID = 'Lead Acid'
|
||||
THERMAL = 'thermal'
|
||||
ELECTRICAL = 'electrical'
|
||||
|
||||
# Geometry
|
||||
EPSILON = 0.0000001
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class HubFunctionToCercConstructionFunction:
|
|||
def __init__(self):
|
||||
self._dictionary = {
|
||||
cte.RESIDENTIAL: 'MURB_MidRiseApartment',
|
||||
cte.SINGLE_FAMILY_HOUSE: 'SingleFamilyHouse',
|
||||
cte.SINGLE_FAMILY_HOUSE: 'MidriseApartment',
|
||||
cte.MULTI_FAMILY_HOUSE: 'HighriseApartment',
|
||||
cte.ROW_HOUSE: 'MidriseApartment',
|
||||
cte.MID_RISE_APARTMENT: 'MURB_MidRiseApartment',
|
||||
|
|
|
@ -33,7 +33,6 @@ class MontrealFunctionToHubFunction:
|
|||
'6911': cte.CONVENTION_CENTER,
|
||||
'9510': cte.RESIDENTIAL,
|
||||
'1990': cte.MID_RISE_APARTMENT,
|
||||
'2100': cte.HIGH_RISE_APARTMENT,
|
||||
'1923': cte.NON_HEATED,
|
||||
'7222': cte.SPORTS_LOCATION,
|
||||
'5002': cte.STRIP_MALL,
|
||||
|
|
|
@ -18,7 +18,7 @@ class MontrealGenerationSystemToHubEnergyGenerationSystem:
|
|||
'furnace': cte.BASEBOARD,
|
||||
'cooler': cte.CHILLER,
|
||||
'electricity generator': cte.ELECTRICITY_GENERATOR,
|
||||
'photovoltaic': cte.PHOTOVOLTAIC,
|
||||
'PV system': cte.PHOTOVOLTAIC,
|
||||
'heat pump': cte.HEAT_PUMP
|
||||
}
|
||||
|
||||
|
|
|
@ -69,8 +69,6 @@ class CercPhysicsParameters:
|
|||
thermal_archetype.indirect_heated_ratio = 0
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_on = catalog_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_off = catalog_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
_constructions = []
|
||||
for catalog_construction in catalog_archetype.constructions:
|
||||
construction = Construction()
|
||||
|
|
|
@ -66,8 +66,6 @@ class EilatPhysicsParameters:
|
|||
thermal_archetype.indirect_heated_ratio = 0
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_on = catalog_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_off = catalog_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
effective_thermal_capacity = 0
|
||||
_constructions = []
|
||||
for catalog_construction in catalog_archetype.constructions:
|
||||
|
|
|
@ -3,7 +3,6 @@ NrcanPhysicsParameters import the construction and material information defined
|
|||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
Project Collaborator Saeed Ranjbar saeed.ranjbar@concordia.ca
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
@ -33,21 +32,10 @@ class NrcanPhysicsParameters:
|
|||
city = self._city
|
||||
nrcan_catalog = ConstructionCatalogFactory('nrcan').catalog
|
||||
for building in city.buildings:
|
||||
main_function = None
|
||||
functions = building.function.split('_')
|
||||
if len(functions) > 1:
|
||||
maximum_percentage = 0
|
||||
for function in functions:
|
||||
percentage_and_function = function.split('-')
|
||||
if float(percentage_and_function[0]) > maximum_percentage:
|
||||
maximum_percentage = float(percentage_and_function[0])
|
||||
main_function = percentage_and_function[-1]
|
||||
else:
|
||||
main_function = functions[-1]
|
||||
if main_function not in Dictionaries().hub_function_to_nrcan_construction_function:
|
||||
logging.error('Building %s has an unknown building function %s', building.name, main_function)
|
||||
if building.function not in Dictionaries().hub_function_to_nrcan_construction_function:
|
||||
logging.error('Building %s has an unknown building function %s', building.name, building.function)
|
||||
continue
|
||||
function = Dictionaries().hub_function_to_nrcan_construction_function[main_function]
|
||||
function = Dictionaries().hub_function_to_nrcan_construction_function[building.function]
|
||||
try:
|
||||
archetype = self._search_archetype(nrcan_catalog, function, building.year_of_construction, self._climate_zone)
|
||||
|
||||
|
@ -79,9 +67,6 @@ class NrcanPhysicsParameters:
|
|||
thermal_archetype.indirect_heated_ratio = 0
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_on = catalog_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_off = catalog_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
|
||||
_constructions = []
|
||||
for catalog_construction in catalog_archetype.constructions:
|
||||
construction = Construction()
|
||||
|
|
|
@ -69,8 +69,6 @@ class NrelPhysicsParameters:
|
|||
thermal_archetype.indirect_heated_ratio = catalog_archetype.indirect_heated_ratio
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_on = catalog_archetype.infiltration_rate_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_for_ventilation_system_off = catalog_archetype.infiltration_rate_for_ventilation_system_off
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_on = catalog_archetype.infiltration_rate_area_for_ventilation_system_on
|
||||
thermal_archetype.infiltration_rate_area_for_ventilation_system_off = catalog_archetype.infiltration_rate_area_for_ventilation_system_off
|
||||
_constructions = []
|
||||
for catalog_construction in catalog_archetype.constructions:
|
||||
construction = Construction()
|
||||
|
|
|
@ -136,14 +136,14 @@ class MontrealCustomEnergySystemParameters:
|
|||
_distribution_system.distribution_consumption_variable_flow = \
|
||||
archetype_distribution_system.distribution_consumption_variable_flow
|
||||
_distribution_system.heat_losses = archetype_distribution_system.heat_losses
|
||||
_generic_emission_system = None
|
||||
_emission_system = None
|
||||
if archetype_distribution_system.emission_systems is not None:
|
||||
_emission_systems = []
|
||||
for emission_system in archetype_distribution_system.emission_systems:
|
||||
_generic_emission_system = EmissionSystem()
|
||||
_generic_emission_system.parasitic_energy_consumption = emission_system.parasitic_energy_consumption
|
||||
_emission_systems.append(_generic_emission_system)
|
||||
_distribution_system.emission_systems = _emission_systems
|
||||
_emission_system = EmissionSystem()
|
||||
_emission_system.parasitic_energy_consumption = emission_system.parasitic_energy_consumption
|
||||
_emission_systems.append(_emission_system)
|
||||
_distribution_system.emission_systems = _emission_systems
|
||||
_distribution_systems.append(_distribution_system)
|
||||
return _distribution_systems
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ class MontrealFutureEnergySystemParameters:
|
|||
archetype_name = building.energy_systems_archetype_name
|
||||
try:
|
||||
archetype = self._search_archetypes(montreal_custom_catalog, archetype_name)
|
||||
building.energy_systems_archetype_cluster_id = archetype.cluster_id
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown energy system archetype for system name %s', building.name,
|
||||
archetype_name)
|
||||
|
@ -88,12 +87,12 @@ class MontrealFutureEnergySystemParameters:
|
|||
archetype_generation_systems = archetype_system.generation_systems
|
||||
if archetype_generation_systems is not None:
|
||||
for archetype_generation_system in archetype_system.generation_systems:
|
||||
if archetype_generation_system.system_type == 'photovoltaic':
|
||||
if archetype_generation_system.system_type == 'Photovoltaic':
|
||||
_generation_system = PvGenerationSystem()
|
||||
_generation_system.name = archetype_generation_system.name
|
||||
_generation_system.model_name = archetype_generation_system.model_name
|
||||
_generation_system.manufacturer = archetype_generation_system.manufacturer
|
||||
_type = archetype_generation_system.system_type
|
||||
_type = 'PV system'
|
||||
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[_type]
|
||||
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
|
||||
_generation_system.fuel_type = _fuel_type
|
||||
|
@ -104,21 +103,15 @@ class MontrealFutureEnergySystemParameters:
|
|||
_generation_system.nominal_radiation = archetype_generation_system.nominal_radiation
|
||||
_generation_system.standard_test_condition_cell_temperature = archetype_generation_system.standard_test_condition_cell_temperature
|
||||
_generation_system.standard_test_condition_maximum_power = archetype_generation_system.standard_test_condition_maximum_power
|
||||
_generation_system.standard_test_condition_radiation = archetype_generation_system.standard_test_condition_radiation
|
||||
_generation_system.cell_temperature_coefficient = archetype_generation_system.cell_temperature_coefficient
|
||||
_generation_system.width = archetype_generation_system.width
|
||||
_generation_system.height = archetype_generation_system.height
|
||||
_generation_system.tilt_angle = self._city.latitude
|
||||
_generic_storage_system = None
|
||||
if archetype_generation_system.energy_storage_systems is not None:
|
||||
_storage_systems = []
|
||||
for storage_system in archetype_generation_system.energy_storage_systems:
|
||||
if storage_system.type_energy_stored == 'electrical':
|
||||
_generic_storage_system = ElectricalStorageSystem()
|
||||
_generic_storage_system.type_energy_stored = 'electrical'
|
||||
_storage_systems.append(_generic_storage_system)
|
||||
_generation_system.energy_storage_systems = _storage_systems
|
||||
|
||||
_generic_storage_system = ElectricalStorageSystem()
|
||||
_generic_storage_system.type_energy_stored = 'electrical'
|
||||
_generation_system.energy_storage_systems = [_generic_storage_system]
|
||||
else:
|
||||
_generation_system = NonPvGenerationSystem()
|
||||
_generation_system.name = archetype_generation_system.name
|
||||
|
@ -126,7 +119,7 @@ class MontrealFutureEnergySystemParameters:
|
|||
_generation_system.manufacturer = archetype_generation_system.manufacturer
|
||||
_type = archetype_generation_system.system_type
|
||||
_generation_system.system_type = Dictionaries().montreal_generation_system_to_hub_energy_generation_system[_type]
|
||||
_fuel_type = Dictionaries().montreal_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
|
||||
_fuel_type = Dictionaries().north_america_custom_fuel_to_hub_fuel[archetype_generation_system.fuel_type]
|
||||
_generation_system.fuel_type = _fuel_type
|
||||
_generation_system.nominal_heat_output = archetype_generation_system.nominal_heat_output
|
||||
_generation_system.nominal_cooling_output = archetype_generation_system.nominal_cooling_output
|
||||
|
@ -192,14 +185,14 @@ class MontrealFutureEnergySystemParameters:
|
|||
_distribution_system.distribution_consumption_variable_flow = \
|
||||
archetype_distribution_system.distribution_consumption_variable_flow
|
||||
_distribution_system.heat_losses = archetype_distribution_system.heat_losses
|
||||
_generic_emission_system = None
|
||||
_emission_system = None
|
||||
if archetype_distribution_system.emission_systems is not None:
|
||||
_emission_systems = []
|
||||
for emission_system in archetype_distribution_system.emission_systems:
|
||||
_generic_emission_system = EmissionSystem()
|
||||
_generic_emission_system.parasitic_energy_consumption = emission_system.parasitic_energy_consumption
|
||||
_emission_systems.append(_generic_emission_system)
|
||||
_distribution_system.emission_systems = _emission_systems
|
||||
_emission_system = EmissionSystem()
|
||||
_emission_system.parasitic_energy_consumption = emission_system.parasitic_energy_consumption
|
||||
_emission_systems.append(_emission_system)
|
||||
_distribution_system.emission_systems = _emission_systems
|
||||
_distribution_systems.append(_distribution_system)
|
||||
return _distribution_systems
|
||||
|
||||
|
|
|
@ -127,31 +127,6 @@ class Geojson:
|
|||
function = None
|
||||
if self._function_field is not None:
|
||||
function = str(feature['properties'][self._function_field])
|
||||
if function == '1000':
|
||||
height = float(feature['properties'][self._extrusion_height_field])
|
||||
function = self._define_building_function(height, function)
|
||||
|
||||
if function == 'Mixed use' or function == 'mixed use':
|
||||
function_parts = []
|
||||
if 'usages' in feature['properties']:
|
||||
usages = feature['properties']['usages']
|
||||
for usage in usages:
|
||||
if self._function_to_hub is not None and usage['usage'] in self._function_to_hub:
|
||||
function_parts.append(f"{usage['percentage']}-{self._function_to_hub[usage['usage']]}")
|
||||
else:
|
||||
function_parts.append(f"{usage['percentage']}-{usage['usage']}")
|
||||
else:
|
||||
for key, value in feature['properties'].items():
|
||||
if key.startswith("mixed_type_") and not key.endswith("_percentage"):
|
||||
type_key = key
|
||||
percentage_key = f"{key}_percentage"
|
||||
if percentage_key in feature['properties']:
|
||||
if self._function_to_hub is not None and feature['properties'][type_key] in self._function_to_hub:
|
||||
usage_function = self._function_to_hub[feature['properties'][type_key]]
|
||||
function_parts.append(f"{feature['properties'][percentage_key]}-{usage_function}")
|
||||
else:
|
||||
function_parts.append(f"{feature['properties'][percentage_key]}-{feature['properties'][type_key]}")
|
||||
function = "_".join(function_parts)
|
||||
if self._function_to_hub is not None:
|
||||
# use the transformation dictionary to retrieve the proper function
|
||||
if function in self._function_to_hub:
|
||||
|
@ -354,14 +329,3 @@ class Geojson:
|
|||
building.add_alias(alias)
|
||||
building.volume = volume
|
||||
return building
|
||||
|
||||
def _define_building_function(self, height, function):
|
||||
if height < 10:
|
||||
return '1100'
|
||||
if height < 20 and height > 10:
|
||||
return '1990'
|
||||
if height > 20:
|
||||
return '2100'
|
||||
else:
|
||||
return '1000'
|
||||
|
|
@ -24,7 +24,7 @@ class EnergyPlusMultipleBuildings:
|
|||
csv_output = list(csv.DictReader(csv_file))
|
||||
|
||||
for building in self._city.buildings:
|
||||
building_name = building.name.upper()
|
||||
building_name = building.name
|
||||
buildings_energy_demands[f'Building {building_name} Heating Demand (J)'] = [
|
||||
float(
|
||||
row[f"{building_name} IDEAL LOADS AIR SYSTEM:Zone Ideal Loads Supply Air Total Heating Energy [J](Hourly)"])
|
||||
|
@ -36,7 +36,7 @@ class EnergyPlusMultipleBuildings:
|
|||
for row in csv_output
|
||||
]
|
||||
buildings_energy_demands[f'Building {building_name} DHW Demand (W)'] = [
|
||||
float(row[f"DHW {building_name}:Water Use Equipment Heating Rate [W](Hourly)"])
|
||||
float(row[f"DHW {building.name}:Water Use Equipment Heating Rate [W](Hourly)"])
|
||||
for row in csv_output
|
||||
]
|
||||
buildings_energy_demands[f'Building {building_name} Appliances (W)'] = [
|
||||
|
@ -58,15 +58,14 @@ class EnergyPlusMultipleBuildings:
|
|||
if energy_plus_output_file_path.is_file():
|
||||
building_energy_demands = self._building_energy_demands(energy_plus_output_file_path)
|
||||
for building in self._city.buildings:
|
||||
building_name = building.name.upper()
|
||||
building.heating_demand[cte.HOUR] = building_energy_demands[f'Building {building_name} Heating Demand (J)']
|
||||
building.cooling_demand[cte.HOUR] = building_energy_demands[f'Building {building_name} Cooling Demand (J)']
|
||||
building.heating_demand[cte.HOUR] = building_energy_demands[f'Building {building.name} Heating Demand (J)']
|
||||
building.cooling_demand[cte.HOUR] = building_energy_demands[f'Building {building.name} Cooling Demand (J)']
|
||||
building.domestic_hot_water_heat_demand[cte.HOUR] = \
|
||||
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} DHW Demand (W)']]
|
||||
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} DHW Demand (W)']]
|
||||
building.appliances_electrical_demand[cte.HOUR] = \
|
||||
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} Appliances (W)']]
|
||||
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} Appliances (W)']]
|
||||
building.lighting_electrical_demand[cte.HOUR] = \
|
||||
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building_name} Lighting (W)']]
|
||||
[x * cte.WATTS_HOUR_TO_JULES for x in building_energy_demands[f'Building {building.name} Lighting (W)']]
|
||||
building.heating_demand[cte.MONTH] = MonthlyValues.get_total_month(building.heating_demand[cte.HOUR])
|
||||
building.cooling_demand[cte.MONTH] = MonthlyValues.get_total_month(building.cooling_demand[cte.HOUR])
|
||||
building.domestic_hot_water_heat_demand[cte.MONTH] = (
|
||||
|
|
|
@ -34,7 +34,7 @@ class SimplifiedRadiosityAlgorithm:
|
|||
for key in self._results:
|
||||
_irradiance = {}
|
||||
header_name = key.split(':')
|
||||
result = [x for x in self._results[key]]
|
||||
result = [x * cte.WATTS_HOUR_TO_JULES for x in self._results[key]]
|
||||
city_object_name = header_name[1]
|
||||
building = self._city.city_object(city_object_name)
|
||||
surface_id = header_name[2]
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
"""
|
||||
RetrofitFactory retrieve the specific construction module for the given region
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2024 Concordia CERC group
|
||||
Project Coder mohamed Osman mohamed.osman@mail.concordia.ca
|
||||
"""
|
||||
|
||||
from hub.city_model_structure.building import Building
|
||||
from hub.city_model_structure.city import City
|
||||
import hub.helpers.constants as cte
|
||||
# from hub.data.retrofit_data import retrofit_data
|
||||
|
||||
class RetrofitFactory:
|
||||
def __init__(self, retrofit_data, city):
|
||||
"""
|
||||
|
|
|
@ -3,7 +3,6 @@ ComnetUsageParameters extracts the usage properties from Comnet catalog and assi
|
|||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
Project Collaborator Saeed Ranjbar saeed.ranjbar@concordia.ca
|
||||
"""
|
||||
import copy
|
||||
import logging
|
||||
|
@ -19,8 +18,6 @@ from hub.city_model_structure.building_demand.domestic_hot_water import Domestic
|
|||
from hub.city_model_structure.attributes.schedule import Schedule
|
||||
from hub.city_model_structure.building_demand.internal_gain import InternalGain
|
||||
from hub.catalog_factories.usage_catalog_factory import UsageCatalogFactory
|
||||
from hub.catalog_factories.construction_catalog_factory import ConstructionCatalogFactory
|
||||
from hub.imports.construction.helpers.construction_helper import ConstructionHelper
|
||||
|
||||
|
||||
class ComnetUsageParameters:
|
||||
|
@ -38,62 +35,29 @@ class ComnetUsageParameters:
|
|||
city = self._city
|
||||
comnet_catalog = UsageCatalogFactory('comnet').catalog
|
||||
for building in city.buildings:
|
||||
usages = []
|
||||
comnet_archetype_usages = []
|
||||
building_functions = building.function.split('_')
|
||||
for function in building_functions:
|
||||
usages.append(function.split('-'))
|
||||
for usage in usages:
|
||||
comnet_usage_name = Dictionaries().hub_usage_to_comnet_usage[usage[-1]]
|
||||
try:
|
||||
comnet_archetype_usage = self._search_archetypes(comnet_catalog, comnet_usage_name)
|
||||
comnet_archetype_usages.append(comnet_archetype_usage)
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown usage archetype for usage %s', building.name, comnet_usage_name)
|
||||
continue
|
||||
for (i, internal_zone) in enumerate(building.internal_zones):
|
||||
internal_zone_usages = []
|
||||
if len(building.internal_zones) > 1:
|
||||
volume_per_area = 0
|
||||
if internal_zone.area is None:
|
||||
logging.error('Building %s has internal zone area not defined, ACH cannot be calculated for usage %s',
|
||||
building.name, usages[i][-1])
|
||||
continue
|
||||
if internal_zone.volume is None:
|
||||
logging.error('Building %s has internal zone volume not defined, ACH cannot be calculated for usage %s',
|
||||
building.name, usages[i][-1])
|
||||
continue
|
||||
if internal_zone.area <= 0:
|
||||
logging.error('Building %s has internal zone area equal to 0, ACH cannot be calculated for usage %s',
|
||||
building.name, usages[i][-1])
|
||||
continue
|
||||
volume_per_area += internal_zone.volume / internal_zone.area
|
||||
usage = Usage()
|
||||
usage.name = usages[i][-1]
|
||||
self._assign_values(usage, comnet_archetype_usages[i], volume_per_area, building.cold_water_temperature)
|
||||
usage.percentage = 1
|
||||
self._calculate_reduced_values_from_extended_library(usage, comnet_archetype_usages[i])
|
||||
internal_zone_usages.append(usage)
|
||||
else:
|
||||
storeys_above_ground = building.storeys_above_ground
|
||||
if storeys_above_ground is None:
|
||||
logging.error('Building %s no number of storeys assigned, ACH cannot be calculated for usage %s. '
|
||||
'NRCAN construction data for the year %s is used to calculated number of storeys above '
|
||||
'ground', building.name, usages, building.year_of_construction)
|
||||
storeys_above_ground = self.average_storey_height_calculator(self._city, building)
|
||||
volume_per_area = building.volume / building.floor_area / storeys_above_ground
|
||||
for (j, mixed_usage) in enumerate(usages):
|
||||
usage = Usage()
|
||||
usage.name = mixed_usage[-1]
|
||||
if len(usages) > 1:
|
||||
usage.percentage = float(mixed_usage[0]) / 100
|
||||
else:
|
||||
usage.percentage = 1
|
||||
self._assign_values(usage, comnet_archetype_usages[j], volume_per_area, building.cold_water_temperature)
|
||||
self._calculate_reduced_values_from_extended_library(usage, comnet_archetype_usages[j])
|
||||
internal_zone_usages.append(usage)
|
||||
usage_name = Dictionaries().hub_usage_to_comnet_usage[building.function]
|
||||
try:
|
||||
archetype_usage = self._search_archetypes(comnet_catalog, usage_name)
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown usage archetype for usage %s', building.name, usage_name)
|
||||
continue
|
||||
|
||||
for internal_zone in building.internal_zones:
|
||||
if internal_zone.area is None:
|
||||
raise TypeError('Internal zone area not defined, ACH cannot be calculated')
|
||||
if internal_zone.volume is None:
|
||||
raise TypeError('Internal zone volume not defined, ACH cannot be calculated')
|
||||
if internal_zone.area <= 0:
|
||||
raise TypeError('Internal zone area is zero, ACH cannot be calculated')
|
||||
volume_per_area = internal_zone.volume / internal_zone.area
|
||||
usage = Usage()
|
||||
usage.name = usage_name
|
||||
self._assign_values(usage, archetype_usage, volume_per_area, building.cold_water_temperature)
|
||||
usage.percentage = 1
|
||||
self._calculate_reduced_values_from_extended_library(usage, archetype_usage)
|
||||
|
||||
internal_zone.usages = [usage]
|
||||
|
||||
internal_zone.usages = internal_zone_usages
|
||||
@staticmethod
|
||||
def _search_archetypes(comnet_catalog, usage_name):
|
||||
comnet_archetypes = comnet_catalog.entries('archetypes').usages
|
||||
|
@ -265,37 +229,3 @@ class ComnetUsageParameters:
|
|||
_mean_internal_gain.schedules = _schedules
|
||||
|
||||
return [_mean_internal_gain]
|
||||
|
||||
@staticmethod
|
||||
def average_storey_height_calculator(city, building):
|
||||
climate_zone = ConstructionHelper.city_to_nrcan_climate_zone(city.climate_reference_city)
|
||||
nrcan_catalog = ConstructionCatalogFactory('nrcan').catalog
|
||||
main_function = None
|
||||
functions = building.function.split('_')
|
||||
if len(functions) > 1:
|
||||
maximum_percentage = 0
|
||||
for function in functions:
|
||||
percentage_and_function = function.split('-')
|
||||
if float(percentage_and_function[0]) > maximum_percentage:
|
||||
maximum_percentage = float(percentage_and_function[0])
|
||||
main_function = percentage_and_function[-1]
|
||||
else:
|
||||
main_function = functions[-1]
|
||||
if main_function not in Dictionaries().hub_function_to_nrcan_construction_function:
|
||||
logging.error('Building %s has an unknown building function %s', building.name, main_function)
|
||||
function = Dictionaries().hub_function_to_nrcan_construction_function[main_function]
|
||||
construction_archetype = None
|
||||
average_storey_height = None
|
||||
nrcan_archetypes = nrcan_catalog.entries('archetypes')
|
||||
for building_archetype in nrcan_archetypes:
|
||||
construction_period_limits = building_archetype.construction_period.split('_')
|
||||
if int(construction_period_limits[0]) <= int(building.year_of_construction) <= int(construction_period_limits[1]):
|
||||
if str(function) == str(building_archetype.function) and climate_zone == str(building_archetype.climate_zone):
|
||||
construction_archetype = building_archetype
|
||||
average_storey_height = building_archetype.average_storey_height
|
||||
if construction_archetype is None:
|
||||
logging.error('Building %s has unknown construction archetype for building function: %s '
|
||||
'[%s], building year of construction: %s and climate zone %s', building.name, function,
|
||||
building.function, building.year_of_construction, climate_zone)
|
||||
|
||||
return average_storey_height
|
|
@ -3,13 +3,11 @@ NrcanUsageParameters extracts the usage properties from NRCAN catalog and assign
|
|||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
|
||||
Project Collaborator Saeed Ranjbar saeed.ranjbar@concordia.ca
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
import hub.helpers.constants as cte
|
||||
from hub.catalog_factories.construction_catalog_factory import ConstructionCatalogFactory
|
||||
from hub.helpers.dictionaries import Dictionaries
|
||||
from hub.city_model_structure.building_demand.usage import Usage
|
||||
from hub.city_model_structure.building_demand.lighting import Lighting
|
||||
|
@ -18,7 +16,6 @@ from hub.city_model_structure.building_demand.appliances import Appliances
|
|||
from hub.city_model_structure.building_demand.thermal_control import ThermalControl
|
||||
from hub.city_model_structure.building_demand.domestic_hot_water import DomesticHotWater
|
||||
from hub.catalog_factories.usage_catalog_factory import UsageCatalogFactory
|
||||
from hub.imports.construction.helpers.construction_helper import ConstructionHelper
|
||||
|
||||
|
||||
class NrcanUsageParameters:
|
||||
|
@ -36,75 +33,53 @@ class NrcanUsageParameters:
|
|||
city = self._city
|
||||
nrcan_catalog = UsageCatalogFactory('nrcan').catalog
|
||||
comnet_catalog = UsageCatalogFactory('comnet').catalog
|
||||
for building in city.buildings:
|
||||
usages = []
|
||||
nrcan_archetype_usages = []
|
||||
comnet_archetype_usages = []
|
||||
building_functions = building.function.split('_')
|
||||
for function in building_functions:
|
||||
usages.append(function.split('-'))
|
||||
for usage in usages:
|
||||
usage_name = Dictionaries().hub_usage_to_nrcan_usage[usage[-1]]
|
||||
try:
|
||||
archetype_usage = self._search_archetypes(nrcan_catalog, usage_name)
|
||||
nrcan_archetype_usages.append(archetype_usage)
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown usage archetype for usage %s', building.name, usage_name)
|
||||
continue
|
||||
comnet_usage_name = Dictionaries().hub_usage_to_comnet_usage[usage[-1]]
|
||||
try:
|
||||
comnet_archetype_usage = self._search_archetypes(comnet_catalog, comnet_usage_name)
|
||||
comnet_archetype_usages.append(comnet_archetype_usage)
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown usage archetype for usage %s', building.name, comnet_usage_name)
|
||||
continue
|
||||
|
||||
for (i, internal_zone) in enumerate(building.internal_zones):
|
||||
internal_zone_usages = []
|
||||
for building in city.buildings:
|
||||
usage_name = Dictionaries().hub_usage_to_nrcan_usage[building.function]
|
||||
try:
|
||||
archetype_usage = self._search_archetypes(nrcan_catalog, usage_name)
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown usage archetype for usage %s', building.name, usage_name)
|
||||
continue
|
||||
|
||||
comnet_usage_name = Dictionaries().hub_usage_to_comnet_usage[building.function]
|
||||
try:
|
||||
comnet_archetype_usage = self._search_archetypes(comnet_catalog, comnet_usage_name)
|
||||
except KeyError:
|
||||
logging.error('Building %s has unknown usage archetype for usage %s', building.name, comnet_usage_name)
|
||||
continue
|
||||
|
||||
for internal_zone in building.internal_zones:
|
||||
if len(building.internal_zones) > 1:
|
||||
volume_per_area = 0
|
||||
if internal_zone.area is None:
|
||||
logging.error('Building %s has internal zone area not defined, ACH cannot be calculated for usage %s',
|
||||
building.name, usages[i][-1])
|
||||
building.name, usage_name)
|
||||
continue
|
||||
if internal_zone.volume is None:
|
||||
logging.error('Building %s has internal zone volume not defined, ACH cannot be calculated for usage %s',
|
||||
building.name, usages[i][-1])
|
||||
building.name, usage_name)
|
||||
continue
|
||||
if internal_zone.area <= 0:
|
||||
logging.error('Building %s has internal zone area equal to 0, ACH cannot be calculated for usage %s',
|
||||
building.name, usages[i][-1])
|
||||
building.name, usage_name)
|
||||
continue
|
||||
volume_per_area += internal_zone.volume / internal_zone.area
|
||||
usage = Usage()
|
||||
usage.name = usages[i][-1]
|
||||
self._assign_values(usage, nrcan_archetype_usages[i], volume_per_area, building.cold_water_temperature)
|
||||
self._assign_comnet_extra_values(usage, comnet_archetype_usages[i], nrcan_archetype_usages[i].occupancy.occupancy_density)
|
||||
usage.percentage = 1
|
||||
self._calculate_reduced_values_from_extended_library(usage, nrcan_archetype_usages[i])
|
||||
internal_zone_usages.append(usage)
|
||||
else:
|
||||
storeys_above_ground = building.storeys_above_ground
|
||||
if storeys_above_ground is None:
|
||||
logging.error('Building %s no number of storeys assigned, ACH cannot be calculated for usage %s. '
|
||||
'NRCAN construction data for the year %s is used to calculated number of storeys above '
|
||||
'ground', building.name, usages, building.year_of_construction)
|
||||
storeys_above_ground = self.average_storey_height_calculator(self._city, building)
|
||||
if building.storeys_above_ground is None:
|
||||
logging.error('Building %s no number of storeys assigned, ACH cannot be calculated for usage %s',
|
||||
building.name, usage_name)
|
||||
continue
|
||||
volume_per_area = building.volume / building.floor_area / storeys_above_ground
|
||||
for (j, mixed_usage) in enumerate(usages):
|
||||
usage = Usage()
|
||||
usage.name = mixed_usage[-1]
|
||||
if len(usages) > 1:
|
||||
usage.percentage = float(mixed_usage[0]) / 100
|
||||
else:
|
||||
usage.percentage = 1
|
||||
self._assign_values(usage, nrcan_archetype_usages[j], volume_per_area, building.cold_water_temperature)
|
||||
self._assign_comnet_extra_values(usage, comnet_archetype_usages[j], nrcan_archetype_usages[j].occupancy.occupancy_density)
|
||||
self._calculate_reduced_values_from_extended_library(usage, nrcan_archetype_usages[j])
|
||||
internal_zone_usages.append(usage)
|
||||
volume_per_area = building.volume / building.floor_area / building.storeys_above_ground
|
||||
|
||||
internal_zone.usages = internal_zone_usages
|
||||
usage = Usage()
|
||||
usage.name = usage_name
|
||||
self._assign_values(usage, archetype_usage, volume_per_area, building.cold_water_temperature)
|
||||
self._assign_comnet_extra_values(usage, comnet_archetype_usage, archetype_usage.occupancy.occupancy_density)
|
||||
usage.percentage = 1
|
||||
self._calculate_reduced_values_from_extended_library(usage, archetype_usage)
|
||||
|
||||
internal_zone.usages = [usage]
|
||||
|
||||
@staticmethod
|
||||
def _search_archetypes(catalog, usage_name):
|
||||
|
@ -222,39 +197,3 @@ class NrcanUsageParameters:
|
|||
usage.thermal_control.mean_heating_set_point = max_heating_setpoint
|
||||
usage.thermal_control.heating_set_back = min_heating_setpoint
|
||||
usage.thermal_control.mean_cooling_set_point = min_cooling_setpoint
|
||||
|
||||
@staticmethod
|
||||
def average_storey_height_calculator(city, building):
|
||||
climate_zone = ConstructionHelper.city_to_nrcan_climate_zone(city.climate_reference_city)
|
||||
nrcan_catalog = ConstructionCatalogFactory('nrcan').catalog
|
||||
main_function = None
|
||||
functions = building.function.split('_')
|
||||
if len(functions) > 1:
|
||||
maximum_percentage = 0
|
||||
for function in functions:
|
||||
percentage_and_function = function.split('-')
|
||||
if float(percentage_and_function[0]) > maximum_percentage:
|
||||
maximum_percentage = float(percentage_and_function[0])
|
||||
main_function = percentage_and_function[-1]
|
||||
else:
|
||||
main_function = functions[-1]
|
||||
if main_function not in Dictionaries().hub_function_to_nrcan_construction_function:
|
||||
logging.error('Building %s has an unknown building function %s', building.name, main_function)
|
||||
function = Dictionaries().hub_function_to_nrcan_construction_function[main_function]
|
||||
construction_archetype = None
|
||||
average_storey_height = None
|
||||
nrcan_archetypes = nrcan_catalog.entries('archetypes')
|
||||
for building_archetype in nrcan_archetypes:
|
||||
construction_period_limits = building_archetype.construction_period.split('_')
|
||||
if int(construction_period_limits[0]) <= int(building.year_of_construction) <= int(construction_period_limits[1]):
|
||||
if str(function) == str(building_archetype.function) and climate_zone == str(building_archetype.climate_zone):
|
||||
construction_archetype = building_archetype
|
||||
average_storey_height = building_archetype.average_storey_height
|
||||
if construction_archetype is None:
|
||||
logging.error('Building %s has unknown construction archetype for building function: %s '
|
||||
'[%s], building year of construction: %s and climate zone %s', building.name, function,
|
||||
building.function, building.year_of_construction, climate_zone)
|
||||
|
||||
return average_storey_height
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
"""
|
||||
Hub version number
|
||||
"""
|
||||
__version__ = '0.2.0.12'
|
||||
__version__ = '0.2.0.6'
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
"name": "01044604",
|
||||
"address": "rue Victor-Hugo (MTL) 1636",
|
||||
"function": "1000",
|
||||
"height": 22,
|
||||
"height": 12,
|
||||
"year_of_construction": 1986
|
||||
}
|
||||
},
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"type": "FeatureCollection",
|
||||
"crs": { "type": "name", "properties": { "name": "urn:ogc:def:crs:OGC:1.3:CRS84" } },
|
||||
"features": [
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 162726, "id": "01001802", "CIVIQUE_DE": 4530, "CIVIQUE_FI": 4530, "NOM_RUE": "avenue Henri-Julien (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 9, "AREA_NEW": 158, "MBG_Width": 12, "MBG_Length": 13, "MBG_Orientation": 122, "Shape_Length": 50, "Shape_Area": 158, "BuildingCategory": "detached", "BuildingVolume": 1422, "AspectRatio": 1.034, "SurfacetoVolumeRatio": 0.111, "FloorNu_RawTax": 3, "FloorNu_RawTax.1": 3, "Floor_frmHieght": 3, "TotalFloorArea": 474, "ANNEE_CONS": 1980 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.584529976107675, 45.523035946589552 ], [ -73.584668476667062, 45.523096845969846 ], [ -73.584752377018077, 45.523002646985603 ], [ -73.584613876598254, 45.522941746806083 ], [ -73.584529976107675, 45.523035946589552 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 162727, "id": "01001804", "CIVIQUE_DE": 4535, "CIVIQUE_FI": 4535, "NOM_RUE": "avenue Henri-Julien (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 11, "AREA_NEW": 161, "MBG_Width": 12, "MBG_Length": 14, "MBG_Orientation": 118, "Shape_Length": 52, "Shape_Area": 169, "BuildingCategory": "semi-attached", "BuildingVolume": 1771, "AspectRatio": 1.118, "SurfacetoVolumeRatio": 0.091, "FloorNu_RawTax": 2, "FloorNu_RawTax.1": 2, "Floor_frmHieght": 3, "TotalFloorArea": 483, "ANNEE_CONS": 1980 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.584504328100977, 45.523318275073017 ], [ -73.584470063117109, 45.523357528940657 ], [ -73.584430877357136, 45.523409646947947 ], [ -73.584428076873849, 45.52341334646033 ], [ -73.584574755505997, 45.523468170484847 ], [ -73.584656456001568, 45.523374796559551 ], [ -73.584574577402094, 45.523346746210301 ], [ -73.584576876816001, 45.523343546476525 ], [ -73.584505377070585, 45.523318645930914 ], [ -73.584504328100977, 45.523318275073017 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 162168, "id": "01001944", "CIVIQUE_DE": 4820, "CIVIQUE_FI": 4850, "NOM_RUE": "rue de Grand-Pré (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 11, "AREA_NEW": 504, "MBG_Width": 16, "MBG_Length": 42, "MBG_Orientation": 123, "Shape_Length": 116, "Shape_Area": 669, "BuildingCategory": "fully-attached", "BuildingVolume": 5544, "AspectRatio": 2.648, "SurfacetoVolumeRatio": 0.091, "FloorNu_RawTax": 3, "FloorNu_RawTax.1": 3, "Floor_frmHieght": 3, "TotalFloorArea": 1512, "ANNEE_CONS": 1980 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.586673951057165, 45.524838247152971 ], [ -73.586568305570552, 45.524952686098082 ], [ -73.58662307714782, 45.524979547084882 ], [ -73.586731877320233, 45.525032846618785 ], [ -73.586815478124791, 45.525073847297307 ], [ -73.586820877038548, 45.525068346972965 ], [ -73.586874077743531, 45.525094146322125 ], [ -73.586895378594193, 45.525104346900406 ], [ -73.586943277305565, 45.525127046703169 ], [ -73.587016976014752, 45.525161993449707 ], [ -73.587125015986871, 45.525044959829344 ], [ -73.587121277851907, 45.525043246686081 ], [ -73.587092777275416, 45.525074446965931 ], [ -73.587032277294412, 45.525047146948445 ], [ -73.587039678023586, 45.525038947369048 ], [ -73.587033777622878, 45.525036346828877 ], [ -73.586929477897286, 45.524990346357107 ], [ -73.58664877714105, 45.524866746179505 ], [ -73.586674177796809, 45.524838346863149 ], [ -73.586673951057165, 45.524838247152971 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 160896, "id": "01024652", "CIVIQUE_DE": 350, "CIVIQUE_FI": 350, "NOM_RUE": "rue Boucher (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 22, "AREA_NEW": 863, "MBG_Width": 23, "MBG_Length": 48, "MBG_Orientation": 121, "Shape_Length": 142, "Shape_Area": 1115, "BuildingCategory": "detached", "BuildingVolume": 18986, "AspectRatio": 2.038, "SurfacetoVolumeRatio": 0.045, "FloorNu_RawTax": 4, "FloorNu_RawTax.1": 4, "Floor_frmHieght": 6, "TotalFloorArea": 5178, "ANNEE_CONS": 1991 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.591937079830473, 45.5275066477327 ], [ -73.591937179849452, 45.52750674753436 ], [ -73.591964178776365, 45.527466247428634 ], [ -73.592026878777105, 45.527486947227878 ], [ -73.592027580168264, 45.527486846780647 ], [ -73.592013879829011, 45.527422746963936 ], [ -73.591984880030196, 45.527286547239505 ], [ -73.591984579182366, 45.527286547481765 ], [ -73.591875879019881, 45.527239846914121 ], [ -73.591626180051733, 45.527132446482739 ], [ -73.591624679856523, 45.527134147482663 ], [ -73.591472379004458, 45.527302947133734 ], [ -73.59147727935661, 45.527305146916163 ], [ -73.591543180175734, 45.527334146336074 ], [ -73.59156227958276, 45.527312847127916 ], [ -73.591817879694347, 45.527425747269653 ], [ -73.591794879188384, 45.527451547052145 ], [ -73.591794980324778, 45.52745154697088 ], [ -73.591937079830473, 45.5275066477327 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 158453, "id": "01026412", "CIVIQUE_DE": 3964, "CIVIQUE_FI": 3964, "NOM_RUE": "rue Rivard (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 13, "AREA_NEW": 155, "MBG_Width": 12, "MBG_Length": 13, "MBG_Orientation": 33, "Shape_Length": 51, "Shape_Area": 161, "BuildingCategory": "semi-attached", "BuildingVolume": 2015, "AspectRatio": 1.053, "SurfacetoVolumeRatio": 0.077, "FloorNu_RawTax": 3, "FloorNu_RawTax.1": 3, "Floor_frmHieght": 4, "TotalFloorArea": 620, "ANNEE_CONS": 1981 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.574691673036824, 45.520801446234479 ], [ -73.574606373743563, 45.520895346331137 ], [ -73.574608572928923, 45.520896346417111 ], [ -73.574741150104259, 45.52095245567763 ], [ -73.574829542976886, 45.520856483821881 ], [ -73.574691673036824, 45.520801446234479 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 160314, "id": "01027192", "CIVIQUE_DE": 3876, "CIVIQUE_FI": 3880, "NOM_RUE": "rue de Mentana (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 12, "AREA_NEW": 366, "MBG_Width": 16, "MBG_Length": 32, "MBG_Orientation": 110, "Shape_Length": 96, "Shape_Area": 507, "BuildingCategory": "semi-attached", "BuildingVolume": 4392, "AspectRatio": 2.009, "SurfacetoVolumeRatio": 0.083, "FloorNu_RawTax": 3, "FloorNu_RawTax.1": 3, "Floor_frmHieght": 3, "TotalFloorArea": 1098, "ANNEE_CONS": 1980 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.570800071665957, 45.522686946460304 ], [ -73.57093107256577, 45.522726047825749 ], [ -73.571028271866595, 45.522613046698432 ], [ -73.570955272361019, 45.522582046683695 ], [ -73.57092677184869, 45.522615346769584 ], [ -73.570836471663341, 45.522577047118958 ], [ -73.570681923964358, 45.522511513915816 ], [ -73.570599160784397, 45.522601741674258 ], [ -73.57068447255547, 45.522631046198299 ], [ -73.570683872035971, 45.52263194640998 ], [ -73.5706905727058, 45.522641647038853 ], [ -73.570695971264669, 45.522651146908998 ], [ -73.570720172024352, 45.522643346512112 ], [ -73.570741072289536, 45.522674046912528 ], [ -73.570768873124834, 45.522664547177342 ], [ -73.570786672496425, 45.522690747590424 ], [ -73.570800772812049, 45.522685647556457 ], [ -73.570800071665957, 45.522686946460304 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 160961, "id": "01027868", "CIVIQUE_DE": 1315, "CIVIQUE_FI": 1315, "NOM_RUE": "rue Gilford (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 25, "AREA_NEW": 792, "MBG_Width": 21, "MBG_Length": 39, "MBG_Orientation": 33, "Shape_Length": 119, "Shape_Area": 799, "BuildingCategory": "detached", "BuildingVolume": 19800, "AspectRatio": 1.892, "SurfacetoVolumeRatio": 0.04, "FloorNu_RawTax": 7, "FloorNu_RawTax.1": 7, "Floor_frmHieght": 7, "TotalFloorArea": 5544, "ANNEE_CONS": 1982 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.58083517681375, 45.531873048325558 ], [ -73.580835076949739, 45.531873048396221 ], [ -73.580854575894378, 45.531884548031371 ], [ -73.580836876619628, 45.53189954827026 ], [ -73.580834276336617, 45.531902247826601 ], [ -73.581032076072006, 45.531993748148139 ], [ -73.581035576182472, 45.531995348277754 ], [ -73.581308475569898, 45.531702748189019 ], [ -73.581094575638417, 45.5316043481116 ], [ -73.58108917684747, 45.531601847693175 ], [ -73.58083517681375, 45.531873048325558 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 160929, "id": "01030953", "CIVIQUE_DE": 5115, "CIVIQUE_FI": 5115, "NOM_RUE": "rue Clark (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 14, "AREA_NEW": 181, "MBG_Width": 13, "MBG_Length": 17, "MBG_Orientation": 33, "Shape_Length": 60, "Shape_Area": 217, "BuildingCategory": "semi-attached", "BuildingVolume": 2534, "AspectRatio": 1.366, "SurfacetoVolumeRatio": 0.071, "FloorNu_RawTax": 2, "FloorNu_RawTax.1": 2, "Floor_frmHieght": 4, "TotalFloorArea": 724, "ANNEE_CONS": 1983 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.593727979935949, 45.522833645694313 ], [ -73.593622379981483, 45.522943045763455 ], [ -73.593627979641539, 45.5229456462108 ], [ -73.593757046904472, 45.523005285227981 ], [ -73.59376545085415, 45.522996062168147 ], [ -73.593790280472035, 45.522967946078182 ], [ -73.593790847971491, 45.522968193968069 ], [ -73.593875827697602, 45.522874944824011 ], [ -73.59387543312792, 45.522874766080079 ], [ -73.593855979643365, 45.52289494658158 ], [ -73.593791679795828, 45.52286404669664 ], [ -73.593727979935949, 45.522833645694313 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 159711, "id": "01031631", "CIVIQUE_DE": 5222, "CIVIQUE_FI": 5222, "NOM_RUE": "avenue Casgrain (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 10, "AREA_NEW": 146, "MBG_Width": 10, "MBG_Length": 15, "MBG_Orientation": 32, "Shape_Length": 50, "Shape_Area": 147, "BuildingCategory": "semi-attached", "BuildingVolume": 1460, "AspectRatio": 1.607, "SurfacetoVolumeRatio": 0.1, "FloorNu_RawTax": 2, "FloorNu_RawTax.1": 2, "Floor_frmHieght": 3, "TotalFloorArea": 438, "ANNEE_CONS": 1983 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.594000879767933, 45.525218447055174 ], [ -73.594043080289808, 45.525236947218026 ], [ -73.5941039805478, 45.525264146909009 ], [ -73.594208881213859, 45.52514714696995 ], [ -73.594107197565634, 45.525102137119283 ], [ -73.594000390389937, 45.525218232396192 ], [ -73.594000879767933, 45.525218447055174 ] ] ] } },
|
||||
{ "type": "Feature", "properties": { "OBJECTID": 162724, "id": "01093229", "CIVIQUE_DE": 5180, "CIVIQUE_FI": 5180, "NOM_RUE": "rue Drolet (MTL)", "MUNICIPALI": 50, "CODE_UTILI": 1000, "LIBELLE_UT": "Logement", "CATEGORIE_": "Régulier", "Hieght_LiD": 13, "AREA_NEW": 162, "MBG_Width": 13, "MBG_Length": 13, "MBG_Orientation": 32, "Shape_Length": 52, "Shape_Area": 171, "BuildingCategory": "fully-attached", "BuildingVolume": 2106, "AspectRatio": 1.061, "SurfacetoVolumeRatio": 0.077, "FloorNu_RawTax": 3, "FloorNu_RawTax.1": 3, "Floor_frmHieght": 4, "TotalFloorArea": 648, "ANNEE_CONS": 1989 }, "geometry": { "type": "Polygon", "coordinates": [ [ [ -73.591401779194541, 45.526781846358489 ], [ -73.591391179875345, 45.526792546731429 ], [ -73.591396178918018, 45.526794847220536 ], [ -73.591449340007159, 45.526819974082471 ], [ -73.591532003408886, 45.52672522496804 ], [ -73.591538651998277, 45.526716092568755 ], [ -73.591526179377823, 45.526710747618488 ], [ -73.591400782956626, 45.526656800065901 ], [ -73.591320310492023, 45.526757487175246 ], [ -73.591374078538919, 45.526782746763345 ], [ -73.59137467927394, 45.526782946946994 ], [ -73.591384179409957, 45.526773347058757 ], [ -73.591401779194541, 45.526781846358489 ] ] ] } }
|
||||
]
|
||||
}
|
|
@ -5,8 +5,8 @@
|
|||
"roof_u_value": 0.15,
|
||||
"ground_u_value": 0.18,
|
||||
"infiltration_reduction": 30,
|
||||
"window_u_value": 0.8,
|
||||
"window_g_value": 0.4
|
||||
"window_u_value": 1.1,
|
||||
"window_g_value": 0.6
|
||||
},
|
||||
"176293": {
|
||||
"retrofit_types": ["windows"],
|
||||
|
|
5
main.py
5
main.py
|
@ -27,9 +27,8 @@ city = GeometryFactory('geojson',
|
|||
function_field='function',
|
||||
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
|
||||
# Enrich city data
|
||||
|
||||
ConstructionFactory('cerc', city).enrich()
|
||||
UsageFactory('cerc', city).enrich()
|
||||
ConstructionFactory('nrcan', city).enrich()
|
||||
UsageFactory('nrcan', city).enrich()
|
||||
|
||||
RetrofitFactory(retrofit_data, city).enrich()
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
xmltodict
|
||||
numpy==1.26.4
|
||||
numpy
|
||||
trimesh[all]
|
||||
pyproj
|
||||
pandas
|
||||
|
@ -24,5 +24,4 @@ triangle
|
|||
psycopg2-binary
|
||||
Pillow
|
||||
pathlib
|
||||
sqlalchemy_utils
|
||||
build
|
||||
sqlalchemy_utils
|
|
@ -1,80 +0,0 @@
|
|||
from hub.imports.energy_systems_factory import EnergySystemsFactory
|
||||
from hub.imports.results_factory import ResultFactory
|
||||
from pathlib import Path
|
||||
from hub.imports.geometry_factory import GeometryFactory
|
||||
from hub.helpers.dictionaries import Dictionaries
|
||||
from hub.imports.construction_factory import ConstructionFactory
|
||||
from hub.imports.usage_factory import UsageFactory
|
||||
from hub.imports.weather_factory import WeatherFactory
|
||||
import json
|
||||
import hub.helpers.constants as cte
|
||||
from scripts.energy_system_sizing_and_simulation_factory import EnergySystemsSimulationFactory
|
||||
|
||||
# Specify the GeoJSON file path
|
||||
input_files_path = (Path(__file__).parent / 'input_files')
|
||||
geojson_file_path = input_files_path / 'omhm_selected_buildings.geojson'
|
||||
output_path = (Path(__file__).parent / 'out_files').resolve()
|
||||
output_path.mkdir(parents=True, exist_ok=True)
|
||||
ep_output_path = output_path / 'ep_outputs'
|
||||
ep_output_path.mkdir(parents=True, exist_ok=True)
|
||||
# Create city object from GeoJSON file
|
||||
city = GeometryFactory('geojson',
|
||||
path=geojson_file_path,
|
||||
height_field='Hieght_LiD',
|
||||
year_of_construction_field='ANNEE_CONS',
|
||||
function_field='CODE_UTILI',
|
||||
function_to_hub=Dictionaries().montreal_function_to_hub_function).city
|
||||
# Enrich city data
|
||||
ConstructionFactory('nrcan', city).enrich()
|
||||
UsageFactory('nrcan', city).enrich()
|
||||
WeatherFactory('epw', city).enrich()
|
||||
ResultFactory('energy_plus_multiple_buildings', city, ep_output_path).enrich()
|
||||
# for building in city.buildings:
|
||||
# building.energy_systems_archetype_name = 'system 7 electricity pv'
|
||||
# EnergySystemsFactory('montreal_custom', city).enrich()
|
||||
for building in city.buildings:
|
||||
building.energy_systems_archetype_name = 'PV+4Pipe+DHW'
|
||||
EnergySystemsFactory('montreal_future', city).enrich()
|
||||
for building in city.buildings:
|
||||
EnergySystemsSimulationFactory('archetype13', building=building, output_path=output_path).enrich()
|
||||
month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
building_data = {}
|
||||
for building in city.buildings:
|
||||
building_data[f'building_{building.name}'] = {'id': building.name,
|
||||
'total_floor_area':
|
||||
building.thermal_zones_from_internal_zones[0].total_floor_area,
|
||||
'yearly_heating_consumption_kWh':
|
||||
building.heating_consumption[cte.YEAR][0] / 3.6e6,
|
||||
'yearly_cooling_consumption_kWh':
|
||||
building.cooling_consumption[cte.YEAR][0] / 3.6e6,
|
||||
'yearly_dhw_consumption_kWh':
|
||||
building.domestic_hot_water_consumption[cte.YEAR][0] / 3.6e6,
|
||||
'yearly_appliance_electricity_consumption_kWh':
|
||||
building.appliances_electrical_demand[cte.YEAR][0] / 3.6e6,
|
||||
'yearly_lighting_electricity_consumption_kWh':
|
||||
building.lighting_electrical_demand[cte.YEAR][0] / 3.6e6,
|
||||
'heating_peak_load_kW': max(
|
||||
building.heating_consumption[cte.HOUR]) / 3.6e6,
|
||||
'cooling_peak_load_kW': max(
|
||||
building.cooling_consumption[cte.HOUR]) / 3.6e6,
|
||||
'monthly_heating_demand':
|
||||
{month_name: building.heating_demand[cte.MONTH][i] / 3.6e6
|
||||
for (i, month_name) in enumerate(month_names)},
|
||||
'monthly_heating_consumption_kWh':
|
||||
{month_name: building.heating_consumption[cte.MONTH][i] / 3.6e6
|
||||
for (i, month_name) in enumerate(month_names)},
|
||||
'monthly_cooling_demand_kWh':
|
||||
{month_name: building.cooling_demand[cte.MONTH][i] / 3.6e6
|
||||
for (i, month_name) in enumerate(month_names)},
|
||||
'monthly_cooling_consumption_kWh':
|
||||
{month_name: building.cooling_consumption[cte.MONTH][i] / 3.6e6
|
||||
for (i, month_name) in enumerate(month_names)},
|
||||
'monthly_dhw_demand_kWh':
|
||||
{month_name: building.domestic_hot_water_heat_demand[cte.MONTH][i] / 3.6e6
|
||||
for (i, month_name) in enumerate(month_names)},
|
||||
'monthly_dhw_consumption_kWh':
|
||||
{month_name: building.domestic_hot_water_consumption[cte.MONTH][i] /
|
||||
3.6e6 for (i, month_name) in enumerate(month_names)}}
|
||||
|
||||
with open(output_path / "air_to_water_hp_buildings_data.json", "w") as json_file:
|
||||
json.dump(building_data, json_file, indent=4)
|
|
@ -1,35 +0,0 @@
|
|||
"""
|
||||
EnergySystemSizingSimulationFactory retrieve the energy system archetype sizing and simulation module
|
||||
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
||||
Copyright © 2022 Concordia CERC group
|
||||
Project Coder Saeed Ranjbar saeed.ranjbar@mail.concordia.ca
|
||||
"""
|
||||
|
||||
from scripts.system_simulation_models.archetype13 import Archetype13
|
||||
|
||||
|
||||
|
||||
class EnergySystemsSimulationFactory:
|
||||
"""
|
||||
EnergySystemsFactory class
|
||||
"""
|
||||
|
||||
def __init__(self, handler, building, output_path):
|
||||
self._output_path = output_path
|
||||
self._handler = '_' + handler.lower()
|
||||
self._building = building
|
||||
|
||||
def _archetype13(self):
|
||||
"""
|
||||
Enrich the city by using the sizing and simulation model developed for archetype13 of montreal_future_systems
|
||||
"""
|
||||
Archetype13(self._building, self._output_path).enrich_buildings()
|
||||
self._building.level_of_detail.energy_systems = 2
|
||||
self._building.level_of_detail.energy_systems = 2
|
||||
|
||||
def enrich(self):
|
||||
"""
|
||||
Enrich the city given to the class using the class given handler
|
||||
:return: None
|
||||
"""
|
||||
getattr(self, self._handler, lambda: None)()
|
|
@ -1,56 +0,0 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from matplotlib.ticker import MaxNLocator
|
||||
|
||||
output_path = (Path(__file__).parent / 'out_files').resolve()
|
||||
|
||||
# File paths for the three JSON files
|
||||
file1 = output_path / 'base_case_buildings_data.json'
|
||||
file2 = output_path / 'air_to_air_hp_buildings_data.json'
|
||||
file3 = output_path / 'air_to_water_hp_buildings_data.json'
|
||||
|
||||
# Opening and reading all three JSON files at the same time
|
||||
with open(file1) as f1, open(file2) as f2, open(file3) as f3:
|
||||
base_case = json.load(f1)
|
||||
air = json.load(f2)
|
||||
water = json.load(f3)
|
||||
|
||||
month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
x = np.arange(len(month_names)) # the label locations
|
||||
width = 0.25 # the width of the bars
|
||||
|
||||
# Prettier colors for each scenario
|
||||
colors = ['#66B2FF', '#e74c3c'] # Blue, Red, Green
|
||||
|
||||
|
||||
# Plotting heating data for all buildings in a 2x5 grid
|
||||
fig, axes = plt.subplots(2, 5, figsize=(20, 10), dpi=96)
|
||||
fig.suptitle('Monthly DHW Consumption Comparison Across Buildings', fontsize=16, weight='bold', alpha=0.8)
|
||||
axes = axes.flatten()
|
||||
|
||||
for idx, building_name in enumerate(base_case.keys()):
|
||||
heating_data = [list(data["monthly_dhw_consumption_kWh"].values()) for data in
|
||||
[base_case[building_name], water[building_name]]]
|
||||
|
||||
ax = axes[idx]
|
||||
for i, data in enumerate(heating_data):
|
||||
ax.bar(x + (i - 1) * width, data, width, label=f'Scenario {i+1}', color=colors[i], zorder=2)
|
||||
|
||||
# Grid settings
|
||||
ax.grid(which="major", axis='x', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
ax.grid(which="major", axis='y', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
|
||||
# Axis labels and title
|
||||
ax.set_title(building_name, fontsize=14, weight='bold', alpha=0.8, pad=10)
|
||||
ax.set_xticks(x)
|
||||
ax.set_xticklabels(month_names, rotation=45, ha='right')
|
||||
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
ax.yaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
if idx % 5 == 0:
|
||||
ax.set_ylabel('DHW Consumption (kWh)', fontsize=12, labelpad=10)
|
||||
|
||||
fig.legend(['Base Case', 'Scenario 1&2'], loc='upper right', ncol=3)
|
||||
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
|
||||
plt.savefig(output_path / 'monthly_dhw.png')
|
|
@ -1,87 +0,0 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from matplotlib.ticker import MaxNLocator
|
||||
|
||||
output_path = (Path(__file__).parent / 'out_files').resolve()
|
||||
|
||||
# File paths for the three JSON files
|
||||
file1 = output_path / 'base_case_buildings_data.json'
|
||||
file2 = output_path / 'air_to_air_hp_buildings_data.json'
|
||||
file3 = output_path / 'air_to_water_hp_buildings_data.json'
|
||||
|
||||
# Opening and reading all three JSON files at the same time
|
||||
with open(file1) as f1, open(file2) as f2, open(file3) as f3:
|
||||
base_case = json.load(f1)
|
||||
air = json.load(f2)
|
||||
water = json.load(f3)
|
||||
|
||||
month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
x = np.arange(len(month_names)) # the label locations
|
||||
width = 0.25 # the width of the bars
|
||||
|
||||
# Prettier colors for each scenario
|
||||
colors = ['#66B2FF', '#e74c3c', '#2ecc71'] # Blue, Red, Green
|
||||
|
||||
|
||||
# Plotting heating data for all buildings in a 2x5 grid
|
||||
fig, axes = plt.subplots(2, 5, figsize=(20, 10), dpi=96)
|
||||
fig.suptitle('Monthly Heating Consumption Comparison Across Buildings', fontsize=16, weight='bold', alpha=0.8)
|
||||
axes = axes.flatten()
|
||||
|
||||
for idx, building_name in enumerate(base_case.keys()):
|
||||
heating_data = [list(data["monthly_heating_consumption_kWh"].values()) for data in
|
||||
[base_case[building_name], air[building_name], water[building_name]]]
|
||||
|
||||
ax = axes[idx]
|
||||
for i, data in enumerate(heating_data):
|
||||
ax.bar(x + (i - 1) * width, data, width, label=f'Scenario {i+1}', color=colors[i], zorder=2)
|
||||
|
||||
# Grid settings
|
||||
ax.grid(which="major", axis='x', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
ax.grid(which="major", axis='y', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
|
||||
# Axis labels and title
|
||||
ax.set_title(building_name, fontsize=14, weight='bold', alpha=0.8, pad=10)
|
||||
ax.set_xticks(x)
|
||||
ax.set_xticklabels(month_names, rotation=45, ha='right')
|
||||
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
ax.yaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
if idx % 5 == 0:
|
||||
ax.set_ylabel('Heating Consumption (kWh)', fontsize=12, labelpad=10)
|
||||
|
||||
fig.legend(['Base Case', 'Scenario 1', 'Scenario 2'], loc='upper right', ncol=3)
|
||||
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
|
||||
plt.savefig(output_path / 'monthly_heating.png')
|
||||
|
||||
# Plotting cooling data for all buildings in a 2x5 grid
|
||||
# Plotting cooling data for all buildings in a 2x5 grid
|
||||
fig, axes = plt.subplots(2, 5, figsize=(20, 10), dpi=96)
|
||||
fig.suptitle('Monthly Cooling Consumption Comparison Across Buildings', fontsize=16, weight='bold', alpha=0.8)
|
||||
axes = axes.flatten()
|
||||
|
||||
for idx, building_name in enumerate(base_case.keys()):
|
||||
cooling_data = [list(data["monthly_cooling_consumption_kWh"].values()) for data in
|
||||
[base_case[building_name], air[building_name], water[building_name]]]
|
||||
|
||||
ax = axes[idx]
|
||||
for i, data in enumerate(cooling_data):
|
||||
ax.bar(x + (i - 1) * width, data, width, label=f'Scenario {i+1}', color=colors[i], zorder=2)
|
||||
|
||||
# Grid settings
|
||||
ax.grid(which="major", axis='x', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
ax.grid(which="major", axis='y', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
|
||||
# Axis labels and title
|
||||
ax.set_title(building_name, fontsize=14, weight='bold', alpha=0.8, pad=10)
|
||||
ax.set_xticks(x)
|
||||
ax.set_xticklabels(month_names, rotation=45, ha='right')
|
||||
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
ax.yaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
if idx % 5 == 0:
|
||||
ax.set_ylabel('Cooling Consumption (kWh)', fontsize=12, labelpad=10)
|
||||
|
||||
fig.legend(['Base Case', 'Scenario 1', 'Scenario 2'], loc='upper right', ncol=3)
|
||||
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
|
||||
plt.savefig(output_path / 'monthly_cooling.png')
|
|
@ -1,73 +0,0 @@
|
|||
import json
|
||||
from pathlib import Path
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from matplotlib.ticker import MaxNLocator
|
||||
from matplotlib.patches import Patch
|
||||
|
||||
output_path = (Path(__file__).parent / 'out_files').resolve()
|
||||
|
||||
# File paths for the three JSON files
|
||||
file1 = output_path / 'base_case_buildings_data.json'
|
||||
file2 = output_path / 'air_to_air_hp_buildings_data.json'
|
||||
file3 = output_path / 'air_to_water_hp_buildings_data.json'
|
||||
|
||||
# Opening and reading all three JSON files at the same time
|
||||
with open(file1) as f1, open(file2) as f2, open(file3) as f3:
|
||||
base_case = json.load(f1)
|
||||
air = json.load(f2)
|
||||
water = json.load(f3)
|
||||
|
||||
month_names = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||
x = np.arange(len(month_names)) # the label locations
|
||||
|
||||
|
||||
# Scenario labels and color palette
|
||||
scenarios = ['Scenario 1', 'Scenario 2']
|
||||
colors = ['#66B2FF', '#e74c3c'] # Blue for Scenario 1, Red for Scenario 2
|
||||
width = 0.25 # Width for each bar
|
||||
|
||||
# Creating the grid for peak load comparisons across buildings
|
||||
fig, axes = plt.subplots(2, 5, figsize=(20, 10), dpi=96)
|
||||
fig.suptitle('Yearly Heating and Cooling Peak Load Comparison Across Buildings', fontsize=16, weight='bold', alpha=0.8)
|
||||
axes = axes.flatten()
|
||||
|
||||
for idx, building_name in enumerate(base_case.keys()):
|
||||
# Extracting heating and cooling peak loads for each scenario
|
||||
heating_peak_load = [
|
||||
air[building_name]["heating_peak_load_kW"],
|
||||
water[building_name]["heating_peak_load_kW"]
|
||||
]
|
||||
cooling_peak_load = [
|
||||
air[building_name]["cooling_peak_load_kW"],
|
||||
water[building_name]["cooling_peak_load_kW"]
|
||||
]
|
||||
|
||||
ax = axes[idx]
|
||||
x = np.arange(2) # X locations for the "Heating" and "Cooling" groups
|
||||
|
||||
# Plotting each scenario for heating and cooling
|
||||
for i in range(len(scenarios)):
|
||||
ax.bar(x[0] - width + i * width, heating_peak_load[i], width, color=colors[i], zorder=2)
|
||||
ax.bar(x[1] - width + i * width, cooling_peak_load[i], width, color=colors[i], zorder=2)
|
||||
|
||||
# Grid and styling
|
||||
ax.grid(which="major", axis='x', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
ax.grid(which="major", axis='y', color='#DAD8D7', alpha=0.5, zorder=1)
|
||||
|
||||
# Axis and title settings
|
||||
ax.set_title(building_name, fontsize=14, weight='bold', alpha=0.8, pad=10)
|
||||
ax.set_xticks(x)
|
||||
ax.set_xticklabels(['Heating Peak Load', 'Cooling Peak Load'])
|
||||
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
ax.yaxis.set_major_locator(MaxNLocator(integer=True))
|
||||
if idx % 5 == 0:
|
||||
ax.set_ylabel('Peak Load (kW)', fontsize=12, labelpad=10)
|
||||
|
||||
# Custom legend handles to ensure color match with scenarios
|
||||
legend_handles = [Patch(color=colors[i], label=scenarios[i]) for i in range(len(scenarios))]
|
||||
|
||||
# Global legend and layout adjustments
|
||||
fig.legend(handles=legend_handles, loc='upper right', ncol=1)
|
||||
plt.tight_layout(rect=[0, 0.03, 1, 0.95])
|
||||
plt.savefig(output_path / 'peak_loads.png')
|
|
@ -1,391 +0,0 @@
|
|||
import math
|
||||
import hub.helpers.constants as cte
|
||||
import csv
|
||||
from hub.helpers.monthly_values import MonthlyValues
|
||||
|
||||
|
||||
class Archetype13:
|
||||
def __init__(self, building, output_path):
|
||||
self._building = building
|
||||
self._name = building.name
|
||||
self._pv_system = building.energy_systems[0]
|
||||
self._hvac_system = building.energy_systems[1]
|
||||
self._dhw_system = building.energy_systems[-1]
|
||||
self._dhw_peak_flow_rate = (building.thermal_zones_from_internal_zones[0].total_floor_area *
|
||||
building.thermal_zones_from_internal_zones[0].domestic_hot_water.peak_flow *
|
||||
cte.WATER_DENSITY)
|
||||
self._heating_peak_load = building.heating_peak_load[cte.YEAR][0]
|
||||
self._cooling_peak_load = building.cooling_peak_load[cte.YEAR][0]
|
||||
self._domestic_hot_water_peak_load = building.domestic_hot_water_peak_load[cte.YEAR][0]
|
||||
self._hourly_heating_demand = [demand / cte.HOUR_TO_SECONDS for demand in building.heating_demand[cte.HOUR]]
|
||||
self._hourly_cooling_demand = [demand / cte.HOUR_TO_SECONDS for demand in building.cooling_demand[cte.HOUR]]
|
||||
self._hourly_dhw_demand = [demand / cte.WATTS_HOUR_TO_JULES for demand in
|
||||
building.domestic_hot_water_heat_demand[cte.HOUR]]
|
||||
self._output_path = output_path
|
||||
self._t_out = building.external_temperature[cte.HOUR]
|
||||
self.results = {}
|
||||
self.dt = 900
|
||||
|
||||
def hvac_sizing(self):
|
||||
storage_factor = 1.5
|
||||
heat_pump = self._hvac_system.generation_systems[1]
|
||||
boiler = self._hvac_system.generation_systems[0]
|
||||
thermal_storage = boiler.energy_storage_systems[0]
|
||||
heat_pump.nominal_heat_output = round(self._heating_peak_load)
|
||||
heat_pump.nominal_cooling_output = round(self._cooling_peak_load)
|
||||
boiler.nominal_heat_output = 0
|
||||
thermal_storage.volume = round(
|
||||
(self._heating_peak_load * storage_factor * cte.WATTS_HOUR_TO_JULES) /
|
||||
(cte.WATER_HEAT_CAPACITY * cte.WATER_DENSITY * 25))
|
||||
return heat_pump, boiler, thermal_storage
|
||||
|
||||
def dhw_sizing(self):
|
||||
storage_factor = 3
|
||||
dhw_hp = self._dhw_system.generation_systems[0]
|
||||
dhw_hp.nominal_heat_output = 0.7 * self._domestic_hot_water_peak_load
|
||||
dhw_hp.source_temperature = self._t_out
|
||||
dhw_tes = dhw_hp.energy_storage_systems[0]
|
||||
dhw_tes.volume = round(
|
||||
(self._domestic_hot_water_peak_load * storage_factor * 3600) / (cte.WATER_HEAT_CAPACITY * cte.WATER_DENSITY * 10))
|
||||
if dhw_tes.volume == 0:
|
||||
dhw_tes.volume = 1
|
||||
return dhw_hp, dhw_tes
|
||||
|
||||
def heating_system_simulation(self):
|
||||
hp, boiler, tes = self.hvac_sizing()
|
||||
heat_efficiency = float(hp.heat_efficiency)
|
||||
cop_curve_coefficients = [float(coefficient) for coefficient in hp.heat_efficiency_curve.coefficients]
|
||||
number_of_ts = int(cte.HOUR_TO_SECONDS / self.dt)
|
||||
demand = [0] + [x for x in self._hourly_heating_demand for _ in range(number_of_ts)]
|
||||
t_out = [0] + [x for x in self._t_out for _ in range(number_of_ts)]
|
||||
hp.source_temperature = self._t_out
|
||||
variable_names = ["t_sup_hp", "t_tank", "t_ret", "m_ch", "m_dis", "q_hp", "q_boiler", "hp_cop",
|
||||
"hp_electricity", "boiler_gas_consumption", "t_sup_boiler", "boiler_energy_consumption",
|
||||
"heating_consumption"]
|
||||
num_hours = len(demand)
|
||||
variables = {name: [0] * num_hours for name in variable_names}
|
||||
(t_sup_hp, t_tank, t_ret, m_ch, m_dis, q_hp, q_boiler, hp_cop,
|
||||
hp_electricity, boiler_gas_consumption, t_sup_boiler, boiler_energy_consumption, heating_consumption) = \
|
||||
[variables[name] for name in variable_names]
|
||||
t_tank[0] = 55
|
||||
hp_heating_cap = hp.nominal_heat_output
|
||||
boiler_heating_cap = boiler.nominal_heat_output
|
||||
hp_delta_t = 7
|
||||
boiler_efficiency = float(boiler.heat_efficiency)
|
||||
v, h = float(tes.volume), float(tes.height)
|
||||
r_tot = sum(float(layer.thickness) / float(layer.material.conductivity) for layer in
|
||||
tes.layers)
|
||||
u_tot = 1 / r_tot
|
||||
d = math.sqrt((4 * v) / (math.pi * h))
|
||||
a_side = math.pi * d * h
|
||||
a_top = math.pi * d ** 2 / 4
|
||||
ua = u_tot * (2 * a_top + a_side)
|
||||
# storage temperature prediction
|
||||
for i in range(len(demand) - 1):
|
||||
t_tank[i + 1] = (t_tank[i] +
|
||||
(m_ch[i] * (t_sup_boiler[i] - t_tank[i]) +
|
||||
(ua * (t_out[i] - t_tank[i])) / cte.WATER_HEAT_CAPACITY -
|
||||
m_dis[i] * (t_tank[i] - t_ret[i])) * (self.dt / (cte.WATER_DENSITY * v)))
|
||||
# hp operation
|
||||
if t_tank[i + 1] < 40:
|
||||
q_hp[i + 1] = hp_heating_cap
|
||||
m_ch[i + 1] = q_hp[i + 1] / (cte.WATER_HEAT_CAPACITY * hp_delta_t)
|
||||
t_sup_hp[i + 1] = (q_hp[i + 1] / (m_ch[i + 1] * cte.WATER_HEAT_CAPACITY)) + t_tank[i + 1]
|
||||
elif 40 <= t_tank[i + 1] < 55 and q_hp[i] == 0:
|
||||
q_hp[i + 1] = 0
|
||||
m_ch[i + 1] = 0
|
||||
t_sup_hp[i + 1] = t_tank[i + 1]
|
||||
elif 40 <= t_tank[i + 1] < 55 and q_hp[i] > 0:
|
||||
q_hp[i + 1] = hp_heating_cap
|
||||
m_ch[i + 1] = q_hp[i + 1] / (cte.WATER_HEAT_CAPACITY * hp_delta_t)
|
||||
t_sup_hp[i + 1] = (q_hp[i + 1] / (m_ch[i + 1] * cte.WATER_HEAT_CAPACITY)) + t_tank[i + 1]
|
||||
else:
|
||||
q_hp[i + 1], m_ch[i + 1], t_sup_hp[i + 1] = 0, 0, t_tank[i + 1]
|
||||
t_sup_hp_fahrenheit = 1.8 * t_sup_hp[i + 1] + 32
|
||||
t_out_fahrenheit = 1.8 * t_out[i + 1] + 32
|
||||
if q_hp[i + 1] > 0:
|
||||
hp_cop[i + 1] = (cop_curve_coefficients[0] +
|
||||
cop_curve_coefficients[1] * t_sup_hp_fahrenheit +
|
||||
cop_curve_coefficients[2] * t_sup_hp_fahrenheit ** 2 +
|
||||
cop_curve_coefficients[3] * t_out_fahrenheit +
|
||||
cop_curve_coefficients[4] * t_out_fahrenheit ** 2 +
|
||||
cop_curve_coefficients[5] * t_sup_hp_fahrenheit * t_out_fahrenheit)
|
||||
hp_electricity[i + 1] = q_hp[i + 1] / heat_efficiency
|
||||
else:
|
||||
hp_cop[i + 1] = 0
|
||||
hp_electricity[i + 1] = 0
|
||||
# boiler operation
|
||||
if q_hp[i + 1] > 0:
|
||||
if t_sup_hp[i + 1] < 45:
|
||||
q_boiler[i + 1] = boiler_heating_cap
|
||||
elif demand[i + 1] > 0.5 * self._heating_peak_load / self.dt:
|
||||
q_boiler[i + 1] = 0.5 * boiler_heating_cap
|
||||
boiler_energy_consumption[i + 1] = q_boiler[i + 1] / boiler_efficiency
|
||||
# boiler_gas_consumption[i + 1] = (q_boiler[i + 1] * self.dt) / (boiler_efficiency * cte.NATURAL_GAS_LHV)
|
||||
t_sup_boiler[i + 1] = t_sup_hp[i + 1] + (q_boiler[i + 1] / (m_ch[i + 1] * cte.WATER_HEAT_CAPACITY))
|
||||
# storage discharging
|
||||
if demand[i + 1] == 0:
|
||||
m_dis[i + 1] = 0
|
||||
t_ret[i + 1] = t_tank[i + 1]
|
||||
else:
|
||||
if demand[i + 1] > 0.5 * self._heating_peak_load / cte.HOUR_TO_SECONDS:
|
||||
factor = 8
|
||||
else:
|
||||
factor = 4
|
||||
m_dis[i + 1] = self._heating_peak_load / (cte.WATER_HEAT_CAPACITY * factor * cte.HOUR_TO_SECONDS)
|
||||
t_ret[i + 1] = t_tank[i + 1] - demand[i + 1] / (m_dis[i + 1] * cte.WATER_HEAT_CAPACITY)
|
||||
tes.temperature = []
|
||||
hp_electricity_j = [(x * cte.WATTS_HOUR_TO_JULES) / number_of_ts for x in hp_electricity]
|
||||
boiler_consumption_j = [(x * cte.WATTS_HOUR_TO_JULES) / number_of_ts for x in boiler_energy_consumption]
|
||||
hp_hourly = []
|
||||
boiler_hourly = []
|
||||
boiler_sum = 0
|
||||
hp_sum = 0
|
||||
for i in range(1, len(demand)):
|
||||
hp_sum += hp_electricity_j[i]
|
||||
boiler_sum += boiler_consumption_j[i]
|
||||
if (i - 1) % number_of_ts == 0:
|
||||
tes.temperature.append(t_tank[i])
|
||||
hp_hourly.append(hp_sum)
|
||||
boiler_hourly.append(boiler_sum)
|
||||
hp_sum = 0
|
||||
boiler_sum = 0
|
||||
hp.energy_consumption[cte.HEATING] = {}
|
||||
hp.energy_consumption[cte.HEATING][cte.HOUR] = hp_hourly
|
||||
hp.energy_consumption[cte.HEATING][cte.MONTH] = MonthlyValues.get_total_month(
|
||||
hp.energy_consumption[cte.HEATING][cte.HOUR])
|
||||
hp.energy_consumption[cte.HEATING][cte.YEAR] = [
|
||||
sum(hp.energy_consumption[cte.HEATING][cte.MONTH])]
|
||||
boiler.energy_consumption[cte.HEATING] = {}
|
||||
boiler.energy_consumption[cte.HEATING][cte.HOUR] = boiler_hourly
|
||||
boiler.energy_consumption[cte.HEATING][cte.MONTH] = MonthlyValues.get_total_month(
|
||||
boiler.energy_consumption[cte.HEATING][cte.HOUR])
|
||||
boiler.energy_consumption[cte.HEATING][cte.YEAR] = [
|
||||
sum(boiler.energy_consumption[cte.HEATING][cte.MONTH])]
|
||||
|
||||
self.results['Heating Demand (W)'] = demand
|
||||
self.results['HP Heat Output (W)'] = q_hp
|
||||
self.results['HP Source Temperature'] = t_out
|
||||
self.results['HP Supply Temperature'] = t_sup_hp
|
||||
self.results['HP COP'] = hp_cop
|
||||
self.results['HP Electricity Consumption (W)'] = hp_electricity
|
||||
self.results['Boiler Heat Output (W)'] = q_boiler
|
||||
self.results['Boiler Supply Temperature'] = t_sup_boiler
|
||||
self.results['Boiler Gas Consumption'] = boiler_gas_consumption
|
||||
self.results['TES Temperature'] = t_tank
|
||||
self.results['TES Charging Flow Rate (kg/s)'] = m_ch
|
||||
self.results['TES Discharge Flow Rate (kg/s)'] = m_dis
|
||||
self.results['Heating Loop Return Temperature'] = t_ret
|
||||
return hp_hourly, boiler_hourly
|
||||
|
||||
def cooling_system_simulation(self):
|
||||
hp = self.hvac_sizing()[0]
|
||||
eer_curve_coefficients = [float(coefficient) for coefficient in hp.cooling_efficiency_curve.coefficients]
|
||||
cooling_efficiency = float(hp.cooling_efficiency)
|
||||
number_of_ts = int(cte.HOUR_TO_SECONDS / self.dt)
|
||||
demand = [0] + [x for x in self._hourly_cooling_demand for _ in range(number_of_ts)]
|
||||
t_out = [0] + [x for x in self._t_out for _ in range(number_of_ts)]
|
||||
hp.source_temperature = self._t_out
|
||||
variable_names = ["t_sup_hp", "t_ret", "m", "q_hp", "hp_electricity", "hp_eer"]
|
||||
num_hours = len(demand)
|
||||
variables = {name: [0] * num_hours for name in variable_names}
|
||||
(t_sup_hp, t_ret, m, q_hp, hp_electricity, hp_eer) = [variables[name] for name in variable_names]
|
||||
t_ret[0] = 13
|
||||
|
||||
for i in range(1, len(demand)):
|
||||
if demand[i] > 0:
|
||||
m[i] = self._cooling_peak_load / (cte.WATER_HEAT_CAPACITY * 5 * cte.HOUR_TO_SECONDS)
|
||||
if t_ret[i - 1] >= 13:
|
||||
if demand[i] < 0.25 * self._cooling_peak_load / cte.HOUR_TO_SECONDS:
|
||||
q_hp[i] = 0.25 * hp.nominal_cooling_output
|
||||
elif demand[i] < 0.5 * self._cooling_peak_load / cte.HOUR_TO_SECONDS:
|
||||
q_hp[i] = 0.5 * hp.nominal_cooling_output
|
||||
else:
|
||||
q_hp[i] = hp.nominal_cooling_output
|
||||
t_sup_hp[i] = t_ret[i - 1] - q_hp[i] / (m[i] * cte.WATER_HEAT_CAPACITY)
|
||||
else:
|
||||
q_hp[i] = 0
|
||||
t_sup_hp[i] = t_ret[i - 1]
|
||||
if m[i] == 0:
|
||||
t_ret[i] = t_sup_hp[i]
|
||||
else:
|
||||
t_ret[i] = t_sup_hp[i] + demand[i] / (m[i] * cte.WATER_HEAT_CAPACITY)
|
||||
else:
|
||||
m[i] = 0
|
||||
q_hp[i] = 0
|
||||
t_sup_hp[i] = t_ret[i -1]
|
||||
t_ret[i] = t_ret[i - 1]
|
||||
t_sup_hp_fahrenheit = 1.8 * t_sup_hp[i] + 32
|
||||
t_out_fahrenheit = 1.8 * t_out[i] + 32
|
||||
if q_hp[i] > 0:
|
||||
hp_eer[i] = (eer_curve_coefficients[0] +
|
||||
eer_curve_coefficients[1] * t_sup_hp_fahrenheit +
|
||||
eer_curve_coefficients[2] * t_sup_hp_fahrenheit ** 2 +
|
||||
eer_curve_coefficients[3] * t_out_fahrenheit +
|
||||
eer_curve_coefficients[4] * t_out_fahrenheit ** 2 +
|
||||
eer_curve_coefficients[5] * t_sup_hp_fahrenheit * t_out_fahrenheit)
|
||||
hp_electricity[i] = q_hp[i] / cooling_efficiency
|
||||
else:
|
||||
hp_eer[i] = 0
|
||||
hp_electricity[i] = 0
|
||||
hp_electricity_j = [(x * cte.WATTS_HOUR_TO_JULES) / number_of_ts for x in hp_electricity]
|
||||
hp_hourly = []
|
||||
hp_sum = 0
|
||||
for i in range(1, len(demand)):
|
||||
hp_sum += hp_electricity_j[i]
|
||||
if (i - 1) % number_of_ts == 0:
|
||||
hp_hourly.append(hp_sum)
|
||||
hp_sum = 0
|
||||
hp.energy_consumption[cte.COOLING] = {}
|
||||
hp.energy_consumption[cte.COOLING][cte.HOUR] = hp_hourly
|
||||
hp.energy_consumption[cte.COOLING][cte.MONTH] = MonthlyValues.get_total_month(
|
||||
hp.energy_consumption[cte.COOLING][cte.HOUR])
|
||||
hp.energy_consumption[cte.COOLING][cte.YEAR] = [
|
||||
sum(hp.energy_consumption[cte.COOLING][cte.MONTH])]
|
||||
self.results['Cooling Demand (W)'] = demand
|
||||
self.results['HP Cooling Output (W)'] = q_hp
|
||||
self.results['HP Cooling Supply Temperature'] = t_sup_hp
|
||||
self.results['HP Cooling COP'] = hp_eer
|
||||
self.results['HP Electricity Consumption'] = hp_electricity
|
||||
self.results['Cooling Loop Flow Rate (kg/s)'] = m
|
||||
self.results['Cooling Loop Return Temperature'] = t_ret
|
||||
return hp_hourly
|
||||
|
||||
def dhw_system_simulation(self):
|
||||
hp, tes = self.dhw_sizing()
|
||||
heat_efficiency = float(hp.heat_efficiency)
|
||||
cop_curve_coefficients = [float(coefficient) for coefficient in hp.heat_efficiency_curve.coefficients]
|
||||
number_of_ts = int(cte.HOUR_TO_SECONDS / self.dt)
|
||||
demand = [0] + [x for x in self._hourly_dhw_demand for _ in range(number_of_ts)]
|
||||
t_out = [0] + [x for x in self._t_out for _ in range(number_of_ts)]
|
||||
variable_names = ["t_sup_hp", "t_tank", "m_ch", "m_dis", "q_hp", "q_coil", "hp_cop",
|
||||
"hp_electricity", "available hot water (m3)", "refill flow rate (kg/s)"]
|
||||
num_hours = len(demand)
|
||||
variables = {name: [0] * num_hours for name in variable_names}
|
||||
(t_sup_hp, t_tank, m_ch, m_dis, m_refill, q_hp, q_coil, hp_cop, hp_electricity, v_dhw) = \
|
||||
[variables[name] for name in variable_names]
|
||||
t_tank[0] = 70
|
||||
v_dhw[0] = tes.volume
|
||||
|
||||
hp_heating_cap = hp.nominal_heat_output
|
||||
hp_delta_t = 8
|
||||
v, h = float(tes.volume), float(tes.height)
|
||||
r_tot = sum(float(layer.thickness) / float(layer.material.conductivity) for layer in
|
||||
tes.layers)
|
||||
u_tot = 1 / r_tot
|
||||
d = math.sqrt((4 * v) / (math.pi * h))
|
||||
a_side = math.pi * d * h
|
||||
a_top = math.pi * d ** 2 / 4
|
||||
ua = u_tot * (2 * a_top + a_side)
|
||||
freshwater_temperature = 18
|
||||
for i in range(len(demand) - 1):
|
||||
delta_t_demand = demand[i] * (self.dt / (cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY * v))
|
||||
if t_tank[i] < 65:
|
||||
q_hp[i] = hp_heating_cap
|
||||
delta_t_hp = q_hp[i] * (self.dt / (cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY * v))
|
||||
if demand[i] > 0:
|
||||
dhw_needed = (demand[i] * cte.HOUR_TO_SECONDS) / (cte.WATER_HEAT_CAPACITY * t_tank[i] * cte.WATER_DENSITY)
|
||||
m_dis[i] = dhw_needed * cte.WATER_DENSITY / cte.HOUR_TO_SECONDS
|
||||
m_refill[i] = m_dis[i]
|
||||
delta_t_freshwater = m_refill[i] * (t_tank[i] - freshwater_temperature) * (self.dt / (v * cte.WATER_DENSITY))
|
||||
diff = delta_t_freshwater + delta_t_demand - delta_t_hp
|
||||
if diff > 0:
|
||||
if diff > 0:
|
||||
power = diff * (cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY * v) / self.dt
|
||||
if power <= float(tes.heating_coil_capacity):
|
||||
q_coil[i] = power
|
||||
else:
|
||||
q_coil[i] = float(tes.heating_coil_capacity)
|
||||
delta_t_coil = q_coil[i] * (self.dt / (cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY * v))
|
||||
|
||||
if q_hp[i] > 0:
|
||||
m_ch[i] = q_hp[i] / (cte.WATER_HEAT_CAPACITY * hp_delta_t)
|
||||
t_sup_hp[i] = (q_hp[i] / (m_ch[i] * cte.WATER_HEAT_CAPACITY)) + t_tank[i]
|
||||
else:
|
||||
m_ch[i] = 0
|
||||
t_sup_hp[i] = t_tank[i]
|
||||
t_sup_hp_fahrenheit = 1.8 * t_sup_hp[i] + 32
|
||||
t_out_fahrenheit = 1.8 * t_out[i] + 32
|
||||
if q_hp[i] > 0:
|
||||
hp_cop[i] = (cop_curve_coefficients[0] +
|
||||
cop_curve_coefficients[1] * t_sup_hp_fahrenheit +
|
||||
cop_curve_coefficients[2] * t_sup_hp_fahrenheit ** 2 +
|
||||
cop_curve_coefficients[3] * t_out_fahrenheit +
|
||||
cop_curve_coefficients[4] * t_out_fahrenheit ** 2 +
|
||||
cop_curve_coefficients[5] * t_sup_hp_fahrenheit * t_out_fahrenheit)
|
||||
hp_electricity[i] = q_hp[i] / heat_efficiency
|
||||
else:
|
||||
hp_cop[i] = 0
|
||||
hp_electricity[i] = 0
|
||||
|
||||
t_tank[i + 1] = t_tank[i] + (delta_t_hp - delta_t_freshwater - delta_t_demand + delta_t_coil)
|
||||
tes.temperature = []
|
||||
hp_electricity_j = [(x * cte.WATTS_HOUR_TO_JULES) / number_of_ts for x in hp_electricity]
|
||||
heating_coil_j = [(x * cte.WATTS_HOUR_TO_JULES) / number_of_ts for x in q_coil]
|
||||
hp_hourly = []
|
||||
coil_hourly = []
|
||||
coil_sum = 0
|
||||
hp_sum = 0
|
||||
for i in range(1, len(demand)):
|
||||
hp_sum += hp_electricity_j[i]
|
||||
coil_sum += heating_coil_j[i]
|
||||
if (i - 1) % number_of_ts == 0:
|
||||
tes.temperature.append(t_tank[i])
|
||||
hp_hourly.append(hp_sum)
|
||||
coil_hourly.append(coil_sum)
|
||||
hp_sum = 0
|
||||
coil_sum = 0
|
||||
|
||||
hp.energy_consumption[cte.DOMESTIC_HOT_WATER] = {}
|
||||
hp.energy_consumption[cte.DOMESTIC_HOT_WATER][cte.HOUR] = hp_hourly
|
||||
hp.energy_consumption[cte.DOMESTIC_HOT_WATER][cte.MONTH] = MonthlyValues.get_total_month(
|
||||
hp.energy_consumption[cte.DOMESTIC_HOT_WATER][cte.HOUR])
|
||||
hp.energy_consumption[cte.DOMESTIC_HOT_WATER][cte.YEAR] = [
|
||||
sum(hp.energy_consumption[cte.DOMESTIC_HOT_WATER][cte.MONTH])]
|
||||
tes.heating_coil_energy_consumption = {}
|
||||
tes.heating_coil_energy_consumption[cte.HOUR] = coil_hourly
|
||||
tes.heating_coil_energy_consumption[cte.MONTH] = MonthlyValues.get_total_month(
|
||||
tes.heating_coil_energy_consumption[cte.HOUR])
|
||||
tes.heating_coil_energy_consumption[cte.YEAR] = [
|
||||
sum(tes.heating_coil_energy_consumption[cte.MONTH])]
|
||||
tes.temperature = t_tank
|
||||
|
||||
self.results['DHW Demand (W)'] = demand
|
||||
self.results['DHW HP Heat Output (W)'] = q_hp
|
||||
self.results['DHW HP Electricity Consumption (W)'] = hp_electricity
|
||||
self.results['DHW HP Source Temperature'] = t_out
|
||||
self.results['DHW HP Supply Temperature'] = t_sup_hp
|
||||
self.results['DHW HP COP'] = hp_cop
|
||||
self.results['DHW TES Heating Coil Heat Output (W)'] = q_coil
|
||||
self.results['DHW TES Temperature'] = t_tank
|
||||
self.results['DHW TES Charging Flow Rate (kg/s)'] = m_ch
|
||||
self.results['DHW Flow Rate (kg/s)'] = m_dis
|
||||
self.results['DHW TES Refill Flow Rate (kg/s)'] = m_refill
|
||||
self.results['Available Water in Tank (m3)'] = v_dhw
|
||||
return hp_hourly, coil_hourly
|
||||
|
||||
def enrich_buildings(self):
|
||||
hp_heating, boiler_consumption = self.heating_system_simulation()
|
||||
hp_cooling = self.cooling_system_simulation()
|
||||
hp_dhw, heating_coil = self.dhw_system_simulation()
|
||||
heating_consumption = [hp_heating[i] + boiler_consumption[i] for i in range(len(hp_heating))]
|
||||
dhw_consumption = [hp_dhw[i] + heating_coil[i] for i in range(len(hp_dhw))]
|
||||
self._building.heating_consumption[cte.HOUR] = heating_consumption
|
||||
self._building.heating_consumption[cte.MONTH] = (
|
||||
MonthlyValues.get_total_month(self._building.heating_consumption[cte.HOUR]))
|
||||
self._building.heating_consumption[cte.YEAR] = [sum(self._building.heating_consumption[cte.MONTH])]
|
||||
self._building.cooling_consumption[cte.HOUR] = hp_cooling
|
||||
self._building.cooling_consumption[cte.MONTH] = (
|
||||
MonthlyValues.get_total_month(self._building.cooling_consumption[cte.HOUR]))
|
||||
self._building.cooling_consumption[cte.YEAR] = [sum(self._building.cooling_consumption[cte.MONTH])]
|
||||
self._building.domestic_hot_water_consumption[cte.HOUR] = dhw_consumption
|
||||
self._building.domestic_hot_water_consumption[cte.MONTH] = (
|
||||
MonthlyValues.get_total_month(self._building.domestic_hot_water_consumption[cte.HOUR]))
|
||||
self._building.domestic_hot_water_consumption[cte.YEAR] = [sum(self._building.domestic_hot_water_consumption[cte.MONTH])]
|
||||
file_name = f'energy_system_simulation_results_{self._name}.csv'
|
||||
with open(self._output_path / file_name, 'w', newline='') as csvfile:
|
||||
output_file = csv.writer(csvfile)
|
||||
# Write header
|
||||
output_file.writerow(self.results.keys())
|
||||
# Write data
|
||||
output_file.writerows(zip(*self.results.values()))
|
|
@ -83,7 +83,7 @@ class TestUsageFactory(TestCase):
|
|||
city = self._get_citygml(file)
|
||||
for building in city.buildings:
|
||||
building.function = Dictionaries().pluto_function_to_hub_function[building.function]
|
||||
ConstructionFactory('nrcan', city).enrich()
|
||||
|
||||
UsageFactory('comnet', city).enrich()
|
||||
self._check_buildings(city)
|
||||
for building in city.buildings:
|
||||
|
|
142
texttest
Normal file
142
texttest
Normal file
|
@ -0,0 +1,142 @@
|
|||
ZoneControl:Thermostat,
|
||||
Room_180_7ad8616b Thermostat, !- Name
|
||||
Room_180_7ad8616b, !- Zone or ZoneList Name
|
||||
Room_180_7ad8616b Thermostat Schedule, !- Control Type Schedule Name
|
||||
ThermostatSetpoint:DualSetpoint, !- Control 1 Object Type
|
||||
LargeOffice Building_Setpoint 26, !- Control 1 Name
|
||||
, !- Control 2 Object Type
|
||||
, !- Control 2 Name
|
||||
, !- Control 3 Object Type
|
||||
, !- Control 3 Name
|
||||
, !- Control 4 Object Type
|
||||
, !- Control 4 Name
|
||||
0; !- Temperature Difference Between Cutout And Setpoint {deltaC}
|
||||
|
||||
Schedule:Compact,
|
||||
Room_180_7ad8616b Thermostat Schedule, !- Name
|
||||
Room_180_7ad8616b Thermostat Schedule Type Limits, !- Schedule Type Limits Name
|
||||
Through: 12/31, !- Field 1
|
||||
For: AllDays, !- Field 2
|
||||
Until: 24:00, !- Field 3
|
||||
4; !- Field 4
|
||||
|
||||
ScheduleTypeLimits,
|
||||
Room_180_7ad8616b Thermostat Schedule Type Limits, !- Name
|
||||
0, !- Lower Limit Value {BasedOnField A3}
|
||||
4, !- Upper Limit Value {BasedOnField A3}
|
||||
DISCRETE; !- Numeric Type
|
||||
|
||||
ThermostatSetpoint:DualSetpoint,
|
||||
LargeOffice Building_Setpoint 26, !- Name
|
||||
LargeOffice Building_Setpoint_HtgSetp Schedule, !- Heating Setpoint Temperature Schedule Name
|
||||
LargeOffice Building_Setpoint_ClgSetp Schedule; !- Cooling Setpoint Temperature Schedule Name
|
||||
|
||||
ZoneHVAC:EquipmentConnections,
|
||||
Room_180_7ad8616b, !- Zone Name
|
||||
Room_180_7ad8616b Equipment List, !- Zone Conditioning Equipment List Name
|
||||
Room_180_7ad8616b Inlet Node List, !- Zone Air Inlet Node or NodeList Name
|
||||
, !- Zone Air Exhaust Node or NodeList Name
|
||||
Node 27, !- Zone Air Node Name
|
||||
Room_180_7ad8616b Return Node List; !- Zone Return Air Node or NodeList Name
|
||||
|
||||
NodeList,
|
||||
Room_180_7ad8616b Inlet Node List, !- Name
|
||||
Node 305; !- Node Name 1
|
||||
|
||||
NodeList,
|
||||
Room_180_7ad8616b Return Node List, !- Name
|
||||
Node 308; !- Node Name 1
|
||||
|
||||
ZoneHVAC:Baseboard:Convective:Electric,
|
||||
Elec Baseboard 1, !- Name
|
||||
Always On Discrete hvac_library, !- Availability Schedule Name
|
||||
, !- Heating Design Capacity Method
|
||||
Autosize, !- Heating Design Capacity {W}
|
||||
, !- Heating Design Capacity Per Floor Area {W/m2}
|
||||
, !- Fraction of Autosized Heating Design Capacity
|
||||
1; !- Efficiency
|
||||
|
||||
AirTerminal:SingleDuct:ConstantVolume:NoReheat,
|
||||
Diffuser 21, !- Name
|
||||
Always On Discrete hvac_library, !- Availability Schedule Name
|
||||
Node 307, !- Air Inlet Node Name
|
||||
Node 305, !- Air Outlet Node Name
|
||||
AutoSize; !- Maximum Air Flow Rate {m3/s}
|
||||
|
||||
ZoneHVAC:AirDistributionUnit,
|
||||
ADU Diffuser 21, !- Name
|
||||
Node 305, !- Air Distribution Unit Outlet Node Name
|
||||
AirTerminal:SingleDuct:ConstantVolume:NoReheat, !- Air Terminal Object Type
|
||||
Diffuser 21; !- Air Terminal Name
|
||||
|
||||
ZoneHVAC:EquipmentList,
|
||||
Room_180_7ad8616b Equipment List, !- Name
|
||||
SequentialLoad, !- Load Distribution Scheme
|
||||
ZoneHVAC:Baseboard:Convective:Electric, !- Zone Equipment Object Type 1
|
||||
Elec Baseboard 1, !- Zone Equipment Name 1
|
||||
1, !- Zone Equipment Cooling Sequence 1
|
||||
1, !- Zone Equipment Heating or No-Load Sequence 1
|
||||
, !- Zone Equipment Sequential Cooling Fraction Schedule Name 1
|
||||
, !- Zone Equipment Sequential Heating Fraction Schedule Name 1
|
||||
ZoneHVAC:AirDistributionUnit, !- Zone Equipment Object Type 2
|
||||
ADU Diffuser 21, !- Zone Equipment Name 2
|
||||
2, !- Zone Equipment Cooling Sequence 2
|
||||
2, !- Zone Equipment Heating or No-Load Sequence 2
|
||||
, !- Zone Equipment Sequential Cooling Fraction Schedule Name 2
|
||||
; !- Zone Equipment Sequential Heating Fraction Schedule Name 2
|
||||
|
||||
Sizing:Zone,
|
||||
Room_180_7ad8616b, !- Zone or ZoneList Name
|
||||
SupplyAirTemperature, !- Zone Cooling Design Supply Air Temperature Input Method
|
||||
14, !- Zone Cooling Design Supply Air Temperature {C}
|
||||
11.11, !- Zone Cooling Design Supply Air Temperature Difference {deltaC}
|
||||
SupplyAirTemperature, !- Zone Heating Design Supply Air Temperature Input Method
|
||||
40, !- Zone Heating Design Supply Air Temperature {C}
|
||||
11.11, !- Zone Heating Design Supply Air Temperature Difference {deltaC}
|
||||
0.0085, !- Zone Cooling Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
0.008, !- Zone Heating Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
Room_180_7ad8616b DSOA Space List, !- Design Specification Outdoor Air Object Name
|
||||
, !- Zone Heating Sizing Factor
|
||||
, !- Zone Cooling Sizing Factor
|
||||
DesignDay, !- Cooling Design Air Flow Method
|
||||
0, !- Cooling Design Air Flow Rate {m3/s}
|
||||
0.000762, !- Cooling Minimum Air Flow per Zone Floor Area {m3/s-m2}
|
||||
0, !- Cooling Minimum Air Flow {m3/s}
|
||||
0, !- Cooling Minimum Air Flow Fraction
|
||||
DesignDay, !- Heating Design Air Flow Method
|
||||
0, !- Heating Design Air Flow Rate {m3/s}
|
||||
0.002032, !- Heating Maximum Air Flow per Zone Floor Area {m3/s-m2}
|
||||
0.1415762, !- Heating Maximum Air Flow {m3/s}
|
||||
0.3, !- Heating Maximum Air Flow Fraction
|
||||
, !- Design Specification Zone Air Distribution Object Name
|
||||
No, !- Account for Dedicated Outdoor Air System
|
||||
, !- Dedicated Outdoor Air System Control Strategy
|
||||
, !- Dedicated Outdoor Air Low Setpoint Temperature for Design {C}
|
||||
, !- Dedicated Outdoor Air High Setpoint Temperature for Design {C}
|
||||
Sensible Load Only No Latent Load, !- Zone Load Sizing Method
|
||||
HumidityRatioDifference, !- Zone Latent Cooling Design Supply Air Humidity Ratio Input Method
|
||||
, !- Zone Dehumidification Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
0.005, !- Zone Cooling Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir}
|
||||
HumidityRatioDifference, !- Zone Latent Heating Design Supply Air Humidity Ratio Input Method
|
||||
, !- Zone Humidification Design Supply Air Humidity Ratio {kgWater/kgDryAir}
|
||||
0.005; !- Zone Humidification Design Supply Air Humidity Ratio Difference {kgWater/kgDryAir}
|
||||
|
||||
DesignSpecification:OutdoorAir:SpaceList,
|
||||
Room_180_7ad8616b DSOA Space List, !- Name
|
||||
Room_180_7ad8616b_Space, !- Space Name 1
|
||||
MidriseApartment Apartment Ventilation; !- Space Design Specification Outdoor Air Object Name 1
|
||||
|
||||
Zone,
|
||||
Room_181_3a411b5d, !- Name
|
||||
, !- Direction of Relative North {deg}
|
||||
0, !- X Origin {m}
|
||||
0, !- Y Origin {m}
|
||||
0, !- Z Origin {m}
|
||||
, !- Type
|
||||
1, !- Multiplier
|
||||
4, !- Ceiling Height {m}
|
||||
291.62935408288, !- Volume {m3}
|
||||
, !- Floor Area {m2}
|
||||
, !- Zone Inside Convection Algorithm
|
||||
, !- Zone Outside Convection Algorithm
|
||||
Yes; !- Part of Total Floor Area
|
Loading…
Reference in New Issue
Block a user