Skip to content

Commit

Permalink
Merge pull request #412 from ibpsa/issue273_tesCasMulZonOffSimAir
Browse files Browse the repository at this point in the history
Closes #273
  • Loading branch information
dhblum authored Apr 7, 2022
2 parents f20656b + aa5a1e3 commit 00bbc0b
Show file tree
Hide file tree
Showing 98 changed files with 640,816 additions and 15 deletions.
37 changes: 27 additions & 10 deletions data/find_days.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy as np

def find_days(heat, cool, data='simulate', img_name='boptest_bestest_air',
plot = False):
plot = False, peak_cool_restriction_hour=None):
'''Find the start and final times for the test case scenarios.
Parameters
Expand All @@ -39,6 +39,12 @@ def find_days(heat, cool, data='simulate', img_name='boptest_bestest_air',
performed.
plot: boolean
Set to True to show an overview of the days found
peak_cool_restriction_hour: integer, optional
Hour if want peak cooling loads to only be considered equal to or after the hour
each day. This can be useful to avoid including hours with peak
cooling loads due to morning start up, which may lead to the
same peak load for many different days. None will have no restrictions.
Default is None.
Returns
-------
Expand Down Expand Up @@ -87,37 +93,48 @@ def find_days(heat, cool, data='simulate', img_name='boptest_bestest_air',
df.dropna(axis=0, inplace=True)
# Since assume two-week test period with one-week warmup,
# edges of year are not available to choose from
df_available = df.loc[pd.Timedelta(days=14):pd.Timedelta(days=365-7)]
df_available = df.loc[pd.Timedelta(days=14):pd.Timedelta(days=365-7)]
df_available_cool = df[cool].loc[pd.Timedelta(days=14):pd.Timedelta(days=365-7)]
df_cool = df[cool]
if peak_cool_restriction_hour is not None:
# Limit available cooling hours to those after restriction
df_available_cool = df_available_cool[df_available_cool.index.seconds/3600>=peak_cool_restriction_hour]
df_cool = df_cool[df_cool.index.seconds/3600>=peak_cool_restriction_hour]
df_available_heat = df[heat].loc[pd.Timedelta(days=14):pd.Timedelta(days=365-7)]
df_heat = df[heat]


# Find peak
if heat is not None:
peak_heat_day = df_available[heat].idxmax().days
peak_heat_day = df_available_heat.idxmax().days
days['peak_heat_day'] = peak_heat_day
print('Peak heat is day {0}.'.format(peak_heat_day))

if cool is not None:
peak_cool_day = df_available[cool].idxmax().days
peak_cool_day = df_available_cool.idxmax().days
days['peak_cool_day'] = peak_cool_day
print('Peak cool is day {0}.'.format(peak_cool_day))

# Find typical
df_daily = df.resample('D').max()
df_available_daily = df_available.resample('D').max()
df_daily_cool = df_cool.resample('D').max()
df_available_daily_cool = df_available_cool.resample('D').max()
df_daily_heat = df_heat.resample('D').max()
df_available_daily_heat = df_available_heat.resample('D').max()

if heat is not None:
median_heat = df_daily[heat][df_daily[heat]>1].median()
typical_heat_day = df_available_daily[heat][df_available_daily[heat].values <= median_heat].sort_values(ascending=False).index[0].days
median_heat = df_daily_heat[df_daily_heat>1].median()
typical_heat_day = df_available_daily_heat[df_available_daily_heat.values <= median_heat].sort_values(ascending=False).index[0].days
days['typical_heat_day'] = typical_heat_day
print('Typical heat is day {0}.'.format(typical_heat_day))

if cool is not None:
median_cool = df_daily[cool][df_daily[cool]>1].median()
typical_cool_day = df_available_daily[cool][df_available_daily[cool].values <= median_cool].sort_values(ascending=False).index[0].days
median_cool = df_daily_cool[df_daily_cool>1].median()
typical_cool_day = df_available_daily_cool[df_available_daily_cool.values <= median_cool].sort_values(ascending=False).index[0].days
days['typical_cool_day'] = typical_cool_day
print('Typical cool is day {0}.'.format(typical_cool_day))

# Find heat cool mix
df_available_daily = df_available.resample('D').sum()
if (heat is not None) and (cool is not None):
df_available_daily_sum = pd.DataFrame(index=df_available_daily.index, columns=df_available_daily.columns)
# For every day, integrate heating and cooling load
Expand Down
6 changes: 3 additions & 3 deletions parsing/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def parse_instances(model_path, file_name):
'''

# Compile fmu
fmu_path = compile_fmu(model_path, file_name)
fmu_path = compile_fmu(model_path, file_name, jvm_args="-Xmx8g")
# Load fmu
fmu = load_fmu(fmu_path)
# Check version
Expand Down Expand Up @@ -179,13 +179,13 @@ def write_wrapper(model_path, file_name, instances):
# End file -- with hard line ending
f.write('end wrapped;\n')
# Export as fmu
fmu_path = compile_fmu('wrapped', [wrapped_path]+file_name)
fmu_path = compile_fmu('wrapped', [wrapped_path]+file_name, jvm_args="-Xmx8g")
# If there are not, write and export wrapper model
else:
# Warn user
warnings.warn('No signal exchange block instances found in model. Exporting model as is.')
# Compile fmu
fmu_path = compile_fmu(model_path, file_name)
fmu_path = compile_fmu(model_path, file_name, jvm_args="-Xmx8g")
wrapped_path = None

return fmu_path, wrapped_path
Expand Down
5 changes: 5 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ Released on xx/xx/xxxx.

- Fix and clarify ``README.md`` for the ``/initialize`` and other API end points. This is for [#408](https://github.com/ibpsa/project1-boptest/issues/408).

**The following new test cases have been added:**

- ``multizone_office_simple_air``, a 5-zone building based on the U.S. DOE medium office reference building located in Chicago, IL, USA, served by a single-duct Variable Air Volume (VAV) with terminal reheat, air-cooled chiller, and air-to-water heat pump. This is for [#273](https://github.com/ibpsa/project1-boptest/issues/273).


## BOPTEST v0.2.0

Released on 03/05/2022.
Expand Down
3 changes: 2 additions & 1 deletion testcases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ This directory contains test cases for BOPTEST. A summary of available test cas
| ``bestest_hydronic``| BESTEST Case 900 room model with gas boiler and radiator.|**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**: <br />``'peak_heat_day'``, <br />``'typical_heat_day'``|
| ``bestest_hydronic_heat_pump``| BESTEST Case 900 room model, scaled by four in floor area, that uses a heat pump as heating production system and floor heating as heating emission system.|**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**: <br />``'peak_heat_day'``, <br />``'typical_heat_day'``|
| ``multizone_residential_hydronic``| Multi-zone residential hydronic model with gas boiler, radiators, and ideal cooling system. |**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**: <br />``'peak_heat_day'``, <br />``'typical_heat_day'``|
| ``singlezone_commercial_hydronic``| Single-zone commercial building model representing a university building with district heating source, zone radiator, occupancy based on real data, and air handling unit providing fresh air with CO2 control and heat recovery. |**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**: <br />``'peak_heat_day'``, <br />``'typical_heat_day'``|
| ``singlezone_commercial_hydronic``| Single-zone commercial building model representing a university building with district heating source, zone radiator, occupancy based on real data, and air handling unit providing fresh air with CO2 control and heat recovery. |**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**: <br />``'peak_heat_day'``, <br />``'typical_heat_day'``|
| ``multizone_office_simple_air`` | Multi-zone commercial building model based on U.S. DOE medium office building with single-duct VAV with terminal reheat, air-cooled chiller, and air-to-water heat pump.|**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**:<br />``'peak_heat_day'``, <br />``'typical_heat_day'``, <br />``'peak_cool_day'``, <br />``'typical_cool_day'``, <br />``'mix_day'``|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions testcases/multizone_office_simple_air/doc/images/gain_schedule.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
0, 0.05
8, 0.05
9, 0.9
12, 0.9
12, 0.8
13, 0.8
13, 1
17, 1
19, 0.1
24, 0.05
Loading

0 comments on commit 00bbc0b

Please sign in to comment.