Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples

Collection of models that illustrate model use and test models

Information

Extends from Buildings.BaseClasses.BaseIconExamples (Icon for Examples packages).

Package Content

NameDescription
CheckCeilingHeight Test model for ceiling height check
CheckPressure Test model for pressure check
CheckSkyCover Test model for checking sky cover
CheckWindDirection Test model for wind direction check
CheckWindSpeed Test model for wind speed check
ConvertRadiation Test model for convert radiation
ConvertRelativeHumidity Test model for converting temperature
ConvertTemperature Test model for converting temperature
EquationOfTime Test model for equation of time
GetHeaderElement Test model to get header element
LocalCivilTime Test model for calculate local civil time
SolarTime Test model for solar time


Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckCeilingHeight

Test model for ceiling height check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckCeilingHeight

Modelica definition

model CheckCeilingHeight "Test model for ceiling height check"
  import Buildings;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckCeilingHeight
    cheCeiHei;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[20], cheCeiHei.ceiHeiIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end CheckCeilingHeight;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure

Test model for pressure check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure

Modelica definition

model CheckPressure "Test model for pressure check"
  import Buildings;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckPressure chePre;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[4], chePre.PIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end CheckPressure;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckSkyCover

Test model for checking sky cover

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckSkyCover

Modelica definition

model CheckSkyCover "Test model for checking sky cover"
  import Buildings;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckSkyCover
    cheTotSkyCov "Check total sky cover";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckSkyCover
    cheOpaSkyCov "Check opaque sky cover";
  Buildings.Utilities.SimulationTime simTim "Generate simulation time";
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[17], cheTotSkyCov.nIn);
  connect(datRea.y[18], cheOpaSkyCov.nIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end CheckSkyCover;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindDirection

Test model for wind direction check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindDirection

Modelica definition

model CheckWindDirection "Test model for wind direction check"
  import Buildings;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckWindDirection
    cheWinDir;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[15], cheWinDir.nIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end CheckWindDirection;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindSpeed

Test model for wind speed check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindSpeed

Modelica definition

model CheckWindSpeed "Test model for wind speed check"
  import Buildings;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckWindSpeed cheWinSpe;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[16], cheWinSpe.winSpeIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end CheckWindSpeed;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation

Test model for convert radiation

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation

Modelica definition

model ConvertRadiation "Test model for convert radiation"
  import Buildings;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    cheGloRad "Check global horizontal radiation";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    cheDifRad "Check diffuse horizontal radiation";
  Buildings.Utilities.SimulationTime simTim;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime timCon 
    "Convert simmulation time to calendar time";
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
equation 
  connect(timCon.calTim, datRea.u);
  connect(datRea.y[8], cheGloRad.HIn);
  connect(datRea.y[10], cheDifRad.HIn);
  connect(simTim.y, timCon.simTim);
end ConvertRadiation;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity

Test model for converting temperature

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity

Modelica definition

model ConvertRelativeHumidity "Test model for converting temperature"
  import Buildings;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRelativeHumidity
    conHum;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[3], conHum.relHumIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end ConvertRelativeHumidity;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTemperature

Test model for converting temperature

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTemperature

Modelica definition

model ConvertTemperature "Test model for converting temperature"
  import Buildings;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTemperature
    conTemDryBul "Convert unit for dry bulb temperature ";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTemperature
    conTemDewPoi "Convert unit for dew point temperature";
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=
        "Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos",
    columns=2:30,
    smoothness=Modelica.Blocks.Types.Smoothness.ContinuousDerivative) 
    "Data reader";
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(datRea.y[1], conTemDryBul.TemC);
  connect(datRea.y[2], conTemDewPoi.TemC);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end ConvertTemperature;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime

Test model for equation of time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime

Modelica definition

model EquationOfTime "Test model for equation of time"
  import Buildings;
  Utilities.SimulationTime simTim;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.EquationOfTime eqnTim;
equation 
  connect(simTim.y, eqnTim.nDay);
end EquationOfTime;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetHeaderElement

Test model to get header element

Parameters

TypeNameDefaultDescription
Anglelongitude [rad]
TimetimeZone [s]

Modelica definition

model GetHeaderElement "Test model to get header element"
  parameter Modelica.SIunits.Angle longitude(fixed=false, displayUnit="deg");
  parameter Modelica.SIunits.Time timeZone(fixed=false, displayUnit="h");

initial equation 
  longitude = Buildings.BoundaryConditions.WeatherData.BaseClasses.getLongitudeTMY3(
    filNam="Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos");
  timeZone = Buildings.BoundaryConditions.WeatherData.BaseClasses.getTimeZoneTMY3(
    filNam="Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos");
  assert(abs(timeZone+6*3600) < 1, "Error when parsing time zone, timeZone = "
    + realString(timeZone));
  assert(abs(longitude*180/Modelica.Constants.pi+87.92) < 1,
      "Error when parsing longitude, longitude = " + realString(longitude));

end GetHeaderElement;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime

Test model for calculate local civil time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime

Modelica definition

model LocalCivilTime "Test model for calculate local civil time"
  import Buildings;
  Buildings.Utilities.SimulationTime simTim;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.LocalCivilTime locTim(
      timZon=-21600, lon=-1.5293932423067);
equation 
  connect(simTim.y, locTim.cloTim);
end LocalCivilTime;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.SolarTime

Test model for solar time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.SolarTime

Modelica definition

model SolarTime "Test model for solar time"
  import Buildings;
  Utilities.SimulationTime simTim;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.LocalCivilTime locTim(
      timZon=-21600, lon=-1.7039261675061);
  Buildings.BoundaryConditions.WeatherData.BaseClasses.SolarTime solTim;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.EquationOfTime eqnTim;
equation 
  connect(simTim.y, locTim.cloTim);
  connect(locTim.locTim, solTim.locTim);
  connect(simTim.y, eqnTim.nDay);
  connect(eqnTim.eqnTim, solTim.equTim);
end SolarTime;

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