2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2022-04-08 18:03:35 -04:00
|
|
|
InternalGain module
|
2020-10-28 13:42:58 -04:00
|
|
|
SPDX - License - Identifier: LGPL - 3.0 - or -later
|
2022-04-08 09:35:33 -04:00
|
|
|
Copyright © 2022 Concordia CERC group
|
|
|
|
Project Coder Guille Gutierrez guillermo.gutierrezmorote@concordia.ca
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
|
2022-03-17 18:49:44 -04:00
|
|
|
from typing import Union, List
|
2022-03-08 19:19:52 -05:00
|
|
|
from city_model_structure.attributes.schedule import Schedule
|
2021-09-14 13:46:48 -04:00
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
|
2022-04-08 18:03:35 -04:00
|
|
|
class InternalGain:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2022-04-08 18:03:35 -04:00
|
|
|
InternalGain class
|
2021-04-15 10:04:44 -04:00
|
|
|
"""
|
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
def __init__(self):
|
2021-11-11 17:25:53 -05:00
|
|
|
self._type = None
|
2020-10-28 13:42:58 -04:00
|
|
|
self._average_internal_gain = None
|
|
|
|
self._convective_fraction = None
|
|
|
|
self._radiative_fraction = None
|
|
|
|
self._latent_fraction = None
|
2022-03-17 18:49:44 -04:00
|
|
|
self._schedules = None
|
2020-10-28 13:42:58 -04:00
|
|
|
|
2021-11-11 17:25:53 -05:00
|
|
|
@property
|
|
|
|
def type(self) -> Union[None, str]:
|
|
|
|
"""
|
|
|
|
Get internal gains type
|
|
|
|
:return: None or string
|
|
|
|
"""
|
|
|
|
return self._type
|
|
|
|
|
|
|
|
@type.setter
|
|
|
|
def type(self, value):
|
|
|
|
"""
|
|
|
|
Set internal gains type
|
|
|
|
:param value: string
|
|
|
|
"""
|
|
|
|
if value is not None:
|
|
|
|
self._type = str(value)
|
|
|
|
|
2020-10-28 13:42:58 -04:00
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def average_internal_gain(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Get internal gains average internal gain in W/m2
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._average_internal_gain
|
|
|
|
|
|
|
|
@average_internal_gain.setter
|
|
|
|
def average_internal_gain(self, value):
|
|
|
|
"""
|
2021-01-08 16:08:29 -05:00
|
|
|
Set internal gains average internal gain in W/m2
|
2021-11-11 17:25:53 -05:00
|
|
|
:param value: float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._average_internal_gain = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def convective_fraction(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get internal gains convective fraction
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._convective_fraction
|
|
|
|
|
|
|
|
@convective_fraction.setter
|
|
|
|
def convective_fraction(self, value):
|
|
|
|
"""
|
|
|
|
Set internal gains convective fraction
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._convective_fraction = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def radiative_fraction(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get internal gains radiative fraction
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._radiative_fraction
|
|
|
|
|
|
|
|
@radiative_fraction.setter
|
|
|
|
def radiative_fraction(self, value):
|
|
|
|
"""
|
|
|
|
Set internal gains convective fraction
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._radiative_fraction = float(value)
|
2020-10-28 13:42:58 -04:00
|
|
|
|
|
|
|
@property
|
2021-09-14 13:46:48 -04:00
|
|
|
def latent_fraction(self) -> Union[None, float]:
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
Get internal gains latent fraction
|
2021-09-14 13:46:48 -04:00
|
|
|
:return: None or float
|
2020-10-28 13:42:58 -04:00
|
|
|
"""
|
|
|
|
return self._latent_fraction
|
|
|
|
|
|
|
|
@latent_fraction.setter
|
|
|
|
def latent_fraction(self, value):
|
|
|
|
"""
|
|
|
|
Set internal gains latent fraction
|
|
|
|
:param value: float
|
|
|
|
"""
|
2021-09-14 13:46:48 -04:00
|
|
|
if value is not None:
|
|
|
|
self._latent_fraction = float(value)
|
2022-03-08 19:19:52 -05:00
|
|
|
|
|
|
|
@property
|
2022-03-17 18:49:44 -04:00
|
|
|
def schedules(self) -> Union[None, List[Schedule]]:
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Get internal gain schedule
|
2022-04-06 16:06:55 -04:00
|
|
|
dataType = fraction
|
2022-03-17 18:49:44 -04:00
|
|
|
:return: [Schedule]
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
return self._schedules
|
2022-03-08 19:19:52 -05:00
|
|
|
|
2022-03-17 18:49:44 -04:00
|
|
|
@schedules.setter
|
|
|
|
def schedules(self, value):
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
|
|
|
Set internal gain schedule
|
2022-04-06 16:06:55 -04:00
|
|
|
dataType = fraction
|
2022-03-17 18:49:44 -04:00
|
|
|
:param value: [Schedule]
|
2022-03-08 19:19:52 -05:00
|
|
|
"""
|
2022-03-17 18:49:44 -04:00
|
|
|
self._schedules = value
|