Code style and logging unification

This commit is contained in:
Guille Gutierrez 2023-05-17 17:10:30 -04:00
parent baa82c8ec8
commit 84ae32bcdb
118 changed files with 418 additions and 324816 deletions

View File

@ -112,16 +112,19 @@ class NrelCatalog(Catalog):
function = archetype['@building_type']
name = f"{function} {archetype['@climate_zone']} {archetype['@reference_standard']}"
climate_zone = archetype['@climate_zone']
construction_period = \
ConstructionHelper().reference_standard_to_construction_period[archetype['@reference_standard']]
construction_period = ConstructionHelper().reference_standard_to_construction_period[
archetype['@reference_standard']
]
average_storey_height = float(archetype['average_storey_height']['#text'])
thermal_capacity = float(archetype['thermal_capacity']['#text']) * 1000
extra_loses_due_to_thermal_bridges = float(archetype['extra_loses_due_to_thermal_bridges']['#text'])
indirect_heated_ratio = float(archetype['indirect_heated_ratio']['#text'])
infiltration_rate_for_ventilation_system_off = \
float(archetype['infiltration_rate_for_ventilation_system_off']['#text'])
infiltration_rate_for_ventilation_system_on = \
float(archetype['infiltration_rate_for_ventilation_system_on']['#text'])
infiltration_rate_for_ventilation_system_off = float(
archetype['infiltration_rate_for_ventilation_system_off']['#text']
)
infiltration_rate_for_ventilation_system_on = float(
archetype['infiltration_rate_for_ventilation_system_on']['#text']
)
archetype_constructions = []
for archetype_construction in archetype['constructions']['construction']:

View File

@ -4,11 +4,11 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import logging
from pathlib import Path
from typing import TypeVar
from hub.catalog_factories.construction.nrel_catalog import NrelCatalog
from hub.hub_logger import logger
from hub.helpers.utils import validate_import_export_type
from hub.catalog_factories.construction.nrcan_catalog import NrcanCatalog
Catalog = TypeVar('Catalog')
@ -22,7 +22,7 @@ class ConstructionCatalogFactory:
class_funcs = validate_import_export_type(ConstructionCatalogFactory)
if self._catalog_type not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
logging.error(err_msg)
raise Exception(err_msg)
self._path = base_path

View File

@ -15,7 +15,6 @@ from hub.catalog_factories.data_models.cost.item_description import ItemDescript
from hub.catalog_factories.data_models.cost.operational_cost import OperationalCost
from hub.catalog_factories.data_models.cost.fuel import Fuel
from hub.catalog_factories.data_models.cost.income import Income
from hub.catalog_factories.data_models.cost.cost_helper import CostHelper
class MontrealCustomCatalog(Catalog):
@ -53,7 +52,6 @@ class MontrealCustomCatalog(Catalog):
def _get_capital_costs(self, entry):
general_chapters = []
chapters_titles = CostHelper().chapters_in_lod1
shell = entry['B_shell']
items_list = []
item_type = 'B10_superstructure'
@ -125,9 +123,9 @@ class MontrealCustomCatalog(Catalog):
for archetype in archetypes:
function = archetype['@function']
municipality = archetype['@municipality']
country = 'CA'#archetype['@country']
lod = 0 #float(archetype['@lod'])
currency = 'CAD'#archetype['currency']
country = archetype['@country']
lod = float(archetype['@lod'])
currency = archetype['currency']
capital_cost = self._get_capital_costs(archetype['capital_cost'])
operational_cost = self._get_operational_costs(archetype['operational_cost'])
end_of_life_cost = float(archetype['end_of_life_cost']['#text'])

View File

@ -64,4 +64,3 @@ class Construction:
:return: Window
"""
return self._window

View File

@ -1,48 +0,0 @@
"""
Cost helper
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import hub.helpers.constants as cte
from typing import Dict
class CostHelper:
"""
Cost helper class
"""
_costs_units = {
'currency/m2': cte.CURRENCY_PER_SQM,
'currency/m3': cte.CURRENCY_PER_CBM,
'currency/kW': cte.CURRENCY_PER_KW,
'currency/kWh': cte.CURRENCY_PER_KWH,
'currency/month': cte.CURRENCY_PER_MONTH,
'currency/l': cte.CURRENCY_PER_LITRE,
'currency/kg': cte.CURRENCY_PER_KG,
'currency/(m3/h)': cte.CURRENCY_PER_CBM_PER_HOUR,
'%': cte.PERCENTAGE
}
_chapters_in_lod1 = {
'B_shell': cte.SUPERSTRUCTURE,
'D_services': cte.ENVELOPE,
'Z_allowances_overhead_profit': cte.ALLOWANCES_OVERHEAD_PROFIT
}
@property
def costs_units(self) -> Dict:
"""
List of supported costs units
:return: dict
"""
return self._costs_units
@property
def chapters_in_lod1(self) -> Dict:
"""
List of chapters included in lod 1
:return: dict
"""
return self._chapters_in_lod1

View File

@ -32,4 +32,3 @@ class Content:
All soils in the catalog
"""
return self._soils

View File

@ -5,10 +5,10 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from hub.catalog_factories.data_models.greenery.plant import Plant as libs_plant
from hub.catalog_factories.data_models.greenery.plant import Plant as hub_plant
class PlantPercentage(libs_plant):
class PlantPercentage(hub_plant):
def __init__(self, percentage, plant_category, plant):
super().__init__(plant_category, plant)

View File

@ -2,7 +2,7 @@
Usage catalog domestic hot water
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import Union, List

View File

@ -2,7 +2,7 @@
Usage catalog occupancy
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez Morote Guillermo.GutierrezMorote@concordia.ca
Project Coder Guille Gutierrez Guillermo.GutierrezMorote@concordia.ca
"""
from typing import Union, List

View File

@ -73,4 +73,3 @@ class Schedule:
:return: None or [str]
"""
return self._day_types

View File

@ -18,8 +18,7 @@ class ThermalControl:
hvac_availability_schedules,
heating_set_point_schedules,
cooling_set_point_schedules):
#todo: eliminate negative value
deltaTsetpoint=0
self._mean_heating_set_point = mean_heating_set_point
self._heating_set_back = heating_set_back
self._mean_cooling_set_point = mean_cooling_set_point

View File

@ -29,7 +29,6 @@ class Usage:
self._days_year = days_year
self._mechanical_air_change = mechanical_air_change
self._ventilation_rate = ventilation_rate
# classes
self._occupancy = occupancy
self._lighting = lighting
self._appliances = appliances

View File

@ -4,11 +4,11 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Álvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import logging
from pathlib import Path
from typing import TypeVar
from hub.catalog_factories.energy_systems.montreal_custom_catalog import MontrealCustomCatalog
from hub.hub_logger import logger
from hub.helpers.utils import validate_import_export_type
Catalog = TypeVar('Catalog')
@ -20,9 +20,9 @@ class EnergySystemsCatalogFactory:
self._catalog_type = '_' + file_type.lower()
class_funcs = validate_import_export_type(EnergySystemsCatalogFactory)
if self._catalog_type not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f'Wrong import type. Valid functions include {class_funcs}'
logging.error(error_message)
raise Exception(error_message)
self._path = base_path
@property

View File

@ -45,7 +45,7 @@ class GreeneryCatalog(Catalog):
if plant.name == plant_percentage.plant.name:
plant_category = plant.category
break
plant_percentages.append(libs_pp(plant_percentage.percentage,plant_category, plant_percentage.plant))
plant_percentages.append(libs_pp(plant_percentage.percentage, plant_category, plant_percentage.plant))
vegetations.append(libs_vegetation(name, vegetation, plant_percentages))
plants = []
for plant_category in catalog_data.plantCategories:

View File

@ -4,11 +4,11 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import logging
from pathlib import Path
from typing import TypeVar
from hub.catalog_factories.greenery.greenery_catalog import GreeneryCatalog
from hub.hub_logger import logger
from hub.helpers.utils import validate_import_export_type
Catalog = TypeVar('Catalog')
@ -23,9 +23,9 @@ class GreeneryCatalogFactory:
self._catalog_type = '_' + file_type.lower()
class_funcs = validate_import_export_type(GreeneryCatalogFactory)
if self._catalog_type not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f'Wrong import type. Valid functions include {class_funcs}'
logging.error(error_message)
raise Exception(error_message)
self._path = base_path
@property

View File

@ -129,8 +129,11 @@ class ComnetCatalog(Catalog):
for usage_name in comnet_usages:
if usage_name == 'C-13 Data Center':
continue
_extracted_data = pd.read_excel(self._comnet_schedules_path, sheet_name=comnet_usages[usage_name],
skiprows=[0, 1, 2, 3], nrows=39, usecols="A:AA")
_extracted_data = pd.read_excel(
self._comnet_schedules_path,
sheet_name=comnet_usages[usage_name],
skiprows=[0, 1, 2, 3], nrows=39, usecols="A:AA"
)
_schedules = {}
for row in range(0, 39, 3):
_schedule_values = {}
@ -167,8 +170,11 @@ class ComnetCatalog(Catalog):
"""
number_usage_types = 33
xl_file = pd.ExcelFile(self._comnet_archetypes_path)
file_data = pd.read_excel(xl_file, sheet_name="Modeling Data", skiprows=[0, 1, 2, 24],
nrows=number_usage_types, usecols="A:AB")
file_data = pd.read_excel(
xl_file, sheet_name="Modeling Data",
skiprows=[0, 1, 2, 24],
nrows=number_usage_types, usecols="A:AB"
)
lighting_data = {}
plug_loads_data = {}

View File

@ -94,8 +94,7 @@ class NrcanCatalog(Catalog):
# W/m2
appliances_density = space_type['electric_equipment_per_area_w_per_m2']
# peak flow in gallons/h/m2
domestic_hot_water_peak_flow = space_type['service_water_heating_peak_flow_per_area'] \
* cte.GALLONS_TO_QUBIC_METERS / cte.HOUR_TO_SECONDS
domestic_hot_water_peak_flow = space_type['service_water_heating_peak_flow_per_area'] * cte.GALLONS_TO_QUBIC_METERS / cte.HOUR_TO_SECONDS
space_types_dictionary[usage_type] = {'occupancy_per_area': occupancy_density,
'lighting_per_area': lighting_density,
'electric_equipment_per_area': appliances_density,
@ -132,8 +131,9 @@ class NrcanCatalog(Catalog):
# cfm/ft2 to m3/m2.s
ventilation_rate = space_type['ventilation_per_area'] / (cte.METERS_TO_FEET * cte.MINUTES_TO_SECONDS)
# cfm/person to m3/m2.s
ventilation_rate += space_type['ventilation_per_person'] / (pow(cte.METERS_TO_FEET, 3) * cte.MINUTES_TO_SECONDS)\
* occupancy_density
ventilation_rate += space_type['ventilation_per_person'] / (
pow(cte.METERS_TO_FEET, 3) * cte.MINUTES_TO_SECONDS
) * occupancy_density
lighting_radiative_fraction = space_type['lighting_fraction_radiant']
lighting_convective_fraction = 0

View File

@ -17,8 +17,8 @@ class UsageHelper:
'Lighting': cte.LIGHTING,
'Occupancy': cte.OCCUPANCY,
'Equipment': cte.APPLIANCES,
'Thermostat Setpoint Cooling': cte.COOLING_SET_POINT, # Compose 'Thermostat Setpoint' + 'Cooling'
'Thermostat Setpoint Heating': cte.HEATING_SET_POINT, # Compose 'Thermostat Setpoint' + 'Heating'
'Thermostat Setpoint Cooling': cte.COOLING_SET_POINT,
'Thermostat Setpoint Heating': cte.HEATING_SET_POINT,
'Fan': cte.HVAC_AVAILABILITY,
'Service Water Heating': cte.DOMESTIC_HOT_WATER
}

View File

@ -4,12 +4,12 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import logging
from pathlib import Path
from typing import TypeVar
from hub.catalog_factories.usage.comnet_catalog import ComnetCatalog
from hub.catalog_factories.usage.nrcan_catalog import NrcanCatalog
from hub.hub_logger import logger
from hub.helpers.utils import validate_import_export_type
Catalog = TypeVar('Catalog')
@ -21,9 +21,9 @@ class UsageCatalogFactory:
self._catalog_type = '_' + file_type.lower()
class_funcs = validate_import_export_type(UsageCatalogFactory)
if self._catalog_type not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong import type. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
self._path = base_path
@property

View File

@ -6,10 +6,10 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from __future__ import annotations
import logging
import math
import sys
from typing import List
from hub.hub_logger import logger
import numpy as np
from trimesh import Trimesh
import trimesh.intersections
@ -264,12 +264,10 @@ class Polygon:
new_face.append(face[len(face)-i-1])
new_faces.append(new_face)
mesh = Trimesh(vertices=vertices, faces=new_faces)
return mesh
except ValueError:
logger.error(f'Not able to triangulate polygon\n')
sys.stderr.write(f'Not able to triangulate polygon\n')
logging.error(f'Not able to triangulate polygon\n')
_vertices = [[0, 0, 0], [0, 0, 1], [0, 1, 0]]
_faces = [[0, 1, 2]]
return Trimesh(vertices=_vertices, faces=_faces)

View File

@ -6,20 +6,20 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import sys
import logging
from typing import List, Union
import numpy as np
import pandas as pd
from hub.hub_logger import logger
import hub.helpers.constants as cte
from hub.helpers.peak_loads import PeakLoads
from hub.city_model_structure.building_demand.surface import Surface
from hub.city_model_structure.city_object import CityObject
from hub.city_model_structure.attributes.polyhedron import Polyhedron
from hub.city_model_structure.building_demand.household import Household
from hub.city_model_structure.building_demand.internal_zone import InternalZone
from hub.city_model_structure.attributes.polyhedron import Polyhedron
from hub.city_model_structure.building_demand.surface import Surface
from hub.city_model_structure.city_object import CityObject
from hub.city_model_structure.energy_systems.energy_system import EnergySystem
from hub.helpers.peak_loads import PeakLoads
class Building(CityObject):
@ -82,8 +82,7 @@ class Building(CityObject):
elif surface.type == cte.INTERIOR_SLAB:
self._interior_slabs.append(surface)
else:
logger.error(f'Building {self.name} [alias {self.alias}] has an unexpected surface type {surface.type}.\n')
sys.stderr.write(f'Building {self.name} [alias {self.alias}] has an unexpected surface type {surface.type}.\n')
logging.error(f'Building {self.name} [alias {self.alias}] has an unexpected surface type {surface.type}.\n')
@property
def shell(self) -> Polyhedron:
@ -373,7 +372,7 @@ class Building(CityObject):
results = {}
if cte.HOUR in self.heating:
monthly_values = PeakLoads().\
peak_loads_from_hourly(self.heating[cte.HOUR][next(iter(self.heating[cte.HOUR]))].values)
peak_loads_from_hourly(self.heating[cte.HOUR][next(iter(self.heating[cte.HOUR]))])
else:
monthly_values = PeakLoads(self).heating_peak_loads_from_methodology
if monthly_values is None:
@ -389,9 +388,7 @@ class Building(CityObject):
:return: dict{DataFrame(float)}
"""
results = {}
monthly_values = None
if cte.HOUR in self.cooling:
# todo: .values???????? Like heating
monthly_values = PeakLoads().peak_loads_from_hourly(self.cooling[cte.HOUR][next(iter(self.cooling[cte.HOUR]))])
else:
monthly_values = PeakLoads(self).cooling_peak_loads_from_methodology

View File

@ -355,7 +355,7 @@ class Surface:
@property
def solar_collectors_area_reduction_factor(self):
"""
Get factor area collector per surface area if set or calculate using Romero Rodríguez, L. et al (2017) model if not
Get factor area collector per surface area if set or calculate using Romero Rodriguez, L. et al (2017) model if not
:return: float
"""
if self._solar_collectors_area_reduction_factor is None:
@ -373,8 +373,9 @@ class Surface:
_construction_restriction = 0.9
_separation_of_panels = 0.9
_shadow_between_panels = 1
_solar_collectors_area_reduction_factor = _protected_building_restriction * _construction_restriction \
* _separation_of_panels * _shadow_between_panels
_solar_collectors_area_reduction_factor = (
_protected_building_restriction * _construction_restriction * _separation_of_panels * _shadow_between_panels
)
return self._solar_collectors_area_reduction_factor
@solar_collectors_area_reduction_factor.setter

View File

@ -363,12 +363,15 @@ class ThermalZone:
return None
_lighting_density += usage.percentage * usage.lighting.density
if usage.lighting.convective_fraction is not None:
_convective_part += usage.percentage * usage.lighting.density \
* usage.lighting.convective_fraction
_radiative_part += usage.percentage * usage.lighting.density \
* usage.lighting.radiative_fraction
_latent_part += usage.percentage * usage.lighting.density \
* usage.lighting.latent_fraction
_convective_part += (
usage.percentage * usage.lighting.density * usage.lighting.convective_fraction
)
_radiative_part += (
usage.percentage * usage.lighting.density * usage.lighting.radiative_fraction
)
_latent_part += (
usage.percentage * usage.lighting.density * usage.lighting.latent_fraction
)
self._lighting.density = _lighting_density
if _lighting_density > 0:
self._lighting.convective_fraction = _convective_part / _lighting_density
@ -421,12 +424,15 @@ class ThermalZone:
return None
_appliances_density += usage.percentage * usage.appliances.density
if usage.appliances.convective_fraction is not None:
_convective_part += usage.percentage * usage.appliances.density \
* usage.appliances.convective_fraction
_radiative_part += usage.percentage * usage.appliances.density \
* usage.appliances.radiative_fraction
_latent_part += usage.percentage * usage.appliances.density \
* usage.appliances.latent_fraction
_convective_part += (
usage.percentage * usage.appliances.density * usage.appliances.convective_fraction
)
_radiative_part += (
usage.percentage * usage.appliances.density * usage.appliances.radiative_fraction
)
_latent_part += (
usage.percentage * usage.appliances.density * usage.appliances.latent_fraction
)
self._appliances.density = _appliances_density
if _appliances_density > 0:
self._appliances.convective_fraction = _convective_part / _appliances_density
@ -486,12 +492,15 @@ class ThermalZone:
for usage in self.usages:
for internal_gain in usage.internal_gains:
_average_internal_gain += internal_gain.average_internal_gain * usage.percentage
_convective_fraction += internal_gain.average_internal_gain * usage.percentage \
* internal_gain.convective_fraction
_radiative_fraction += internal_gain.average_internal_gain * usage.percentage \
* internal_gain.radiative_fraction
_latent_fraction += internal_gain.average_internal_gain * usage.percentage \
* internal_gain.latent_fraction
_convective_fraction += (
internal_gain.average_internal_gain * usage.percentage * internal_gain.convective_fraction
)
_radiative_fraction += (
internal_gain.average_internal_gain * usage.percentage * internal_gain.radiative_fraction
)
_latent_fraction += (
internal_gain.average_internal_gain * usage.percentage * internal_gain.latent_fraction
)
for usage in self.usages:
for internal_gain in usage.internal_gains:
if internal_gain.schedules is None:

View File

@ -21,15 +21,13 @@ from hub.city_model_structure.building import Building
from hub.city_model_structure.city_object import CityObject
from hub.city_model_structure.city_objects_cluster import CityObjectsCluster
from hub.city_model_structure.buildings_cluster import BuildingsCluster
from hub.city_model_structure.fuel import Fuel
from hub.city_model_structure.iot.station import Station
from hub.city_model_structure.level_of_detail import LevelOfDetail
from hub.city_model_structure.machine import Machine
from hub.city_model_structure.parts_consisting_building import PartsConsistingBuilding
from hub.helpers.geometry_helper import GeometryHelper
from hub.helpers.location import Location
from hub.city_model_structure.energy_system import EnergySystem
from hub.city_model_structure.lca_material import LcaMaterial
import pandas as pd
@ -65,22 +63,6 @@ class City:
self._energy_systems_connection_table = None
self._generic_energy_systems = None
@property
def fuels(self) -> [Fuel]:
return self._fuels
@fuels.setter
def fuels(self, value):
self._fuels = value
@property
def machines(self) -> [Machine]:
return self._machines
@machines.setter
def machines(self, value):
self._machines = value
def _get_location(self) -> Location:
if self._location is None:
gps = pyproj.CRS('EPSG:4326') # LatLon with WGS84 datum used by GPS units and Google Earth
@ -423,31 +405,6 @@ class City:
else:
raise NotImplementedError
@property
def lca_materials(self) -> Union[List[LcaMaterial], None]:
"""
Get life cycle materials for the city
:return: [LcaMaterial] or
"""
return self._lca_materials
@lca_materials.setter
def lca_materials(self, value):
"""
Set life cycle materials for the city
"""
self._lca_materials = value
def lca_material(self, lca_id) -> Union[LcaMaterial, None]:
"""
Get the lca material matching the given Id
:return: LcaMaterial or None
"""
for lca_material in self.lca_materials:
if str(lca_material.id) == str(lca_id):
return lca_material
return None
@property
def copy(self) -> City:
"""

View File

@ -5,12 +5,11 @@ Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from typing import Union, List
from typing import Union
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
from hub.city_model_structure.energy_systems.generic_emission_system import GenericEmissionSystem
from hub.city_model_structure.city_object import CityObject
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
class GenericEnergySystem:

View File

@ -1,45 +0,0 @@
"""
ConstructionFactory (before PhysicsFactory) retrieve the specific construction module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
class Fuel:
def __init__(self, fuel_id, name, carbon_emission_factor, unit):
self._fuel_id = fuel_id
self._name = name
self._carbon_emission_factor = carbon_emission_factor
self._unit = unit
@property
def id(self) -> int:
"""
Get fuel id
:return: int
"""
return self._fuel_id
@property
def name(self) -> str:
"""
Get fuel name
:return: str
"""
return self._name
@property
def carbon_emission_factor(self) -> float:
"""
Get fuel carbon emission factor
:return: float
"""
return self._carbon_emission_factor
@property
def unit(self) -> str:
"""
Get fuel units
:return: str
"""
return self._unit

View File

@ -19,7 +19,7 @@ class Station:
def id(self):
"""
Get the station id a random uuid will be assigned if no ID was provided to the constructor
:return: Id
:return: ID
"""
if self._id is None:
self._id = uuid.uuid4()

View File

@ -1,242 +0,0 @@
"""
LCA Material module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder atiya.atiya@mail.concordia.ca
"""
from typing import Union
class LcaMaterial:
def __init__(self):
self._id = None
self._type = None
self._name = None
self._density = None
self._density_unit = None
self._embodied_carbon = None
self._embodied_carbon_unit = None
self._recycling_ratio = None
self._company_recycling_ratio = None
self._onsite_recycling_ratio = None
self._landfilling_ratio = None
self._cost = None
self._cost_unit = None
@property
def id(self):
"""
Get material id
:return: int
"""
return self._id
@id.setter
def id(self, value):
"""
Set material id
:param value: int
"""
self._id = int(value)
@property
def type(self):
"""
Get material type
:return: str
"""
return self._type
@type.setter
def type(self, value):
"""
Set material type
:param value: string
"""
self._type = str(value)
@property
def name(self):
"""
Get material name
:return: str
"""
return self._name
@name.setter
def name(self, value):
"""
Set material name
:param value: string
"""
self._name = str(value)
@property
def density(self) -> Union[None, float]:
"""
Get material density in kg/m3
:return: None or float
"""
return self._density
@density.setter
def density(self, value):
"""
Set material density
:param value: float
"""
if value is not None:
self._density = float(value)
@property
def density_unit(self) -> Union[None, str]:
"""
Get material density unit
:return: None or string
"""
return self._density_unit
@density_unit.setter
def density_unit(self, value):
"""
Set material density unit
:param value: string
"""
if value is not None:
self._density_unit = str(value)
@property
def embodied_carbon(self) -> Union[None, float]:
"""
Get material embodied carbon
:return: None or float
"""
return self._embodied_carbon
@embodied_carbon.setter
def embodied_carbon(self, value):
"""
Set material embodied carbon
:param value: float
"""
if value is not None:
self._embodied_carbon = float(value)
@property
def embodied_carbon_unit(self) -> Union[None, str]:
"""
Get material embodied carbon unit
:return: None or string
"""
return self._embodied_carbon
@embodied_carbon_unit.setter
def embodied_carbon_unit(self, value):
"""
Set material embodied carbon unit
:param value: string
"""
if value is not None:
self._embodied_carbon_unit = str(value)
@property
def recycling_ratio(self) -> Union[None, float]:
"""
Get material recycling ratio
:return: None or float
"""
return self._recycling_ratio
@recycling_ratio.setter
def recycling_ratio(self, value):
"""
Set material recycling ratio
:param value: float
"""
if value is not None:
self._recycling_ratio = float(value)
@property
def onsite_recycling_ratio(self) -> Union[None, float]:
"""
Get material onsite recycling ratio
:return: None or float
"""
return self._onsite_recycling_ratio
@onsite_recycling_ratio.setter
def onsite_recycling_ratio(self, value):
"""
Set material onsite recycling ratio
:param value: float
"""
if value is not None:
self._onsite_recycling_ratio = float(value)
@property
def company_recycling_ratio(self) -> Union[None, float]:
"""
Get material company recycling ratio
:return: None or float
"""
return self._company_recycling_ratio
@company_recycling_ratio.setter
def company_recycling_ratio(self, value):
"""
Set material company recycling ratio
:param value: float
"""
if value is not None:
self._company_recycling_ratio = float(value)
@property
def landfilling_ratio(self) -> Union[None, float]:
"""
Get material landfilling ratio
:return: None or float
"""
return self._landfilling_ratio
@landfilling_ratio.setter
def landfilling_ratio(self, value):
"""
Set material landfilling ratio
:param value: float
"""
if value is not None:
self._landfilling_ratio = float(value)
@property
def cost(self) -> Union[None, float]:
"""
Get material cost
:return: None or float
"""
return self._cost
@cost.setter
def cost(self, value):
"""
Set material cost
:param value: float
"""
if value is not None:
self._cost = float(value)
@property
def cost_unit(self) -> Union[None, str]:
"""
Get material cost unit
:return: None or string
"""
return self._cost_unit
@cost_unit.setter
def cost_unit(self, value):
"""
Set material cost unit
:param value: string
"""
if value is not None:
self._cost_unit = float(value)

View File

@ -1,87 +0,0 @@
"""
LifeCycleAssessment retrieve the specific Life Cycle Assessment module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
class Machine:
"""
Machine class
"""
def __init__(self, machine_id, name, work_efficiency, work_efficiency_unit, energy_consumption_rate,
energy_consumption_unit, carbon_emission_factor, carbon_emission_unit):
self._machine_id = machine_id
self._name = name
self._work_efficiency = work_efficiency
self._work_efficiency_unit = work_efficiency_unit
self._energy_consumption_rate = energy_consumption_rate
self._energy_consumption_unit = energy_consumption_unit
self._carbon_emission_factor = carbon_emission_factor
self._carbon_emission_unit = carbon_emission_unit
@property
def id(self) -> int:
"""
Get machine id
:return: int
"""
return self._machine_id
@property
def name(self) -> str:
"""
Get machine name
:return: str
"""
return self._name
@property
def work_efficiency(self) -> float:
"""
Get machine work efficiency
:return: float
"""
return self._work_efficiency
@property
def work_efficiency_unit(self) -> str:
"""
Get machine work efficiency unit
:return: str
"""
return self._work_efficiency_unit
@property
def energy_consumption_rate(self) -> float:
"""
Get energy consumption rate
:return: float
"""
return self._energy_consumption_rate
@property
def energy_consumption_unit(self) -> str:
"""
Get energy consumption unit
:return: str
"""
return self._energy_consumption_unit
@property
def carbon_emission_factor(self) -> float:
"""
Get carbon emission factor
:return: float
"""
return self._carbon_emission_factor
@property
def carbon_emission_unit(self) -> str:
"""
Get carbon emission unit
:return: str
"""
return self._carbon_emission_unit

View File

@ -1,68 +0,0 @@
"""
LifeCycleAssessment retrieve the specific Life Cycle Assessment module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
class Vehicle:
"""
Vehicle class
"""
def __init__(self, vehicle_id, name, fuel_consumption_rate, fuel_consumption_unit, carbon_emission_factor,
carbon_emission_factor_unit):
self._vehicle_id = vehicle_id
self._name = name
self._fuel_consumption_rate = fuel_consumption_rate
self._fuel_consumption_unit = fuel_consumption_unit
self._carbon_emission_factor = carbon_emission_factor
self._carbon_emission_factor_unit = carbon_emission_factor_unit
@property
def id(self) -> int:
"""
Get vehicle id
:return: int
"""
return self._vehicle_id
@property
def name(self) -> str:
"""
Get vehicle name
:return: str
"""
return self._name
@property
def fuel_consumption_rate(self) -> float:
"""
Get vehicle fuel consumption rate
:return: float
"""
return self._fuel_consumption_rate
@property
def fuel_consumption_unit(self) -> str:
"""
Get fuel consumption unit
:return: str
"""
return self._fuel_consumption_unit
@property
def carbon_emission_factor(self) -> float:
"""
Get vehicle carbon emission factor
:return: float
"""
return self._carbon_emission_factor
@property
def carbon_emission_factor_unit(self) -> str:
"""
Get carbon emission units
:return: str
"""
return self._carbon_emission_factor_unit

View File

@ -1,166 +0,0 @@
<archetypes>
<archetype function="residential" municipality="montreal" currency="CAD">
<capital_cost>
<ASubstructure>
<A10sub_structural cost_unit="currency/m2"> 15.89 </A10sub_structural>
<A20structural cost_unit="currency/m3"> 215.90 </A20structural>
</ASubstructure>
<BShell>
<B10superstructure>
<reposition cost_unit="currency/m2"> 0 </reposition>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</B10superstructure>
<B20envelope>
<B2010opaquewalls>
<reposition cost_unit="currency/m2"> 304 </reposition>
<initial_investment cost_unit="currency/m2"> 304 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</B2010opaquewalls>
<B2020transparent>
<reposition cost_unit="currency/m2"> 857.14 </reposition>
<initial_investment cost_unit="currency/m2"> 857.14 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</B2020transparent>
</B20envelope>
<B30roofing>
<B3010opaqueroof>
<reposition cost_unit="currency/m2"> 118 </reposition>
<initial_investment cost_unit="currency/m2"> 118 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</B3010opaqueroof>
<B3020transparentroof>
<reposition cost_unit="currency/m2"> 857.14 </reposition>
<initial_investment cost_unit="currency/m2"> 857.14 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</B3020transparentroof>
</B30roofing>
</BShell>
<CInteriors>
<C10Interiorconstruction>
<reposition cost_unit="currency/m2"> 0 </reposition>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</C10Interiorconstruction>
<C20Stairs>
<reposition cost_unit="currency/m2"> 0 </reposition>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</C20Stairs>
<C30Interiorfinishes>
<C3010Walls>
<reposition cost_unit="currency/m2"> 50 </reposition>
<initial_investment cost_unit="currency/m2"> 50 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</C3010Walls>
<C3020Floors>
<reposition cost_unit="currency/m2"> 62 </reposition>
<initial_investment cost_unit="currency/m2"> 62 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</C3020Floors>
<C3030Ceilings>
<reposition cost_unit="currency/m2"> 70 </reposition>
<initial_investment cost_unit="currency/m2"> 70 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</C3030Ceilings>
</C30Interiorfinishes>
</CInteriors>
<DServices>
<D10Conveying cost_unit="currency/m2"> 0 </D10Conveying>
<D20Plumbing cost_unit="currency/m2"> 100 </D20Plumbing>
<D30HVAC>
<D3010EnergySupply>
<D301010photovoltaic_system>
<initial_investment cost_unit="currency/m2"> 800 </initial_investment>
<reposition cost_unit="currency/m2"> 800 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D301010photovoltaic_system>
</D3010EnergySupply>
<D3020Heatgeneratingsystems>
<initial_investment cost_unit="currency/kW"> 622.86 </initial_investment>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D3020Heatgeneratingsystems>
<D3030Coolinggenerationsystems>
<initial_investment cost_unit="currency/kW"> 622.86 </initial_investment>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3030Coolinggenerationsystems>
<D3040Distributionsystems>
<initial_investment cost_unit="currency/kW"> 0 </initial_investment>
<reposition cost_unit="currency/kW"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3040Distributionsystems>
<D3060Controlsandinstrumentation>
<initial_investment cost_unit="currency/kW"> 0 </initial_investment>
<reposition cost_unit="currency/kW"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3060Controlsandinstrumentation>
<D3080OtherHVAC_AHU>
<initial_investment cost_unit="currency/kW"> 47.62 </initial_investment>
<reposition cost_unit="currency/kW"> 47.62 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3080OtherHVAC_AHU>
</D30HVAC>
<D50Electrical>
<D5010Electricalservicesanddistribution>
<initial_investment cost_unit="currency/m2"> 171.43 </initial_investment>
<reposition cost_unit="currency/m2"> 171.43 </reposition>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</D5010Electricalservicesanddistribution>
<D5020Lightingandbranchwiring>
<initial_investment cost_unit="currency/kW"> 139 </initial_investment>
<reposition cost_unit="currency/kW"> 139 </reposition>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</D5020Lightingandbranchwiring>
</D50Electrical>
</DServices>
<EEquimentsandfurnishing>
<E10Equipments>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<reposition cost_unit="currency/m2"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</E10Equipments>
<E10Furnishing>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<reposition cost_unit="currency/m2"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</E10Furnishing>
</EEquimentsandfurnishing>
<engineer cost_unit="%"> 2.5 </engineer>
</capital_cost>
<operational_cost>
<fuel fuel_type="electricity">
<fixed>
<fixed_monthly cost_unit="currency/month"> 0 </fixed_monthly>
<fixed_power cost_unit="currency/kW"> 0 </fixed_power>
</fixed>
<variable cost_unit="currency/kWh"> 5.6 </variable>
</fuel>
<maintenance>
<heating_equipment cost_unit="currency/kW"> 40 </heating_equipment>
<cooling_equipment cost_unit="currency/kW"> 40 </cooling_equipment>
<general_hvac_equipment cost_unit="currency/(m3/h)"> 0.05 </general_hvac_equipment>
<photovoltaic_system cost_unit="currency/m2"> 1 </photovoltaic_system>
<other_systems cost_unit="currency/m2"> 4.6 </other_systems>
</maintenance>
<CO2_cost cost_unit="currency/kgCO2"> 30 </CO2_cost>
</operational_cost>
<end_of_life_cost cost_unit="currency/m2"> 6.3 </end_of_life_cost>
<incomes>
<subsidies>
<construction_subsidy cost_unit="%"> 2 </construction_subsidy>
<hvac_subsidy cost_unit="%"> 1.5 </hvac_subsidy>
<photovoltaic_subsidy cost_unit="%"> 3.6 </photovoltaic_subsidy>
</subsidies>
<energy_exports>
<electricity cost_unit="currency/kWh"> hourlydatatable </electricity>
<heat cost_unit="currency/kWh"> 0 </heat>
</energy_exports>
<tax_reductions>
<reductions_taxes cost_unit="%"> 2 </reductions_taxes>
</tax_reductions>
<CO2_income cost_unit="currency/kgCO2exported"> 0 </CO2_income>
</incomes>
</archetype>
</archetypes>

View File

@ -1,212 +0,0 @@
<archetypes>
<archetype function="residential" municipality="montreal" currency="CAD">
<capital_cost>
<B_Shell>
<B10_superstructure>
<refurbishment_cost_basement cost_unit="currency/m2"> 0 </refurbishment_cost_basement>
</B10_superstructure>
<B20_envelope>
<B2010_opaquewalls>
<refurbishment_cost cost_unit="currency/m2"> 304 </refurbishment_cost>
</B2010_opaquewalls>
<B2020_transparent>
<refurbishment_cost cost_unit="currency/m2"> 857.14 </refurbishment_cost>
</B2020_transparent>
</B20_envelope>
<B30_roofing>
<B3010_opaqueroof>
<refurbishment_cost cost_unit="currency/m2"> 118 </refurbishment_cost>
</B3010_opaqueroof>
</B30_roofing>
</B_Shell>
<D_Services>
<D30_HVAC>
<D3010_EnergySupply>
<D301010_Photovoltaic_system>
<initial_investment cost_unit="currency/m2"> 800 </initial_investment>
<reposition cost_unit="currency/m2"> 800 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D301010_Photovoltaic_system>
</D3010_EnergySupply>
<D3020_Heat_generating_systems>
<investment_cost cost_unit="currency/kW"> 622.86 </investment_cost>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D3020_Heat_generating_systems>
<D3030_Cooling_generation_systems>
<investment_cost cost_unit="currency/kW"> 622.86 </investment_cost>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3030_Cooling_generation_systems>
<D3040_Distributionsystems>
<investment_cost cost_unit="currency/kW"> 0 </investment_cost>
<reposition cost_unit="currency/kW"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3040_Distributionsystems>
<D3080_OtherHVAC_AHU>
<investment_cost cost_unit="currency/kW"> 47.62 </investment_cost>
<reposition cost_unit="currency/kW"> 47.62 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3080_OtherHVAC_AHU>
</D30_HVAC>
<D50_Electrical>
<D5020Lightingandbranchwiring>
<refurbishmentcost cost_unit="currency/kW"> 139 </refurbishmentcost>
<reposition cost_unit="currency/kW"> 139 </reposition>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</D5020Lightingandbranchwiring>
</D50_Electrical>
</D_Services>
<Z_Allowances_overhead_profit>
<Z10_Design_allowance cost_unit="%"> 2.5 </Z10_Design_allowance>
<Z10_Overhead_and_profit cost_unit="%"> 14 </Z10_Overhead_and_profit>
</Z_Allowances_overhead_profit>
</capital_cost>
<operational_cost>
<fuel fuel_type="electricity">
<fixed>
<fixed_monthly cost_unit="currency/month"> 12.27 </fixed_monthly>
<fixed_power cost_unit="currency/month*kW"> 0 </fixed_power>
</fixed>
<variable cost_unit="currency/kWh"> 0.075 </variable>
</fuel>
<fuel fuel_type="gas">
<fixed>
<fixed_monthly cost_unit="currency/month"> 17.71 </fixed_monthly>
</fixed>
<variable cost_unit="currency/kWh"> 0.640 </variable>
</fuel>
<fuel fuel_type="diesel">
<variable cost_unit="currency/l"> 1.2 </variable>
</fuel>
<fuel fuel_type="biomass">
<variable cost_unit="currency/kg"> 0.09 </variable>
</fuel>
<maintenance>
<heating_equipment cost_unit="currency/kW"> 40 </heating_equipment>
<cooling_equipment cost_unit="currency/kW"> 40 </cooling_equipment>
<photovoltaic_system cost_unit="currency/m2"> 1 </photovoltaic_system>
</maintenance>
<CO2_cost cost_unit="currency/kgCO2"> 30 </CO2_cost>
</operational_cost>
<end_of_life_cost cost_unit="currency/m2"> 6.3 </end_of_life_cost>
<incomes>
<subsidies>
<construction_subsidy cost_unit="%"> 2 </construction_subsidy>
<hvac_subsidy cost_unit="%"> 1.5 </hvac_subsidy>
<photovoltaic_subsidy cost_unit="%"> 3.6 </photovoltaic_subsidy>
</subsidies>
<energy_exports>
<electricity cost_unit="currency/kWh"> 0 </electricity>
</energy_exports>
<tax_reductions>
<reductions_taxes cost_unit="%"> 2 </reductions_taxes>
</tax_reductions>
</incomes>
</archetype>
<archetype function="non-residential" municipality="montreal" currency="CAD">
<capital_cost>
<B_Shell>
<B10_superstructure>
<refurbishmentcostbasement cost_unit="currency/m2"> 0 </refurbishmentcostbasement>
</B10_superstructure>
<B20_envelope>
<B2010_opaque_walls>
<refurbishmentcost cost_unit="currency/m2"> 304 </refurbishmentcost>
</B2010_opaque_walls>
<B2020_transparent>
<refurbishmentcost cost_unit="currency/m2"> 857.14 </refurbishmentcost>
</B2020_transparent>
</B20_envelope>
<B30_roofing>
<B3010_opaqueroof>
<refurbishmentcost cost_unit="currency/m2"> 118 </refurbishmentcost>
</B3010_opaqueroof>
</B30_roofing>
</B_Shell>
<D_Services>
<D30_HVAC>
<D3010EnergySupply>
<D301010photovoltaic_system>
<initial_investment cost_unit="currency/m2"> 800 </initial_investment>
<reposition cost_unit="currency/m2"> 800 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D301010photovoltaic_system>
</D3010EnergySupply>
<D3020Heatgeneratingsystems>
<investment_cost cost_unit="currency/kW"> 622.86 </investment_cost>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D3020Heatgeneratingsystems>
<D3030_Cooling_generation_systems>
<investment_cost cost_unit="currency/kW"> 622.86 </investment_cost>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3030_Cooling_generation_systems>
<D3040_Distribution_systems>
<refurbishmentcost cost_unit="currency/m2"> 0 </refurbishmentcost>
<reposition cost_unit="currency/kW"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3040_Distribution_systems>
<D3080_Other_HVAC_AHU>
<investment_cost cost_unit="currency/kW"> 47.62 </investment_cost>
<reposition cost_unit="currency/kW"> 47.62 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3080_Other_HVAC_AHU>
</D30_HVAC>
<D50_Electrical>
<D5020_Lighting_and_branch_wiring>
<refurbishmentcost cost_unit="currency/kW"> 139 </refurbishmentcost>
<reposition cost_unit="currency/kW"> 139 </reposition>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</D5020_Lighting_and_branch_wiring>
</D50_Electrical>
</D_Services>
<Z_Allowances_overhead_profit>
<Z10_Design_allowance cost_unit="%"> 6 </Z10_Design_allowance>
<Z20_Overhead_profit cost_unit="%"> 14 </Z20_Overhead_profit>
</Z_Allowances_overhead_profit>
</capital_cost>
<operational_cost>
<fuel fuel_type="electricity">
<fixed>
<fixed_monthly cost_unit="currency/month"> 12.27 </fixed_monthly>
<fixed_power cost_unit="currency/(month*kW)"> 0 </fixed_power>
</fixed>
<variable cost_unit="currency/kWh"> 0.075 </variable>
</fuel>
<fuel fuel_type="gas">
<fixed>
<fixed_monthly cost_unit="currency/month"> 17.71 </fixed_monthly>
</fixed>
<variable cost_unit="currency/m3"> 0.640 </variable>
</fuel>
<fuel fuel_type="diesel">
<variable cost_unit="currency/l"> 1.2 </variable>
</fuel>
<fuel fuel_type="biomass">
<variable cost_unit="currency/kg"> 0.09 </variable>
</fuel>
<maintenance>
<heating_equipment cost_unit="currency/kW"> 40 </heating_equipment>
<cooling_equipment cost_unit="currency/kW"> 40 </cooling_equipment>
<photovoltaic_system cost_unit="currency/m2"> 1 </photovoltaic_system>
</maintenance>
<CO2_cost cost_unit="currency/kgCO2"> 30 </CO2_cost>
</operational_cost>
<end_of_life_cost cost_unit="currency/m2"> 6.3 </end_of_life_cost>
<incomes>
<subsidies>
<construction_subsidy cost_unit="%"> 2 </construction_subsidy>
<hvac_subsidy cost_unit="%"> 1.5 </hvac_subsidy>
<photovoltaic_subsidy cost_unit="%"> 3.6 </photovoltaic_subsidy>
</subsidies>
<energy_exports>
<electricity cost_unit="currency/kWh"> 0 </electricity>
</energy_exports>
<tax_reductions>
<reductions_taxes cost_unit="%"> 2 </reductions_taxes>
</tax_reductions>
</incomes>
</archetype>
</archetypes>

View File

@ -1,178 +0,0 @@
<archetypes>
<archetype function="residential" municipality="montreal" currency="CAD">
<capital_cost>
<ASubstructure>
<A10sub_structural cost_unit="currency/m2"> 15.89 </A10sub_structural>
<A20structural cost_unit="currency/m3"> 215.90 </A20structural>
</ASubstructure>
<BShell>
<B10superstructure>
<reposition cost_unit="currency/m2"> 0 </reposition>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</B10superstructure>
<B20envelope>
<B2010opaquewalls>
<reposition cost_unit="currency/m2"> 304 </reposition>
<initial_investment cost_unit="currency/m2"> 304 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</B2010opaquewalls>
<B2020transparent>
<reposition cost_unit="currency/m2"> 857.14 </reposition>
<initial_investment cost_unit="currency/m2"> 857.14 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</B2020transparent>
</B20envelope>
<B30roofing>
<B3010opaqueroof>
<reposition cost_unit="currency/m2"> 118 </reposition>
<initial_investment cost_unit="currency/m2"> 118 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</B3010opaqueroof>
<B3020transparentroof>
<reposition cost_unit="currency/m2"> 857.14 </reposition>
<initial_investment cost_unit="currency/m2"> 857.14 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</B3020transparentroof>
</B30roofing>
</BShell>
<CInteriors>
<C10Interiorconstruction>
<reposition cost_unit="currency/m2"> 0 </reposition>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</C10Interiorconstruction>
<C20Stairs>
<reposition cost_unit="currency/m2"> 0 </reposition>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<lifetime_equipment lifetime="years"> 50 </lifetime_equipment>
</C20Stairs>
<C30Interiorfinishes>
<C3010Walls>
<reposition cost_unit="currency/m2"> 50 </reposition>
<initial_investment cost_unit="currency/m2"> 50 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</C3010Walls>
<C3020Floors>
<reposition cost_unit="currency/m2"> 62 </reposition>
<initial_investment cost_unit="currency/m2"> 62 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</C3020Floors>
<C3030Ceilings>
<reposition cost_unit="currency/m2"> 70 </reposition>
<initial_investment cost_unit="currency/m2"> 70 </initial_investment>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</C3030Ceilings>
</C30Interiorfinishes>
</CInteriors>
<DServices>
<D10Conveying cost_unit="currency/m2"> 0 </D10Conveying>
<D20Plumbing cost_unit="currency/m2"> 100 </D20Plumbing>
<D30HVAC>
<D3010EnergySupply>
<D301010photovoltaic_system>
<initial_investment cost_unit="currency/m2"> 800 </initial_investment>
<reposition cost_unit="currency/m2"> 800 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D301010photovoltaic_system>
</D3010EnergySupply>
<D3020Heatgeneratingsystems>
<initial_investment cost_unit="currency/kW"> 622.86 </initial_investment>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 25 </lifetime_equipment>
</D3020Heatgeneratingsystems>
<D3030Coolinggenerationsystems>
<initial_investment cost_unit="currency/kW"> 622.86 </initial_investment>
<reposition cost_unit="currency/kW"> 622.86 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3030Coolinggenerationsystems>
<D3040Distributionsystems>
<initial_investment cost_unit="currency/kW"> 0 </initial_investment>
<reposition cost_unit="currency/kW"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3040Distributionsystems>
<D3060Controlsandinstrumentation>
<initial_investment cost_unit="currency/kW"> 0 </initial_investment>
<reposition cost_unit="currency/kW"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3060Controlsandinstrumentation>
<D3080OtherHVAC_AHU>
<initial_investment cost_unit="currency/kW"> 47.62 </initial_investment>
<reposition cost_unit="currency/kW"> 47.62 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</D3080OtherHVAC_AHU>
</D30HVAC>
<D50Electrical>
<D5010Electricalservicesanddistribution>
<initial_investment cost_unit="currency/m2"> 171.43 </initial_investment>
<reposition cost_unit="currency/m2"> 171.43 </reposition>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</D5010Electricalservicesanddistribution>
<D5020Lightingandbranchwiring>
<initial_investment cost_unit="currency/kW"> 139 </initial_investment>
<reposition cost_unit="currency/kW"> 139 </reposition>
<lifetime_equipment lifetime="years"> 20 </lifetime_equipment>
</D5020Lightingandbranchwiring>
</D50Electrical>
</DServices>
<EEquimentsandfurnishing>
<E10Equipments>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<reposition cost_unit="currency/m2"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</E10Equipments>
<E10Furnishing>
<initial_investment cost_unit="currency/m2"> 0 </initial_investment>
<reposition cost_unit="currency/m2"> 0 </reposition>
<lifetime_equipment lifetime="years"> 15 </lifetime_equipment>
</E10Furnishing>
</EEquimentsandfurnishing>
<engineer cost_unit="%"> 2.5 </engineer>
</capital_cost>
<operational_cost>
<fuel fuel_type="electricity">
<fixed>
<fixed_monthly cost_unit="currency/month"> 12.27 </fixed_monthly>
</fixed>
<variable_base cost_unit="currency/kWh"> hourlydatatable1 </variable_base>
<variable_peak cost_unit="currency/kWh"> hourlydatatable2 </variable_peak>
</fuel>
<fuel fuel_type="gaz">
<fixed>
<fixed_monthly cost_unit="currency/month"> 17.71 </fixed_monthly>
</fixed>
<variable cost_unit="currency/m3"> 0.640 </variable>
</fuel>
<fuel fuel_type="diesel">
<variable cost_unit="currency/l"> 1.2 </variable>
</fuel>
<fuel fuel_type="biomass">
<variable cost_unit="currency/kg"> 0.09 </variable>
</fuel>
<maintenance>
<heating_equipment cost_unit="currency/kW"> 40 </heating_equipment>
<cooling_equipment cost_unit="currency/kW"> 40 </cooling_equipment>
<general_hvac_equipment cost_unit="currency/(m3/h)"> 0.05 </general_hvac_equipment>
<photovoltaic_system cost_unit="currency/m2"> 1 </photovoltaic_system>
<other_systems cost_unit="currency/m2"> 4.6 </other_systems>
</maintenance>
<CO2_cost cost_unit="currency/kgCO2"> 30 </CO2_cost>
</operational_cost>
<end_of_life_cost cost_unit="currency/m2"> 6.3 </end_of_life_cost>
<incomes>
<subsidies>
<construction_subsidy cost_unit="%"> 2 </construction_subsidy>
<hvac_subsidy cost_unit="%"> 1.5 </hvac_subsidy>
<photovoltaic_subsidy cost_unit="%"> 3.6 </photovoltaic_subsidy>
</subsidies>
<energy_exports>
<electricity cost_unit="currency/kWh"> hourlydatatable </electricity>
<heat cost_unit="currency/kWh"> 0 </heat>
</energy_exports>
<tax_reductions>
<reductions_taxes cost_unit="%"> 2 </reductions_taxes>
</tax_reductions>
<CO2_income cost_unit="currency/kgCO2exported"> 0 </CO2_income>
</incomes>
</archetype>
</archetypes>

View File

@ -97,7 +97,7 @@ P 40
B 41 CONST
P 41
$HPDisactivationTemperature % Constant value
$HPDeactivationTemperature % Constant value
B 42 CONST
P 42

View File

@ -97,7 +97,7 @@ P 30
B 31 CONST
P 31
$HPDisactivationTemperature % Constant value
$HPDeactivationTemperature % Constant value
B 32 CONST
P 32

View File

@ -339,7 +339,7 @@ P 142
B 143 CONST
P 143
$HPDisactivationTemperature % Constant value
$HPDeactivationTemperature % Constant value
B 144 CONST
P 144

View File

@ -303,7 +303,7 @@ P 106
B 107 CONST
P 107
$HPDisactivationTemperature % Constant value
$HPDeactivationTemperature % Constant value
B 108 CONST
P 108

View File

@ -1,559 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<library name="LCA">
<fuels>
<fuel id="1" name="Black_coal">
<carbon_emission_factor unit="kgCO2/ kWh">0.32</carbon_emission_factor>
</fuel>
<fuel id="2" name="Brown_coal">
<carbon_emission_factor unit="kgCO2/ kWh">0.4</carbon_emission_factor>
</fuel>
<fuel id="3" name="Brown_coal_briquette">
<carbon_emission_factor unit="kgCO2/ kWh">0.4</carbon_emission_factor>
</fuel>
<fuel id="4" name="Brown_coal_coke">
<carbon_emission_factor unit="kgCO2/ kWh">0.5</carbon_emission_factor>
</fuel>
<fuel id="5" name="CNG">
<carbon_emission_factor unit="kgCO2/ kWh">0.18</carbon_emission_factor>
</fuel>
<fuel id="6" name="Coal_coke">
<carbon_emission_factor unit="kgCO2/ kWh">0.39</carbon_emission_factor>
</fuel>
<fuel id="7" name="Crude_oil">
<carbon_emission_factor unit="kgCO2/ kWh">0.27</carbon_emission_factor>
</fuel>
<fuel id="8" name="Diesel_Machine">
<carbon_emission_factor unit="kgCO2/ liter">4.16</carbon_emission_factor>
</fuel>
<fuel id="9" name="Diesel_Vehicle">
<carbon_emission_factor unit="kgCO2/ liter">2.24</carbon_emission_factor>
</fuel>
<fuel id="10" name="Ethane">
<carbon_emission_factor unit="kgCO2/ kWh">0.2</carbon_emission_factor>
</fuel>
<fuel id="11" name="Fuel_oil">
<carbon_emission_factor unit="kgCO2/ liter">3.19</carbon_emission_factor>
</fuel>
<fuel id="12" name="Gas_flared">
<carbon_emission_factor unit="kgCO2/ kg">3.53</carbon_emission_factor>
</fuel>
<fuel id="13" name="Kerosene">
<carbon_emission_factor unit="kgCO2/ kWh">0.27</carbon_emission_factor>
</fuel>
<fuel id="14" name="LNG">
<carbon_emission_factor unit="kgCO2/ kWh">0.21</carbon_emission_factor>
</fuel>
<fuel id="15" name="LPG">
<carbon_emission_factor unit="kgCO2/ liter">1.69</carbon_emission_factor>
</fuel>
<fuel id="16" name="Natural_gas">
<carbon_emission_factor unit="kgCO2/ kWh">0.21</carbon_emission_factor>
</fuel>
<fuel id="17" name="Petroleum_coke">
<carbon_emission_factor unit="kgCO2/ kWh">0.35</carbon_emission_factor>
</fuel>
<fuel id="18" name="UNG">
<carbon_emission_factor unit="kgCO2/ kWh">0.18</carbon_emission_factor>
</fuel>
<fuel id="19" name="Biodiesel">
<carbon_emission_factor unit="kgCO2/ liter">0.81</carbon_emission_factor>
</fuel>
<fuel id="20" name="Bioethanol">
<carbon_emission_factor unit="kgCO2/ kg">1.21</carbon_emission_factor>
</fuel>
<fuel id="21" name="Biogas">
<carbon_emission_factor unit="kgCO2/ kg">1.61</carbon_emission_factor>
</fuel>
<fuel id="22" name="Biomass">
<carbon_emission_factor unit="kgCO2/ kg">0.11</carbon_emission_factor>
</fuel>
<fuel id="23" name="Methanol">
<carbon_emission_factor unit="kgCO2/ kg">0.3</carbon_emission_factor>
</fuel>
<fuel id="24" name="Petrol_eightyfive_ethanol">
<carbon_emission_factor unit="kgCO2/ kg">1.16</carbon_emission_factor>
</fuel>
<fuel id="25" name="Steam">
<carbon_emission_factor unit="kgCO2/ kg">0.61</carbon_emission_factor>
</fuel>
</fuels>
<machines>
<machine id="1" name="Rock_drill">
<work_efficiency unit="h/m3">0.347</work_efficiency>
<energy_consumption_rate unit="kWh/h">16.5</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="2" name="Hydraulic_hammer">
<work_efficiency unit="h/m3">0.033</work_efficiency>
<energy_consumption_rate unit="kg_fuel/h">25.2</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kg_fuel">4.16 </carbon_emission_factor>
</machine>
<machine id="3" name="Crawler_bulldozer">
<work_efficiency unit="h/m3">0.027</work_efficiency>
<energy_consumption_rate unit="kg_fuel/h3">16.8</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kg_fuel">2.239</carbon_emission_factor>
</machine>
<machine id="4" name="Crawler_excavator">
<work_efficiency unit="h/m3">0.023</work_efficiency>
<energy_consumption_rate unit="kg_fuel/h">16.8</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kg_fuel">2.239</carbon_emission_factor>
</machine>
<machine id="5" name="Crawler_hydraulic_rock_crusher">
<work_efficiency unit="h/m3">0.109</work_efficiency>
<energy_consumption_rate unit="kg_fuel/h">25.2</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kg_fuel">2.239</carbon_emission_factor>
</machine>
<machine id="6" name="Mobile_recycling_equipment">
<work_efficiency unit="h/ton">0.003</work_efficiency>
<energy_consumption_rate unit="kg_fuel/h">16.4</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kg_fuel">4.16</carbon_emission_factor>
</machine>
<machine id="7" name="Vibration_feeder">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">11</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="8" name="Jaw_crusher">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">90</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="9" name="Electromagnetic_separator">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">10</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="10" name="Wind_sorting_machine">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">11</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="11" name="Impact_crusher">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">132</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="12" name="Double_circular_vibrating_plug">
<work_efficiency unit=" h/ton ">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">15</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kW">0.918</carbon_emission_factor>
</machine>
<machine id="13" name="Spiral_sand_washing_machine">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">5.5</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
<machine id="14" name="Conveyor_belts">
<work_efficiency unit="h/ton">0.002</work_efficiency>
<energy_consumption_rate unit="kWh/h">22.5</energy_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</machine>
</machines>
<vehicles>
<vehicle id="1" name="Freight_lorry_18_ton">
<fuel_consumption_rate unit="kg_fuel/ton.km">0.0123</fuel_consumption_rate>
<carbon_emission_factor unit="kgCO2/kg_fuel">2.239</carbon_emission_factor>
</vehicle>
<vehicle id="2" name="Freight_train">
<fuel_consumption_rate unit="kWh/ton.km">0.042</fuel_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">0.918</carbon_emission_factor>
</vehicle>
<vehicle id="3" name="Freight_ship">
<fuel_consumption_rate unit="kWh/ton.km">0.01</fuel_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">1.00000</carbon_emission_factor>
</vehicle>
<vehicle id="4" name="Freight_Air">
<fuel_consumption_rate unit="kWh/ton.km">1.3</fuel_consumption_rate>
<carbon_emission_factor unit="kgCO2/kWh">1.00000</carbon_emission_factor>
</vehicle>
</vehicles>
<building_materials>
<material type="brick" id="1" name="clay brick">
<density unit="ton/m3">1.8</density>
<embodied_carbon unit="kgCO2/ton">560</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
<company_recycling_ratio>0.7</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="brick" id="2" name="light clay brick">
<density unit="ton/m3">1.2</density>
<embodied_carbon unit="kgCO2/ton">310</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
<company_recycling_ratio>0.7</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="brick" id="3" name="refractory">
<density unit="ton/m3">2</density>
<embodied_carbon unit="kgCO2/ton">3080</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
<company_recycling_ratio>0.7</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="brick" id="4" name="sand-lime brick">
<density unit="ton/m3">1.4</density>
<embodied_carbon unit="kgCO2/ton">300</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0.3</onsite_recycling_ratio>
<company_recycling_ratio>0.7</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="5" name="light weight expanded clay">
<density unit="ton/m3">1.6</density>
<embodied_carbon unit="kgCO2/ton">900</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="6" name="lightweight Expanded perlite">
<density unit="ton/m3">1.6</density>
<embodied_carbon unit="kgCO2/ton">2340</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="7" name="lightweight expanded vermiculite">
<density unit="ton/m3">1.6</density>
<embodied_carbon unit="kgCO2/ton">1570</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="8" name="lightweight polystyrene">
<density unit="ton/m3">1.4</density>
<embodied_carbon unit="kgCO2/ton">1840</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="9" name="lightweight pumice">
<density unit="ton/m3">1.3</density>
<embodied_carbon unit="kgCO2/ton">410</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="10" name="concrete 20 MPa">
<density unit="ton/m3">2.3</density>
<embodied_carbon unit="kgCO2/ton">160</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="11" name="concrete 25 MPa">
<density unit="ton/m3">2.3</density>
<embodied_carbon unit="kgCO2/ton">170</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="12" name="concrete 30-32 MPa">
<density unit="ton/m3">2.3</density>
<embodied_carbon unit="kgCO2/ton">230</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="13" name="concrete 35 MPae">
<density unit="ton/m3">2.4</density>
<embodied_carbon unit="kgCO2/ton">240</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="14" name="concrete 50 MPa">
<density unit="ton/m3">2.4</density>
<embodied_carbon unit="kgCO2/ton">280</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="15" name="concrete block">
<density unit="ton/m3">2.3</density>
<embodied_carbon unit="kgCO2/ton">170</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="concrete" id="16" name="concrete roof tile">
<density unit="ton/m3">1.2</density>
<embodied_carbon unit="kgCO2/ton">440</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="glass" id="17" name="flat glass, coated">
<density unit="ton/m3">2.58</density>
<embodied_carbon unit="kgCO2/ton">2660</embodied_carbon>
<recycling_ratio>0.95</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.05</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="glass" id="18" name="glass fibre">
<density unit="ton/m3">2.58</density>
<embodied_carbon unit="kgCO2/ton">5260</embodied_carbon>
<recycling_ratio>0.95</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.05</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="19" name="cellulose fibre">
<density unit="ton/m3">0.06</density>
<embodied_carbon unit="kgCO2/ton">1760</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="20" name="cork slab">
<density unit="ton/m3">0.122</density>
<embodied_carbon unit="kgCO2/ton">3080</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="21" name="polystyren foam">
<density unit="ton/m3">0.028</density>
<embodied_carbon unit="kgCO2/ton">3180</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="22" name="polystyrene 10% recycled">
<density unit="ton/m3">0.024</density>
<embodied_carbon unit="kgCO2/ton">5140</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="23" name="stone wool">
<density unit="ton/m3">0.1</density>
<embodied_carbon unit="kgCO2/ton">6040</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="24" name="foam glass">
<density unit="ton/m3">0.3</density>
<embodied_carbon unit="kgCO2/ton">5380</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="insulation" id="25" name="glass wool mat">
<density unit="ton/m3">0.032</density>
<embodied_carbon unit="kgCO2/ton">2150</embodied_carbon>
<recycling_ratio>0.9</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="wood" id="26" name="fiberboard, hard">
<density unit="ton/m3">0.9</density>
<embodied_carbon unit="kgCO2/ton">3420</embodied_carbon>
<recycling_ratio>0.6</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.4</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="wood" id="27" name="three layerd laminated board">
<density unit="ton/m3">0.7</density>
<embodied_carbon unit="kgCO2/ton">1430</embodied_carbon>
<recycling_ratio>0.6</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.4</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="wood" id="28" name="fibreboard, soft">
<density unit="ton/m3">0.65</density>
<embodied_carbon unit="kgCO2/ton">2780</embodied_carbon>
<recycling_ratio>0.6</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.4</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="wood" id="29" name="plywood">
<density unit="ton/m3">0.72</density>
<embodied_carbon unit="kgCO2/ton">2190</embodied_carbon>
<recycling_ratio>0.6</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.4</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="30" name="acrylic filler">
<density unit="ton/m3">1.43</density>
<embodied_carbon unit="kgCO2/ton">1070</embodied_carbon>
<recycling_ratio>0</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>0</company_recycling_ratio>
<landfilling_ratio>1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="31" name="anhydrite floor">
<density unit="ton/m3">1.43</density>
<embodied_carbon unit="kgCO2/ton">240</embodied_carbon>
<recycling_ratio>0</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>0</company_recycling_ratio>
<landfilling_ratio>1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="32" name="base plaster">
<density unit="ton/m3">1.43</density>
<embodied_carbon unit="kgCO2/ton">430</embodied_carbon>
<recycling_ratio>0</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>0</company_recycling_ratio>
<landfilling_ratio>1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="33" name="cement cast plaster floor">
<density unit="ton/m3">1.43</density>
<embodied_carbon unit="kgCO2/ton">340</embodied_carbon>
<recycling_ratio>0</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>0</company_recycling_ratio>
<landfilling_ratio>1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="34" name="cement tile">
<density unit="ton/m3">1.2</density>
<embodied_carbon unit="kgCO2/ton">440</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="35" name="ceramic tile">
<density unit="ton/m3">2.1</density>
<embodied_carbon unit="kgCO2/ton">1410</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="36" name="clay plaster">
<density unit="ton/m3">1.43</density>
<embodied_carbon unit="kgCO2/ton">250</embodied_carbon>
<recycling_ratio>0</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>0</company_recycling_ratio>
<landfilling_ratio>1</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="37" name="fiber cement corrugated slab">
<density unit="ton/m3">1.44</density>
<embodied_carbon unit="kgCO2/ton">1480</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="38" name="fiber cement facing tile">
<density unit="ton/m3">1.44</density>
<embodied_carbon unit="kgCO2/ton">2220</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="wood" id="39" name="gypsum fibreboard">
<density unit="ton/m3">1.27</density>
<embodied_carbon unit="kgCO2/ton">3960</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="covering" id="40" name="gypsum plaster board">
<density unit="ton/m3">1.15</density>
<embodied_carbon unit="kgCO2/ton">760</embodied_carbon>
<recycling_ratio>0.8</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.2</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="metal" id="41" name="steel">
<density unit="ton/m3">8</density>
<embodied_carbon unit="kgCO2/ton">3160</embodied_carbon>
<recycling_ratio> 0.98</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.02</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="metal" id="42" name="aluminium">
<density unit="ton/m3">2.7</density>
<embodied_carbon unit="kgCO2/ton">5370</embodied_carbon>
<recycling_ratio> 0.98</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.02</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
<material type="metal" id="43" name="reinforcing steel">
<density unit="ton/m3">7.85</density>
<embodied_carbon unit="kgCO2/ton">3910</embodied_carbon>
<recycling_ratio> 0.98</recycling_ratio>
<onsite_recycling_ratio>0</onsite_recycling_ratio>
<company_recycling_ratio>1</company_recycling_ratio>
<landfilling_ratio>0.02</landfilling_ratio>
<cost unit="CAD">0.1</cost>
</material>
</building_materials>
</library>

View File

@ -1,83 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<archetypes reference_library_building_type="DOE">
<archetypes ID="0" building_type="high-rise apartment" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_OfficeSmall_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="1" building_type="midrise apartment" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_ApartmentMidRise_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="2" building_type="hospital" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_Hospital_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="3" building_type="large hotel" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_HotelLarge_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="4" building_type="small hotel" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_HotelSmall_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="5" building_type="large office" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_OfficeLarge_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="6" building_type="medium office" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_OfficeMedium_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="7" building_type="small office" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_OfficeSmall_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="8" building_type="outpatient healthcare" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_OutPatientHealthCare_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="9" building_type="quick service restaurant" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_RestaurantFastFood_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="10" building_type="full service restaurant" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_RestaurantSitDown_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="11" building_type="stand-alone-retail" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_RetailStandalone_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="12" building_type="strip mall" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_RetailStripmall_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="13" building_type="primary school" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_SchoolPrimary_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="14" building_type="secondary school" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_SchoolSecondary_STD2019_Rochester.idf</path>
</idf>
</archetypes>
<archetypes ID="15" building_type="warehouse" reference_standard="ASHRAE 90.1-2019" climate_zone="ASHRAE_2009:6A">
<idf>
<path>idf_files/ASHRAE901_Warehouse_STD2019_Rochester.idf</path>
</idf>
</archetypes>
</archetypes>

View File

@ -1,8 +0,0 @@
{
"sensors": [
{ "city_object" : "EV",
"sensors": ["TOTKWCH3.IC","TOTKWEV.IC","COMPTEUR.SQD.017.IC:POWER 3P", "COMPTEUR.SQD.B1.IC:POWER 3P",
"COMPTEUR.SQD.B2.IC:POWER 3P"]
}
]
}

View File

@ -1,10 +0,0 @@
{
"sensors": [
{ "city_object" : "GM",
"sensors": ["MDICOR.GM"]
},
{ "city_object" : "GM_MB_EV",
"sensors": ["TOTAL.GAZ.MOIS.ENCS.IC"]
}
]
}

View File

@ -1,7 +0,0 @@
{
"sensors": [
{ "city_object" : "EV",
"sensors": ["MTX-017.IC", "MTACBT.IC","MTRCBT.IC"]
}
]
}

View File

@ -391,7 +391,7 @@ class EnergyAde:
'@gml:id': f'GML_{uuid.uuid4()}',
'gml:name': f'{thermal_boundary.construction_name}',
'energy:thermalBoundaryType': thermal_boundary.type,
'energy:azumuth': {
'energy:azimuth': {
'@uom': 'rad',
'#text': f'{thermal_boundary.parent_surface.azimuth}'
},

View File

@ -4,7 +4,7 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Guillermo.GutierrezMorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
Oriol Gavaldà Torrellas oriol.gavalda@concordia.ca
Oriol Gavalda Torrellas oriol.gavalda@concordia.ca
"""
import copy
from pathlib import Path
@ -277,9 +277,10 @@ class Idf:
return self._add_standard_compact_hourly_schedule(usage, schedule_type, new_schedules)
def _add_construction(self, thermal_boundary):
vegetation_name = f'{thermal_boundary.construction_name}_{thermal_boundary.parent_surface.vegetation.name}'
for construction in self._idf.idfobjects[self._CONSTRUCTION]:
if thermal_boundary.parent_surface.vegetation is not None:
if construction.Name == f'{thermal_boundary.construction_name}_{thermal_boundary.parent_surface.vegetation.name}':
if construction.Name == vegetation_name:
return
else:
if construction.Name == thermal_boundary.construction_name:
@ -295,7 +296,7 @@ class Idf:
layers = thermal_boundary.layers
# The constructions should have at least one layer
if thermal_boundary.parent_surface.vegetation is not None:
_kwargs = {'Name': f'{thermal_boundary.construction_name}_{thermal_boundary.parent_surface.vegetation.name}',
_kwargs = {'Name': vegetation_name,
'Outside_Layer': thermal_boundary.parent_surface.vegetation.name}
for i in range(0, len(layers) - 1):
_kwargs[f'Layer_{i + 2}'] = layers[i].material.name
@ -307,8 +308,8 @@ class Idf:
def _add_window_construction_and_material(self, thermal_opening):
for window_material in self._idf.idfobjects[self._WINDOW_MATERIAL_SIMPLE]:
if window_material['UFactor'] == thermal_opening.overall_u_value and \
window_material['Solar_Heat_Gain_Coefficient'] == thermal_opening.g_value:
if window_material['UFactor'] == thermal_opening.overall_u_value and window_material[
'Solar_Heat_Gain_Coefficient'] == thermal_opening.g_value:
return
order = str(len(self._idf.idfobjects[self._WINDOW_MATERIAL_SIMPLE]) + 1)
@ -333,10 +334,12 @@ class Idf:
for thermostat in self._idf.idfobjects[self._THERMOSTAT]:
if thermostat.Name == thermostat_name:
return thermostat
return self._idf.newidfobject(self._THERMOSTAT,
Name=thermostat_name,
Heating_Setpoint_Schedule_Name=f'Heating thermostat schedules {thermal_zone.usage_name}',
Cooling_Setpoint_Schedule_Name=f'Cooling thermostat schedules {thermal_zone.usage_name}')
return self._idf.newidfobject(
self._THERMOSTAT,
Name=thermostat_name,
Heating_Setpoint_Schedule_Name=f'Heating thermostat schedules {thermal_zone.usage_name}',
Cooling_Setpoint_Schedule_Name=f'Cooling thermostat schedules {thermal_zone.usage_name}'
)
def _add_heating_system(self, thermal_zone, zone_name):
for air_system in self._idf.idfobjects[self._IDEAL_LOAD_AIR_SYSTEM]:
@ -353,8 +356,7 @@ class Idf:
def _add_occupancy(self, thermal_zone, zone_name):
number_of_people = thermal_zone.occupancy.occupancy_density * thermal_zone.total_floor_area
fraction_radiant = 0
total_sensible = thermal_zone.occupancy.sensible_radiative_internal_gain + \
thermal_zone.occupancy.sensible_convective_internal_gain
total_sensible = thermal_zone.occupancy.sensible_radiative_internal_gain + thermal_zone.occupancy.sensible_convective_internal_gain
if total_sensible != 0:
fraction_radiant = thermal_zone.occupancy.sensible_radiative_internal_gain / total_sensible
@ -422,12 +424,7 @@ class Idf:
)
def _add_ventilation(self, thermal_zone, zone_name):
# for zone in self._idf.idfobjects["ZONE"]:
# if zone.Name == f'{zone_name}_infiltration':
# return
schedule = f'Ventilation schedules {thermal_zone.usage_name}'
# if schedule not in self._idf.idfobjects[self._HOURLY_SCHEDULE]:
# return
# todo: revise ventilation with Pilar
self._idf.newidfobject(self._VENTILATION,
Name=f'{zone_name}_ventilation',
@ -696,8 +693,8 @@ class Idf:
glazing = window_construction['Outside_Layer']
for material in self._idf.idfobjects[self._WINDOW_MATERIAL_SIMPLE]:
if material['Name'] == glazing:
if material['UFactor'] == opening.overall_u_value and \
material['Solar_Heat_Gain_Coefficient'] == opening.g_value:
if material['UFactor'] == opening.overall_u_value and material[
'Solar_Heat_Gain_Coefficient'] == opening.g_value:
return True
return False
@ -717,26 +714,25 @@ class Idf:
leaf_reflectivity += plant.percentage * plant.leaf_reflectivity
leaf_emissivity += plant.percentage * plant.leaf_emissivity
minimal_stomatal_resistance += plant.percentage * plant.minimal_stomatal_resistance
self._idf.newidfobject(self._MATERIAL_ROOFVEGETATION,
Name=vegetation.name,
Height_of_Plants=height,
Leaf_Area_Index=leaf_area_index,
Leaf_Reflectivity=leaf_reflectivity,
Leaf_Emissivity=leaf_emissivity,
Minimum_Stomatal_Resistance=minimal_stomatal_resistance,
Soil_Layer_Name=soil.name,
Roughness=soil.roughness,
Thickness=vegetation.soil_thickness,
Conductivity_of_Dry_Soil=soil.dry_conductivity,
Density_of_Dry_Soil=soil.dry_density,
Specific_Heat_of_Dry_Soil=soil.dry_specific_heat,
Thermal_Absorptance=soil.thermal_absorptance,
Solar_Absorptance=soil.solar_absorptance,
Visible_Absorptance=soil.visible_absorptance,
Saturation_Volumetric_Moisture_Content_of_the_Soil_Layer=
soil.saturation_volumetric_moisture_content,
Residual_Volumetric_Moisture_Content_of_the_Soil_Layer=
soil.residual_volumetric_moisture_content,
Initial_Volumetric_Moisture_Content_of_the_Soil_Layer=
soil.initial_volumetric_moisture_content,
Moisture_Diffusion_Calculation_Method=self._SIMPLE)
self._idf.newidfobject(
self._MATERIAL_ROOFVEGETATION,
Name=vegetation.name,
Height_of_Plants=height,
Leaf_Area_Index=leaf_area_index,
Leaf_Reflectivity=leaf_reflectivity,
Leaf_Emissivity=leaf_emissivity,
Minimum_Stomatal_Resistance=minimal_stomatal_resistance,
Soil_Layer_Name=soil.name,
Roughness=soil.roughness,
Thickness=vegetation.soil_thickness,
Conductivity_of_Dry_Soil=soil.dry_conductivity,
Density_of_Dry_Soil=soil.dry_density,
Specific_Heat_of_Dry_Soil=soil.dry_specific_heat,
Thermal_Absorptance=soil.thermal_absorptance,
Solar_Absorptance=soil.solar_absorptance,
Visible_Absorptance=soil.visible_absorptance,
Saturation_Volumetric_Moisture_Content_of_the_Soil_Layer=soil.saturation_volumetric_moisture_content,
Residual_Volumetric_Moisture_Content_of_the_Soil_Layer=soil.residual_volumetric_moisture_content,
Initial_Volumetric_Moisture_Content_of_the_Soil_Layer=soil.initial_volumetric_moisture_content,
Moisture_Diffusion_Calculation_Method=self._SIMPLE
)

View File

@ -5,14 +5,13 @@ Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import numpy as np
import logging
from pathlib import Path
import sys
from hub.hub_logger import logger
from hub.exports.formats.insel import Insel
from hub.imports.weather.helpers.weather import Weather
import numpy as np
import hub.helpers.constants as cte
from hub.imports.weather.helpers.weather import Weather
_CONSTRUCTION_CODE = {
cte.WALL: '1',
@ -25,10 +24,12 @@ _CONSTRUCTION_CODE = {
}
class InselMonthlyEnergyBalance(Insel):
class InselMonthlyEnergyBalance:
def __init__(self, city, path, radiation_calculation_method='sra', weather_format='epw'):
super().__init__(city, path)
self._city = city
self._path = path
self._results = None
self._radiation_calculation_method = radiation_calculation_method
self._weather_format = weather_format
self._contents = []
@ -41,16 +42,24 @@ class InselMonthlyEnergyBalance(Insel):
if building.internal_zones is not None:
for internal_zone in building.internal_zones:
if internal_zone.thermal_zones is None:
logger.error(f'Building {building.name} has missing values. '
f'Monthly Energy Balance cannot be processed\n')
sys.stderr.write(f'Building {building.name} has missing values. '
f'Monthly Energy Balance cannot be processed\n')
logging.error(f'Building {building.name} has missing values. Monthly Energy Balance cannot be processed\n')
break
self._contents.append(
self._generate_meb_template(building, output_path, self._radiation_calculation_method,self._weather_format)
self._generate_meb_template(building, output_path, self._radiation_calculation_method, self._weather_format)
)
self._export()
@staticmethod
def _add_block(file, block_number, block_type, inputs='', parameters=''):
file += "S " + str(block_number) + " " + block_type + "\n"
for block_input in inputs:
file += str(block_input) + "\n"
if len(parameters) > 0:
file += "P " + str(block_number) + "\n"
for block_parameter in parameters:
file += str(block_parameter) + "\n"
return file
def _export(self):
for i_file, content in enumerate(self._contents):
file_name = self._insel_files_paths[i_file]
@ -87,7 +96,7 @@ class InselMonthlyEnergyBalance(Insel):
file = ""
i_block = 1
parameters = ["1", "12", "1"]
file = Insel._add_block(file, i_block, 'DO', parameters=parameters)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'DO', parameters=parameters)
i_block = 4
inputs = ["1.1", "20.1", "21.1"]
@ -210,7 +219,7 @@ class InselMonthlyEnergyBalance(Insel):
else:
parameters.append(0.0)
file = Insel._add_block(file, i_block, 'd18599', inputs=inputs, parameters=parameters)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'd18599', inputs=inputs, parameters=parameters)
i_block = 20
inputs = ['1']
@ -221,7 +230,7 @@ class InselMonthlyEnergyBalance(Insel):
for i in range(0, len(external_temperature)):
parameters.append(f'{i + 1} {external_temperature.at[i, weather_format]}')
file = Insel._add_block(file, i_block, 'polyg', inputs=inputs, parameters=parameters)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'polyg', inputs=inputs, parameters=parameters)
i_block = 21
inputs = ['1']
@ -231,7 +240,7 @@ class InselMonthlyEnergyBalance(Insel):
for i, temperature in enumerate(sky_temperature):
parameters.append(f'{i + 1} {temperature}')
file = Insel._add_block(file, i_block, 'polyg', inputs=inputs, parameters=parameters)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'polyg', inputs=inputs, parameters=parameters)
for i, surface in enumerate(surfaces):
i_block = 101 + i
@ -249,17 +258,17 @@ class InselMonthlyEnergyBalance(Insel):
for j in range(0, 12):
parameters.append(f'{j + 1} 0.0')
file = Insel._add_block(file, i_block, 'polyg', inputs=inputs, parameters=parameters)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'polyg', inputs=inputs, parameters=parameters)
i_block = 300 + len(surfaces)
inputs = ['4.1', '4.2']
file = Insel._add_block(file, i_block, 'cum', inputs=inputs)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'cum', inputs=inputs)
in_1 = f'{i_block}.1'
in_2 = f'{i_block}.2'
i_block = 303 + len(surfaces)
inputs = [in_1, in_2]
file = Insel._add_block(file, i_block, 'atend', inputs=inputs)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'atend', inputs=inputs)
i_block = 310 + len(surfaces)
inputs = ['4.1', '4.2']
@ -267,6 +276,6 @@ class InselMonthlyEnergyBalance(Insel):
'0 % Suppress FNQ inputs',
f"'{str(insel_outputs_path)}' % File name",
"'*' % Fortran format"]
file = Insel._add_block(file, i_block, 'WRITE', inputs=inputs, parameters=parameters)
file = InselMonthlyEnergyBalance._add_block(file, i_block, 'WRITE', inputs=inputs, parameters=parameters)
return file

View File

@ -5,12 +5,12 @@ Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de uribarri pilar.monsalvete@concordia.ca
"""
import logging
from pathlib import Path
from hub.exports.building_energy.energy_ade import EnergyAde
from hub.exports.building_energy.idf import Idf
from hub.exports.building_energy.insel.insel_monthly_energy_balance import InselMonthlyEnergyBalance
from hub.helpers.utils import validate_import_export_type
from hub.hub_logger import logger
class EnergyBuildingsExportsFactory:
@ -22,9 +22,9 @@ class EnergyBuildingsExportsFactory:
self._export_type = '_' + export_type.lower()
class_funcs = validate_import_export_type(EnergyBuildingsExportsFactory)
if self._export_type not in class_funcs:
err_msg = f"Wrong import type [{self._export_type}]. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong import type [{self._export_type}]. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
if isinstance(path, str):
path = Path(path)
self._path = path
@ -43,7 +43,7 @@ class EnergyBuildingsExportsFactory:
"""
Export the city to Energy+ idf format
When target_buildings is set, only those will be calculated and their energy consumption output, non adjacent
When target_buildings is set, only those will be calculated and their energy consumption output, non-adjacent
buildings will be considered shading objects and adjacent buildings will be considered adiabatic.
Adjacent buildings are provided they will be considered heated so energy plus calculations are more precise but

View File

@ -31,10 +31,10 @@ class AirSourceHPExport(HeatPumpExport):
def _extract_model_coff(self, hp_model: str, data_type='heat') -> Union[List, None]:
"""
Extracts heat pump coefficient data for a specific
model. e.g 012, 140
model. e.g. 012, 140
:param hp_model: the model type
:param data_type: indicates whether we're extracting cooling
or heating perfarmcn coefficients
or heating performance coefficients
:return:
"""
for energy_system in self._city.energy_systems:
@ -56,5 +56,5 @@ class AirSourceHPExport(HeatPumpExport):
insel should run for heat or cooling performance
:return:
"""
capacity_coeff = self._extract_model_coff(hp_model, data_type)
return super(AirSourceHPExport, self)._run_insel(user_input, capacity_coeff, 'air_source.insel')
capacity_coefficient = self._extract_model_coff(hp_model, data_type)
return super(AirSourceHPExport, self)._run_insel(user_input, capacity_coefficient, 'air_source.insel')

View File

@ -5,11 +5,11 @@ Copyright © 2022 Concordia CERC group
Project Coder Peter Yefi peteryefi@gmail.com
"""
import os
import logging
from typing import List, Union, Dict
import yaml
from string import Template
import pandas as pd
from hub.hub_logger import logger
class HeatPumpExport:
@ -29,17 +29,17 @@ class HeatPumpExport:
self._base_path = base_path
self._output_path = output_path
def _run_insel(self, user_input: Dict, capacity_coeff: List, filename: str) -> Union[Dict, None]:
def _run_insel(self, user_input: Dict, capacity_coefficient: List, filename: str) -> Union[Dict, None]:
"""
Runs insel and write the necessary files
:param user_input: a dictionary containing the user
values necessary to run insel
:param capacity_coeff: a list containing capacity coefficients
:param capacity_coefficient: a list containing capacity coefficients
:param filename: the name of the insel file to be created
:return:
"""
self._input_data = user_input
self._update_input_data_with_coff(capacity_coeff)
self._update_input_data_with_coff(capacity_coefficient)
# update input data with constants
self._update_input_data_with_constants()
# update input data with input and output files for insel
@ -57,15 +57,14 @@ class HeatPumpExport:
insel_file_handler.write(insel_template)
# Now run insel
self._delete_existing_output_files()
logger.info(f'Running Insel with user input: {user_input} and coefficients {capacity_coeff}')
logging.info(f'Running Insel with user input: {user_input} and coefficients {capacity_coefficient}')
os.system('insel {}'.format(insel_file))
# Writer headers to csv output files generated by insel
self._write_insel_output_headers()
# User output
return self._get_user_out_put()
except IOError as err:
print("I/O exception: {}".format(str(err)))
logger.error(f'An I/O error occurred while running insel: {str(err)}')
logging.error(f'An I/O error occurred while running insel: {str(err)}')
finally:
insel_file_handler.close()
insel_template_handler.close()
@ -185,16 +184,16 @@ class HeatPumpExport:
self._input_data[key] = value
# compute water to water HP specific values
if 55 <= self._input_data['HPSupTemp'] <= 60:
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 5
self._input_data["HPDeactivationTemperature"] = self._input_data["HPSupTemp"] - 5
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 18
elif 50 <= self._input_data["HPSupTemp"] < 55:
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 5
self._input_data["HPDeactivationTemperature"] = self._input_data["HPSupTemp"] - 5
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 13
elif 45 <= self._input_data["HPSupTemp"] < 50:
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 3
self._input_data["HPDeactivationTemperature"] = self._input_data["HPSupTemp"] - 3
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 8
elif 35 <= self._input_data["HPSupTemp"] < 40:
self._input_data["HPDisactivationTemperature"] = self._input_data["HPSupTemp"] - 2
self._input_data["HPDeactivationTemperature"] = self._input_data["HPSupTemp"] - 2
self._input_data["HPReactivationTemperature"] = self._input_data["HPSupTemp"] - 4
# compute maximum demand. todo: This should come from catalog in the future
@ -203,29 +202,29 @@ class HeatPumpExport:
self._input_data["TESCapacity"] = self._input_data["HoursOfStorageAtMaxDemand"] * (max_demand * 3.6) / (
(self._input_data["Cp"] / 1000) * self._input_data["TemperatureDifference"])
def _update_input_data_with_coff(self, a_coeff: List):
def _update_input_data_with_coff(self, a_coefficient: List):
"""
Updates the user data with coefficients derived from imports
:param a_coeff: insel a coefficient values
Meaning of a is in the models for air source heat pump
:param a_coefficient: insel a coefficient values
Meaning of a coefficient is in the models for air source heat pump
and water to water source heat pump
:return:
"""
self._input_data["a1"] = a_coeff[0]
self._input_data["a2"] = a_coeff[1]
self._input_data["a3"] = a_coeff[2]
self._input_data["a4"] = a_coeff[3]
self._input_data["a5"] = a_coeff[4]
self._input_data["a6"] = a_coeff[5]
self._input_data["a1"] = a_coefficient[0]
self._input_data["a2"] = a_coefficient[1]
self._input_data["a3"] = a_coefficient[2]
self._input_data["a4"] = a_coefficient[3]
self._input_data["a5"] = a_coefficient[4]
self._input_data["a6"] = a_coefficient[5]
# additional coefficients for water to water source
if self._water_temp is not None:
self._input_data["a7"] = a_coeff[6]
self._input_data["a8"] = a_coeff[7]
self._input_data["a9"] = a_coeff[8]
self._input_data["a10"] = a_coeff[9]
self._input_data["a11"] = a_coeff[10]
self._input_data["a7"] = a_coefficient[6]
self._input_data["a8"] = a_coefficient[7]
self._input_data["a9"] = a_coefficient[8]
self._input_data["a10"] = a_coefficient[9]
self._input_data["a11"] = a_coefficient[10]
def _get_user_out_put(self) -> Union[Dict, None]:
"""

View File

@ -29,10 +29,10 @@ class WaterToWaterHPExport(HeatPumpExport):
super().__init__(base_path=base_path, city=city, output_path=output_path, template=template_path,
demand_path=demand_path, water_temp=water_temp)
def _extract_model_coff(self, hp_model: str) -> Union[List, None]:
def _extract_model_coefficient(self, hp_model: str) -> Union[List, None]:
"""
Extracts heat pump coefficient data for a specific
model. e.g ClimateMaster 156 kW, etc
model. e.g. ClimateMaster 156 kW, etc.
:param hp_model: the model type
:return:
"""
@ -51,5 +51,5 @@ class WaterToWaterHPExport(HeatPumpExport):
pump model to be used e.g. 012, 015
:return:
"""
pow_demand_coeff = self._extract_model_coff(hp_model)
return super(WaterToWaterHPExport, self)._run_insel(user_input, pow_demand_coeff, 'w2w.insel')
pow_demand_coefficient = self._extract_model_coefficient(hp_model)
return super(WaterToWaterHPExport, self)._run_insel(user_input, pow_demand_coefficient, 'w2w.insel')

View File

@ -26,7 +26,7 @@ class EnergySystemsExportFactory:
:param sim_type: the simulation type, 0 for series 1 for parallel
:param data_type: indicates whether cooling or heating data is used
:param base_path: the data directory of energy systems
:param demand_path: path to hourly energy dempand file
:param demand_path: path to hourly energy demand file
"""
self._city = city
@ -39,17 +39,18 @@ class EnergySystemsExportFactory:
self._output_path = output_path
self._sim_type = sim_type
self._demand_path = demand_path
self._source = None
def _export_heat_pump(self, source):
def _export_heat_pump(self):
"""
Exports heat pump performance data as coefficients
of some objective function
:return: None
"""
if source == 'air':
if self._source == 'air':
return AirSourceHPExport(self._base_path, self._city, self._output_path, self._sim_type, self._demand_path)\
.execute_insel(self._user_input, self._hp_model, self._data_type)
elif source == 'water':
elif self._source == 'water':
return WaterToWaterHPExport(self._base_path, self._city, self._output_path, self._sim_type, self._demand_path)\
.execute_insel(self._user_input, self._hp_model)
@ -58,4 +59,5 @@ class EnergySystemsExportFactory:
Export the city given to the class using the given export type handler
:return: None
"""
return getattr(self, '_export_heat_pump', lambda: None)(source)
self._source = source
return getattr(self, '_export_heat_pump', lambda: None)()

View File

@ -5,11 +5,11 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import logging
from pathlib import Path
from hub.exports.formats.obj import Obj
from hub.exports.formats.simplified_radiosity_algorithm import SimplifiedRadiosityAlgorithm
from hub.exports.formats.stl import Stl
from hub.hub_logger import logger
from hub.helpers.utils import validate_import_export_type
@ -26,9 +26,9 @@ class ExportsFactory:
self._export_type = '_' + export_type.lower()
class_funcs = validate_import_export_type(ExportsFactory)
if self._export_type not in class_funcs:
err_msg = f"Wrong export type [{self._export_type}]. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong export type [{self._export_type}]. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
if isinstance(path, str):
path = Path(path)
self._path = path

View File

@ -1,29 +0,0 @@
"""
Insel export models to insel format
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from abc import ABC
class Insel(ABC):
def __init__(self, city, path):
self._city = city
self._path = path
self._results = None
@staticmethod
def _add_block(file, block_number, block_type, inputs='', parameters=''):
file += "S " + str(block_number) + " " + block_type + "\n"
for block_input in inputs:
file += str(block_input) + "\n"
if len(parameters) > 0:
file += "P " + str(block_number) + "\n"
for block_parameter in parameters:
file += str(block_parameter) + "\n"
return file
def _export(self):
raise NotImplementedError

View File

@ -71,9 +71,8 @@ class SimplifiedRadiosityAlgorithm:
else:
i = (total_days + day - 1) * 24 + hour - 1
representative_building = self._city.buildings[0]
content += str(day) + ' ' + str(month) + ' ' + str(hour) + ' ' \
+ str(representative_building.global_horizontal[cte.HOUR].epw[i]) + ' ' \
+ str(representative_building.beam[cte.HOUR].epw[i]) + '\n'
content += f'{day} {month} {hour} {representative_building.global_horizontal[cte.HOUR].epw[i]} ' \
f'{representative_building.beam[cte.HOUR].epw[i]}\n'
with open(file, "w") as file:
file.write(content)

View File

@ -1,33 +0,0 @@
"""
User performs user related crud operations
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project CoderPeter Yefi peteryefi@gmail.com
"""
from hub.persistence import User
class UserFactory:
"""
UserFactory class
"""
def __init__(self, db_name, app_env, dotenv_path):
self._user_repo = User(db_name=db_name, app_env=app_env, dotenv_path=dotenv_path)
def login_user(self, name: str, password: str, application_id: int):
"""
Retrieve a single city from postgres
:param name: the email of the user
:param password: the password of the user
:param application_id: the id of the application accessing hub
"""
return self._user_repo.get_by_name_application_and_password(name, password, application_id)
def get_by_name_and_application(self, name: str, application: int):
"""
Retrieve a single user
:param name: user name
:param application: application accessing hub
"""
return self._user_repo.get_by_name_and_application(name, application)

View File

@ -6,7 +6,6 @@ Project Coder Peter Yefi peteryefi@gmail.com
"""
import bcrypt
import re
class Auth(object):
@ -29,8 +28,3 @@ class Auth(object):
:return:
"""
return bcrypt.checkpw(password.encode('utf-8'), hashed_password.encode('utf-8'))

View File

@ -556,7 +556,8 @@ class MontrealFunctionToHubFunction:
'5839': cte.MULTI_FAMILY_HOUSE,
'4316': cte.WAREHOUSE,
'6592': cte.OFFICE_AND_ADMINISTRATION,
'3971': cte.INDUSTRY,
'3971': cte.INDUSTRY,
'3972': cte.INDUSTRY,
'2694': cte.INDUSTRY,
'3882': cte.INDUSTRY,
'3119': cte.INDUSTRY,

View File

@ -115,4 +115,3 @@ class Dictionaries:
:return: dict
"""
return HubFunctionToMontrealCustomCostsFunction().dictionary

View File

@ -66,7 +66,9 @@ class GeometryHelper:
@staticmethod
def coordinate_to_map_point(coordinate, city):
factor = GeometryHelper.factor()
return MapPoint(((coordinate[0] - city.lower_corner[0]) * factor), ((coordinate[1] - city.lower_corner[1]) * factor))
return MapPoint(
((coordinate[0] - city.lower_corner[0]) * factor), ((coordinate[1] - city.lower_corner[1]) * factor)
)
@staticmethod
def city_mapping(city, building_names=None, plot=False):
@ -233,7 +235,7 @@ class GeometryHelper:
:return: [Trimesh]
"""
# The first mesh returns the positive side of the plane and the second the negative side.
# If the plane does not divide the mesh (i.e. it does not touch it or it is coplanar with one or more faces),
# If the plane does not divide the mesh (i.e. it does not touch it, or it is coplanar with one or more faces),
# then it returns only the original mesh.
# todo: review split method in https://github.com/mikedh/trimesh/issues/235,
# once triangulate_polygon in Polygon class is solved

View File

@ -5,7 +5,6 @@ Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import hub.helpers.constants as cte
@ -13,6 +12,7 @@ class LoadsCalculation:
"""
LoadsCalculation class
"""
def __init__(self, building):
self._building = building
@ -28,13 +28,16 @@ class LoadsCalculation:
else:
external_temperature = ambient_temperature
load_transmitted_opaque += thermal_boundary.u_value * thermal_boundary.opaque_area \
* (internal_temperature - external_temperature)
load_transmitted_opaque += (
thermal_boundary.u_value * thermal_boundary.opaque_area * (internal_temperature - external_temperature)
)
for thermal_opening in thermal_boundary.thermal_openings:
load_transmitted_transparent += thermal_opening.overall_u_value \
* (internal_temperature - external_temperature)
load_transmitted_opaque += thermal_zone.additional_thermal_bridge_u_value * thermal_zone.footprint_area \
* (internal_temperature - ambient_temperature)
* (internal_temperature - external_temperature)
load_transmitted_opaque += (
thermal_zone.additional_thermal_bridge_u_value * thermal_zone.footprint_area *
(internal_temperature - ambient_temperature)
)
load_transmitted = load_transmitted_opaque + load_transmitted_transparent
return load_transmitted
@ -43,12 +46,13 @@ class LoadsCalculation:
load_renovation_sensible = 0
for usage in thermal_zone.usages:
load_renovation_sensible += cte.AIR_DENSITY * cte.AIR_HEAT_CAPACITY * usage.mechanical_air_change \
* thermal_zone.volume / cte.HOUR_TO_MINUTES / cte.MINUTES_TO_SECONDS \
* (internal_temperature - ambient_temperature)
* thermal_zone.volume / cte.HOUR_TO_MINUTES / cte.MINUTES_TO_SECONDS \
* (internal_temperature - ambient_temperature)
load_infiltration_sensible = cte.AIR_DENSITY * cte.AIR_HEAT_CAPACITY * thermal_zone.infiltration_rate_system_off \
* thermal_zone.volume / cte.HOUR_TO_MINUTES / cte.MINUTES_TO_SECONDS \
* (internal_temperature - ambient_temperature)
load_infiltration_sensible = (
cte.AIR_DENSITY * cte.AIR_HEAT_CAPACITY * thermal_zone.infiltration_rate_system_off * thermal_zone.volume /
cte.HOUR_TO_MINUTES / cte.MINUTES_TO_SECONDS * (internal_temperature - ambient_temperature)
)
load_ventilation = load_renovation_sensible + load_infiltration_sensible
@ -97,12 +101,14 @@ class LoadsCalculation:
cooling_load_occupancy_sensible += (thermal_zone.occupancy.sensible_convective_internal_gain
+ thermal_zone.occupancy.sensible_radiative_internal_gain) \
* thermal_zone.footprint_area
cooling_load_lighting += (thermal_zone.lighting.density * thermal_zone.lighting.convective_fraction
+ thermal_zone.lighting.density * thermal_zone.lighting.radiative_fraction) \
* thermal_zone.footprint_area
cooling_load_equipment_sensible += (thermal_zone.appliances.density * thermal_zone.appliances.convective_fraction
+ thermal_zone.appliances.density * thermal_zone.appliances.radiative_fraction) \
* thermal_zone.footprint_area
cooling_load_lighting += (
thermal_zone.lighting.density * thermal_zone.lighting.convective_fraction + thermal_zone.lighting.density *
thermal_zone.lighting.radiative_fraction
) * thermal_zone.footprint_area
cooling_load_equipment_sensible += (
thermal_zone.appliances.density * thermal_zone.appliances.convective_fraction +
thermal_zone.appliances.density * thermal_zone.appliances.radiative_fraction
) * thermal_zone.footprint_area
internal_load = cooling_load_occupancy_sensible + cooling_load_lighting + cooling_load_equipment_sensible
return internal_load
@ -113,6 +119,7 @@ class LoadsCalculation:
for thermal_boundary in thermal_zone.thermal_boundaries:
for thermal_opening in thermal_boundary.thermal_openings:
radiation = thermal_boundary.parent_surface.global_irradiance[cte.HOUR][irradiance_format][hour]
cooling_load_radiation += thermal_opening.area * (1 - thermal_opening.frame_ratio) * thermal_opening.g_value \
* radiation
cooling_load_radiation += (
thermal_opening.area * (1 - thermal_opening.frame_ratio) * thermal_opening.g_value * radiation
)
return cooling_load_radiation

View File

@ -1,46 +0,0 @@
"""
Yearly from daily schedules module
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 calendar as cal
import hub.helpers.constants as cte
from hub.city_model_structure.attributes.schedule import Schedule
class YearlyFromDailySchedules:
"""
YearlyFromDailySchedules class
"""
def __init__(self, daily_schedules, year):
self._daily_schedules = daily_schedules
self._year = year
@property
def yearly_schedule(self) -> Schedule:
"""
Creates a yearly schedule out of a set of daily schedules
:return: Schedule
"""
yearly_schedule = Schedule()
weekly_schedules = [0, 0, 0, 0, 0, 0, 0]
day_types = dict({cte.MONDAY: 0, cte.TUESDAY: 1, cte.WEDNESDAY: 2, cte.THURSDAY: 3,
cte.FRIDAY: 4, cte.SATURDAY: 5, cte.SUNDAY: 6})
for daily_schedule in self._daily_schedules:
for day_type in daily_schedule.day_types:
weekly_schedules[day_types[day_type]] = daily_schedule.values
values = []
for month in range(1, 13):
_, number_days = cal.monthrange(self._year, month)
for day in range(1, number_days+1):
week_day = cal.weekday(self._year, month, day)
values.extend(weekly_schedules[week_day])
yearly_schedule.type = self._daily_schedules[0].type
yearly_schedule.data_type = self._daily_schedules[0].data_type
yearly_schedule.time_range = cte.YEAR
yearly_schedule.time_step = cte.HOUR
yearly_schedule.values = values
return yearly_schedule

View File

@ -1,32 +0,0 @@
import logging as logger
from pathlib import Path
import os
import sys
def get_logger(file_logger=False, debug_level=logger.ERROR):
"""
Returns a logging object
:param file_logger: a boolean to indicate the kind of logging
:param debug_level: the value for the logger level (default error)
object to return, true (default) means a file logger is required
:return:
"""
log_format = "%(asctime)s:%(levelname)s:{%(pathname)s:%(funcName)s:%(lineno)d} - %(message)s"
if file_logger:
log_dir = (Path(__file__).parent.parent / 'logs').resolve()
log_file = (log_dir / 'hub.log').resolve()
try:
if not os.path.isfile(log_file):
if not os.path.exists(log_dir):
os.mkdir(log_dir)
with open(log_file, 'x'):
pass
logger.basicConfig(filename=log_file, format=log_format, level=debug_level)
return logger
except IOError as err:
print(f'I/O exception: {err}')
else:
logger.getLogger().addHandler(logger.StreamHandler(stream=sys.stdout))
logger.getLogger().setLevel(debug_level)
return logger.getLogger()

View File

@ -84,7 +84,9 @@ class ConstructionHelper:
:param city: str
:return: str
"""
reference_city = 'Baltimore'
reference_city = ConstructionHelper.city_to_reference_city(city)
if reference_city not in ConstructionHelper._reference_city_to_nrel_climate_zone.keys():
reference_city = 'Baltimore'
return ConstructionHelper._reference_city_to_nrel_climate_zone[reference_city]
@staticmethod

View File

@ -4,18 +4,18 @@ 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 datetime
import sys
import math
import numpy as np
import sys
from typing import List
from hub.helpers import constants as cte
from hub.city_model_structure.attributes.polygon import Polygon
import numpy as np
from hub.city_model_structure.attributes.point import Point
from hub.city_model_structure.attributes.polygon import Polygon
from hub.city_model_structure.building_demand.storey import Storey
from hub.city_model_structure.building_demand.surface import Surface
from hub.city_model_structure.building_demand.thermal_zone import ThermalZone
from hub.helpers import constants as cte
class StoreysGeneration:

View File

@ -5,10 +5,8 @@ Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import logging
import math
import sys
from hub.hub_logger import logger
import hub.helpers.constants as cte
from hub.catalog_factories.construction_catalog_factory import ConstructionCatalogFactory
@ -23,6 +21,7 @@ class NrcanPhysicsParameters:
"""
NrcanPhysicsParameters class
"""
def __init__(self, city, divide_in_storeys=False):
self._city = city
self._divide_in_storeys = divide_in_storeys
@ -36,21 +35,16 @@ class NrcanPhysicsParameters:
nrcan_catalog = ConstructionCatalogFactory('nrcan').catalog
for building in city.buildings:
if building.function not in Dictionaries().hub_function_to_nrcan_construction_function.keys():
logger.error(f'Building {building.name} has an unknown building function {building.function}\n')
sys.stderr.write(f'Building {building.name} has an unknown building function {building.function}\n')
logging.error(f'Building {building.name} has an unknown building function {building.function}\n')
continue
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)
except KeyError:
logger.error(f'Building {building.name} has unknown construction archetype for building function: '
f'{function} [{building.function}], building year of construction: {building.year_of_construction} '
f'and climate zone {self._climate_zone}\n')
sys.stderr.write(f'Building {building.name} has unknown construction archetype for building function: '
f'{function} [{building.function}], '
f'building year of construction: {building.year_of_construction} '
f'and climate zone {self._climate_zone}\n')
logging.error(f'Building {building.name} has unknown construction archetype for building function: {function} '
f'[{building.function}], building year of construction: {building.year_of_construction} '
f'and climate zone {self._climate_zone}\n')
continue
# if building has no thermal zones defined from geometry, and the building will be divided in storeys,
@ -82,8 +76,7 @@ class NrcanPhysicsParameters:
for building_archetype in nrcan_archetypes:
construction_period_limits = building_archetype.construction_period.split('_')
if int(construction_period_limits[0]) <= int(year_of_construction) <= int(construction_period_limits[1]):
if (str(function) == str(building_archetype.function)) and \
(climate_zone == str(building_archetype.climate_zone)):
if str(function) == str(building_archetype.function) and climate_zone == str(building_archetype.climate_zone):
return building_archetype
raise KeyError('archetype not found')

View File

@ -5,9 +5,8 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import sys
import logging
from hub.hub_logger import get_logger
from hub.catalog_factories.construction_catalog_factory import ConstructionCatalogFactory
from hub.city_model_structure.building_demand.layer import Layer
from hub.city_model_structure.building_demand.material import Material
@ -15,8 +14,6 @@ from hub.helpers.dictionaries import Dictionaries
from hub.imports.construction.helpers.construction_helper import ConstructionHelper
from hub.imports.construction.helpers.storeys_generation import StoreysGeneration
logger = get_logger()
class NrelPhysicsParameters:
"""
@ -36,24 +33,18 @@ class NrelPhysicsParameters:
nrel_catalog = ConstructionCatalogFactory('nrel').catalog
for building in city.buildings:
if building.function not in Dictionaries().hub_function_to_nrel_construction_function.keys():
logger.error(f'Building {building.name} has unknown function [{building.function}]')
sys.stderr.write(f'Building {building.name} has unknown function [{building.function}]\n')
logging.error(f'Building {building.name} has unknown function [{building.function}]')
continue
if building.function not in Dictionaries().hub_function_to_nrel_construction_function.keys():
logger.error(f'Building {building.name} has unknown function {building.function}\n')
sys.stderr.write(f'Building {building.name} has unknown function {building.function}\n')
logging.error(f'Building {building.name} has unknown function {building.function}\n')
continue
function = Dictionaries().hub_function_to_nrel_construction_function[building.function]
try:
archetype = self._search_archetype(nrel_catalog, function, building.year_of_construction, self._climate_zone)
except KeyError:
logger.error(f'Building {building.name} has unknown construction archetype for building function: '
f'{function} [{building.function}], building year of construction: {building.year_of_construction}'
f' and climate zone {self._climate_zone}\n')
sys.stderr.write(f'Building {building.name} has unknown construction archetype for building function: '
f'{function} [{building.function}], '
f'building year of construction: {building.year_of_construction} '
f'and climate zone {self._climate_zone}\n')
logging.error(f'Building {building.name} has unknown construction archetype for building function: {function} '
f'[{building.function}], building year of construction: {building.year_of_construction}'
f' and climate zone {self._climate_zone}\n')
continue
# if building has no thermal zones defined from geometry, and the building will be divided in storeys,
@ -87,8 +78,7 @@ class NrelPhysicsParameters:
if construction_period_limits[1] == 'PRESENT':
construction_period_limits[1] = 3000
if int(construction_period_limits[0]) <= int(year_of_construction) < int(construction_period_limits[1]):
if (str(function) == str(building_archetype.function)) and \
(climate_zone == str(building_archetype.climate_zone)):
if str(function) == str(building_archetype.function) and climate_zone == str(building_archetype.climate_zone):
return building_archetype
raise KeyError('archetype not found')

View File

@ -6,13 +6,11 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from hub.hub_logger import get_logger
import logging
from hub.helpers.utils import validate_import_export_type
from hub.imports.construction.nrel_physics_parameters import NrelPhysicsParameters
from hub.imports.construction.nrcan_physics_parameters import NrcanPhysicsParameters
logger = get_logger()
class ConstructionFactory:
"""
@ -22,9 +20,9 @@ class ConstructionFactory:
self._handler = '_' + handler.lower().replace(' ', '_')
class_funcs = validate_import_export_type(ConstructionFactory)
if self._handler not in class_funcs:
err_msg = f"Wrong import type [{self._handler}]. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong import type [{self._handler}]. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
self._city = city
def _nrel(self):

View File

@ -91,8 +91,8 @@ class AirSourceHeatPumpParameters:
def _extract_heat_pump_data(heat_pump_capacity_data: Dict) -> [List, List]:
"""
Fetches a list of metric based data for heat pump for various temperature,
eg. cooling capacity data for 12 capacity heat pump
for 6,7,8,9,10 and 11 degree celsius
e.g. cooling capacity data for 12 capacity heat pump
for 6,7,8,9,10 and 11 degree Celsius
:param heat_pump_capacity_data: the heat pump capacity data from the
which the metric specific data is fetched: {List}
:return: List
@ -108,7 +108,7 @@ class AirSourceHeatPumpParameters:
"""
Compute heat output and electrical demand coefficients
from heating and cooling performance data
:param heat_pump_data: a list of heat pump data. eg. cooling capacity
:param heat_pump_data: a list of heat pump data. e.g. cooling capacity
:param data_type: string to indicate if data is cooling performance data
or heating performance data
:return: Tuple[Dict, Dict]

View File

@ -4,15 +4,14 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2023 Concordia CERC group
Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import logging
import sys
from pandas import DataFrame
from hub.hub_logger import logger
from hub.catalog_factories.energy_systems_catalog_factory import EnergySystemsCatalogFactory
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
from hub.city_model_structure.energy_systems.generic_energy_system import GenericEnergySystem
from hub.city_model_structure.energy_systems.generic_generation_system import GenericGenerationSystem
from hub.city_model_structure.energy_systems.generic_distribution_system import GenericDistributionSystem
from hub.helpers.dictionaries import Dictionaries
@ -45,9 +44,7 @@ class MontrealCustomEnergySystemParameters:
try:
archetype = self._search_archetypes(montreal_custom_catalog, archetype_name)
except KeyError:
logger.error(f'Building {building.name} has unknown energy system archetype for system name: {archetype_name}')
sys.stderr.write(f'Building {building.name} has unknown energy system archetype '
f'for system name: {archetype_name}')
logging.error(f'Building {building.name} has unknown energy system archetype for system name: {archetype_name}')
continue
building_systems = []

View File

@ -146,8 +146,9 @@ class WaterToWaterHPParameters:
demand = [i / j for i, j in zip(heat_pump_data['tc'], heat_pump_data['pd'])]
# Compute heat output coefficients
popt, _ = curve_fit(self._objective_function, [heat_pump_data['ewt'], heat_pump_data['lwt'], heat_pump_data['fr']],
demand)
popt, _ = curve_fit(
self._objective_function, [heat_pump_data['ewt'], heat_pump_data['lwt'], heat_pump_data['fr']], demand
)
return popt.tolist()
@staticmethod

View File

@ -5,15 +5,13 @@ Copyright © 2022 Concordia CERC group
Project Coder Pilar Monsalvete pilar.monsalvete@concordi.
Code contributors: Peter Yefi peteryefi@gmail.com
"""
import logging
from pathlib import Path
from hub.imports.energy_systems.air_source_hp_parameters import AirSourceHeatPumpParameters
from hub.imports.energy_systems.water_to_water_hp_parameters import WaterToWaterHPParameters
from hub.helpers.utils import validate_import_export_type
from hub.hub_logger import get_logger
from hub.imports.energy_systems.montreal_custom_energy_system_parameters import MontrealCustomEnergySystemParameters
logger = get_logger()
class EnergySystemsFactory:
"""
@ -26,9 +24,9 @@ class EnergySystemsFactory:
self._handler = '_' + handler.lower().replace(' ', '_')
class_funcs = validate_import_export_type(EnergySystemsFactory)
if self._handler not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong import type. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
self._city = city
self._base_path = base_path

View File

@ -6,6 +6,7 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import geopandas
import logging
from hub.city_model_structure.city import City
from hub.imports.geometry.citygml import CityGml
from hub.imports.geometry.obj import Obj
@ -13,9 +14,6 @@ from hub.imports.geometry.rhino import Rhino
from hub.imports.geometry.gpandas import GPandas
from hub.imports.geometry.geojson import Geojson
from hub.helpers.utils import validate_import_export_type
from hub.hub_logger import get_logger
logger = get_logger()
class GeometryFactory:
@ -33,9 +31,9 @@ class GeometryFactory:
self._file_type = '_' + file_type.lower()
class_funcs = validate_import_export_type(GeometryFactory)
if self._file_type not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong import type. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
self._path = path
self._data_frame = data_frame
self._name_field = name_field

View File

@ -1,25 +0,0 @@
"""
CityGml module parses citygml_classes files and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
import xmltodict
from pathlib import Path
from hub.city_model_structure.fuel import Fuel
class LcaFuel:
def __init__(self, city, base_path):
self._city = city
self._base_path = base_path
self._lca = None
def enrich(self):
self._city.fuels = []
path = Path(self._base_path / 'lca_data.xml').resolve()
with open(path) as xml:
self._lca = xmltodict.parse(xml.read())
for fuel in self._lca["library"]["fuels"]['fuel']:
self._city.fuels.append(Fuel(fuel['@id'], fuel['@name'], fuel['carbon_emission_factor']['#text'],
fuel['carbon_emission_factor']['@unit']))

View File

@ -1,30 +0,0 @@
"""
CityGml module parses citygml_classes files and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
import xmltodict
from pathlib import Path
from hub.city_model_structure.machine import Machine
class LcaMachine:
def __init__(self, city, base_path):
self._city = city
self._base_path = base_path
self._lca = None
def enrich(self):
self._city.machines = []
path = Path(self._base_path / 'lca_data.xml').resolve()
with open(path) as xml:
self._lca = xmltodict.parse(xml.read())
for machine in self._lca["library"]["machines"]['machine']:
self._city.machines.append(Machine(machine['@id'], machine['@name'], machine['work_efficiency']['#text'],
machine['work_efficiency']['@unit'],
machine['energy_consumption_rate']['#text'],
machine['energy_consumption_rate']['@unit'],
machine['carbon_emission_factor']['#text'],
machine['carbon_emission_factor']['@unit']))

View File

@ -1,41 +0,0 @@
"""
CityGml module parses citygml_classes files and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
import xmltodict
from pathlib import Path
from hub.city_model_structure.lca_material import LcaMaterial as LMaterial
class LcaMaterial:
def __init__(self, city, base_path):
self._city = city
self._base_path = base_path
self._lca = None
def enrich(self):
self._city.lca_materials = []
path = Path(self._base_path / 'lca_data.xml').resolve()
with open(path) as xml:
self._lca = xmltodict.parse(xml.read())
for material in self._lca["library"]["building_materials"]['material']:
_material = LMaterial()
_material.type = material['@type']
_material.id = material['@id']
_material.name = material['@name']
_material.density = material['density']['#text']
_material.density_unit = material['density']['@unit']
_material.embodied_carbon = material['embodied_carbon']['#text']
_material.embodied_carbon_unit = material['embodied_carbon']['@unit']
_material.recycling_ratio = material['recycling_ratio']
_material.onsite_recycling_ratio = material['onsite_recycling_ratio']
_material.company_recycling_ratio = material['company_recycling_ratio']
_material.landfilling_ratio = material['landfilling_ratio']
_material.cost = material['cost']['#text']
_material._cost_unit = material['cost']['@unit']
self._city.lca_materials.append(_material)

View File

@ -1,28 +0,0 @@
"""
CityGml module parses citygml_classes files and import the geometry into the city model structure
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
import xmltodict
from pathlib import Path
from hub.city_model_structure.vehicle import Vehicle
class LcaVehicle:
def __init__(self, city, base_path):
self._city = city
self._base_path = base_path
self._lca = None
def enrich(self):
self._city.vehicles = []
path = Path(self._base_path / 'lca_data.xml').resolve()
with open(path) as xml:
self._lca = xmltodict.parse(xml.read())
for vehicle in self._lca["library"]["vehicles"]['vehicle']:
self._city.vehicles.append(Vehicle(vehicle['@id'], vehicle['@name'], vehicle['fuel_consumption_rate']['#text'],
vehicle['fuel_consumption_rate']['@unit'],
vehicle['carbon_emission_factor']['#text'],
vehicle['carbon_emission_factor']['@unit']))

View File

@ -1,64 +0,0 @@
"""
ConstructionFactory (before PhysicsFactory) retrieve the specific construction module for the given region
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
from pathlib import Path
from hub.imports.life_cycle_assessment.lca_fuel import LcaFuel
from hub.imports.life_cycle_assessment.lca_vehicle import LcaVehicle
from hub.imports.life_cycle_assessment.lca_machine import LcaMachine
from hub.imports.life_cycle_assessment.lca_material import LcaMaterial
from hub.helpers.utils import validate_import_export_type
from hub.hub_logger import get_logger
logger = get_logger()
class LifeCycleAssessment:
"""
Life cycle assessment factory class
"""
def __init__(self, handler, city, base_path=None):
if base_path is None:
base_path = Path(Path(__file__).parent.parent / 'data/life_cycle_assessment')
self._handler = '_' + handler.lower().replace(' ', '_')
class_funcs = validate_import_export_type(LifeCycleAssessment)
if self._handler not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
self._city = city
self._base_path = base_path
def _fuel(self):
"""
Enrich the city by adding the fuel carbon information
"""
LcaFuel(self._city, self._base_path).enrich()
def _vehicle(self):
"""
Enrich the city by adding the vehicle carbon information
"""
LcaVehicle(self._city, self._base_path).enrich()
def _machine(self):
"""
Enrich the city by adding the machine carbon information
"""
LcaMachine(self._city, self._base_path).enrich()
def _material(self):
"""
Enrich the city by adding the material carbon information
"""
LcaMaterial(self._city, self._base_path).enrich()
def enrich(self):
"""
Enrich the city given to the class using the class given handler
:return: None
"""
getattr(self, self._handler, lambda: None)()

View File

@ -83,7 +83,9 @@ class InselMonthlyEnergyBalance:
for value in schedule.values:
total_day += value
for day_type in schedule.day_types:
demand = peak_flow * cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY * (service_temperature - cold_water[month])
demand = (
peak_flow * cte.WATER_DENSITY * cte.WATER_HEAT_CAPACITY * (service_temperature - cold_water[month])
)
total_dhw_demand += total_day * cte.DAYS_A_MONTH[day_type][month] * demand
domestic_hot_water_demand.append(total_dhw_demand * area)
@ -94,13 +96,16 @@ class InselMonthlyEnergyBalance:
columns=[cte.INSEL_MEB])
building.lighting_electrical_demand[cte.MONTH] = pd.DataFrame(lighting_demand, columns=[cte.INSEL_MEB])
yearly_lighting_electrical_demand = [sum(lighting_demand)]
building.lighting_electrical_demand[cte.YEAR] = pd.DataFrame(yearly_lighting_electrical_demand,
columns=[cte.INSEL_MEB])
building.lighting_electrical_demand[cte.YEAR] = pd.DataFrame(
yearly_lighting_electrical_demand,
columns=[cte.INSEL_MEB]
)
building.appliances_electrical_demand[cte.MONTH] = pd.DataFrame(appliances_demand, columns=[cte.INSEL_MEB])
yearly_appliances_electrical_demand = [sum(appliances_demand)]
building.appliances_electrical_demand[cte.YEAR] = pd.DataFrame(yearly_appliances_electrical_demand,
columns=[cte.INSEL_MEB])
building.appliances_electrical_demand[cte.YEAR] = pd.DataFrame(
yearly_appliances_electrical_demand,
columns=[cte.INSEL_MEB]
)
def enrich(self):
for building in self._city.buildings:

View File

@ -41,7 +41,8 @@ class SimplifiedRadiosityAlgorithm:
del out[cte.MONTH]
return out
def _get_yearly_mean_values(self, values):
@staticmethod
def _get_yearly_mean_values(values):
return values.mean()
def _read_results(self):
@ -59,7 +60,7 @@ class SimplifiedRadiosityAlgorithm:
if id_building != column.split(':')[1]:
id_building = column.split(':')[1]
if len(header_building) > 0:
self._radiation_list.append(pd.concat([self._month_hour, self._results[header_building]],axis=1))
self._radiation_list.append(pd.concat([self._month_hour, self._results[header_building]], axis=1))
header_building = [column]
else:
header_building.append(column)
@ -93,8 +94,7 @@ class SimplifiedRadiosityAlgorithm:
else:
pd.concat([surface.global_irradiance[cte.HOUR], new_value], axis=1)
if cte.YEAR not in surface.global_irradiance:
surface.global_irradiance[cte.YEAR] = self._get_yearly_mean_values(new_value)
surface.global_irradiance[cte.YEAR] = SimplifiedRadiosityAlgorithm._get_yearly_mean_values(new_value)
self._city.level_of_detail.surface_radiation = 2
for building in self._city.buildings:
building.level_of_detail.surface_radiation = 2

View File

@ -5,16 +5,14 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
import logging
from pathlib import Path
from hub.helpers.utils import validate_import_export_type
from hub.hub_logger import get_logger
from hub.imports.results.simplified_radiosity_algorithm import SimplifiedRadiosityAlgorithm
from hub.imports.results.insel_monthly_energry_balance import InselMonthlyEnergyBalance
from hub.imports.results.insel_heatpump_energy_demand import InselHeatPumpEnergyDemand
logger = get_logger()
class ResultFactory:
"""
@ -35,9 +33,9 @@ class ResultFactory:
self._handler = '_' + handler.lower().replace(' ', '_')
class_funcs = validate_import_export_type(ResultFactory)
if self._handler not in class_funcs:
err_msg = f"Wrong import type [{self._handler}]. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
error_message = f"Wrong import type [{self._handler}]. Valid functions include {class_funcs}"
logging.error(error_message)
raise Exception(error_message)
self._city = city
self._base_path = base_path
self._hp_model = hp_model

View File

@ -1,38 +0,0 @@
"""
Concordia energy consumption
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import pandas as pd
from hub.imports.sensors.concordia_file_report import ConcordiaFileReport
class ConcordiaEnergyConsumption(ConcordiaFileReport):
"""
Concordia energy consumption sensor class
"""
def __init__(self, city, end_point, base_path):
super().__init__(city, end_point, base_path, 'concordia_energy_db.json')
for city_object in city.city_objects:
self._assign_sensor_to_object(city_object)
def _assign_sensor_to_object(self, obj):
for i in range(len(self._city_object)):
if self._city_object[i] == obj.name and self._sensors[i] in self._sensor_point:
building_measures = [self._measures["Date time"], self._measures[self._sensor_point[self._sensors[i]]]]
building_headers = ["Date time", "Energy consumption"]
building_energy_consumption = pd.concat(building_measures, keys=building_headers, axis=1)
"""
sensor = ConcordiaEnergySensor(self._sensors[i])
sensor_exist = False
for j in range(len(obj.sensors)):
if obj.sensors[j].name is sensor.name:
obj.sensors[j].add_period(building_energy_consumption)
sensor_exist = True
break
if not sensor_exist:
sensor.add_period(building_energy_consumption)
obj.sensors.append(sensor)
"""

View File

@ -1,80 +0,0 @@
"""
Concordia file report
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import io
import json
from pathlib import Path
import pandas as pd
class ConcordiaFileReport:
"""
Concordia file report for sensors base class
"""
def __init__(self, city, end_point, base_path, db_file):
self._city_object = []
self._city_objects_cluster = []
self._sensors = []
self._sensor_point = {}
self._city = city
self._end_point = end_point
self._sensor_database = base_path
metadata = True
content = False
with open(Path(base_path / db_file).resolve()) as concordia_db:
self._sensor_database = json.load(concordia_db)
for city_object in self._sensor_database['sensors']:
city_object_name = city_object['city_object']
for sensor in city_object['sensors']:
self._city_object.append(city_object_name)
self._sensors.append(sensor)
buffer = ""
with open(end_point.resolve()) as data:
for line in data:
line = ConcordiaFileReport._clean_line(line)
if metadata:
fields = line.split(',')
if len(fields) > 2:
point = fields[0].replace(":", "")
key = fields[1]
if fields[1] in self._sensors:
self._sensor_point[key] = point
if "End of Report" in line:
content = False
if content:
line = ConcordiaFileReport._merge_date_time(line)
buffer = buffer + line + '\n'
if line == '':
metadata = False
content = True
measures = pd.read_csv(io.StringIO(buffer), sep=',')
measures["Date time"] = pd.to_datetime(measures["Date time"])
self._measures = ConcordiaFileReport._force_format(measures)
@staticmethod
def _clean_line(line):
return line.replace('"', '').replace('\n', '')
@staticmethod
def _merge_date_time(line):
fields = line.split(',')
date = fields[0]
time = fields[1]
if '<>' in date:
return line.replace(f'{date},{time}', 'Date time')
date_fields = date.split('/')
format_date_time = f'"{int(date_fields[2])}-{int(date_fields[0]):02d}-{int(date_fields[1]):02d} {time}"'
return line.replace(f'{date},{time}', format_date_time)
@staticmethod
def _force_format(df):
for head in df.head():
if 'Date time' not in head:
df = df.astype({head: 'float64'})
return df

View File

@ -1,55 +0,0 @@
"""
SensorsFactory retrieve sensors information
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca
"""
from pathlib import Path
from hub.hub_logger import get_logger
from hub.helpers.utils import validate_import_export_type
logger = get_logger()
class SensorsFactory:
"""
UsageFactory class
"""
def __init__(self, handler, city, end_point, base_path=None):
if base_path is None:
base_path = Path(Path(__file__).parent.parent / 'data/sensors')
self._handler = '_' + handler.lower().replace(' ', '_')
class_funcs = validate_import_export_type(SensorsFactory)
if self._handler not in class_funcs:
err_msg = f"Wrong import type. Valid functions include {class_funcs}"
logger.error(err_msg)
raise Exception(err_msg)
self._city = city
self._end_point = end_point
self._base_path = base_path
def _cec(self):
"""
Enrich the city by using concordia energy consumption sensors as data source
"""
raise NotImplementedError('need to be reimplemented')
def _cgf(self):
"""
Enrich the city by using concordia gas flow sensors as data source
"""
raise NotImplementedError('need to be reimplemented')
def _ct(self):
"""
Enrich the city by using concordia temperature sensors as data source
"""
raise NotImplementedError('need to be reimplemented')
def enrich(self):
"""
Enrich the city given to the class using the given sensor handler
:return: None
"""
getattr(self, self._handler, lambda: None)()

Some files were not shown because too many files have changed in this diff Show More