Skip to content

Commit

Permalink
hotfix, sky temp should be less than one and close to the average
Browse files Browse the repository at this point in the history
  • Loading branch information
jimenofonseca committed Nov 12, 2019
1 parent 9c67935 commit 9081381
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
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 = [397797.926, 0.0, 0.0, 54619.37700000001, 95850.97399999999, 19784.981, 0.0, 0.0, 26186.16, 0.0, 0.0, 171600.0]
values = [397332.706, 0.0, 0.0, 54493.56, 96284.527, 19784.978, 0.0, 0.0, 26186.16, 0.0, 0.0, 171600.0]

[test_calc_thermal_loads_other_buildings]
results = {"B01": [95850.97399999999, 54619.37700000001, 19784.981], "B03": [60669.873999999996, 101658.949, 117381.317], "B02": [298794.787, 25824.404000000002, 312646.881], "B05": [127637.944, 0.0, 73558.87800000001], "B04": [152702.88799999998, 36519.422, 17519.379], "B07": [157994.025, 49868.568999999996, 31347.153000000002], "B06": [65801.242, 79651.688, 168320.982], "B09": [135996.991, 18311.208, 15160.359], "B08": [164454.187, 29172.488999999998, 400109.311]}
results = {"B01": [96284.527, 54493.56, 19784.978], "B03": [60941.42700000001, 101654.203, 117381.388], "B02": [299345.566, 25872.039, 312647.82999999996], "B05": [127871.16, 0.0, 73559.536], "B04": [153030.22400000002, 36521.226, 17519.388000000003], "B07": [158362.75199999998, 49693.31, 31347.407], "B06": [66017.055, 79389.545, 168321.332], "B09": [136263.101, 18328.773999999998, 15160.633999999998], "B08": [164834.07100000003, 29106.078999999998, 400109.881]}

6 changes: 3 additions & 3 deletions cea/utilities/epwreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ def epw_reader(weather_path):
result['date'] = pd.Series(pd.date_range(str(result["year"][0])+"/1/1", periods=HOURS_IN_YEAR, freq='H'))
result['dayofyear'] = pd.date_range(str(result["year"][0])+"/1/1", periods=HOURS_IN_YEAR, freq='H').dayofyear
result['ratio_diffhout'] = result['difhorrad_Whm2'] / result['glohorrad_Whm2']
result['skycover'] = result['ratio_diffhout'].fillna(1.0)
result['skycover'] = result['skycover'].replace(np.inf, 1.0)
result['ratio_diffhout'] = result['ratio_diffhout'].replace(np.inf, np.nan)
result['skycover'] = result['ratio_diffhout'].fillna(result['ratio_diffhout'].mean())
result['wetbulb_C'] = np.vectorize(calc_wetbulb)(result['drybulb_C'], result['relhum_percent'])
result['skytemp_C'] = np.vectorize(calc_skytemp)(result['drybulb_C'], result['dewpoint_C'], result['skycover'])

Expand All @@ -58,7 +58,7 @@ def calc_wetbulb(Tdrybulb, RH):
def main(config):
locator = cea.inputlocator.InputLocator(scenario=config.scenario)
# for the interface, the user should pick a file out of of those in ...DB/Weather/...
epw_reader(weather_path=(locator.get_weather()))
epw_reader(weather_path=(locator.get_weather_file()))


if __name__ == '__main__':
Expand Down

0 comments on commit 9081381

Please sign in to comment.