Updated file

This commit is contained in:
Peter Yefi 2022-04-28 10:33:29 -04:00
commit 574cc2e11c
113 changed files with 1408 additions and 1483 deletions

1
.gitignore vendored
View File

@ -5,4 +5,3 @@
/data/energy_systems/heat_pumps/*.csv
/data/energy_systems/heat_pumps/*.insel
.DS_Store
libshortwave.dylib

View File

@ -4,115 +4,50 @@
## Our Pledge
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
community a harassment-free experience for everyone, rejecting any kind of discrimination.
We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
and healthy community.
## Our Standards
Examples of behavior that contributes to a positive environment for our
community include:
* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Demonstrating empathy and kindness toward other people.
* Being respectful of differing opinions, viewpoints, and experiences.
* Giving and gracefully accepting constructive feedback.
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
and learning from the experience.
* Focusing on what is best not just for us as individuals, but for the
overall community
overall community.
Examples of unacceptable behavior include:
* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
advances of any kind.
* Trolling, insulting or derogatory comments, and personal or political attacks.
* Public or private harassment.
* Publishing others' private information, such as a physical or email
address, without their explicit permission
address, without their explicit permission.
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Enforcement Responsibilities
Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.
Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.
professional setting.
## Scope
This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.
posting via an official social media account, participating in a congress
or acting as an appointed representative at an online or offline event.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
guillermo.gutierrezmorote@concordia.ca.
Instances of abusive, harassing, or otherwise unacceptable behavior might be
reported to guillermo.gutierrezmorote@concordia.ca or ursula.eicker@concordia.ca.
All complaints will be reviewed and investigated promptly and fairly.
All community leaders are obligated to respect the privacy and security of the
reporter of any incident.
## Enforcement Guidelines
Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:
### 1. Correction
**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.
**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.
### 2. Warning
**Community Impact**: A violation through a single incident or series
of actions.
**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
### 3. Temporary Ban
**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.
**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.
### 4. Permanent Ban
**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.
**Consequence**: A permanent ban from any sort of public interaction within
the community.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
@ -123,7 +58,3 @@ Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.

View File

@ -0,0 +1,164 @@
# How to create a class for the Central Data Model
This document explains the steps to follow if you want to contribute to the city data model by adding new classes or new attributes.
Use this document after having a clear idea of how your data model should look like already integrated in the Central Data Model.
Please, refer to the [cerclibs.pdf](https://liveconcordia.sharepoint.com/:b:/s/CERC-Next-GenCities-Platform/EfPNAGXexCFOju2sKBr6pNMBcwnvLin1Wio1Ahpfu4cxag?e=rhkdca)
to integrate your data model with the Central Data Model.
## Starting with the basics
- Install all requirements and download the Libs project. [Here](WINDOWS_INSTALL.md) how to do it for windows.
In order to maintain a good quality code, we will work in branches. New codes will need to pass quality standards before being accepted in the main branch.
- Check and follow our [coding style](PYGUIDE.md).
- Dont forget to create unit tests and ensure that the old ones pass normally after your changes.
- Imperative! Document your work using comments in the code and, if needed, adding text files with extended explanations.
If the code doesn't pass the quality review, it will be rejected.
## Adding new parameters to existing classes
Adding a new parameter is an easy task. Open the desired class, for example, CityObject:
![city object](./docs/img_contributing/img_5.png)
Add the name of your new parameter to the list at the constructor and initialize it as desired:
![new parameter](./docs/img_contributing/img_6.png)
At the end of the class, add the corresponding getter and setter. It is very important that they are documented!
![getter and setter](./docs/img_contributing/img_7.png)
You will see that the name of the file (city_object.py) changes from white to blue. That means that your version is different
from that one in the git. Once you finish doing your changes, you should commit and push them to your branch. The name of the file will turn back white.
## Creating a new class
Create a new class in the corresponding folder (if it does not exist, create a new folder ad hoc).
![new folder](./docs/img_contributing/img_0.png)
![new file](./docs/img_contributing/img_1.png)
![add to git](./docs/img_contributing/img_2.png)
And add it to git (the name of the file will turn from red to green).
Every new class must have:
- A header with the following information:
```python
"""
My New Data Class module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Name of Project Coder name.project.coder@concordia.ca
"""
```
- A brief explanation of what it is, what it does, what it can be used for, etc. under its name:
```python
"""
MyNewDataClass class
This class models this and does that
"""
```
- All imported libraries together at the beginning.
![new class](./docs/img_contributing/img_3.png)
A data class contains properties that describe the data model. Therefore, it should be mainly composed by getters and setters.
We would like to avoid having methods in the data classes. All those methods that could be done in the factories must be written there.
The properties can be divided into two groups, those that can be modified during the use of the model, and those that
are set only once and stay unchangeable. The line that divides these to groups is sometimes difficult to draw.
An example to get a taste of this difference could be the following. A building is formed by surfaces, the list of surfaces
is something that defines the building and, for our purposes, is unchangeable. On the other hand, if one of our studies is
to show the effect of the construction on the building demand, we may want to modify this during the run, so the construction
becomes changeable. This is important because those parameters that are static (unchangeable), must be provided for the
initialization and dont have setter, while the others are initialized at None and do have setter:
It is important to highlight that all setters and getters (@property) must have comments to describe the parameters, as shown in the previous image.
![new class getters and setters](./docs/img_contributing/img_4.png)
Once you finish doing your changes, you should commit and push them to your branch. The name of the new files will change from green to white.
## Requesting a merge to the main branch
### Add a plugin
First, it is required to install a plugin for such purpose. We recommend [GitLab Merge Requests](https://plugins.jetbrains.com/plugin/18689-gitlab-merge-requests),
but you are free to choose the one you prefer. In order to install the plug, be sure that you have the latest pycharm version.
Go to Help -> Check for Updates... It will ask you to Update the new version, click on Update and Restart and follow the instructions.
![update pycharm](./docs/img_contributing/img_9.png)
Don't forget to look in the bottom-right corner, there you always find the instructions, warnings, errors, announcements...
![pycharm announcement](./docs/img_contributing/img_10.png)
Once you updated pycharm, go to File -> Settings... -> Plugins and search for _GitLab Merge Request_ and press Install.
![pycharm plugins](./docs/img_contributing/img_11.png)
### Select the project
This step needs to be done only the first time.
Once the plugin is installed, it will appear a new tab at the bottom list called Gitlab Merge Requests as in the image:
![new tab](./docs/img_contributing/img_12.png)
Click on _Clik to discover servers_ and select the gitlab.concordia.ca.
![new server](./docs/img_contributing/img_13.png)
Observe that in the top-right corner of the tab, the message has changed from _No Repository_ to _Repo: /Guille/libs_.
![new repo](./docs/img_contributing/img_14.png)
If you now click on Refresh Merge Request (see previous image), you will get a message asking for a token. As you don't have one yet, click on Create token.
![create token](./docs/img_contributing/img_15.png)
You will be sent to the gitlab repository to create a new token. Give a name to it and check all options.
You are creating a token that has the same permits as your gitlab account has.
![create token in gitlab](./docs/img_contributing/img_16.png)
A new personal access token will be created. Copy and paste it in the Access Token box.
A token is a personal and no-transferable key. Don't show it to anyone!
![copy token](./docs/img_contributing/img_17.png)
![paste token](./docs/img_contributing/img_18.png)
### Create merge request
Every time you want to send some changes to the main branch (merge your branch to the main one)
you will need to follow these steps.
Right clic on the blanc area and select + Create Merge Request.
![new merge request](./docs/img_contributing/img_19.png)
A window will appear with the information of the request:
![request info](./docs/img_contributing/img_20.png)
Clic on Assignees + and look for the project owner, in this case, Guillermo Gutierrez Morote.
Select him as assignee and clic OK.
This action will send a request for the merge. Now wait until this is accepted or rejected. You will receive an email to
the email account you use for gitlab with the answer.
Once the changes are accepted, go back to the main branch by selecting the Git tab (bottom-left). Right clic on Master and select Checkout.
![checkout master](./docs/img_contributing/img_24.png)
Now pull (blue arrow), and delete the branch.
![erase branch](./docs/img_contributing/img_26.png)
Now you have again the same version as in gitlab. For new changes, create a new branch and repeat the process.
## Documentation and authoring
There are two types of authors, that one who created the model and that one who coded it. If they are not the same person,
in the headers of the classes must appear just the name of the coder, who is the reference person to ask anything about the code,
and the one in charge of maintaining it, and interacting with the git.
The author of the data model will appear in the official documentation of the Insel4Cities platform. In those documents,
a larger explanation of the data model should be also added. This official documentation is under development and will be
linked here as soon as it is available.

View File

@ -2,30 +2,40 @@
## Push Request Checklist
Before sending your pull requests, make sure you followed this list.
Before sending your pull requests, make sure you completed this checklist:
- Read [contributing guidelines](CONTRIBUTING.md).
- Read to the end [this document](CONTRIBUTING_EXTERNALS.md).
- Read [Code of Conduct](CODE_OF_CONDUCT.md).
- Check if my changes are consistent with the [guidelines](CONTRIBUTING.md#user-content-general-guidelines-and-philosophy-for-contribution).
- Changes are consistent with the [Coding Style](CONTRIBUTING.md#user-content-coding-style).
- Manually test your code and add [Unit Tests](CONTRIBUTING.md#user-content-testing-best-practices).
- [Document your work](CONTRIBUTING.md#user-content-documentation).
- Check if your changes are consistent with the [Guidelines](CONTRIBUTING_EXTERNALS.md#user-content-general-guidelines-and-philosophy-for-contribution).
- Check if your changes are consistent with the [Coding Style](CONTRIBUTING_EXTERNALS.md#user-content-coding-style).
- Manually test your code and add [Unit Tests](CONTRIBUTING_EXTERNALS.md#user-content-testing-best-practices).
- Be sure that you didn't brake anything by running all unit tests in folder unittests (right click on the folder and click on the green play).
- [Document your work](CONTRIBUTING_EXTERNALS.md#user-content-documentation).
## How to become a contributor and submit your own code
### Contributor License Agreements
CERC Libs is an [LGPL licensed](LICENSE.md) software, so even if we'd love to accept your patches, Before we can take them, please be sure that you are the intellectual property owner of your code and that do you fully understand and respect our software license.
CERC Libs is an [LGPL licensed](LICENSE.md) software, so even if we'd love to accept your patches, before we can take them,
please be sure that you are the intellectual property owner of your code and that do you fully understand and respect our software license.
***NOTE***: Only source code that you own will go into the main repository.
### Contributing code
If you have improvements to CERC Libs or want to extend the functionality, please send us your pull request as seen at [git pull request documentation](https://git-scm.com/docs/git-request-pull)
If you made any changes in your own project, just push them to git. You are the owner, you are the manager.
To do so, first, commit your changes by clicking on the green check at the top-right corner of Pycharm. Add a comment that explains briefly your changes.
Then, pull by clicking on the blue arrow to be sure that there are no conflicts between your version (local) and the one in gitlab (remote).
Once the conflicts are solved and the merge in local is done, push the changes by clicking on the green arrow.
If you have improvements to CERC Libs or want to extend the functionality, please send us your pull request as seen at [git pull request documentation](https://git-scm.com/docs/git-request-pull).
Or ASK GUILLE!!!!
Once the pull requests are approved and pass continuous integration checks, a team member will merge your changes on CERC Libs, and your code will become an integral part of Insel4D platform.
If you prefer to contribute, instead of adding new functionality, you can also take a look at our ticket system and try to fix any of the listed issues.
??????????? SURE WE WANT THIS?
### Contribution guidelines and standards
@ -37,17 +47,17 @@ Before sending your pull request for review, make sure your changes are consiste
* Prove that your code works correctly.
* Guard against future breaking changes to lower the maintenance cost.
* Bug fixes also generally require unit tests, because the presence of bugs usually indicates insufficient test coverage.
* Keep backward compatibility in mind when you change code in CERC Libs, and if you need to broke the backward compatibility, please ensure that you:
* Keep backward compatibility in mind when you change code in CERC Libs, and if you need to brake the backward compatibility, please ensure that you:
* Clearly indicate which features are affected by your changes.
* Technical reasons for the changes.
??????????? SURE WE WANT THIS?
* Tests should follow the
[testing best practices](CONTRIBUTING.md#user-content-testing-best-practices)
[testing best practices](CONTRIBUTING_EXTERNALS.md#user-content-testing-best-practices)
guide.
* [Document your contribution](CONTRIBUTING.md#user-content-documentation)
* [Document your contribution](CONTRIBUTING_EXTERNALS.md#user-content-documentation)
#### License

103
MACOS_INSTALL.md Normal file
View File

@ -0,0 +1,103 @@
# Prepare your environment
Download the latest version of python and Microsoft c++ redistributable
* [Microsoft C++ redistributable](https://www.microsoft.com/en-ca/download/details.aspx?id=48145)
* [Python environment](https://www.python.org/downloads/)
# Get the code
1. First thing you will need is an editor for your source code, that's a personal choice, but we would like to recommend PyCharm community edition, an excellent open-source python editor. [PyCharm Community edition](https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC)
2. Run the installer, and follow the installation instructions for PyCharm, you may change a few options, but the default ones should be fine.
3. Open PyCharm and click on **"Get from Version Control"**.
![pycharm welcome screen](docs/img_windows_install/img_0.png)
You can find it also at VCS -> Get from Version Control...
![pycharm get from version control](docs/img_windows_install/img_6.png)
4. Select Git as the version control, and set the URL to [libs repository](https://rs-loy-gitlab.concordia.ca/Guille/libs.git) as shown in the picture.
At the website, copy the URL from Clone -> Clone with HTTPS.
![pycharm get from version control screen](docs/img_windows_install/img_1.png)
You may need to install Git, by clicking at ***Download and install***.
If that message does not appear is because you have it already installed in your computer.
5. Click Clone to download CERC libs source code. You will end with a project like this:
![pycharm project screen](docs/img_windows_install/img_2.png)
6. To create your working branch you need rights to edit that project. Please, talk to Guillermo (guillermo.gutierrezmorote@concordia.ca)
or Koa (kekoa.wells@concordia.ca) to get those rights. Once you have them, right-click on the project folder (libs) -> Git -> Repository -> Branches:
![create new branch 1](docs/img_windows_install/img_9.png)
And then + New Branch:
![create new branch 2](docs/img_windows_install/img_10.png)
Give a name to your branch and open the tab Git at the down-left corner. Right-click on your branch and push.
![push new branch 1](docs/img_windows_install/img_11.png)
![push new branch 2](docs/img_windows_install/img_12.png)
Check that your branch appears in the Remote list:
![check all set](docs/img_windows_install/img_13.png)
If your branch is there, you are done with this part.
# Configure PyCharm
We use two spaces as a tab instead of standard [pep8](https://www.python.org/dev/peps/pep-0008/) four spaces indentation.
This option can be configured in PyCharm at the settings screen, as shown in the picture.
![pycharm configuration screen](docs/img_windows_install/img_5.png)
# Start your project
1. At our Git (https://rs-loy-gitlab.concordia.ca/), click on New project:
![git new project screen](docs/img_windows_install/img_14.png)
The create a black project with the desired name (remember to follow our ![Coding Style](PYGUIDE.md)).
Be sure that Initialize repository with a README is selected, and ideally, that the Visibility Level is Public.
![git give a name](docs/img_windows_install/img_15.png)
And finally, clone it following the same steps as for ![libs](WINDOWS_INSTALL.md#get-the-code) (steps 3 to 5).
2. Go to project settings and add the libs project to your own, by clicking on Add Content Root:
![pycharm new project screen](docs/img_windows_install/img_4.png)
![pycharm add libs](docs/img_windows_install/img_7.png)
3. Add your first file to your project and click on install requirements to automatically download all the dependencies (in blue at top-right corner).
![pycharm add dependencies](docs/img_windows_install/img_8.png)
4. When all the dependencies are satisfied, you are all set to start importing your first city model.
Add the following code to your main.py
```python
from imports.geometry_factory import GeometryFactory
city = GeometryFactory('citygml', 'myfile.gml').city
```
5. Always remember to push your own project changes as the last thing you do before ending your working day!
First, commit your changes by clicking on the green check at the top-right corner of Pycharm. Add a comment that explains briefly your changes.
Then, pull by clicking on the blue arrow to be sure that there are no conflicts between your version (local) and the remote one (gitlab).
Once the conflicts are solved and the merge in local is done, push the changes by clicking on the green arrow.

View File

@ -3,7 +3,7 @@
Coding style is just how the code looks, it's incredibly personal, and everyone has their style.
Your preferred architectures, variable and function naming style all of then impacts in your code style and how the others read and understand it, so it could become a significant burden if everyone is coding on his own.
Your preferred architectures, variable and function naming style all of then impacts in your code style and how the others read and understand it, so it could become a significant burden if everyone is coding on his or her own.
At CERC, we are following the [PEP8](https://www.python.org/dev/peps/pep-0008/) with two spaces indentation instead of four.
@ -11,17 +11,17 @@ At CERC, we are following the [PEP8](https://www.python.org/dev/peps/pep-0008/)
We use [PyCharm](https://www.jetbrains.com/pycharm/) as an integrated development environment and follow the tool's overall advice but the space indentation, which we set to two spaces instead of default four spaces.
For code analysis, we enforce the usage of [pylint](https://www.pylint.org/) with our own [custom style definition](pylintrc).
For code analysis, we enforce the usage of [pylint](https://www.pylint.org/) with our own [custom style definition](pylintrc). This file will be downloaded with the project the first time you clone it.
## Naming convention.
* Name your folders and files in lowercase.
* Name your folders and files in lowercase and use _ (underscore) to separate words.
* Your class names must start in capital letters and follow the python CapWords pattern.
* Methods and properties that return lists must end in "s".
* Methods and properties that return lists must end in "s". Therefore, those that return single values, must be singular.
* Methods and variables should be lowercase and use _ (underscore) as a word separator.
* Constant names must be all capitals.
* Avoid the usage of "get_" and "set_" methods whenever possible, by using @property and @variable.setter decorators instead.
* "Private" methods, variables and properties start with _ (underscore)
* Avoid the usage of "get_" and "set_" methods whenever it is possible, use @property and @variable.setter decorators instead.
* "Private" methods, variables and properties start with _ (underscore).
## Imports.
Place your imports at the top of the file, after the license and contact information
@ -43,7 +43,7 @@ Ensure that your imports are used and remove any unused.
## Object attributes and methods.
Use properties whenever possible and encapsulate the access to all the calculated object attributes into properties, as shown in the following example.
Use properties whenever it is possible. Encapsulate the access to all the calculated object attributes to avoid recalculating each time the property is called.
```python
@ -56,7 +56,7 @@ Use properties whenever possible and encapsulate the access to all the calculate
```
And like in the following example for read and write properties.
And like in the following example for read and write properties:
```python
@ -70,7 +70,7 @@ And like in the following example for read and write properties.
```
If your method or attribute returns a complex object use type hints as in this example.
If your method or attribute returns a complex object, use type hints as in this example:
```python
@ -79,7 +79,8 @@ If your method or attribute returns a complex object use type hints as in this e
return self._object_changeable_attribute
def new_complex_object(self, first_param, second_param) -> ComplexObject:
return ComplexObject(first_param, second_param, self.property)
other_needed_property = self.other_needed_property
return ComplexObject(first_param, second_param, other_needed_property)
```
@ -96,11 +97,11 @@ Always access your variable through the method and avoid to access directly.
```
### Coments.
### Comments.
#### Code documentation.
All public classes, properties, and methods must have code comments.
All public classes, properties, and methods must have code comments. Code comments start with capital letters and end without period:
```python
@ -115,20 +116,42 @@ All public classes, properties, and methods must have code comments.
@property
def object_attribute(self):
"""
My class object attributes
Get my class object attribute
:return: int
"""
return self._object_attribute
def operation(self, first_param, second_param):
"""
multiplies object_attribute by two
Multiplies object_attribute by two
:return: int
"""
return self.object_attribute * 2
```
Comments at getters and setters always start with Get and Set, and identity the type of variable at return (at getter) or the value (at setter):
```python
@property
def object_attribute(self):
"""
Get object attribute
:return: int
"""
return self._object_attribute
@object_attribute.setter
def object_attribute(self, value):
"""
Set object attribute
:param value: int
"""
self._object_attribute = value
```
Attributes with known units should be explicit in method's comment.
```python

View File

@ -1,20 +1,20 @@
# Libs
Libs is part of Insel4D architecture for the urban simulations, created by the CERC group at Concordia University.
Libs is part of Insel4D architecture for urban simulations, created by the CERC group at Concordia University.
Libs repository contains a set of classes modeling the data for urban environments in the form of:
* city_model_structure
* geometry
* physics
* usages
Libs repository contains:
* city_model_structure: a central data model specifically design to model urban environments. An instance of this is called City.
* catalog_factories: a set of classes to describe catalog structures used by the import and export factories.
* imports: factories to import data from different formats to feed the city model structure (and create a City) or the catalog structures depending on the purpose.
* exports: factories to export desired parts of the City to different formats depending on the purpose, or to export catalogs in a common format.
* data: contains offered data, either for geometry, weather or different types of catalogs.
* other folders to support manipulating data.
Released under [LGPL license](LICENSE.md), will provide an object-oriented, modular approach to urban simulations.
Our aims are:
* involve as many scientists and contributors as possible
* involve as many scientists and contributors as possible.
* provide a complete set of classes that help scientists and students to model urban environments.
Please check the [contributing information](CONTRIBUTING.md) and [code of conduct](CODE_OF_CONDUCT.md) if you want to contribute, and let us know any new feature you may be of interest for you or your team.
Please check the [contributing information](CONTRIBUTING_EXTERNALS.md) and [code of conduct](CODE_OF_CONDUCT.md) if you want to contribute, and let us know any new feature you may be of interest for you or your team.

View File

@ -1,64 +1,103 @@
# Prepare your environment.
# Prepare your environment
Download the latest version of python and Microsoft c++ redistributable
* [Microsoft C++ redistributable](https://www.microsoft.com/en-ca/download/details.aspx?id=48145)
* [Python environment](https://www.python.org/downloads/)
# Get the code.
# Get the code
1. First thing you will need is an editor for your source code, that's a personal choice, but we would like to recommend PyCharm community edition, an excellent open-source python editor.
[PyCharm Community edition](https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC)
1. First thing you will need is an editor for your source code, that's a personal choice, but we would like to recommend PyCharm community edition, an excellent open-source python editor. [PyCharm Community edition](https://www.jetbrains.com/pycharm/download/download-thanks.html?platform=windows&code=PCC)
2. Run the installer, and follow the installation instructions for PyCharm, you may change a few options, but the default ones should be fine.
3. Open PyCharm and click on **"Get from Version Control"**.
![pycharm wellcome screen](./docs/img/img_0.png)
![pycharm welcome screen](docs/img_windows_install/img_0.png)
4. Select Git as the version control and set the URL to [libs repository](https://binarycat.org/git/Guille/libs.git) as shown in the picture.
You can find it also at VCS -> Get from Version Control...
![pycharm get from version control](docs/img_windows_install/img_6.png)
![pycharm get from version control screen](./docs/img/img_1.png)
4. Select Git as the version control, and set the URL to [libs repository](https://rs-loy-gitlab.concordia.ca/Guille/libs.git) as shown in the picture.
At the website, copy the URL from Clone -> Clone with HTTPS.
![pycharm get from version control screen](docs/img_windows_install/img_1.png)
You may need to install Git, by clicking at ***Download and install***.
If that message does not appear is because you have it already installed in your computer.
5. Click Clone to download CERC libs source code.
5. Click Clone to download CERC libs source code. You will end with a project like this:
![pycharm project screen](./docs/img/img_2.png)
you will end with a project like this.
![pycharm project screen](docs/img_windows_install/img_2.png)
6. To create your working branch you need rights to edit that project. Please, talk to Guillermo (guillermo.gutierrezmorote@concordia.ca)
or Koa (kekoa.wells@concordia.ca) to get those rights. Once you have them, right-click on the project folder (libs) -> Git -> Repository -> Branches:
# Configure PyCharm.
![create new branch 1](docs/img_windows_install/img_9.png)
And then + New Branch:
![create new branch 2](docs/img_windows_install/img_10.png)
Give a name to your branch and open the tab Git at the down-left corner. Right-click on your branch and push.
![push new branch 1](docs/img_windows_install/img_11.png)
![push new branch 2](docs/img_windows_install/img_12.png)
Check that your branch appears in the Remote list:
![check all set](docs/img_windows_install/img_13.png)
If your branch is there, you are done with this part.
# Configure PyCharm
We use two spaces as a tab instead of standard [pep8](https://www.python.org/dev/peps/pep-0008/) four spaces indentation.
This option could be configured in PyCharm at the settings screen, as shown in the picture.
This option can be configured in PyCharm at the settings screen, as shown in the picture.
![pycharm configuration screen](./docs/img/img_5.png)
![pycharm configuration screen](docs/img_windows_install/img_5.png)
# Start your project.
# Start your project
1. Click on file new project like in the image.
1. At our Git (https://rs-loy-gitlab.concordia.ca/), click on New project:
![pycharm new project screen](./docs/img/img_3.png)
![git new project screen](docs/img_windows_install/img_14.png)
2. Go to project settings and add the libs project to your own, as shown in the picture.
The create a black project with the desired name (remember to follow our ![Coding Style](PYGUIDE.md)).
Be sure that Initialize repository with a README is selected, and ideally, that the Visibility Level is Public.
![pycharm new project screen](./docs/img/img_4.png)
![git give a name](docs/img_windows_install/img_15.png)
3. Add your first file to your project and click in install requirements to automatically download all the dependencies.
And finally, clone it following the same steps as for ![libs](WINDOWS_INSTALL.md#get-the-code) (steps 3 to 5).
4. When all the dependencies are satisfied, we are good to go to start importing our first model.
2. Go to project settings and add the libs project to your own, by clicking on Add Content Root:
by adding the following code to our main.py
![pycharm new project screen](docs/img_windows_install/img_4.png)
```
from geometry.geometry_factory import GeometryFactory
![pycharm add libs](docs/img_windows_install/img_7.png)
3. Add your first file to your project and click on install requirements to automatically download all the dependencies (in blue at top-right corner).
![pycharm add dependencies](docs/img_windows_install/img_8.png)
4. When all the dependencies are satisfied, you are all set to start importing your first city model.
Add the following code to your main.py
```python
from imports.geometry_factory import GeometryFactory
city = GeometryFactory('citygml', 'myfile.gml').city
```
5. Always remember to push your own project changes as the last thing you do before ending your working day!
First, commit your changes by clicking on the green check at the top-right corner of Pycharm. Add a comment that explains briefly your changes.
Then, pull by clicking on the blue arrow to be sure that there are no conflicts between your version (local) and the remote one (gitlab).
Once the conflicts are solved and the merge in local is done, push the changes by clicking on the green arrow.

View File

@ -5,12 +5,12 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Catalog:
"""
Catalogs base class not implemented instance of the Catalog base class, catalogs will inherit from this class.
Catalogs base class not implemented instance of the Catalog base class, catalog_factories will inherit from this class.
"""
@property
def names(self, category=None):
"""
Base property to return the catalog entries names

View File

@ -0,0 +1,43 @@
from helpers import constants as cte
nrel_to_function = {
'residential': cte.RESIDENTIAL,
'midrise apartment': cte.MID_RISE_APARTMENT,
'high-rise apartment': cte.HIGH_RISE_APARTMENT,
'small office': cte.SMALL_OFFICE,
'medium office': cte.MEDIUM_OFFICE,
'large office': cte.LARGE_OFFICE,
'primary school': cte.PRIMARY_SCHOOL,
'secondary school': cte.SECONDARY_SCHOOL,
'stand-alone retail': cte.STAND_ALONE_RETAIL,
'hospital': cte.HOSPITAL,
'outpatient healthcare': cte.OUT_PATIENT_HEALTH_CARE,
'strip mall': cte.STRIP_MALL,
'supermarket': cte.SUPERMARKET,
'warehouse': cte.WAREHOUSE,
'quick service restaurant': cte.QUICK_SERVICE_RESTAURANT,
'full service restaurant': cte.FULL_SERVICE_RESTAURANT,
'small hotel': cte.SMALL_HOTEL,
'large hotel': cte.LARGE_HOTEL,
'industry': cte.INDUSTRY
}
nrcan_to_function = {
'residential': cte.RESIDENTIAL,
}
reference_standard_to_construction_period = {
'non_standard_dompark': '1900 - 2004',
'ASHRAE 90.1_2004': '2004 - 2009',
'ASHRAE 189.1_2009': '2009 - PRESENT'
}
nrel_surfaces_types_to_hub_types = {
'exterior wall': cte.WALL,
'interior wall': cte.INTERIOR_WALL,
'ground wall': cte.GROUND_WALL,
'exterior slab': cte.GROUND,
'attic floor': cte.ATTIC_FLOOR,
'interior slab': cte.INTERIOR_SLAB,
'roof': cte.ROOF
}

View File

@ -0,0 +1,229 @@
"""
Nrel construction catalog
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import xmltodict
from pathlib import Path
from catalog_factories.catalog import Catalog
from catalog_factories.data_models.construction.window import Window
from catalog_factories.data_models.construction.material import Material
from catalog_factories.data_models.construction.layer import Layer
from catalog_factories.data_models.construction.construction import Construction
from catalog_factories.data_models.construction.content import Content
from catalog_factories.data_models.construction.archetype import Archetype
from catalog_factories.construction.construction_helpers import nrel_to_function
from catalog_factories.construction.construction_helpers import reference_standard_to_construction_period
from catalog_factories.construction.construction_helpers import nrel_surfaces_types_to_hub_types
class NrelCatalog(Catalog):
def __init__(self, path):
archetypes_path = str(Path(path / 'us_archetypes.xml').resolve())
constructions_path = str(Path(path / 'us_constructions.xml').resolve())
with open(constructions_path) as xml:
self._constructions = xmltodict.parse(xml.read(), force_list=('material', 'window', 'construction', 'layer'))
with open(archetypes_path) as xml:
self._archetypes = xmltodict.parse(xml.read(), force_list=('archetype', 'construction'))
self._catalog_windows = self._load_windows()
self._catalog_materials = self._load_materials()
self._catalog_constructions = self._load_constructions()
self._catalog_archetypes = self._load_archetypes()
# store the full catalog data model in self._content
self._content = Content(self._catalog_archetypes,
self._catalog_constructions,
self._catalog_materials,
self._catalog_windows)
def _load_windows(self):
_catalog_windows = []
windows = self._constructions['library']['windows']['window']
for window in windows:
frame_ratio = window['frame_ratio']['#text']
g_value = window['shgc']
overall_u_value = float(window['conductivity']['#text']) / float(window['thickness']['#text'])
name = window['@name']
window_id = window['@id']
_catalog_windows.append(Window(window_id, frame_ratio, g_value, overall_u_value, name))
return _catalog_windows
def _load_materials(self):
_catalog_materials = []
materials = self._constructions['library']['materials']['material']
for material in materials:
material_id = material['@id']
name = material['@name']
solar_absorptance = material['solar_absorptance']['#text']
thermal_absorptance = material['thermal_absorptance']['#text']
visible_absorptance = material['visible_absorptance']['#text']
no_mass = False
thermal_resistance = None,
conductivity = None,
density = None,
specific_heat = None
if 'no_mass' in material and material['no_mass'] == 'true':
no_mass = True
thermal_resistance = material['thermal_resistance']['#text']
else:
conductivity = material['conductivity']['#text']
density = material['density']['#text']
specific_heat = material['specific_heat']['#text']
_material = Material(material_id,
name,
solar_absorptance,
thermal_absorptance,
visible_absorptance,
no_mass,
thermal_resistance,
conductivity,
density,
specific_heat)
_catalog_materials.append(_material)
return _catalog_materials
def _load_constructions(self):
_catalog_constructions = []
constructions = self._constructions['library']['constructions']['construction']
for construction in constructions:
construction_id = construction['@id']
construction_type = nrel_surfaces_types_to_hub_types[construction['@type']]
name = construction['@name']
layers = []
for layer in construction['layers']['layer']:
layer_id = layer['@id']
layer_name = layer['@name']
material_id = layer['material'][0]
thickness = 0
if 'thickness' in layer:
thickness = layer['thickness']['#text']
for material in self._catalog_materials:
if str(material_id) == str(material.id):
layers.append(Layer(layer_id, layer_name, material, thickness))
break
_catalog_constructions.append(Construction(construction_id, construction_type, name, layers))
return _catalog_constructions
def _load_archetypes(self):
_catalog_archetypes = []
archetypes = self._archetypes['archetypes']['archetype']
for archetype in archetypes:
archetype_id = archetype['@id']
function = nrel_to_function[archetype['@building_type']]
name = f"{function} {archetype['@climate_zone']} {archetype['@reference_standard']}"
climate_zone = archetype['@climate_zone']
construction_period = reference_standard_to_construction_period[archetype['@reference_standard']]
average_storey_height = archetype['average_storey_height']['#text']
thermal_capacity = archetype['thermal_capacity']['#text']
extra_loses_due_to_thermal_bridges = archetype['extra_loses_due_to_thermal_bridges']['#text']
indirect_heated_ratio = archetype['indirect_heated_ratio']['#text']
infiltration_rate_for_ventilation_system_off = archetype['infiltration_rate_for_ventilation_system_off']['#text']
infiltration_rate_for_ventilation_system_on = archetype['infiltration_rate_for_ventilation_system_on']['#text']
archetype_constructions = []
for archetype_construction in archetype['constructions']['construction']:
for construction in self._catalog_constructions:
if construction.id == archetype_construction['@id']:
window_ratio = archetype_construction['window_ratio']['#text']
window_id = archetype_construction['window']
_construction = None
_window = None
for window in self._catalog_windows:
if window_id == window.id:
_window = window
break
_construction = Construction(construction.id,
construction.type,
construction.name,
construction.layers,
window_ratio,
_window)
archetype_constructions.append(_construction)
break
_catalog_archetypes.append(Archetype(archetype_id,
name,
function,
climate_zone,
construction_period,
archetype_constructions,
average_storey_height,
thermal_capacity,
extra_loses_due_to_thermal_bridges,
indirect_heated_ratio,
infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on))
return _catalog_archetypes
def names(self, category=None):
"""
Get the catalog elements names
:parm: optional category filter
"""
if category is None:
_names = {'archetypes': [], 'constructions': [], 'materials': [], 'windows': []}
for archetype in self._content.archetypes:
_names['archetypes'].append(archetype.name)
for construction in self._content.constructions:
_names['constructions'].append(construction.name)
for material in self._content.materials:
_names['materials'].append(material.name)
for window in self._content.windows:
_names['windows'].append(window.name)
else:
_names = {category: []}
if category.lower() == 'archetypes':
for archetype in self._content.archetypes:
_names[category].append(archetype.name)
elif category.lower() == 'constructions':
for construction in self._content.constructions:
_names[category].append(construction.name)
elif category.lower() == 'materials':
for material in self._content.materials:
_names[category].append(material.name)
elif category.lower() == 'windows':
for window in self._content.windows:
_names[category].append(window.name)
else:
raise ValueError(f'Unknown category [{category}]')
return _names
def entries(self, category=None):
"""
Get the catalog elements
:parm: optional category filter
"""
if category is None:
return self._content
else:
if category.lower() == 'archetypes':
return self._content.archetypes
elif category.lower() == 'constructions':
return self._content.constructions
elif category.lower() == 'materials':
return self._content.materials
elif category.lower() == 'windows':
return self._content.windows
else:
raise ValueError(f'Unknown category [{category}]')
def get_entry(self, name):
"""
Get one catalog element by names
:parm: entry name
"""
for entry in self._content.archetypes:
if entry.name.lower() == name.lower():
return entry
for entry in self._content.constructions:
if entry.name.lower() == name.lower():
return entry
for entry in self._content.materials:
if entry.name.lower() == name.lower():
return entry
for entry in self._content.windows:
if entry.name.lower() == name.lower():
return entry
raise IndexError(f"{name} doesn't exists in the catalog")

View File

@ -7,10 +7,10 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
from pathlib import Path
from typing import TypeVar
from catalogs.construction.nrel_catalog import NrelCatalog
from catalogs.construction.nrcan_catalog import NrcanCatalog
from catalog_factories.construction.nrel_catalog import NrelCatalog
Catalog = TypeVar('Catalog')
class ConstructionCatalogFactory:
def __init__(self, file_type, base_path=None):
if base_path is None:
@ -18,18 +18,13 @@ class ConstructionCatalogFactory:
self._catalog_type = '_' + file_type.lower()
self._path = base_path
@property
def _nrel(self):
"""
Retrieve NREL catalog
"""
return NrelCatalog(self._path)
def _nrcan(self):
"""
Retrieve NRCAN catalog
"""
return NrcanCatalog(self._city, self._base_path)
@property
def catalog(self) -> Catalog:
"""
@ -37,3 +32,11 @@ class ConstructionCatalogFactory:
:return: Catalog
"""
return getattr(self, self._catalog_type, lambda: None)
@property
def catalog_debug(self) -> Catalog:
"""
Enrich the city given to the class using the class given handler
:return: Catalog
"""
return NrelCatalog(self._path)

View File

@ -5,25 +5,29 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from catalog_factories.data_models.construction.construction import Construction
class Archetype:
def __init__(self, archetype_id,
name,
function,
climate_zone,
construction_period,
constructions,
average_storey_height,
number_of_storeys,
thermal_capacity,
extra_loses_due_to_thermal_bridges,
indirect_heated_ratio,
infiltration_rate_for_ventilation_system_off,
infiltration_rate_for_ventilation_system_on):
self._id = archetype_id
self._name = name
self._function = function
self._climate_zone = climate_zone
self._construction_period = construction_period
self._constructions = constructions
self._average_storey_height = average_storey_height
self._number_of_storeys = number_of_storeys
self._thermal_capacity = thermal_capacity
self._extra_loses_due_to_thermal_bridges = extra_loses_due_to_thermal_bridges
self._indirect_heated_ratio = indirect_heated_ratio
@ -38,6 +42,15 @@ class Archetype:
"""
return self._id
@property
def name(self):
"""
Get archetype name
:return: str
"""
return self._name
@property
def function(self):
"""
Get archetype function
@ -45,6 +58,22 @@ class Archetype:
"""
return self._function
@property
def climate_zone(self):
"""
Get archetype climate zone
:return: str
"""
return self._climate_zone
@property
def constructions(self) -> [Construction]:
"""
Get archetype constructions
:return: [Construction]
"""
return self._constructions
@property
def construction_period(self):
"""
@ -61,14 +90,6 @@ class Archetype:
"""
return self._average_storey_height
@property
def number_of_storeys(self):
"""
Get archetype number of storeys
:return: int
"""
return self._number_of_storeys
@property
def thermal_capacity(self):
"""

View File

@ -4,6 +4,9 @@ SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from catalog_factories.data_models.construction.layer import Layer
from catalog_factories.data_models.construction.window import Window
class Construction:
def __init__(self, construction_id, construction_type, name, layers, window_ratio=None, window=None):
@ -39,7 +42,7 @@ class Construction:
return self._name
@property
def layers(self):
def layers(self) -> [Layer]:
"""
Get construction layers
:return: [layer]
@ -49,15 +52,16 @@ class Construction:
@property
def window_ratio(self):
"""
Get construction window ratio (only when used as archetype construction)
:return: (0..1) or None
Get construction window ratio
:return: float
"""
return self._window_ratio
@property
def window(self):
def window(self) -> Window:
"""
Get construction window (only when used as archetype construction)
:return: window or None
Get construction window
:return: Window
"""
return self._window

View File

@ -5,6 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Content:
def __init__(self, archetypes, constructions, materials, windows):
self._archetypes = archetypes

View File

@ -5,6 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Layer:
def __init__(self, layer_id, name, material, thickness):
self._id = layer_id

View File

@ -5,6 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Material:
def __init__(self, material_id,
name,

View File

@ -0,0 +1,55 @@
"""
Construction catalog window
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Window:
def __init__(self, window_id, frame_ratio, g_value, overall_u_value, name):
self._id = window_id
self._frame_ratio = frame_ratio
self._g_value = g_value
self._overall_u_value = overall_u_value
self._name = name
@property
def id(self):
"""
Get window id
:return: str
"""
return self._id
@property
def name(self):
"""
Get window name
:return: str
"""
return self._name
@property
def frame_ratio(self):
"""
Get window frame ratio
:return: float
"""
return self._frame_ratio
@property
def g_value(self):
"""
Get thermal opening g-value
:return: float
"""
return self._g_value
@property
def overall_u_value(self):
"""
Get thermal opening overall U-value in W/m2K
:return: float
"""
return self._overall_u_value

View File

@ -5,7 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from catalogs.data_models.greenery.soil import Soil as libs_soil
from catalog_factories.data_models.greenery.soil import Soil as libs_soil
class Plant:

View File

@ -5,7 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from catalogs.data_models.greenery.plant import Plant as libs_plant
from catalog_factories.data_models.greenery.plant import Plant as libs_plant
class PlantPercentage(libs_plant):

View File

@ -5,7 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from catalogs.data_models.greenery.plant_percentage import PlantPercentage
from catalog_factories.data_models.greenery.plant_percentage import PlantPercentage
class Vegetation:
def __init__(self, category, vegetation, plant_percentages):

View File

@ -6,14 +6,14 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from pyecore.resources import ResourceSet, URI
from catalogs.greenery.ecore_greenery.greenerycatalog import GreeneryCatalog as gc
from catalogs.catalog import Catalog
from catalog_factories.greenery.ecore_greenery.greenerycatalog import GreeneryCatalog as gc
from catalog_factories.catalog import Catalog
from pathlib import Path
from catalogs.data_models.greenery.vegetation import Vegetation as libs_vegetation
from catalogs.data_models.greenery.plant import Plant as libs_plant
from catalogs.data_models.greenery.soil import Soil as libs_soil
from catalogs.data_models.greenery.plant_percentage import PlantPercentage as libs_pp
from catalogs.data_models.greenery.content import Content as GreeneryContent
from catalog_factories.data_models.greenery.vegetation import Vegetation as libs_vegetation
from catalog_factories.data_models.greenery.plant import Plant as libs_plant
from catalog_factories.data_models.greenery.soil import Soil as libs_soil
from catalog_factories.data_models.greenery.plant_percentage import PlantPercentage as libs_pp
from catalog_factories.data_models.greenery.content import Content as GreeneryContent
class GreeneryCatalog(Catalog):

View File

@ -7,7 +7,7 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
from pathlib import Path
from typing import TypeVar
from catalogs.greenery.greenery_catalog import GreeneryCatalog
from catalog_factories.greenery.greenery_catalog import GreeneryCatalog
Catalog = TypeVar('Catalog')
class GreeneryCatalogFactory:

View File

@ -1,34 +0,0 @@
"""
Greenery catalog
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import xmltodict
from pathlib import Path
from catalogs.catalog import Catalog
class NrelCatalog(Catalog):
def __init__(self, path):
archetypes = str(Path(path / 'us_archetypes.xml').resolve())
constructions = str(Path(path / 'us_constructions.xml').resolve())
with open(constructions) as xml:
self._constructions = xmltodict.parse(xml.read())
with open(archetypes) as xml:
self._archetypes = xmltodict.parse(xml.read())
self._windows = []
self._materials = []
self._constructions = []
self._archetypes = []
@property
def names(self, category=None):
nam
def entries(self, category=None):
pass
def get_entry(self, name):
pass

View File

@ -1,78 +0,0 @@
"""
Construction catalog window
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
class Window:
def __init__(self):
self._frame_ratio = None
self._g_value = None
self._overall_u_value = None
self._construction_name = None
@property
def frame_ratio(self):
"""
Get window frame ratio
:return: None or float
"""
return self._frame_ratio
@frame_ratio.setter
def frame_ratio(self, value):
"""
Set window frame ratio
:param value: float
"""
if value is not None:
self._frame_ratio = float(value)
@property
def g_value(self):
"""
Get thermal opening g-value
:return: None or float
"""
return self._g_value
@g_value.setter
def g_value(self, value):
"""
Set thermal opening g-value
:param value: float
"""
if value is not None:
self._g_value = float(value)
@property
def overall_u_value(self):
"""
Get thermal opening overall U-value in W/m2K
:return: None or float
"""
return self._overall_u_value
@overall_u_value.setter
def overall_u_value(self, value):
"""
Set thermal opening overall U-value in W/m2K
:param value: float
"""
if value is not None:
self._overall_u_value = float(value)
@property
def construction_name(self):
"""
Get thermal opening construction name
"""
return self._construction_name
@construction_name.setter
def construction_name(self, value):
"""
Set thermal opening construction name
"""
self._construction_name = value

View File

@ -33,6 +33,7 @@ class Building(CityObject):
self._roof_type = None
self._internal_zones = None
self._shell = None
self._human_readable_name = None
self._type = 'building'
self._heating = dict()
self._cooling = dict()
@ -322,3 +323,11 @@ class Building(CityObject):
if usage_zone.thermal_control is not None:
return True
return False
@property
def human_readable_name(self):
return self._human_readable_name
@human_readable_name.setter
def human_readable_name(self, value):
self._human_readable_name = value

View File

@ -1,5 +1,5 @@
"""
InternalGains module
InternalGain module
SPDX - License - Identifier: LGPL - 3.0 - or -later
Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
@ -9,9 +9,9 @@ from typing import Union, List
from city_model_structure.attributes.schedule import Schedule
class InternalGains:
class InternalGain:
"""
InternalGains class
InternalGain class
"""
def __init__(self):

View File

@ -5,7 +5,6 @@ Copyright © 2022 Concordia CERC group
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import ast
from typing import Union

View File

@ -11,7 +11,7 @@ from typing import List, Union, TypeVar
from city_model_structure.building_demand.occupancy import Occupancy
from city_model_structure.building_demand.appliances import Appliances
from city_model_structure.building_demand.lighting import Lighting
from city_model_structure.building_demand.internal_gains import InternalGains
from city_model_structure.building_demand.internal_gain import InternalGain
from city_model_structure.attributes.schedule import Schedule
from city_model_structure.building_demand.thermal_control import ThermalControl
from city_model_structure.energy_systems.hvac_system import HvacSystem
@ -25,10 +25,10 @@ class ThermalZone:
"""
ThermalZone class
"""
def __init__(self, thermal_boundaries, parent_internal_zone, volume, floor_area):
def __init__(self, thermal_boundaries, parent_internal_zone, volume, footprint_area):
self._id = None
self._parent_internal_zone = parent_internal_zone
self._floor_area = floor_area
self._footprint_area = footprint_area
self._thermal_boundaries = thermal_boundaries
self._additional_thermal_bridge_u_value = None
self._effective_thermal_capacity = None
@ -38,6 +38,7 @@ class ThermalZone:
self._volume = volume
self._ordinate_number = None
self._view_factors_matrix = None
self._total_floor_area = None
self._usage = None
self._not_detailed_source_mean_annual_internal_gains = None
@ -61,12 +62,12 @@ class ThermalZone:
return self._id
@property
def floor_area(self) -> float:
def footprint_area(self) -> float:
"""
Get thermal zone floor area in m2
Get thermal zone footprint area in m2
:return: float
"""
return self._floor_area
return self._footprint_area
@property
def thermal_boundaries(self) -> List[ThermalBoundary]:
@ -242,15 +243,15 @@ class ThermalZone:
return None
@property
def not_detailed_source_mean_annual_internal_gains(self) -> Union[None, List[InternalGains]]:
def not_detailed_source_mean_annual_internal_gains(self) -> Union[None, List[InternalGain]]:
"""
Get thermal zone internal gains with unknown energy source
:return: [InternalGains]
:return: [InternalGain]
"""
if self._parent_internal_zone.usage_zones is None:
return None
if self._not_detailed_source_mean_annual_internal_gains is None:
_grouped_internal_gain = InternalGains()
_grouped_internal_gain = InternalGain()
_grouped_internal_gain.type = 'grouped internal gains for thermal zone'
_average_internal_gain = 0
_convective_part = 0
@ -311,7 +312,7 @@ class ThermalZone:
def not_detailed_source_mean_annual_internal_gains(self, value):
"""
Set thermal zone internal gains with unknown energy source
:param value: [InternalGains]
:param value: [InternalGain]
"""
self._not_detailed_source_mean_annual_internal_gains = value
@ -563,10 +564,10 @@ class ThermalZone:
_internal_gain.convective_fraction = internal_gain_type.convective_fraction
_internal_gain.schedules = internal_gain_type.schedules
def get_internal_gains(self) -> [InternalGains]:
def get_internal_gains(self) -> [InternalGain]:
"""
Calculates and returns the list of all internal gains defined
:return: InternalGains
:return: [InternalGain]
"""
if self.not_detailed_source_mean_annual_internal_gains is not None:
self._internal_gains = []
@ -575,7 +576,7 @@ class ThermalZone:
if self.occupancy is not None:
if self.occupancy.latent_internal_gain is not None:
_internal_gain = InternalGains()
_internal_gain = InternalGain()
_internal_gain.type = cte.OCCUPANCY
_total_heat_gain = (self.occupancy.sensible_convective_internal_gain
+ self.occupancy.sensible_radiative_internal_gain
@ -596,7 +597,7 @@ class ThermalZone:
self._internal_gains = [_internal_gain]
if self.lighting is not None:
_internal_gain = InternalGains()
_internal_gain = InternalGain()
_internal_gain.type = cte.LIGHTING
self._add_internal_gain(self.lighting, _internal_gain)
if self._internal_gains is not None:
@ -605,7 +606,7 @@ class ThermalZone:
self._internal_gains = [_internal_gain]
if self.appliances is not None:
_internal_gain = InternalGains()
_internal_gain = InternalGain()
_internal_gain.type = cte.APPLIANCES
self._add_internal_gain(self.appliances, _internal_gain)
if self._internal_gains is not None:
@ -682,3 +683,19 @@ class ThermalZone:
:param value: ThermalControl
"""
self._thermal_control = value
@property
def total_floor_area(self):
"""
Get the total floor area of this thermal zone
:return: float
"""
return self._total_floor_area
@total_floor_area.setter
def total_floor_area(self, value):
"""
Set the total floor area of this thermal zone
:param value: float
"""
self._total_floor_area = value

View File

@ -7,7 +7,7 @@ Code contributors: Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
import uuid
from typing import List, Union
from city_model_structure.building_demand.internal_gains import InternalGains
from city_model_structure.building_demand.internal_gain import InternalGain
from city_model_structure.building_demand.occupancy import Occupancy
from city_model_structure.building_demand.lighting import Lighting
from city_model_structure.building_demand.appliances import Appliances
@ -77,10 +77,10 @@ class UsageZone:
self._percentage = float(value)
@property
def not_detailed_source_mean_annual_internal_gains(self) -> List[InternalGains]:
def not_detailed_source_mean_annual_internal_gains(self) -> List[InternalGain]:
"""
Get usage zone internal gains with unknown energy source
:return: [InternalGains]
:return: [InternalGain]
"""
return self._not_detailed_source_mean_annual_internal_gains
@ -88,7 +88,7 @@ class UsageZone:
def not_detailed_source_mean_annual_internal_gains(self, value):
"""
Set usage zone internal gains with unknown energy source
:param value: [InternalGains]
:param value: [InternalGain]
"""
self._not_detailed_source_mean_annual_internal_gains = value

View File

@ -45,14 +45,6 @@ class CityObject:
"""
return self._name
@name.setter
def name(self, value):
"""
Set city object name
:return: str
"""
self._name = value
@property
def lod(self) -> int:
"""

View File

@ -5,6 +5,7 @@ Copyright © 2022 Concordia CERC group
Project Coder Atiya atiya.atiya@mail.concordia.ca
"""
class Machine:
"""
Machine class

View File

@ -1,165 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<archetypes reference_library_building_type="us_library">
<archetype id="1" function="residential" periodOfConstruction="2011-2020">
<constructions>
<construction id="1" type="roof"/>
<construction id="9" type="wall">
<window_ratio units="-">0.2</window_ratio>
<window>33</window>
</construction>
<construction id="17" type="basement_wall"/>
<construction id="25" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.1</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.5</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="2" function="residential" periodOfConstruction="2001-2010">
<constructions>
<construction id="2" type="roof"/>
<construction id="10" type="wall">
<window_ratio units="-">0.2</window_ratio>
<window>34</window>
</construction>
<construction id="18" type="basement_wall"/>
<construction id="26" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.1</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.5</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="3" function="residential" periodOfConstruction="1996-2000">
<constructions>
<construction id="3" type="roof"/>
<construction id="11" type="wall">
<window_ratio units="-">0.2</window_ratio>
<window>34</window>
</construction>
<construction id="19" type="basement_wall"/>
<construction id="27" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.1</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.5</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="4" function="residential" periodOfConstruction="1984-1995">
<constructions>
<construction id="4" type="roof"/>
<construction id="12" type="wall">
<window_ratio units="-">0.2</window_ratio>
<window>34</window>
</construction>
<construction id="20" type="basement_wall"/>
<construction id="28" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.1</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.5</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="5" function="residential" periodOfConstruction="1978-1983">
<constructions>
<construction id="5" type="roof"/>
<construction id="13" type="wall">
<window_ratio units="-">0.13</window_ratio>
<window>34</window>
</construction>
<construction id="21" type="basement_wall"/>
<construction id="29" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.1</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.3</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="6" function="residential" periodOfConstruction="1961-1977">
<constructions>
<construction id="6" type="roof"/>
<construction id="14" type="wall">
<window_ratio units="-">0.13</window_ratio>
<window>34</window>
</construction>
<construction id="22" type="basement_wall"/>
<construction id="30" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.3</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="7" function="residential" periodOfConstruction="1946-1960">
<constructions>
<construction id="7" type="roof"/>
<construction id="15" type="wall">
<window_ratio units="-">0.13</window_ratio>
<window>34</window>
</construction>
<construction id="23" type="basement_wall"/>
<construction id="31" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.3</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="8" function="residential" periodOfConstruction="1900-1945">
<constructions>
<construction id="8" type="roof"/>
<construction id="16" type="wall">
<window_ratio units="-">0.13</window_ratio>
<window>34</window>
</construction>
<construction id="24" type="basement_wall"/>
<construction id="32" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.3</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="9" building_type="office/workshop" periodOfConstruction="2011-2021">
<constructions>
<construction id="8" type="roof"/>
<construction id="16" type="wall">
<window_ratio units="-">0.13</window_ratio>
<window>34</window>
</construction>
<construction id="24" type="basement_wall"/>
<construction id="32" type="floor"/>
</constructions>
<average_storey_height units="m">3</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.3</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
</archetypes>

View File

@ -1,156 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<library name="us_library">
<windows>
<window type="window" id="33" name="global">
<shgc>0.46</shgc>
<g_value>0.46</g_value>
<frame_ratio units="-">0.3</frame_ratio>
<overall_u_value units="W/m2 K">1.8</overall_u_value>
</window>
<window type="window" id="34" name="global">
<shgc>0.52</shgc>
<g_value>0.52</g_value>
<frame_ratio units="-">0.3</frame_ratio>
<overall_u_value units="W/m2 K">2.7</overall_u_value>
</window>
<window type="window" id="35" name="global">
<shgc>0.52</shgc>
<g_value>0.52</g_value>
<frame_ratio units="-">0.3</frame_ratio>
<overall_u_value units="W/m2 K">0.8</overall_u_value>
</window>
</windows>
<constructions>
<construction type="roof" id="1" name="ceiling under attic_post 2010">
<overall_u_value units="W/m2 K">0.18</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="2" name="ceiling under attic_2001-2010">
<overall_u_value units="W/m2 K">0.17</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="3" name="ceiling under attic_1996-2000">
<overall_u_value units="W/m2 K">0.17</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="4" name="ceiling under attic_1984-1995">
<overall_u_value units="W/m2 K">0.253</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="5" name="ceiling under attic_1978-1983">
<overall_u_value units="W/m2 K">0.253</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="6" name="ceiling under attic_1961-1977">
<overall_u_value units="W/m2 K">0.253</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="7" name="ceiling under attic_1946-1960">
<overall_u_value units="W/m2 K">0.253</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
<construction type="roof" id="8" name="ceiling under attic_before 1946">
<overall_u_value units="W/m2 K">0.26</overall_u_value>
<outside_solar_absorptance units="-">0.8</outside_solar_absorptance>
<shortwave_reflectance units="-">0.2</shortwave_reflectance>
</construction>
#wall above grade
<construction type="wall" id="9" name="wall above grade_post 2010">
<overall_u_value units="W/m2 K">0.3</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="10" name="wall above grade_2001-2010">
<overall_u_value units="W/m2 K">0.30</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="11" name="wall above grade_1996-2000">
<overall_u_value units="W/m2 K">0.32</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="12" name="wall above grade_1984-1995">
<overall_u_value units="W/m2 K">0.327</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="13" name="wall above grade_1978-1983">
<overall_u_value units="W/m2 K">0.327</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="14" name="wall above grade_1961-1977">
<overall_u_value units="W/m2 K">0.364</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="15" name="wall above grade_1946-1960">
<overall_u_value units="W/m2 K">0.411</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
<construction type="wall" id="16" name="wall above grade_before 1946">
<overall_u_value units="W/m2 K">0.411</overall_u_value>
<outside_solar_absorptance units="-">0.7</outside_solar_absorptance>
<shortwave_reflectance units="-">0.3</shortwave_reflectance>
</construction>
#wall below grade
<construction type="basement_wall" id="17" name="wall below grade_post 2010">
<overall_u_value units="W/m2 K">0.512</overall_u_value>
</construction>
<construction type="basement_wall" id="18" name="wall below grade_2001-2010">
<overall_u_value units="W/m2 K">0.512</overall_u_value>
</construction>
<construction type="basement_wall" id="19" name="wall below grade_1996-2000">
<overall_u_value units="W/m2 K">0.67</overall_u_value>
</construction>
<construction type="basement_wall" id="20" name="wall below grade_1984-1995">
<overall_u_value units="W/m2 K">0.848</overall_u_value>
</construction>
<construction type="basement_wall" id="21" name="wall below grade_1978-1983">
<overall_u_value units="W/m2 K">1.048</overall_u_value>
</construction>
<construction type="basement_wall" id="22" name="wall below grade_1961-1977">
<overall_u_value units="W/m2 K">1.154</overall_u_value>
</construction>
<construction type="basement_wall" id="23" name="wall below grade_1946-1960">
<overall_u_value units="W/m2 K">1.243</overall_u_value>
</construction>
<construction type="basement_wall" id="24" name="wall below grade_before 1946">
<overall_u_value units="W/m2 K">1.425</overall_u_value>
</construction>
#slab on grade
<construction type="floor" id="25" name="slab on grade_post 2010">
<overall_u_value units="W/m2 K">0.512</overall_u_value>
</construction>
<construction type="floor" id="26" name="slab on grade_2001-2010">
<overall_u_value units="W/m2 K">0.67</overall_u_value>
</construction>
<construction type="floor" id="27" name="slab on grade_1996-2000">
<overall_u_value units="W/m2 K">0.67</overall_u_value>
</construction>
<construction type="floor" id="28" name="slab on grade_1984-1995">
<overall_u_value units="W/m2 K">0.848</overall_u_value>
</construction>
<construction type="floor" id="29" name="slab on grade_1978-1983">
<overall_u_value units="W/m2 K">0.848</overall_u_value>
</construction>
<construction type="floor" id="30" name="slab on grade_1961-1977">
<overall_u_value units="W/m2 K">1.05</overall_u_value>
</construction>
<construction type="floor" id="31" name="slab on grade_1946-1960">
<overall_u_value units="W/m2 K">1.154</overall_u_value>
</construction>
<construction type="floor" id="32" name="slab on grade_before 1946">
<overall_u_value units="W/m2 K">1.154</overall_u_value>
</construction>
</constructions>
</library>

View File

@ -16,7 +16,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">2</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -39,7 +38,7 @@
</construction>
</constructions>
<average_storey_height units="m">3.34</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -62,7 +61,7 @@
</construction>
</constructions>
<average_storey_height units="m">3.34</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -85,7 +84,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.96</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -108,7 +106,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.96</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -131,7 +128,6 @@
</construction>
</constructions>
<average_storey_height units="m">6.1</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -154,7 +150,6 @@
</construction>
</constructions>
<average_storey_height units="m">5.18</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -177,7 +172,6 @@
</construction>
</constructions>
<average_storey_height units="m">6.1</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -200,7 +194,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -223,7 +216,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -246,7 +238,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -269,7 +260,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -292,7 +282,6 @@
</construction>
</constructions>
<average_storey_height units="m">4.27</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -315,7 +304,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -338,7 +326,6 @@
</construction>
</constructions>
<average_storey_height units="m">8.53</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -361,7 +348,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -384,7 +370,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -407,7 +392,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">2</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -430,7 +414,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.34</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -453,7 +436,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.34</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -476,7 +458,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.96</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -499,7 +480,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.96</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -522,7 +502,6 @@
</construction>
</constructions>
<average_storey_height units="m">6.1</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -545,7 +524,6 @@
</construction>
</constructions>
<average_storey_height units="m">5.18</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -568,7 +546,6 @@
</construction>
</constructions>
<average_storey_height units="m">6.1</average_storey_height>
<number_of_storeys units="-">1</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -591,7 +568,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -614,7 +590,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -637,7 +612,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -660,7 +634,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -683,7 +656,6 @@
</construction>
</constructions>
<average_storey_height units="m">4.27</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">130</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -706,7 +678,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -729,7 +700,6 @@
</construction>
</constructions>
<average_storey_height units="m">8.53</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -752,7 +722,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -775,7 +744,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -798,7 +766,6 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
@ -821,12 +788,32 @@
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<number_of_storeys units="-">3</number_of_storeys>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.15</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.50</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
<archetype id="37" building_type="industry" reference_standard="non_standard_dompark" climate_zone="ASHRAE_2004:4A">
<constructions>
<construction id="106" type="exterior wall" >
<window_ratio units="-">0.15</window_ratio>
<window>101</window>
</construction>
<construction id="101" type="exterior slab">
<window_ratio units="-">0</window_ratio>
<window/>
</construction>
<construction id="107" type="roof" >
<window_ratio units="-">0</window_ratio>
<window/>
</construction>
</constructions>
<average_storey_height units="m">3.05</average_storey_height>
<thermal_capacity units="kJ/K m2">90</thermal_capacity>
<extra_loses_due_to_thermal_bridges units="W/K m2">0.05</extra_loses_due_to_thermal_bridges>
<indirect_heated_ratio units="-">0.15</indirect_heated_ratio>
<infiltration_rate_for_ventilation_system_off units="ACH">0.10</infiltration_rate_for_ventilation_system_off>
<infiltration_rate_for_ventilation_system_on units="ACH">0</infiltration_rate_for_ventilation_system_on>
</archetype>
</archetypes>

View File

@ -37,6 +37,15 @@
<back_side_solar_transmittance_at_normal_incidence units="-">0.595043</back_side_solar_transmittance_at_normal_incidence>
<conductivity units="W/m K">0.0134755</conductivity>
</window>
<window id="101" type="window" name="Dbl Blue 6mm/13mm Air - 1001">
<shgc>0.50217</shgc>
<frame_ratio units="-">0</frame_ratio>
<thickness units="m">0.025</thickness>
<solar_transmittance_at_normal_incidence units="-">0.372</solar_transmittance_at_normal_incidence>
<front_side_solar_transmittance_at_normal_incidence units="-">0.95</front_side_solar_transmittance_at_normal_incidence>
<back_side_solar_transmittance_at_normal_incidence units="-">0.929</back_side_solar_transmittance_at_normal_incidence>
<conductivity units="W/m K">0.0487012987012987</conductivity>
</window>
</windows>
<materials>
<material id="1" name="MAT-CC05 8 HW CONCRETE">
@ -186,7 +195,113 @@
<solar_absorptance units="-">0.2</solar_absorptance>
<visible_absorptance units="-">0.2</visible_absorptance>
</material>
<material id="101" name="Urea Formaldehyde Foam_.1327">
<conductivity units="W/m K">0.04</conductivity>
<density units="kg/m3">10.0</density>
<specific_heat units="J/kg K">1400.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.6</solar_absorptance>
<visible_absorptance units="-">0.6</visible_absorptance>
</material>
<material id="102" name="Cast Concrete_.1">
<conductivity units="W/m K">1.13</conductivity>
<density units="kg/m3">2000.0</density>
<specific_heat units="J/kg K">1000.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.6</solar_absorptance>
<visible_absorptance units="-">0.6</visible_absorptance>
</material>
<material id="103" name="Floor/Roof Screed_.07">
<conductivity units="W/m K">0.41</conductivity>
<density units="kg/m3">1200.0</density>
<specific_heat units="J/kg K">840.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.73</solar_absorptance>
<visible_absorptance units="-">0.73</visible_absorptance>
</material>
<material id="104" name="Timber Flooring_.03">
<conductivity units="W/m K">0.14</conductivity>
<density units="kg/m3">650.0</density>
<specific_heat units="J/kg K">1200.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.78</solar_absorptance>
<visible_absorptance units="-">0.78</visible_absorptance>
</material>
<material id="105" name="Cast Concrete (Dense)_.1">
<conductivity units="W/m K">1.4</conductivity>
<density units="kg/m3">2100.0</density>
<specific_heat units="J/kg K">840.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.6</solar_absorptance>
<visible_absorptance units="-">0.6</visible_absorptance>
</material>
<material id="106" name="Gypsum Plasterboard_.025">
<conductivity units="W/m K">0.25</conductivity>
<density units="kg/m3">900.0</density>
<specific_heat units="J/kg K">1000.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.5</solar_absorptance>
<visible_absorptance units="-">0.5</visible_absorptance>
</material>
<material id="107" name="Brick_.25">
<conductivity units="W/m K">0.72</conductivity>
<density units="kg/m3">1920.0</density>
<specific_heat units="J/kg K">840.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.6</solar_absorptance>
<visible_absorptance units="-">0.6</visible_absorptance>
</material>
<material id="108" name="Board insulation (Glass fiber board)_.051">
<conductivity units="W/m K">0.036</conductivity>
<density units="kg/m3">160.0</density>
<specific_heat units="J/kg K">840.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.7</solar_absorptance>
<visible_absorptance units="-">0.7</visible_absorptance>
</material>
<material id="109" name="Metal deck_.01">
<conductivity units="W/m K">45.28</conductivity>
<density units="kg/m3">7824.0</density>
<specific_heat units="J/kg K">500.0</specific_heat>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.7</solar_absorptance>
<visible_absorptance units="-">0.7</visible_absorptance>
</material>
<material id="110" name="LinearBridgingLayer">
<no_mass>true</no_mass>
<thermal_resistance units="m2 K/W">0.6267</thermal_resistance>
<thermal_absorptance units="-">0.01</thermal_absorptance>
<solar_absorptance units="-">0.01</solar_absorptance>
<visible_absorptance units="-">0.01</visible_absorptance>
</material>
<material id="111" name="5_RVAL_2">
<no_mass>true</no_mass>
<thermal_resistance units="m2 K/W">0.15</thermal_resistance>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.7</solar_absorptance>
<visible_absorptance units="-">0.7</visible_absorptance>
</material>
<material id="112" name="6_RVAL_2">
<no_mass>true</no_mass>
<thermal_resistance units="m2 K/W">0.15</thermal_resistance>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.7</solar_absorptance>
<visible_absorptance units="-">0.7</visible_absorptance>
</material>
<material id="113" name="7_RVAL_2">
<no_mass>true</no_mass>
<thermal_resistance units="m2 K/W">0.13</thermal_resistance>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.7</solar_absorptance>
<visible_absorptance units="-">0.7</visible_absorptance>
</material>
<material id="114" name="8_RVAL_2">
<no_mass>true</no_mass>
<thermal_resistance units="m2 K/W">0.13</thermal_resistance>
<thermal_absorptance units="-">0.9</thermal_absorptance>
<solar_absorptance units="-">0.7</solar_absorptance>
<visible_absorptance units="-">0.7</visible_absorptance>
</material>
</materials>
<constructions>
<construction type="exterior slab" id="1" name="189.1-2009 Nonres 4B Exposed Floor Mass">
@ -581,5 +696,114 @@
</layer>
</layers>
</construction>
<construction id="101" type="exterior slab" name="Project ground floor">
<layers>
<layer id="1" name="Layer 1">
<material>101</material>
<thickness units="m">0.1327</thickness>
</layer>
<layer id="2" name="Layer 2">
<material>102</material>
<thickness units="m">0.1</thickness>
</layer>
<layer id="3" name="Layer 3">
<material>103</material>
<thickness units="m">0.07</thickness>
</layer>
<layer id="4" name="Layer 4">
<material>104</material>
<thickness units="m">0.03</thickness>
</layer>
</layers>
</construction>
<construction id="102" type="roof" name="Project internal floor_Reversed">
<layers>
<layer id="1" name="Layer 1">
<material>105</material>
<thickness units="m">0.1</thickness>
</layer>
</layers>
</construction>
<construction id="103" type="interior slab" name="Project internal floor_Reversed_Rev">
<layers>
<layer id="1" name="Layer 1">
<material>105</material>
<thickness units="m">0.1</thickness>
</layer>
</layers>
</construction>
<construction id="104" type="interior wall" name="Project partition">
<layers>
<layer id="1" name="Layer 1">
<material>106</material>
<thickness units="m">0.025</thickness>
</layer>
<layer id="2" name="Layer 2">
<material>111</material>
</layer>
<layer id="3" name="Layer 3">
<material>106</material>
<thickness units="m">0.025</thickness>
</layer>
</layers>
</construction>
<construction id="105" type="interior wall" name="Project partition_Rev">
<layers>
<layer id="1" name="Layer 1">
<material>106</material>
<thickness units="m">0.025</thickness>
</layer>
<layer id="2" name="Layer 2">
<material>112</material>
</layer>
<layer id="3" name="Layer 3">
<material>106</material>
<thickness units="m">0.025</thickness>
</layer>
</layers>
</construction>
<construction id="106" type="exterior wall" name="Dompark Wall">
<layers>
<layer id="1" name="Layer 1">
<material>107</material>
<thickness units="m">0.25</thickness>
</layer>
<layer id="2" name="Layer 2">
<material>113</material>
</layer>
<layer id="3" name="Layer 3">
<material>107</material>
<thickness units="m">0.25</thickness>
</layer>
</layers>
</construction>
<construction id="107" type="roof" name="Dompark Roof">
<layers>
<layer id="1" name="Layer 1">
<material>108</material>
<thickness units="m">0.051</thickness>
</layer>
<layer id="2" name="Layer 2">
<material>109</material>
<thickness units="m">0.01</thickness>
</layer>
</layers>
</construction>
<construction id="108" type="interior slab" name="Project internal floor">
<layers>
<layer id="1" name="Layer 1">
<material>105</material>
<thickness units="m">0.1</thickness>
</layer>
</layers>
</construction>
<construction id="109" type="roof" name="Project internal floor_Rev">
<layers>
<layer id="1" name="Layer 1">
<material>105</material>
<thickness units="m">0.1</thickness>
</layer>
</layers>
</construction>
</constructions>
</library>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 454 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 KiB

View File

@ -27,7 +27,7 @@ class AirSourceHPExport(HeatPumpExport):
template_path = (base_path / tmp_file)
super().__init__(base_path, city, output_path, template_path)
def _extract_model_coff(self, hp_model: str, data_type='heat') -> Union[Tuple[List, List], None]:
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

View File

@ -278,7 +278,7 @@ class EnergyAde:
'energy:type': 'grossFloorArea',
'energy:value': {
'@uom': 'm2',
'#text': f'{thermal_zone.floor_area}'
'#text': f'{thermal_zone.footprint_area}'
}
}
},

View File

@ -7,6 +7,7 @@ Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concord
Soroush Samareh Abolhassani soroush.samarehabolhassani@mail.concordia.ca
"""
from pathlib import Path
from geomeppy import IDF
import helpers.constants as cte
@ -24,6 +25,7 @@ class Idf:
_ROUGHNESS = 'MediumRough'
_HOURLY_SCHEDULE = 'SCHEDULE:DAY:HOURLY'
_COMPACT_SCHEDULE = 'SCHEDULE:COMPACT'
_FILE_SCHEDULE = 'SCHEDULE:FILE'
_ZONE = 'ZONE'
_LIGHTS = 'LIGHTS'
_PEOPLE = 'PEOPLE'
@ -47,13 +49,38 @@ class Idf:
# todo: make an enum for all the usage types
cte.RESIDENTIAL: 'residential_building'
}
idf_type_limits = {
cte.ON_OFF: 'on/off',
cte.FRACTION: 'Fraction',
cte.ANY_NUMBER: 'Any Number',
'continuous': 'Continuous',
'discrete': 'Discrete'
cte.CONTINUOUS: 'Continuous',
cte.DISCRETE: 'Discrete'
}
idf_day_types = {
cte.MONDAY: 'Monday',
cte.TUESDAY: 'Tuesday',
cte.WEDNESDAY: 'Wednesday',
cte.THURSDAY: 'Thursday',
cte.FRIDAY: 'Friday',
cte.SATURDAY: 'Saturday',
cte.SUNDAY: 'Sunday',
cte.HOLIDAY: 'Holidays',
cte.WINTER_DESIGN_DAY: 'WinterDesignDay',
cte.SUMMER_DESIGN_DAY: 'SummerDesignDay'
}
idf_schedule_types = {
'compact': 'Compact',
cte.DAY: 'Day',
cte.WEEK: 'Week',
cte.YEAR: 'Year',
'file': 'File'
}
idf_schedule_data_type = {
'compact': 'Compact',
'hourly': 'Hourly',
'daily': 'Daily',
'interval': 'Interval',
'list': 'List',
}
def __init__(self, city, output_path, idf_file_path, idd_file_path, epw_file_path, export_type="Surfaces"):
@ -121,68 +148,55 @@ class Idf:
Visible_Absorptance=layer.material.visible_absorptance
)
def _add_daily_schedule(self, usage, schedule):
_schedule = self._idf.newidfobject(self._COMPACT_SCHEDULE, Name=f'{schedule.type} schedules {usage}')
_val = schedule.values
_schedule.Schedule_Type_Limits_Name = self.idf_type_limits[schedule.data_type.lower()]
_schedule.Field_1 = "Through: 12/31"
_schedule.Field_2 = "For: AllDays"
_schedule.Field_3 = "Until: 01:00"
_schedule.Field_4 = _val[0]
_schedule.Field_5 = "Until: 02:00"
_schedule.Field_6 = _val[1]
_schedule.Field_7 = "Until: 03:00"
_schedule.Field_8 = _val[2]
_schedule.Field_9 = "Until: 04:00"
_schedule.Field_10 = _val[3]
_schedule.Field_11 = "Until: 05:00"
_schedule.Field_12 = _val[4]
_schedule.Field_13 = "Until: 06:00"
_schedule.Field_14 = _val[5]
_schedule.Field_15 = "Until: 07:00"
_schedule.Field_16 = _val[6]
_schedule.Field_17 = "Until: 08:00"
_schedule.Field_18 = _val[7]
_schedule.Field_19 = "Until: 09:00"
_schedule.Field_20 = _val[8]
_schedule.Field_21 = "Until: 10:00"
_schedule.Field_22 = _val[9]
_schedule.Field_23 = "Until: 11:00"
_schedule.Field_24 = _val[10]
_schedule.Field_25 = "Until: 12:00"
_schedule.Field_26 = _val[11]
_schedule.Field_27 = "Until: 13:00"
_schedule.Field_28 = _val[12]
_schedule.Field_29 = "Until: 14:00"
_schedule.Field_30 = _val[13]
_schedule.Field_31 = "Until: 15:00"
_schedule.Field_32 = _val[14]
_schedule.Field_33 = "Until: 16:00"
_schedule.Field_34 = _val[15]
_schedule.Field_35 = "Until: 17:00"
_schedule.Field_36 = _val[16]
_schedule.Field_37 = "Until: 18:00"
_schedule.Field_38 = _val[17]
_schedule.Field_39 = "Until: 19:00"
_schedule.Field_40 = _val[18]
_schedule.Field_41 = "Until: 20:00"
_schedule.Field_42 = _val[19]
_schedule.Field_43 = "Until: 21:00"
_schedule.Field_44 = _val[20]
_schedule.Field_45 = "Until: 22:00"
_schedule.Field_46 = _val[21]
_schedule.Field_47 = "Until: 23:00"
_schedule.Field_48 = _val[22]
_schedule.Field_49 = "Until: 24:00"
_schedule.Field_50 = _val[23]
def _add_standard_compact_hourly_schedule(self, usage, schedules):
_kwargs = {'Name': f'{schedules[0].type} schedules {usage}',
'Schedule_Type_Limits_Name': self.idf_type_limits[schedules[0].data_type],
'Field_1': 'Through: 12/31'}
for j, schedule in enumerate(schedules):
_val = schedule.values
_new_field = ''
for day_type in schedule.day_types:
_new_field += f' {self.idf_day_types[day_type]}'
_kwargs[f'Field_{j * 25 + 2}'] = f'For:{_new_field}'
for i in range(0, len(_val)):
_kwargs[f'Field_{j * 25 + 3 + i}'] = f'Until: {i + 1:02d}:00,{_val[i]}'
self._idf.newidfobject(self._COMPACT_SCHEDULE, **_kwargs)
def _add_schedule(self, usage, new_schedule):
for schedule in self._idf.idfobjects[self._HOURLY_SCHEDULE]:
if schedule.Name == f'{new_schedule.type} schedules {usage}':
return
if new_schedule.time_range == "day":
return self._add_daily_schedule(usage, new_schedule)
return
def _add_non_hourly_schedule(self, usage, schedules):
raise NotImplementedError
def _write_schedules_file(self, usage, schedule):
file_name = str((Path(self._output_path) / f'{schedule.type} schedules {usage}.dat').resolve())
with open(file_name, 'w') as file:
for value in schedule.values:
file.write(f'{str(value)},\n')
return file_name
def _add_file_schedule(self, usage, schedule, file_name):
print(file_name)
_schedule = self._idf.newidfobject(self._FILE_SCHEDULE, Name=f'{schedule.type} schedules {usage}')
_schedule.Schedule_Type_Limits_Name = self.idf_type_limits[schedule.data_type]
_schedule.File_Name = file_name
_schedule.Column_Number = 1
_schedule.Rows_to_Skip_at_Top = 0
_schedule.Number_of_Hours_of_Data = 8760
_schedule.Column_Separator = 'Comma'
_schedule.Interpolate_to_Timestep = 'No'
_schedule.Minutes_per_Item = 60
def _add_schedules(self, usage, new_schedules, schedule_from_file=False):
if schedule_from_file:
new_schedule = new_schedules[0]
for schedule in self._idf.idfobjects[self._FILE_SCHEDULE]:
if schedule.Name == f'{new_schedule.type} schedules {usage}':
return
file_name = self._write_schedules_file(usage, new_schedule)
return self._add_file_schedule(usage, new_schedule, file_name)
else:
for schedule in self._idf.idfobjects[self._HOURLY_SCHEDULE]:
if schedule.Name == f'{new_schedules[0].type} schedules {usage}':
return
return self._add_standard_compact_hourly_schedule(usage, new_schedules)
def _add_construction(self, thermal_boundary):
for construction in self._idf.idfobjects[self._CONSTRUCTION]:
@ -199,18 +213,18 @@ class Idf:
self._add_material(layer)
layers = thermal_boundary.layers
# The constructions should have at least one layer
_kwargs = {"Name": thermal_boundary.construction_name, "Outside_Layer": layers[0].material.name}
_kwargs = {'Name': thermal_boundary.construction_name, 'Outside_Layer': layers[0].material.name}
for i in range(1, len(layers) - 1):
_kwargs[f'Layer_{i + 1}'] = layers[1].material.name
self._idf.newidfobject(self._CONSTRUCTION, **_kwargs)
def _add_zone(self, usage_zone, thermal_zone_volume):
def _add_zone(self, thermal_zone):
for zone in self._idf.idfobjects['ZONE']:
if zone.Name == usage_zone.id:
if zone.Name == thermal_zone.id:
return
# todo: what do we need to define a zone in energy plus?
self._idf.newidfobject(self._ZONE, Name=usage_zone.id, Volume=thermal_zone_volume * usage_zone.percentage)
self._add_heating_system(usage_zone)
self._idf.newidfobject(self._ZONE, Name=thermal_zone.id, Volume=thermal_zone.volume)
self._add_heating_system(thermal_zone)
def _add_thermostat(self, usage_zone):
thermostat_name = f'Thermostat {usage_zone.usage}'
@ -222,32 +236,32 @@ class Idf:
Constant_Heating_Setpoint=usage_zone.thermal_control.mean_heating_set_point,
Constant_Cooling_Setpoint=usage_zone.thermal_control.mean_cooling_set_point)
def _add_heating_system(self, usage_zone):
def _add_heating_system(self, thermal_zone):
for air_system in self._idf.idfobjects[self._IDEAL_LOAD_AIR_SYSTEM]:
if air_system.Zone_Name == usage_zone.id:
if air_system.Zone_Name == thermal_zone.id:
return
thermostat = self._add_thermostat(usage_zone)
thermostat = self._add_thermostat(thermal_zone)
self._idf.newidfobject(self._IDEAL_LOAD_AIR_SYSTEM,
Zone_Name=usage_zone.id,
System_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {usage_zone.usage}',
Heating_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {usage_zone.usage}',
Cooling_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {usage_zone.usage}',
Zone_Name=thermal_zone.id,
System_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage}',
Heating_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage}',
Cooling_Availability_Schedule_Name=f'HVAC AVAIL SCHEDULES {thermal_zone.usage}',
Template_Thermostat_Name=thermostat.Name)
def _add_occupancy(self, usage_zone, area):
number_of_people = area * usage_zone.occupancy.occupancy_density
fraction_radiant = usage_zone.occupancy.sensible_radiative_internal_gain / \
(usage_zone.occupancy.sensible_radiative_internal_gain +
usage_zone.occupancy.sensible_convective_internal_gain +
usage_zone.occupancy.latent_internal_gain)
def _add_occupancy(self, thermal_zone):
number_of_people = thermal_zone.occupancy.occupancy_density * thermal_zone.total_floor_area
fraction_radiant = thermal_zone.occupancy.sensible_radiative_internal_gain / \
(thermal_zone.occupancy.sensible_radiative_internal_gain +
thermal_zone.occupancy.sensible_convective_internal_gain +
thermal_zone.occupancy.latent_internal_gain)
self._idf.newidfobject(self._PEOPLE,
Name=f'{usage_zone.id}_occupancy',
Zone_or_ZoneList_Name=usage_zone.id,
Number_of_People_Schedule_Name=f'Occupancy schedules {usage_zone.usage}',
Name=f'{thermal_zone.id}_occupancy',
Zone_or_ZoneList_Name=thermal_zone.id,
Number_of_People_Schedule_Name=f'Occupancy schedules {thermal_zone.usage}',
Number_of_People_Calculation_Method="People",
Number_of_People=number_of_people,
Fraction_Radiant=fraction_radiant,
Activity_Level_Schedule_Name=f'Occupancy schedules {usage_zone.usage}'
Activity_Level_Schedule_Name=f'Occupancy schedules {thermal_zone.usage}'
)
def _add_equipment(self, usage_zone):
@ -286,29 +300,17 @@ class Idf:
for thermal_zone in internal_zone.thermal_zones:
for thermal_boundary in thermal_zone.thermal_boundaries:
self._add_construction(thermal_boundary)
for usage_zone in thermal_zone.usage_zones:
usage = usage_zone.usage
usage_zone_area = thermal_zone.floor_area * usage_zone.percentage
usage = thermal_zone.usage
# todo: infiltration can be written with two values (system on and system off) in E+? Or just as schedule?
# self._add_schedule(usage, "Infiltration")
self._add_schedules(usage, thermal_zone.lighting.schedules)
self._add_schedules(usage, thermal_zone.occupancy.occupancy_schedules, schedule_from_file=True)
self._add_schedules(usage, thermal_zone.thermal_control.hvac_availability_schedules)
# todo: infiltration can be written with two values (system on and system off) in E+? Or just as schedule?
# self._add_schedule(usage, "Infiltration")
for schedule in usage_zone.lighting.schedules:
for day_type in schedule.day_types:
if day_type == cte.MONDAY:
self._add_schedule(usage, schedule)
for schedule in usage_zone.occupancy.occupancy_schedules:
for day_type in schedule.day_types:
if day_type == cte.MONDAY:
self._add_schedule(usage, usage_zone.occupancy.occupancy_schedules)
for schedule in usage_zone.thermal_control.hvac_availability_schedules:
for day_type in schedule.day_types:
if day_type == cte.MONDAY:
self._add_schedule(usage, schedule)
self._add_zone(usage_zone, thermal_zone.volume)
self._add_heating_system(usage_zone)
self._add_zone(thermal_zone)
self._add_heating_system(thermal_zone)
# self._add_infiltration(usage_zone)
self._add_occupancy(usage_zone, usage_zone_area)
self._add_occupancy(thermal_zone)
if self._export_type == "Surfaces":
self._add_surfaces(building)
@ -359,10 +361,9 @@ class Idf:
for thermal_zone in internal_zone.thermal_zones:
for boundary in thermal_zone.thermal_boundaries:
idf_surface_type = self.idf_surfaces[boundary.parent_surface.type]
for usage_zone in thermal_zone.usage_zones:
surface = self._idf.newidfobject(self._SURFACE, Name=f'{boundary.parent_surface.name}',
Surface_Type=idf_surface_type, Zone_Name=usage_zone.id,
Construction_Name=boundary.construction_name)
coordinates = self._matrix_to_list(boundary.parent_surface.solid_polygon.coordinates,
self._city.lower_corner)
surface.setcoords(coordinates)
surface = self._idf.newidfobject(self._SURFACE, Name=f'{boundary.parent_surface.name}',
Surface_Type=idf_surface_type, Zone_Name=thermal_zone.id,
Construction_Name=boundary.construction_name)
coordinates = self._matrix_to_list(boundary.parent_surface.solid_polygon.coordinates,
self._city.lower_corner)
surface.setcoords(coordinates)

View File

@ -45,6 +45,9 @@ ON_OFF = 'on_off'
TEMPERATURE = 'temperature'
HUMIDITY = 'humidity'
CONTROL_TYPE = 'control_type'
CONTINUOUS = 'continuous'
DISCRETE = 'discrete'
CONSTANT = 'constant'
# surface types
WALL = 'Wall'

View File

@ -1,83 +0,0 @@
"""
CaPhysicsParameters import the construction and material information for Canada
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 sys
from imports.construction.helpers.construction_helper import ConstructionHelper
from imports.construction.nrel_physics_interface import NrelPhysicsInterface
class CaPhysicsParameters(NrelPhysicsInterface):
"""
CaPhysicsParameters class
"""
def __init__(self, city, base_path):
super().__init__(base_path, 'ca_constructions_reduced.xml', 'ca_archetypes_reduced.xml')
self._city = city
def enrich_buildings(self):
"""
Returns the city with the construction parameters assigned to the buildings
:return: None
"""
city = self._city
# it is assumed that all buildings have the same archetypes' keys
for building in city.buildings:
try:
archetype = self._search_archetype(ConstructionHelper.nrcan_from_libs_function(building.function),
building.year_of_construction)
except KeyError:
sys.stderr.write(f'Building {building.name} has unknown archetype for building function: '
f'{ConstructionHelper.nrcan_from_libs_function(building.function)} '
f'and building year of construction: {building.year_of_construction}\n')
return
# if building has no thermal zones defined from geometry, one thermal zone per storey is assigned
if len(building.internal_zones) == 1:
if building.internal_zones[0].thermal_zones is None:
self._create_storeys(building, archetype)
self._assign_values(building.internal_zones, archetype)
for internal_zone in building.internal_zones:
for thermal_zone in internal_zone.thermal_zones:
self._calculate_view_factors(thermal_zone)
def _search_archetype(self, function, year_of_construction):
for building_archetype in self._building_archetypes:
a_ft = str(building_archetype.archetype_keys['@function'])
a_pc = str(building_archetype.archetype_keys['@periodOfConstruction'])
a_yc1 = int(a_pc.split(sep='-')[0])
a_yc2 = int(a_pc.split(sep='-')[1])
if a_ft == str(function):
if a_yc1 <= int(year_of_construction) <= a_yc2:
return building_archetype
return None
def _assign_values(self, internal_zones, archetype):
for internal_zone in internal_zones:
for thermal_zone in internal_zone.thermal_zones:
thermal_zone.additional_thermal_bridge_u_value = archetype.additional_thermal_bridge_u_value
thermal_zone.effective_thermal_capacity = archetype.effective_thermal_capacity
thermal_zone.indirectly_heated_area_ratio = archetype.indirectly_heated_area_ratio
thermal_zone.infiltration_rate_system_on = archetype.infiltration_rate_system_on
thermal_zone.infiltration_rate_system_off = archetype.infiltration_rate_system_off
for thermal_boundary in thermal_zone.thermal_boundaries:
construction_type = ConstructionHelper.nrcan_construction_types[thermal_boundary.type]
thermal_boundary_archetype = self._search_construction_in_archetype(archetype, construction_type)
thermal_boundary.u_value = thermal_boundary_archetype.overall_u_value
thermal_boundary.outside_solar_absorptance = thermal_boundary_archetype.outside_solar_absorptance
thermal_boundary.construction_name = thermal_boundary_archetype.construction_name
try:
thermal_boundary.window_ratio = thermal_boundary_archetype.window_ratio
except ValueError:
# This is the normal operation way when the windows are defined in the geometry
continue
if thermal_boundary.thermal_openings is not None:
for thermal_opening in thermal_boundary.thermal_openings:
if thermal_boundary_archetype.thermal_opening_archetype is not None:
thermal_opening_archetype = thermal_boundary_archetype.thermal_opening_archetype
thermal_opening.frame_ratio = thermal_opening_archetype.frame_ratio
thermal_opening.g_value = thermal_opening_archetype.g_value
thermal_opening.overall_u_value = thermal_opening_archetype.overall_u_value

View File

@ -71,42 +71,6 @@ class ConstructionHelper:
cte.ROOF: 'roof'
}
# NRCAN
_function_to_nrcan = {
cte.RESIDENTIAL: 'residential',
cte.SINGLE_FAMILY_HOUSE: 'residential',
cte.MULTI_FAMILY_HOUSE: 'residential',
cte.ROW_HOSE: 'residential',
cte.MID_RISE_APARTMENT: 'residential',
cte.HIGH_RISE_APARTMENT: 'residential',
cte.SMALL_OFFICE: cte.SMALL_OFFICE,
cte.MEDIUM_OFFICE: cte.MEDIUM_OFFICE,
cte.LARGE_OFFICE: cte.LARGE_OFFICE,
cte.PRIMARY_SCHOOL: cte.PRIMARY_SCHOOL,
cte.SECONDARY_SCHOOL: cte.SECONDARY_SCHOOL,
cte.STAND_ALONE_RETAIL: cte.STAND_ALONE_RETAIL,
cte.HOSPITAL: cte.HOSPITAL,
cte.OUT_PATIENT_HEALTH_CARE: cte.OUT_PATIENT_HEALTH_CARE,
cte.STRIP_MALL: cte.STRIP_MALL,
cte.SUPERMARKET: cte.SUPERMARKET,
cte.WAREHOUSE: cte.WAREHOUSE,
cte.QUICK_SERVICE_RESTAURANT: cte.QUICK_SERVICE_RESTAURANT,
cte.FULL_SERVICE_RESTAURANT: cte.FULL_SERVICE_RESTAURANT,
cte.SMALL_HOTEL: cte.SMALL_HOTEL,
cte.LARGE_HOTEL: cte.LARGE_HOTEL
}
nrcan_window_types = [cte.WINDOW]
nrcan_construction_types = {
cte.WALL: 'wall',
cte.GROUND_WALL: 'basement_wall',
cte.GROUND: 'floor',
cte.ATTIC_FLOOR: 'attic floor',
cte.INTERIOR_SLAB: 'floor',
cte.ROOF: 'roof'
}
@staticmethod
def nrel_from_libs_function(function):
"""
@ -154,15 +118,3 @@ class ConstructionHelper:
"""
reference_city = ConstructionHelper.city_to_reference_city(city)
return ConstructionHelper._reference_city_to_nrel_climate_zone[reference_city]
@staticmethod
def nrcan_from_libs_function(function):
"""
Get NREL function from the given internal function key
:param function: str
:return: str
"""
try:
return ConstructionHelper._function_to_nrcan[function]
except KeyError:
sys.stderr.write('Error: keyword not found.\n')

View File

@ -5,12 +5,7 @@ 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 xmltodict
from imports.construction.data_classes.building_achetype import BuildingArchetype as nba
from imports.construction.data_classes.thermal_boundary_archetype import ThermalBoundaryArchetype as ntba
from imports.construction.data_classes.thermal_opening_archetype import ThermalOpeningArchetype as ntoa
from imports.construction.data_classes.layer_archetype import LayerArchetype as nla
from imports.construction.helpers.storeys_generation import StoreysGeneration
@ -19,173 +14,6 @@ class NrelPhysicsInterface:
NrelPhysicsInterface abstract class
"""
def __init__(self, base_path, constructions_file='us_constructions.xml',
archetypes_file='us_archetypes.xml'):
self._building_archetypes = []
# load construction Library, CERC-NREL format
path = str(base_path / constructions_file)
with open(path) as xml:
self._library = xmltodict.parse(xml.read(), force_list='layer')
# load archetypes Library, CERC-NREL format
path = str(base_path / archetypes_file)
with open(path) as xml:
self._archetypes = xmltodict.parse(xml.read(), force_list='layer')
for archetype in self._archetypes['archetypes']['archetype']:
archetype_keys = {}
for key, value in archetype.items():
if key[0] == '@':
archetype_keys[key] = value
average_storey_height = archetype['average_storey_height']['#text']
units = archetype['average_storey_height']['@units']
if units != 'm':
raise Exception(f'average storey height units = {units}, expected meters')
storeys_above_ground = archetype['number_of_storeys']['#text']
effective_thermal_capacity = float(archetype['thermal_capacity']['#text']) * 1000
units = archetype['thermal_capacity']['@units']
if units != 'kJ/K m2':
raise Exception(f'thermal capacity units = {units}, expected kJ/K m2')
additional_thermal_bridge_u_value = archetype['extra_loses_due_to_thermal_bridges']['#text']
units = archetype['extra_loses_due_to_thermal_bridges']['@units']
if units != 'W/K m2':
raise Exception(f'extra loses due to thermal bridges units = {units}, expected W/K m2')
indirectly_heated_area_ratio = archetype['indirect_heated_ratio']['#text']
# todo: check how infiltration rate is used in the model
infiltration_rate_system_off = archetype['infiltration_rate_for_ventilation_system_off']['#text']
units = archetype['infiltration_rate_for_ventilation_system_off']['@units']
if units != 'ACH':
raise Exception(f'infiltration rate for ventilation when system off units = {units}, expected ACH')
infiltration_rate_system_on = archetype['infiltration_rate_for_ventilation_system_on']['#text']
units = archetype['infiltration_rate_for_ventilation_system_on']['@units']
if units != 'ACH':
raise Exception(f'infiltration rate for ventilation when system on units = {units}, expected ACH')
thermal_boundary_archetypes = []
for construction in archetype['constructions']['construction']:
construction_type = construction['@type']
construction_id = construction['@id']
c_lib = self._search_construction_type('construction', construction_id)
construction_name = c_lib['@name']
layers = []
if 'layers' in c_lib:
for current_layer in c_lib['layers']['layer']:
material_lib = self._search_construction_type('material', current_layer['material'])
name = material_lib['@name']
solar_absorptance = material_lib['solar_absorptance']['#text']
thermal_absorptance = material_lib['thermal_absorptance']['#text']
visible_absorptance = material_lib['visible_absorptance']['#text']
no_mass = 'no_mass' in material_lib
if no_mass:
thermal_resistance = material_lib['thermal_resistance']['#text']
units = material_lib['thermal_resistance']['@units']
if units != 'm2 K/W':
raise Exception(f'thermal resistance units = {units}, expected m2 K/W')
layer = nla(name, solar_absorptance, thermal_absorptance, visible_absorptance, no_mass=no_mass,
thermal_resistance=thermal_resistance)
else:
thickness = current_layer['thickness']['#text']
units = current_layer['thickness']['@units']
if units != 'm':
raise Exception(f'thickness units = {units}, expected m')
conductivity = material_lib['conductivity']['#text']
units = material_lib['conductivity']['@units']
if units != 'W/m K':
raise Exception(f'conductivity units = {units}, expected W/m K')
specific_heat = material_lib['specific_heat']['#text']
units = material_lib['specific_heat']['@units']
if units != 'J/kg K':
raise Exception(f'specific_heat units = {units}, expected J/kg K')
density = material_lib['density']['#text']
units = material_lib['density']['@units']
if units != 'kg/m3':
raise Exception(f'density units = {units}, expected kg/m3')
layer = nla(name, solar_absorptance, thermal_absorptance, visible_absorptance, thickness=thickness,
conductivity=conductivity, specific_heat=specific_heat, density=density)
layers.append(layer)
thermal_opening = None
window_ratio = 0
if 'window' in construction and construction['window'] is not None:
window_ratio = construction['window_ratio']['#text']
w_lib = self._search_construction_type('window', construction['window'])
window_construction_name = w_lib['@name']
frame_ratio = w_lib['frame_ratio']['#text']
if 'conductivity' in w_lib:
conductivity = w_lib['conductivity']['#text']
units = w_lib['conductivity']['@units']
if units != 'W/m K':
raise Exception(f'conductivity units = {units}, expected W/m K')
thickness = w_lib['thickness']['#text']
units = w_lib['thickness']['@units']
if units != 'm':
raise Exception(f'thickness units = {units}, expected m')
g_value = w_lib['solar_transmittance_at_normal_incidence']['#text']
back_side_solar_transmittance_at_normal_incidence = \
w_lib['back_side_solar_transmittance_at_normal_incidence']['#text']
front_side_solar_transmittance_at_normal_incidence = \
w_lib['front_side_solar_transmittance_at_normal_incidence']['#text']
thermal_opening = ntoa(conductivity=conductivity, frame_ratio=frame_ratio, g_value=g_value,
thickness=thickness, back_side_solar_transmittance_at_normal_incidence=
back_side_solar_transmittance_at_normal_incidence,
front_side_solar_transmittance_at_normal_incidence=
front_side_solar_transmittance_at_normal_incidence,
construction_name=window_construction_name)
else:
overall_u_value = w_lib['overall_u_value']['#text']
units = w_lib['overall_u_value']['@units']
if units != 'W/m2 K':
raise Exception(f'overall U-value units = {units}, expected W/m2 K')
g_value = w_lib['g_value']
thermal_opening = ntoa(frame_ratio=frame_ratio, g_value=g_value, overall_u_value=overall_u_value,
construction_name=window_construction_name)
if 'outside_thermal_absorptance' in c_lib:
outside_solar_absorptance = c_lib['outside_solar_absorptance']['#text']
outside_thermal_absorptance = c_lib['outside_thermal_absorptance']['#text']
outside_visible_absorptance = c_lib['outside_visible_absorptance']['#text']
thermal_boundary_archetype = ntba(construction_type, window_ratio, construction_name, layers, thermal_opening,
outside_solar_absorptance, outside_thermal_absorptance,
outside_visible_absorptance)
else:
if 'overall_u_value' in c_lib:
overall_u_value = c_lib['overall_u_value']['#text']
units = c_lib['overall_u_value']['@units']
if units != 'W/m2 K':
raise Exception(f'overall U-value units = {units}, expected W/m2 K')
if 'outside_solar_absorptance' in c_lib:
outside_solar_absorptance = c_lib['outside_solar_absorptance']['#text']
thermal_boundary_archetype = ntba(construction_type, window_ratio, construction_name, layers,
thermal_opening, outside_solar_absorptance=outside_solar_absorptance,
overall_u_value=overall_u_value)
else:
thermal_boundary_archetype = ntba(construction_type, window_ratio, construction_name, layers,
thermal_opening, overall_u_value=overall_u_value)
else:
thermal_boundary_archetype = ntba(construction_type, window_ratio, construction_name, layers,
thermal_opening)
thermal_boundary_archetypes.append(thermal_boundary_archetype)
building_archetype = nba(archetype_keys, average_storey_height, storeys_above_ground,
effective_thermal_capacity, additional_thermal_bridge_u_value,
indirectly_heated_area_ratio, infiltration_rate_system_off,
infiltration_rate_system_on, thermal_boundary_archetypes)
self._building_archetypes.append(building_archetype)
def _search_construction_type(self, construction_type, construction_id):
for c_lib in self._library['library'][construction_type + 's'][construction_type]:
if construction_id == c_lib['@id']:
return c_lib
raise Exception('Archetype definition contains elements that does not exist in the library')
@staticmethod
def _search_construction_in_archetype(building_archetype, construction_type):
for thermal_boundary in building_archetype.thermal_boundary_archetypes:
if thermal_boundary.boundary_type == construction_type:
return thermal_boundary
raise Exception('Construction type not found')
# todo: verify windows
@staticmethod
def _calculate_view_factors(thermal_zone):
@ -228,15 +56,16 @@ class NrelPhysicsInterface:
view_factors_matrix.append(values)
thermal_zone.view_factors_matrix = view_factors_matrix
@staticmethod
def _create_storeys(building, archetype, divide_in_storeys):
building.average_storey_height = archetype.average_storey_height
building.storeys_above_ground = 1
thermal_zones = StoreysGeneration(building, building.internal_zones[0],
divide_in_storeys=divide_in_storeys).thermal_zones
building.internal_zones[0].thermal_zones = thermal_zones
def enrich_buildings(self):
"""
Raise not implemented error
"""
raise NotImplementedError
@staticmethod
def _create_storeys(building, archetype):
building.average_storey_height = archetype.average_storey_height
building.storeys_above_ground = archetype.storeys_above_ground
thermal_zones = StoreysGeneration(building, building.internal_zones[0]).thermal_zones
building.internal_zones[0].thermal_zones = thermal_zones

View File

@ -8,35 +8,32 @@ Code contributors: Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concord
import sys
from imports.construction.nrel_physics_interface import NrelPhysicsInterface
from imports.construction.helpers.construction_helper import ConstructionHelper
from catalog_factories.construction_catalog_factory import ConstructionCatalogFactory
from city_model_structure.building_demand.layer import Layer
from city_model_structure.building_demand.material import Material
from imports.construction.helpers.construction_helper import ConstructionHelper
class UsPhysicsParameters(NrelPhysicsInterface):
"""
UsPhysicsParameters class
"""
def __init__(self, city, base_path):
def __init__(self, city, base_path, divide_in_storeys=False):
self._city = city
self._path = base_path
self._divide_in_storeys = divide_in_storeys
self._climate_zone = ConstructionHelper.city_to_nrel_climate_zone(city.name)
super().__init__(base_path, 'us_constructions.xml', 'us_archetypes.xml')
super().__init__()
def enrich_buildings(self):
"""
Returns the city with the construction parameters assigned to the buildings
:return: None
"""
# todo: erase
city = self._city
# it is assumed that all buildings have the same archetypes' keys
for building in city.buildings:
building_type = ConstructionHelper.nrel_from_libs_function(building.function)
if building_type is None:
return
try:
archetype = self._search_archetype(building_type,
ConstructionHelper.yoc_to_nrel_standard(building.year_of_construction),
self._climate_zone)
archetype = self._search_archetype(building.function, building.year_of_construction, self._climate_zone)
except KeyError:
sys.stderr.write(f'Building {building.name} has unknown archetype for building function: {building.function} '
f'and building year of construction: {building.year_of_construction}\n')
@ -45,67 +42,91 @@ class UsPhysicsParameters(NrelPhysicsInterface):
# if building has no thermal zones defined from geometry, one thermal zone per storey is assigned
if len(building.internal_zones) == 1:
if building.internal_zones[0].thermal_zones is None:
self._create_storeys(building, archetype)
self._create_storeys(building, archetype, self._divide_in_storeys)
if self._divide_in_storeys:
for internal_zone in building.internal_zones:
for thermal_zone in internal_zone.thermal_zones:
thermal_zone.total_floor_area = thermal_zone.footprint_area
else:
number_of_storeys = int(float(building.eave_height) / float(building.average_storey_height))
thermal_zone = building.internal_zones[0].thermal_zones[0]
thermal_zone.total_floor_area = thermal_zone.footprint_area * number_of_storeys
else:
for internal_zone in building.internal_zones:
for thermal_zone in internal_zone.thermal_zones:
thermal_zone.total_floor_area = thermal_zone.footprint_area
self._assign_values(building.internal_zones, archetype)
for internal_zone in building.internal_zones:
self._assign_values(internal_zone.thermal_zones, archetype)
for thermal_zone in internal_zone.thermal_zones:
self._calculate_view_factors(thermal_zone)
def _search_archetype(self, building_type, standard, climate_zone):
for building_archetype in self._building_archetypes:
a_yc = str(building_archetype.archetype_keys['@reference_standard'])
a_bt = str(building_archetype.archetype_keys['@building_type'])
a_cz = str(building_archetype.archetype_keys['@climate_zone'])
if (a_yc == str(standard)) and (a_bt == str(building_type)) and (a_cz == str(climate_zone)):
return building_archetype
@staticmethod
def _search_archetype(function, year_of_construction, climate_zone):
nrel_catalog = ConstructionCatalogFactory('nrel').catalog
nrel_archetypes = nrel_catalog.entries('archetypes')
for building_archetype in nrel_archetypes:
construction_period_limits = building_archetype.construction_period.split(' - ')
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)):
return building_archetype
return None
def _assign_values(self, internal_zones, archetype):
for internal_zone in internal_zones:
for thermal_zone in internal_zone.thermal_zones:
thermal_zone.additional_thermal_bridge_u_value = archetype.additional_thermal_bridge_u_value
thermal_zone.effective_thermal_capacity = archetype.effective_thermal_capacity
thermal_zone.indirectly_heated_area_ratio = archetype.indirectly_heated_area_ratio
thermal_zone.infiltration_rate_system_on = archetype.infiltration_rate_system_on
thermal_zone.infiltration_rate_system_off = archetype.infiltration_rate_system_off
for thermal_boundary in thermal_zone.thermal_boundaries:
construction_type = ConstructionHelper.nrel_construction_types[thermal_boundary.type]
thermal_boundary_archetype = self._search_construction_in_archetype(archetype, construction_type)
thermal_boundary.outside_solar_absorptance = thermal_boundary_archetype.outside_solar_absorptance
thermal_boundary.outside_thermal_absorptance = thermal_boundary_archetype.outside_thermal_absorptance
thermal_boundary.outside_visible_absorptance = thermal_boundary_archetype.outside_visible_absorptance
thermal_boundary.construction_name = thermal_boundary_archetype.construction_name
try:
thermal_boundary.window_ratio = thermal_boundary_archetype.window_ratio
except ValueError:
# This is the normal operation way when the windows are defined in the geometry
continue
thermal_boundary.layers = []
for layer_archetype in thermal_boundary_archetype.layers:
layer = Layer()
layer.thickness = layer_archetype.thickness
material = Material()
material.name = layer_archetype.name
material.no_mass = layer_archetype.no_mass
material.density = layer_archetype.density
material.conductivity = layer_archetype.conductivity
material.specific_heat = layer_archetype.specific_heat
material.solar_absorptance = layer_archetype.solar_absorptance
material.thermal_absorptance = layer_archetype.thermal_absorptance
material.visible_absorptance = layer_archetype.visible_absorptance
material.thermal_resistance = layer_archetype.thermal_resistance
layer.material = material
thermal_boundary.layers.append(layer)
for thermal_opening in thermal_boundary.thermal_openings:
if thermal_boundary_archetype.thermal_opening_archetype is not None:
thermal_opening_archetype = thermal_boundary_archetype.thermal_opening_archetype
thermal_opening.construction_name = thermal_opening_archetype.construction_name
thermal_opening.frame_ratio = thermal_opening_archetype.frame_ratio
thermal_opening.g_value = thermal_opening_archetype.g_value
thermal_opening.conductivity = thermal_opening_archetype.conductivity
thermal_opening.thickness = thermal_opening_archetype.thickness
thermal_opening.back_side_solar_transmittance_at_normal_incidence = \
thermal_opening_archetype.back_side_solar_transmittance_at_normal_incidence
thermal_opening.front_side_solar_transmittance_at_normal_incidence = \
thermal_opening_archetype.front_side_solar_transmittance_at_normal_incidence
@staticmethod
def _search_construction_in_archetype(archetype, construction_type):
construction_archetypes = archetype.constructions
for construction_archetype in construction_archetypes:
if str(construction_type) == str(construction_archetype.type):
return construction_archetype
return None
def _assign_values(self, thermal_zones, archetype):
for thermal_zone in thermal_zones:
thermal_zone.additional_thermal_bridge_u_value = archetype.extra_loses_due_to_thermal_bridges
thermal_zone.effective_thermal_capacity = archetype.thermal_capacity
thermal_zone.indirectly_heated_area_ratio = archetype.indirect_heated_ratio
thermal_zone.infiltration_rate_system_on = archetype.infiltration_rate_for_ventilation_system_on
thermal_zone.infiltration_rate_system_off = archetype.infiltration_rate_for_ventilation_system_off
for thermal_boundary in thermal_zone.thermal_boundaries:
construction_archetype = self._search_construction_in_archetype(archetype, thermal_boundary.type)
thermal_boundary.construction_name = construction_archetype.name
try:
thermal_boundary.window_ratio = construction_archetype.window_ratio
except ValueError:
# This is the normal operation way when the windows are defined in the geometry
continue
thermal_boundary.layers = []
for layer_archetype in construction_archetype.layers:
layer = Layer()
layer.thickness = layer_archetype.thickness
material = Material()
archetype_material = layer_archetype.material
material.name = layer_archetype.name
material.no_mass = archetype_material.no_mass
if archetype_material.no_mass:
material.thermal_resistance = archetype_material.thermal_resistance
else:
material.density = archetype_material.density
material.conductivity = archetype_material.conductivity
material.specific_heat = archetype_material.specific_heat
material.solar_absorptance = archetype_material.solar_absorptance
material.thermal_absorptance = archetype_material.thermal_absorptance
material.visible_absorptance = archetype_material.visible_absorptance
layer.material = material
thermal_boundary.layers.append(layer)
# The agreement is that the layers are defined from outside to inside
external_layer = construction_archetype.layers[0]
thermal_boundary.outside_solar_absorptance = external_layer.material.solar_absorptance
thermal_boundary.outside_thermal_absorptance = external_layer.material.thermal_absorptance
thermal_boundary.outside_visible_absorptance = external_layer.material.visible_absorptance
for thermal_opening in thermal_boundary.thermal_openings:
if construction_archetype.window is not None:
window_archetype = construction_archetype.window
thermal_opening.construction_name = window_archetype.name
thermal_opening.frame_ratio = window_archetype.frame_ratio
thermal_opening.g_value = window_archetype.g_value
thermal_opening.overall_u_value = window_archetype.overall_u_value

View File

@ -6,7 +6,6 @@ Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
"""
from pathlib import Path
from imports.construction.us_physics_parameters import UsPhysicsParameters
from imports.construction.ca_physics_parameters import CaPhysicsParameters
class ConstructionFactory:
@ -26,19 +25,9 @@ class ConstructionFactory:
"""
UsPhysicsParameters(self._city, self._base_path).enrich_buildings()
def _nrcan(self):
"""
Enrich the city by using NRCAN information
:alert: NRCAN handler only contains simplified construction information (residential)
"""
CaPhysicsParameters(self._city, self._base_path).enrich_buildings()
def enrich(self):
"""
Enrich the city given to the class using the class given handler
:return: None
"""
getattr(self, self._handler, lambda: None)()
def _enrich_debug(self):
self._nrel()

View File

@ -1,39 +0,0 @@
"""
Sanam's customized importer Usage helper
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 sys
import helpers.constants as cte
class SanamCustomizedUsageHelper:
"""
SanamCustomizedUsage class
"""
usage_to_customized = {
cte.RESIDENTIAL: 'residential',
cte.INDUSTRY: 'manufacturing',
cte.OFFICE_AND_ADMINISTRATION: 'office',
cte.HOTEL: 'hotel',
cte.HEALTH_CARE: 'health',
cte.RETAIL: 'retail',
cte.HALL: 'assembly',
cte.RESTAURANT: 'restaurant',
cte.EDUCATION: 'school'
}
customized_default_value = 'residential'
@staticmethod
def customized_from_usage(usage):
"""
Get customized usage from the given internal usage key
:param usage: str
:return: str
"""
try:
return SanamCustomizedUsageHelper.usage_to_customized[usage]
except KeyError:
sys.stderr.write('Error: keyword not found. Returned default HfT usage "residential"\n')
return SanamCustomizedUsageHelper.customized_default_value

View File

@ -1,91 +0,0 @@
"""
SanamCustomizedUsageParameters add two parameters to usage properties from ASHRAE
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 sys
import xmltodict
import helpers.constants as cte
from imports.usage.helpers.usage_helper import UsageHelper
from city_model_structure.building_demand.occupancy import Occupancy
from city_model_structure.building_demand.usage_zone import UsageZone
from imports.geometry.helpers.geometry_helper import GeometryHelper
class SanamCustomizedUsageParameters:
"""
SanamCustomizedUsageParameters class
"""
def __init__(self, city, base_path):
file = 'ashrae_archetypes.xml'
path = str(base_path / file)
self._city = city
self._usage_archetypes = []
with open(path) as xml:
self._archetypes = xmltodict.parse(xml.read(), force_list=('zoneUsageVariant', 'zoneUsageType'))
def enrich_buildings(self):
"""
Returns the city with the usage parameters assigned to the buildings
:return:
"""
city = self._city
for building in city.buildings:
libs_usage = GeometryHelper().libs_usage_from_libs_function(building.function)
comnet_usage = UsageHelper().comnet_from_libs_usage(libs_usage)
archetype = self._search_archetype(comnet_usage)
if archetype is None:
sys.stderr.write(f'Building {building.name} has unknown archetype for building function:'
f' {building.function}, that assigns building usage as '
f'{libs_usage}\n')
return
for internal_zone in building.internal_zones:
if internal_zone.area is None:
raise Exception('Internal zone area not defined, ACH cannot be calculated')
if internal_zone.volume is None:
raise Exception('Internal zone volume not defined, ACH cannot be calculated')
if internal_zone.area <= 0:
raise Exception('Internal zone area is zero, ACH cannot be calculated')
if internal_zone.volume <= 0:
raise Exception('Internal zone volume is zero, ACH cannot be calculated')
volume_per_area = internal_zone.volume / internal_zone.area
usage_zone = UsageZone()
usage_zone.usage = libs_usage
self._assign_values(usage_zone, archetype, volume_per_area)
def _search_archetype(self, libs_usage):
comnet_usage = UsageHelper.comnet_from_libs_usage(libs_usage)
for building_archetype in self._archetypes['buildingUsageLibrary']['zoneUsageType']:
if building_archetype['id'] == comnet_usage:
usage_archetype = self._parse_usage_type(self._archetypes)
return usage_archetype
return None
@staticmethod
def _assign_values(usage_zone, archetype, volume_per_area):
usage_zone.usage = archetype.usage
if archetype.occupancy.occupancy_density is not None:
if usage_zone.occupancy is None:
_occupancy = Occupancy()
usage_zone.occupancy = _occupancy
usage_zone.occupancy.occupancy_density = archetype.occupancy.occupancy_density
archetype_mechanical_air_change = float(archetype.mechanical_air_change) \
* float(archetype.occupancy.occupancy_density) \
* cte.HOUR_TO_MINUTES / cte.METERS_TO_FEET ** 3 / volume_per_area
usage_zone.mechanical_air_change = archetype_mechanical_air_change
@staticmethod
def _parse_usage_type(data):
usage_zone_archetype = UsageZone()
usage_zone_archetype.usage = data['id']
usage_zone_archetype.mechanical_air_change = data['endUses']['ventilation']['minimumVentilationRate'][
'#text']
if 'occupancy' in data:
_occupancy = Occupancy()
_occupancy.occupancy_density = data['occupancy']['occupancyDensity']['#text']
usage_zone_archetype.occupancy = _occupancy
return usage_zone_archetype

View File

@ -1,28 +0,0 @@
"""
CustomizedImportsFactory is used to import any information using user customized formats
This factory can only be called after calling the construction factory.
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 pathlib import Path
class CustomizedImportsFactory:
"""
CustomizedImportsFactory class
"""
def __init__(self, importer_class, city, base_path=None):
if base_path is None:
base_path = Path(Path(__file__).parent.parent / 'data/customized_imports')
self._importer_class = importer_class
self._city = city
self._base_path = base_path
def enrich(self):
"""
Returns the class that will enrich the city given
:return: Class
"""
importer = self._importer_class(self._city, self._base_path)
return importer.enrich_buildings()

View File

@ -251,7 +251,8 @@ class GeometryHelper:
cte.QUICK_SERVICE_RESTAURANT: cte.RESTAURANT,
cte.FULL_SERVICE_RESTAURANT: cte.RESTAURANT,
cte.SMALL_HOTEL: cte.HOTEL,
cte.LARGE_HOTEL: cte.HOTEL
cte.LARGE_HOTEL: cte.HOTEL,
cte.INDUSTRY:cte.INDUSTRY
}
@staticmethod

View File

@ -10,7 +10,7 @@ from imports.geometry.helpers.geometry_helper import GeometryHelper
from imports.usage.hft_usage_interface import HftUsageInterface
from imports.usage.helpers.usage_helper import UsageHelper
from city_model_structure.building_demand.usage_zone import UsageZone
from city_model_structure.building_demand.internal_gains import InternalGains
from city_model_structure.building_demand.internal_gain import InternalGain
from city_model_structure.building_demand.occupancy import Occupancy
from city_model_structure.building_demand.appliances import Appliances
from city_model_structure.building_demand.thermal_control import ThermalControl
@ -74,7 +74,7 @@ class CaUsageParameters(HftUsageInterface):
usage_zone.thermal_control = _control
_internal_gains = []
for archetype_internal_gain in archetype.not_detailed_source_mean_annual_internal_gains:
_internal_gain = InternalGains()
_internal_gain = InternalGain()
_internal_gain.average_internal_gain = archetype_internal_gain.average_internal_gain
_internal_gain.convective_fraction = archetype_internal_gain.convective_fraction
_internal_gain.radiative_fraction = archetype_internal_gain.radiative_fraction

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