Skip to content

Commit

Permalink
Merge branch 'master' into 3347-mismatch-between-usage-of-fossil-fuel…
Browse files Browse the repository at this point in the history
…s-and-installed-components
  • Loading branch information
MatNif committed Nov 6, 2023
2 parents 0fe9c5b + 847cd0b commit 4f97cfa
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 8 deletions.
Binary file modified cea/databases/CH/assemblies/HVAC.xlsx
Binary file not shown.
Binary file modified cea/databases/SG/assemblies/HVAC.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion cea/demand/building_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ def get_properties_technical_systems(locator, prop_hvac):
'Tscs0_aru_C', 'dTcs0_aru_C', 'Tc_sup_air_aru_C', 'Tscs0_scu_C', 'dTcs0_scu_C',
'class_cs', 'convection_cs']
fields_emission_control_heating_and_cooling = ['Name', 'dT_Qhs', 'dT_Qcs']
fields_emission_dhw = ['Name', 'Tsww0_C', 'Qwwmax_Wm2']
fields_emission_dhw = ['Name', 'class_dhw', 'Tsww0_C', 'Qwwmax_Wm2']
fields_system_ctrl_vent = ['Name', 'MECH_VENT', 'WIN_VENT', 'HEAT_REC', 'NIGHT_FLSH', 'ECONOMIZER']

result = df_emission_heating[fields_emission_heating].merge(df_emission_cooling[fields_emission_cooling],
Expand Down
10 changes: 6 additions & 4 deletions cea/demand/hotwater_loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,12 @@ def has_hot_water_technical_system(bpr):
:return: True or False
:rtype: bool
"""
supported = ['HVAC_HOTWATER_AS1', 'HVAC_HOTWATER_AS2', 'HVAC_HOTWATER_AS3', 'HVAC_HOTWATER_AS4']
if bpr.hvac['type_dhw'] in supported:
supported = ['HIGH_TEMP', 'MEDIUM_TEMP', 'LOW_TEMP']
unsupported = ['NONE']

if bpr.hvac['class_dhw'] in supported:
return True
elif bpr.hvac['type_dhw'] in {'HVAC_HOTWATER_AS0'}:
elif bpr.hvac['class_dhw'] in unsupported:
return False
else:
raise ValueError('Invalid value for type_dhw: %s. CEA supports only the next systems %s' %(bpr.hvac['type_dhw'], supported))
raise ValueError('Invalid value for type_dhw: %s. CEA supports only the next systems %s' %(bpr.hvac['class_dhw'], supported))
2 changes: 1 addition & 1 deletion cea/plots/demand/load_curve_supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, project, parameters, cache):

@property
def layout(self):
return dict(barmode='relative', yaxis=dict(title='Final Energy Demand [MW]'),
return dict(barmode='relative', yaxis=dict(title='Final Energy Demand [MWh]'),
yaxis2=dict(title='Temperature [C]', overlaying='y', side='right'))

@property
Expand Down
11 changes: 11 additions & 0 deletions cea/schemas.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2647,6 +2647,17 @@ get_database_air_conditioning_systems:
type: string
unit: '[-]'
values: alphanumeric
class_dhw:
choice:
values:
- NONE
- HIGH_TEMP
- MEDIUM_TEMP
- LOW_TEMP
description: Type or class of the DHW system
type: string
unit: '[-]'
values: alphanumeric
VENTILATION:
columns:
Description:
Expand Down
6 changes: 6 additions & 0 deletions cea/tests/create_unittest_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def main(output_file):
weather_data = epwreader.epw_reader(weather_path)[
['year', 'drybulb_C', 'wetbulb_C', 'relhum_percent', 'windspd_ms', 'skytemp_C']]

# reinit database to ensure updated databases are loaded
from cea.datamanagement.data_initializer import main as data_initializer
config.data_initializer.databases_path = "CH"
config.data_initializer.databases = ["archetypes", "assemblies", "components"]
data_initializer(config)

# run properties script
import cea.datamanagement.archetypes_mapper
cea.datamanagement.archetypes_mapper.archetypes_mapper(locator, True, True, True, True, True, True, [])
Expand Down
4 changes: 2 additions & 2 deletions cea/tests/test_calc_thermal_loads.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[test_calc_thermal_loads]
value_columns = ["E_sys_kWh", "Qcdata_sys_kWh", "Qcre_sys_kWh", "Qcs_sys_kWh", "Qhs_sys_kWh", "Qww_sys_kWh", "Tcs_sys_re_C", "Ths_sys_re_C", "Tww_sys_re_C", "Tcs_sys_sup_C", "Ths_sys_sup_C", "Tww_sys_sup_C"]
values = [1264918.327, 1011078.276, 0.0, 0.0, 157941.208, 19514.412, 0.0, 0.0, 24038.883, 0.0, 0.0, 172260.0]
values = [1264918.327, 1011078.276, 0.0, 0.0, 157941.20799999998, 19514.411999999997, 0.0, 0.0, 24038.882999999998, 0.0, 0.0, 172260.0]

[test_calc_thermal_loads_other_buildings]
results = {"B1013": [155418.314, 0.0, 11274.946], "B1012": [263128.295, 0.0, 33824.482], "B1010": [136786.967, 0.0, 120366.903], "B1000": [725930.178, 0.0, 36047.342], "B1009": [175659.112, 0.0, 13925.498], "B1011": [157941.208, 0.0, 19514.412], "B1006": [255070.399, 0.0, 19238.701], "B1003": [177472.418, 0.0, 12515.02], "B1004": [182042.503, 0.0, 13042.568], "B1001": [189437.865, 0.0, 13781.26], "B1002": [183017.81, 0.0, 13058.863], "B1005": [248962.345, 0.0, 20296.967], "B1008": [245838.310, 0.0, 20402.512], "B1007": [221017.561, 0.0, 16546.766], "B1014": [2654521.704, 0.0, 7532787.507]}
results = {"B1013": [155418.314, 0.0, 11274.946], "B1012": [263128.295, 0.0, 33824.481999999996], "B1010": [136786.967, 0.0, 120366.90299999999], "B1000": [725930.1780000001, 0.0, 36047.342000000004], "B1009": [175659.112, 0.0, 13925.498], "B1011": [157941.20799999998, 0.0, 19514.411999999997], "B1006": [255070.39899999998, 0.0, 19238.701], "B1003": [177472.418, 0.0, 12515.02], "B1004": [182042.50300000003, 0.0, 13042.568], "B1001": [189437.86500000002, 0.0, 13781.26], "B1002": [183017.81, 0.0, 13058.863], "B1005": [248962.345, 0.0, 20296.967], "B1008": [245838.31000000003, 0.0, 20402.512000000002], "B1007": [221017.561, 0.0, 16546.766], "B1014": [2654521.704, 0.0, 7532787.507]}

6 changes: 6 additions & 0 deletions cea/tests/test_calc_thermal_loads.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def setUpClass(cls):
cls.test_config = configparser.ConfigParser()
cls.test_config.read(os.path.join(os.path.dirname(__file__), 'test_calc_thermal_loads.config'))

# reinit database to ensure updated databases are loaded
from cea.datamanagement.data_initializer import main as data_initializer
cls.config.data_initializer.databases_path = "CH"
cls.config.data_initializer.databases = ["archetypes", "assemblies", "components"]
data_initializer(cls.config)

# run properties script
import cea.datamanagement.archetypes_mapper
cea.datamanagement.archetypes_mapper.archetypes_mapper(cls.locator, True, True, True, True, True, True,
Expand Down
12 changes: 12 additions & 0 deletions cea/tests/test_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ def test_mixed_use_schedules(self):
config.scenario = locator.scenario
config.multiprocessing = False

# reinit database to ensure updated databases are loaded
from cea.datamanagement.data_initializer import main as data_initializer
config.data_initializer.databases_path = "CH"
config.data_initializer.databases = ["archetypes", "assemblies", "components"]
data_initializer(config)

building_properties = BuildingProperties(locator, epwreader.epw_reader(locator.get_weather_file()))
bpr = building_properties['B1011']
bpr.occupancy = {'OFFICE': 0.5, 'SERVERROOM': 0.5}
Expand Down Expand Up @@ -115,6 +121,12 @@ def create_data():
config = cea.config.Configuration(cea.config.DEFAULT_CONFIG)
locator = ReferenceCaseOpenLocator()

# reinit database to ensure updated databases are loaded
from cea.datamanagement.data_initializer import main as data_initializer
config.data_initializer.databases_path = "CH"
config.data_initializer.databases = ["archetypes", "assemblies", "components"]
data_initializer(config)

# calculate schedules
building_properties = BuildingProperties(locator, epwreader.epw_reader(locator.get_weather_file()))
bpr = building_properties['B1011']
Expand Down

0 comments on commit 4f97cfa

Please sign in to comment.