Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue566weatherfile #664

Merged
merged 24 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion teaser/data/input/inputdata/weatherdata/ASHRAE140.mos
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ double tab1(8760,30)
#TYPICAL/EXTREME PERIODS,6,Summer - Week Nearest Max Temperature For Period,Extreme,7/13,7/19,Summer - Week Nearest Average Temperature For Period,Typical,8/ 3,8/ 9,Winter - Week Nearest Min Temperature For Period,Extreme,12/ 8,12/14,Winter - Week Nearest Average Temperature For Period,Typical,12/15,12/21,Autumn - Week Nearest Average Temperature For Period,Typical,10/20,10/26,Spring - Week Nearest Average Temperature For Period,Typical,4/19,4/25
#GROUND TEMPERATURES,3,.5,,,,3.79,3.08,4.35,6.34,11.55,15.57,18.29,19.11,17.71,14.58,10.41,6.54,2,,,,6.44,5.16,5.42,6.48,9.96,13.11,15.64,16.99,16.70,14.93,12.06,9.01,4,,,,8.62,7.31,7.02,7.42,9.39,11.52,13.46,14.82,15.14,14.37,12.68,10.62
#HOLIDAYS/DAYLIGHT SAVINGS,No,0,0,0
#COMMENTS 1,"Custom/User Format -- WMO#107290; Bundesinstitut f�r Bau-, Stadt- und Raumforschung im Bundesamt f�r Bauwesen und Raumordnung. 1) DWD are the original author of the DTRY dataset on which these EPWs are based. 2) The EPWs were converted by Climate.OneBuilding.Org. Neither the DWD nor the BBSR were responsible for the conversion, and they disclaim all liability associated with the use of the converted DTRY EPW data set. ATTENTION: So, far, it's only the header defining the location of the ASHRAE 140 weather data set. The rest is DEU_BW_Mannheim_107290_TRY2010_12_Jahr_BBSR."
#COMMENTS 1,"Custom/User Format -- WMO#107290; Bundesinstitut f�r Bau-, Stadt- und Raumforschung im Bundesamt f�r Bauwesen und Raumordnung. 1) DWD are the original author of the DTRY dataset on which these EPWs are based. 2) The EPWs were converted by Climate.OneBuilding.Org. Neither the DWD nor the BBSR were responsible for the conversion, and they disclaim all liability associated with the use of the converted DTRY EPW data set."
#COMMENTS 2,"Downloaded from Climate.OneBuilding.Org -- Ground temps represent undisturbed earth temperatures - calculated from this weather data."
#COMMENTS 3,"ATTENTION: So, far, it's only the header defining the location of the ASHRAE 140 weather data set. The rest is DEU_BW_Mannheim_107290_TRY2010_12_Jahr_BBSR."
#DATA PERIODS,1,1,Data,Monday, 1/ 1,12/31
#C1 Time in seconds. Beginning of a year is 0s.
#C2 Dry bulb temperature in Celsius at indicated time
Expand Down
16 changes: 16 additions & 0 deletions teaser/data/output/aixlib_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from mako.template import Template
from mako.lookup import TemplateLookup
import teaser.logic.utilities as utilities
import shutil


def export_multizone(buildings, prj, path=None):
Expand Down Expand Up @@ -95,6 +96,7 @@ def export_multizone(buildings, prj, path=None):
package_list=buildings,
addition=None,
extra=None)
_copy_weather_data(prj.weather_file_path, path)

for i, bldg in enumerate(buildings):

Expand Down Expand Up @@ -232,3 +234,17 @@ def _help_package_order(path, package_list, addition=None, extra=None):
out_file.write(order_template.render_unicode
(list=package_list, addition=addition, extra=extra))
out_file.close()


def _copy_weather_data(source_path, destination_path):
"""Copies the imported .mos weather file to the results folder.

Parameters
----------
source_path : str
path of local weather file
destination_path : str
path of where the weather file should be placed
"""

shutil.copy2(source_path, destination_path)
1 change: 1 addition & 0 deletions teaser/data/output/ibpsa_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ def export_ibpsa(
package_list=buildings,
addition=None,
extra=None)
ibpsa_output._copy_weather_data(prj.weather_file_path, path)

for i, bldg in enumerate(buildings):

Expand Down
4 changes: 2 additions & 2 deletions teaser/data/output/modelicatemplate/AixLib/AixLib_Multizone
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ AixLib.ThermalZones.ReducedOrder.Multizone.MultizoneEquipped multizone(
AixLib.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=AixLib.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam=
"${weather.replace("\\", "/")}")
filNam=Modelica.Utilities.Files.loadResource(
"modelica://${bldg.parent.name}/${bldg.parent.weather_file_name}"))
"Weather data reader"
annotation (Placement(transformation(extent={{-82,30},{-62,50}})));

Expand Down
3 changes: 2 additions & 1 deletion teaser/data/output/modelicatemplate/IBPSA/IBPSA_FourElements
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ model ${zone.parent.name}_${zone.name}
${library}.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=${library}.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam="${zone.parent.parent.weather_file_path.replace("\\", "/")}")
filNam=Modelica.Utilities.Files.loadResource(
"modelica://${zone.parent.parent.name}/${zone.parent.parent.weather_file_name}"))
"Weather data reader"
annotation (Placement(transformation(extent={{-98,52},{-78,72}})));
${library}.BoundaryConditions.SolarIrradiation.DiffusePerez HDifTil[${min_orientations(zone.model_attr.n_outer)}]( each outSkyCon=true,
Expand Down
3 changes: 2 additions & 1 deletion teaser/data/output/modelicatemplate/IBPSA/IBPSA_OneElement
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ model ${zone.parent.name}_${zone.name}
${library}.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=${library}.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam="${zone.parent.parent.weather_file_path.replace("\\", "/")}")
filNam=Modelica.Utilities.Files.loadResource(
"modelica://${zone.parent.parent.name}/${zone.parent.parent.weather_file_name}"))
"Weather data reader"
annotation (Placement(transformation(extent={{-98,52},{-78,72}})));
${library}.BoundaryConditions.SolarIrradiation.DiffusePerez HDifTil[${min_orientations(zone.model_attr.n_outer)}]( each outSkyCon=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ model ${zone.parent.name}_${zone.name}
${library}.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=${library}.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam="${zone.parent.parent.weather_file_path.replace("\\", "/")}")
filNam=Modelica.Utilities.Files.loadResource(
"modelica://${zone.parent.parent.name}/${zone.parent.parent.weather_file_name}"))
"Weather data reader"
annotation (Placement(transformation(extent={{-98,52},{-78,72}})));
${library}.BoundaryConditions.SolarIrradiation.DiffusePerez HDifTil[${min_orientations(zone.model_attr.n_outer)}]( each outSkyCon=true,
Expand Down
3 changes: 2 additions & 1 deletion teaser/data/output/modelicatemplate/IBPSA/IBPSA_TwoElements
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ model ${zone.parent.name}_${zone.name}
${library}.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
calTSky=${library}.BoundaryConditions.Types.SkyTemperatureCalculation.HorizontalRadiation,
computeWetBulbTemperature=false,
filNam="${zone.parent.parent.weather_file_path.replace("\\", "/")}")
filNam=Modelica.Utilities.Files.loadResource(
"modelica://${zone.parent.parent.name}/${zone.parent.parent.weather_file_name}"))
"Weather data reader"
annotation (Placement(transformation(extent={{-98,52},{-78,72}})));
${library}.BoundaryConditions.SolarIrradiation.DiffusePerez HDifTil[${min_orientations(zone.model_attr.n_outer)}]( each outSkyCon=true,
Expand Down
2 changes: 1 addition & 1 deletion teaser/examples/examplefiles/unitTest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"project": {
"version": "0.7",
"name": "Project",
"weather_file_path": "modelica://AixLib/Resources/WeatherData/TRY2010_12_Jahr_Modelica-Library.txt",
"weather_file_path": null,
"number_of_elements_calc": 2,
"merge_windows_calc": false,
"used_library_calc": "AixLib",
Expand Down
2 changes: 1 addition & 1 deletion teaser/logic/buildingobjects/calculation/aixlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, parent):
self.file_set_t_cool = "TsetCool_" + self.parent.name + ".txt"
self.file_ahu = "AHU_" + self.parent.name + ".txt"
self.file_internal_gains = "InternalGains_" + self.parent.name + ".txt"
self.version = "0.9.1"
self.version = "0.10.7"
self.total_surface_area = None
self.consider_heat_capacity = True
self.use_set_back = True
Expand Down
2 changes: 1 addition & 1 deletion teaser/logic/buildingobjects/calculation/ibpsa.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, parent):
self.parent = parent
self.file_internal_gains = "InternalGains_" + self.parent.name + ".mat"
self.version = {
"AixLib": "0.9.1",
"AixLib": "0.10.7",
"Buildings": "7.0.0",
"BuildingSystems": "2.0.0-beta2",
"IDEAS": "2.1.0",
Expand Down
20 changes: 20 additions & 0 deletions teaser/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,26 @@ def set_default(self, load_data=None):
self._merge_windows_calc = False
self._used_library_calc = "AixLib"

@property
def weather_file_path(self):
return self._weather_file_path

@weather_file_path.setter
def weather_file_path(self, value):
if value is None:
self._weather_file_path = utilities.get_full_path(
os.path.join(
"data",
"input",
"inputdata",
"weatherdata",
"DEU_BW_Mannheim_107290_TRY2010_12_Jahr_BBSR.mos",
)
)
else:
self._weather_file_path = os.path.normpath(value)
self.weather_file_name = os.path.split(self.weather_file_path)[1]

@property
def number_of_elements_calc(self):
return self._number_of_elements_calc
Expand Down