Buildings.BoundaryConditions.WeatherData

Weather data reader

Information


This package contains models to read weather data. It also contains
an expandable connector called Bus that
is used in the library to provide weather data to the different models.

Package Content

NameDescription
Buildings.BoundaryConditions.WeatherData.UsersGuide UsersGuide User's Guide
Buildings.BoundaryConditions.WeatherData.ReaderTMY3 ReaderTMY3 Reader for TMY3 weather data
Buildings.BoundaryConditions.WeatherData.Bus Bus Data bus that stores weather data
Buildings.BoundaryConditions.WeatherData.Examples Examples Collection of models that illustrate model use and test models
Buildings.BoundaryConditions.WeatherData.BaseClasses BaseClasses Library with base classes to read weather data


Buildings.BoundaryConditions.WeatherData.ReaderTMY3 Buildings.BoundaryConditions.WeatherData.ReaderTMY3

Reader for TMY3 weather data

Buildings.BoundaryConditions.WeatherData.ReaderTMY3

Information


This component reads TMY3 weather data (Wilcox and Marion, 2008). The parameter lon is the longitude of the weather station, and the parameter timZone is the time zone relative to Greenwich Mean Time. By default, the reader obtains values for these parameters by scanning the TMY3 weather data file.

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

Parameters

TypeNameDefaultDescription
StringfilNam Name of weather data file

Connectors

TypeNameDescription
BusweaBusWeather Data Bus

Modelica definition

block ReaderTMY3 "Reader for TMY3 weather data "

public 
  parameter String filNam "Name of weather data file";
  final parameter Modelica.SIunits.Angle lon(displayUnit="deg")=
    Buildings.BoundaryConditions.WeatherData.BaseClasses.getLongitudeTMY3(filNam) 
    "Longitude";
  final parameter Modelica.SIunits.Time timZon(displayUnit="h")=
    Buildings.BoundaryConditions.WeatherData.BaseClasses.getTimeZoneTMY3(filNam) 
    "Time zone";
  Bus weaBus "Weather Data Bus";

protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    final tableOnFile=true,
    final tableName="tab1",
    final fileName=filNam,
    final smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative,
    final columns={2,3,4,5,6,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,
        30}) "Data reader";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTemperature
    conTemDryBul "Converts unit for dry bulb temperature ";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTemperature
    conTemDewPoi "Converts unit for dew point temperature";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRelativeHumidity
    conHum 
    "Converts the relative humidity from percentage to [0, 1] and constrains it to [0, 1]";
  BaseClasses.CheckPressure chePre "Checks the air pressure";
  BaseClasses.CheckSkyCover cheTotSkyCov "Checks the total sky cover";
  BaseClasses.CheckSkyCover cheOpaSkyCov "Checks the opaque sky cover";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    cheGloHorRad "Checks the global horizontal radiation";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    cheDifHorRad "Checks the diffuse horizontal radiation";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    cheDirNorRad "Checks the direct normal radiation";
  BaseClasses.CheckCeilingHeight cheCeiHei "Checks the ceiling height";
  BaseClasses.CheckWindSpeed cheWinSpe "Checks the wind speed";
  BaseClasses.ConvertRadiation cheRadHor "Checks the horizontal radiation";
  BaseClasses.CheckWindDirection cheWinDir "Checks the wind direction";
  SkyTemperature.BlackBody TBlaSky(calTSky=0) 
    "Checks the sky black-body temperature";
  Utilities.SimulationTime simTim "Simulation time";
  Modelica.Blocks.Math.Add add 
    "Adds 30 minutes to time to shift weather data reader";
  Modelica.Blocks.Sources.Constant con30mins(k=1800) 
    "Constant used to shift weather data reader";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.LocalCivilTime locTim(
      lon=lon, timZon=timZon) "Local civil time";

  Modelica.Blocks.Tables.CombiTable1Ds datRea1(
    final tableOnFile=true,
    final tableName="tab1",
    final fileName=filNam,
    final smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative,
    final columns=8:11) "Data reader";

  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim1 
    "Converts simulation time to calendar time";
  BaseClasses.ConvertTime conTim "Converts simulation time to calendar time";
  BaseClasses.EquationOfTime eqnTim "Equation of time";
  BaseClasses.SolarTime solTim "Solar time";
equation 
  connect(conTemDryBul.TemK, weaBus.TDryBul);
  connect(conTemDewPoi.TemK, weaBus.TDewPoi);
  connect(conHum.relHumOut, weaBus.relHum);
  connect(chePre.POut, weaBus.pAtm);
  connect(cheTotSkyCov.nOut, weaBus.nTot);
  connect(cheOpaSkyCov.nOut, weaBus.nOpa);
  connect(cheGloHorRad.HOut, weaBus.HGloHor);
  connect(cheDifHorRad.HOut, weaBus.HDifHor);
  connect(cheDirNorRad.HOut, weaBus.HDirNor);
  connect(cheCeiHei.ceiHeiOut, weaBus.celHei);
  connect(cheWinSpe.winSpeOut, weaBus.winSpe);
  connect(cheRadHor.HOut, weaBus.radHor);
  connect(cheWinDir.nOut, weaBus.winDir);
  connect(conTemDryBul.TemK, TBlaSky.TDryBul);
  connect(conTemDewPoi.TemK, TBlaSky.TDewPoi);
  connect(cheOpaSkyCov.nOut, TBlaSky.nOpa);
  connect(cheRadHor.HOut, TBlaSky.radHor);
  connect(TBlaSky.TBlaSky, weaBus.TBlaSky);
  connect(simTim.y, weaBus.cloTim);
  connect(simTim.y, add.u2);
  connect(con30mins.y, add.u1);
  connect(datRea1.y[1], cheRadHor.HIn);
  connect(datRea1.y[3], cheDirNorRad.HIn);
  connect(datRea1.y[2], cheGloHorRad.HIn);
  connect(datRea1.y[4], cheDifHorRad.HIn);
  connect(add.y,conTim1. simTim);
  connect(conTim1.calTim, datRea1.u);
  connect(simTim.y, locTim.cloTim);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
  connect(simTim.y, eqnTim.nDay);
  connect(eqnTim.eqnTim, solTim.equTim);
  connect(locTim.locTim, solTim.locTim);
  connect(solTim.solTim, weaBus.solTim);
  connect(datRea.y[11], cheWinDir.nIn);
  connect(datRea.y[1], conTemDryBul.TemC);
  connect(datRea.y[2], conTemDewPoi.TemC);
  connect(datRea.y[3], conHum.relHumIn);
  connect(datRea.y[13], cheTotSkyCov.nIn);
  connect(datRea.y[14], cheOpaSkyCov.nIn);
  connect(datRea.y[12], cheWinSpe.winSpeIn);
  connect(datRea.y[4], chePre.PIn);
  connect(datRea.y[16], cheCeiHei.ceiHeiIn);
end ReaderTMY3;

Buildings.BoundaryConditions.WeatherData.Bus Buildings.BoundaryConditions.WeatherData.Bus

Data bus that stores weather data

Buildings.BoundaryConditions.WeatherData.Bus

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

expandable connector Bus "Data bus that stores weather data"
  extends Modelica.Icons.SignalBus;

end Bus;

HTML-documentation generated by Dymola Thu Mar 17 10:14:46 2011.