Buildings.BoundaryConditions.WeatherData
Weather data reader
Information
This package contains models to read weather data. It also contains theexpandable connector
Buildings.BoundaryConditions.WeatherData.Bus
that is used in the library to provide weather data to the different models.
Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).
Package Content
Name | Description |
---|---|
Bus | Data bus that stores weather data |
ReaderTMY3 | Reader for TMY3 weather data |
Examples | Collection of models that illustrate model use and test models |
Validation | Collection of validation models |
BaseClasses | Package with base classes for Buildings.BoundaryConditions.WeatherData |
Buildings.BoundaryConditions.WeatherData.Bus
Data bus that stores weather data
Information
This component is an expandable connector that is used to implement a bus that contains the weather data.
Extends from Modelica.Icons.SignalBus (Icon for signal bus).
Modelica definition
Buildings.BoundaryConditions.WeatherData.ReaderTMY3
Reader for TMY3 weather data
Information
This component reads TMY3 weather data (Wilcox and Marion, 2008) or user specified weather data. The weather data format is the Typical Meteorological Year (TMY3) as obtained from the EnergyPlus web site at http://energyplus.net/weather. These data, which are in the EnergyPlus format, need to be converted as described below.
Output to weaBus
The following variables serve as output and are accessible via weaBus
:
Name | Unit | Description |
---|---|---|
HDifHor
|
W/m2 | Horizontal diffuse solar radiation. |
HDifNor
|
W/m2 | Direct normal radiation. |
HGloHor
|
W/m2 | Horizontal global radiation. |
HHorIR
|
W/m2 | Horizontal infrared irradiation. |
TBlaSky
|
K | Output temperature. |
TDewPoi
|
K | Dew point temperature. |
TDryBul
|
K | Dry bulb temperature at ground level. |
TWetBul
|
K | Wet bulb temperature. |
celHei
|
m | Ceiling height. |
cloTim
|
s | One-based day number in seconds. |
lat
|
rad | Latitude of the location. |
lon
|
rad | Longitude of the location. |
nOpa
|
1 | Opaque sky cover [0, 1]. |
nTot
|
1 | Total sky Cover [0, 1]. |
pAtm
|
Pa | Atmospheric pressure. |
relHum
|
1 | Relative humidity. |
solAlt
|
rad | Altitude angle. |
solDec
|
rad | Declination angle. |
solHouAng
|
rad | Solar hour angle. |
solTim
|
s | Solar time. |
solZen
|
rad | Zenith angle. |
winDir
|
rad | Wind direction. |
winSpe
|
m/s | Wind speed. |
Adding new weather data
To add new weather data, proceed as follows:
-
Download the weather data file with the
epw
extension from http://energyplus.net/weather. -
Add the file to
Buildings/Resources/weatherdata
(or to any directory for which you have write permission). -
On a console window, type
cd Buildings/Resources/weatherdata java -jar ../bin/ConvertWeatherData.jar inputFile.epw
This will generate the weather data fileinputFile.mos
, which can be read by the model Buildings.BoundaryConditions.WeatherData.ReaderTMY3.
Location data that are read automatically from the weather data file
The following location data are automatically read from the weather file:
-
The latitude of the weather station,
lat
, -
the longitude of the weather station,
lon
, and -
the time zone relative to Greenwich Mean Time,
timZone
.
Wet bulb temperature
By default, the data bus contains the wet bulb temperature.
This introduces a nonlinear equation.
However, we have not observed an increase in computing time because
of this equation.
To disable the computation of the wet bulb temperature, set
computeWetBulbTemperature=false
.
Using constant or user-defined input signals for weather data
This model has the option of using a constant value, using the data from the weather file, or using data from an input connector for the following variables:
- The atmospheric pressure,
- the ceiling height,
- the total sky cover,
- the opaque sky cover,
- the dry bulb temperature,
- the dew point temperature,
- the sky black body temperature,
- the relative humidity,
- the wind direction,
- the wind speed,
- the global horizontal radiation, direct normal and diffuse horizontal radiation, and
- the infrared horizontal radiation.
By default, all data are obtained from the weather data file,
except for the atmospheric pressure, which is set to the
parameter pAtm=101325
Pascals.
The parameter *Sou
configures the source of the data.
For the atmospheric pressure, temperatures, relative humidity, wind speed and wind direction,
the enumeration
Buildings.BoundaryConditions.Types.DataSource
is used as follows:
Parameter *Sou
|
Data used to compute weather data. |
---|---|
File | Use data from file. |
Parameter | Use value specified by the parameter. |
Input | Use value from the input connector. |
Because global, diffuse and direct radiation are related to each other, the parameter
HSou
is treated differently.
It is set to a value of the enumeration
Buildings.BoundaryConditions.Types.RadiationDataSource,
and allows the following configurations:
Parameter HSou
|
Data used to compute weather data. |
---|---|
File | Use data from file. |
Input_HGloHor_HDifHor | Use global horizontal and diffuse horizontal radiation from input connector. |
Input_HDirNor_HDifHor | Use direct normal and diffuse horizontal radiation from input connector. |
Input_HDirNor_HGloHor | Use direct normal and global horizontal radiation from input connector. |
Length of weather data and simulation period
If weather data span a year, which is the default for TMY3 data, or multiple years,
then this model can be used for simulations that span multiple years. The simulation
start time needs to be set to the clock time of the respective start time. For example,
to start at January 2 at 10am, set start time to t=(24+10)*3600
seconds.
For this computation, the used date and time (here January 2, 10 am) must be expressed in the same time zone
as the one that is used to define the TMY3 file. This is usually the local (winter) time zone.
The parameter `timZon` represents the TMY3 file time zone, expressed in seconds compared to UTC.
Moreover, weather data need not span a whole year, or it can span across New Year. In this case, the simulation cannot exceed the time of the weather data file. Otherwise, the simulation stops with an error.
As weather data have one entry at the start of the time interval, the end time of the weather data file is computed as the last time entry plus the average time increment of the file. For example, an hourly weather data file has 8760 entries, starting on January 1 at 0:00. The last entry in the file will be for December 31 at 23:00. As the time increment is 1 hour, the model assumes the weather file to end at December 31 at 23:00 plus 1 hour, e.g., at January 1 at 0:00.
Notes
-
In HVAC systems, when the fan is off, changes in atmospheric pressure can cause small air flow rates in the duct system due to change in pressure and hence in the mass of air that is stored in air volumes (such as in fluid junctions or in the room model). This may increase computing time. Therefore, the default value for the atmospheric pressure is set to a constant. Furthermore, if the initial pressure of air volumes are different from the atmospheric pressure, then fast pressure transients can happen in the first few seconds of the simulation. This can cause numerical problems for the solver. To avoid this problem, set the atmospheric pressure to the same value as the medium default pressure, which is typically set to the parameter
Medium.p_default
. For medium models for moist air and dry air, the default isMedium.p_default=101325
Pascals. -
Different units apply depending on whether data are obtained from a file, or from a parameter or an input connector:
-
When using TMY3 data from a file (e.g.
USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos
), the units must be the same as the original TMY3 file used by EnergyPlus (e.g.USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.epw
). The TMY3 data used by EnergyPlus are in both SI units and non-SI units. IfResources/bin/ConvertWeatherData.jar
is used to convert the.epw
file to an.mos
file, the units of the TMY3 data are preserved and the file can be directly used by this data reader. The data reader will automatically convert units to the SI units used by Modelica. For example, the dry bulb temperatureTDryBul
in TMY3 is in degree Celsius. The data reader will automatically convert the data to Kelvin. The wind directionwinDir
in TMY3 is degrees and will be automatically converted to radians. -
When using data from a parameter or from an input connector,
the data must be in the SI units used by Modelica.
For instance, the unit must be
Pa
for pressure,K
for temperature,W/m2
for solar radiations andrad
for wind direction.
-
When using TMY3 data from a file (e.g.
- The ReaderTMY3 should only be used with TMY3 data. It contains a time shift for solar radiation data that is explained below. This time shift needs to be removed if the user may want to use the ReaderTMY3 for other weather data types.
Implementation
Start and end data for annual weather data files
The TMY3 weather data, as well as the EnergyPlus weather data, start at 1:00 AM
on January 1, and provide hourly data until midnight on December 31.
Thus, the first entry for temperatures, humidity, wind speed etc. are values
at 1:00 AM and not at midnight. Furthermore, the TMY3 weather data files can have
values at midnight of December 31 that may be significantly different from the values
at 1:00 AM on January 1.
Since annual simulations require weather data that start at 0:00 on January 1,
data need to be provided for this hour. Due to the possibly large change in
weatherdata between 1:00 AM on January 1 and midnight at December 31,
the weather data files in the Buildings library do not use the data entry from
midnight at December 31 as the value for t=0. Rather, the
value from 1:00 AM on January 1 is duplicated and used for 0:00 on January 1.
To maintain a data record with 8760 hours, the weather data record from
midnight at December 31 is deleted.
These changes in the weather data file are done in the Java program
Buildings/Resources/bin/ConvertWeatherData.jar
that converts
EnergyPlus weather data file to Modelica weather data files, and which is described
above.
The length of the weather data is calculated as the
end time stamp minus start time stamp plus average increment, where the
average increment is equal to the end time stamp minus start time stamp divided
by the number of rows minus 1.
This only works correctly for weather files with equidistant time stamps.
Time shift for solar radiation data
To read weather data from the TMY3 weather data file, there are two data readers in this model. One data reader obtains all data except solar radiation, and the other data reader reads only the solar radiation data, shifted by 30 minutes. The reason for this time shift is as follows: The TMY3 weather data file contains for solar radiation the "...radiation received on a horizontal surface during the 60-minute period ending at the timestamp." Thus, as the figure below shows, a more accurate interpolation is obtained if time is shifted by 30 minutes prior to reading the weather data.
References
- Wilcox S. and W. Marion. Users Manual for TMY3 Data Sets. Technical Report, NREL/TP-581-43156, revised May 2008.
Parameters
Type | Name | Default | Description |
---|---|---|---|
Boolean | computeWetBulbTemperature | true | If true, then this model computes the wet bulb temperature |
String | filNam | "" | Name of weather data file |
Data source | |||
DataSource | pAtmSou | Buildings.BoundaryConditions... | Atmospheric pressure |
Pressure | pAtm | 101325 | Atmospheric pressure (used if pAtmSou=Parameter) [Pa] |
DataSource | ceiHeiSou | Buildings.BoundaryConditions... | Ceiling height |
Real | ceiHei | 20000 | Ceiling height (used if ceiHei=Parameter) [m] |
DataSource | totSkyCovSou | Buildings.BoundaryConditions... | Total sky cover |
Real | totSkyCov | 0.5 | Total sky cover (used if totSkyCov=Parameter). Use 0 <= totSkyCov <= 1 [1] |
DataSource | opaSkyCovSou | Buildings.BoundaryConditions... | Opaque sky cover |
Real | opaSkyCov | 0.5 | Opaque sky cover (used if opaSkyCov=Parameter). Use 0 <= opaSkyCov <= 1 [1] |
DataSource | TDryBulSou | Buildings.BoundaryConditions... | Dry bulb temperature |
Temperature | TDryBul | 293.15 | Dry bulb temperature (used if TDryBul=Parameter) [K] |
DataSource | TDewPoiSou | Buildings.BoundaryConditions... | Dew point temperature |
Temperature | TDewPoi | 283.15 | Dew point temperature (used if TDewPoi=Parameter) [K] |
DataSource | TBlaSkySou | Buildings.BoundaryConditions... | Black-body sky temperature |
Temperature | TBlaSky | 273.15 | Black-body sky temperature (used if TBlaSkySou=Parameter) [K] |
DataSource | relHumSou | Buildings.BoundaryConditions... | Relative humidity |
Real | relHum | 0.5 | Relative humidity (used if relHum=Parameter) [1] |
DataSource | winSpeSou | Buildings.BoundaryConditions... | Wind speed |
Velocity | winSpe | 1 | Wind speed (used if winSpe=Parameter) [m/s] |
DataSource | winDirSou | Buildings.BoundaryConditions... | Wind direction |
Angle | winDir | 1.0 | Wind direction (used if winDir=Parameter) [rad] |
DataSource | HInfHorSou | Buildings.BoundaryConditions... | Infrared horizontal radiation |
HeatFlux | HInfHor | 0.0 | Infrared horizontal radiation (used if HInfHorSou=Parameter) [W/m2] |
RadiationDataSource | HSou | Buildings.BoundaryConditions... | Global, diffuse, and direct normal radiation |
Sky temperature | |||
SkyTemperatureCalculation | calTSky | Buildings.BoundaryConditions... | Computation of black-body sky temperature |
Connectors
Type | Name | Description |
---|---|---|
input RealInput | pAtm_in | Input pressure [Pa] |
input RealInput | ceiHei_in | Input ceiling height [m] |
input RealInput | totSkyCov_in | Input total sky cover [1] |
input RealInput | opaSkyCov_in | Input opaque sky cover [1] |
input RealInput | TDryBul_in | Input dry bulb temperature [K] |
input RealInput | TDewPoi_in | Input dew point temperature [K] |
input RealInput | TBlaSky_in | Black-body sky temperature [K] |
input RealInput | relHum_in | Input relative humidity [1] |
input RealInput | winSpe_in | Input wind speed [m/s] |
input RealInput | winDir_in | Input wind direction [rad] |
input RealInput | HInfHor_in | Input infrared horizontal radiation [W/m2] |
input RealInput | HGloHor_in | Input global horizontal radiation [W/m2] |
input RealInput | HDifHor_in | Input diffuse horizontal radiation [W/m2] |
input RealInput | HDirNor_in | Input direct normal radiation [W/m2] |
Bus | weaBus | Weather data bus |
Modelica definition
Buildings.BoundaryConditions.WeatherData.ReaderTMY3.Latitude
Generate constant signal of type Real
Information
Block to output the latitude of the location. This block is added so that the latitude is displayed with a comment in the GUI of the weather bus connector.
Implementation
If Modelica.Blocks.Sources.Constant where used, then the comment for the latitude would be "Connector of Real output signal". As this documentation string cannot be overwritten, a new block was implemented.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Angle | latitude | Latitude [rad] |
Connectors
Type | Name | Description |
---|---|---|
output RealOutput | y | Latitude of the location [rad] |
Modelica definition
Buildings.BoundaryConditions.WeatherData.ReaderTMY3.Longitude
Generate constant signal of type Real
Information
Block to output the longitude of the location. This block is added so that the longitude is displayed with a comment in the GUI of the weather bus connector.
Implementation
If Modelica.Blocks.Sources.Constant where used, then the comment for the longitude would be "Connector of Real output signal". As this documentation string cannot be overwritten, a new block was implemented.
Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).
Parameters
Type | Name | Default | Description |
---|---|---|---|
Angle | longitude | Longitude [rad] |
Connectors
Type | Name | Description |
---|---|---|
output RealOutput | y | Longitude of the location [rad] |