LBL logo

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples

Collection of models that illustrate model use and test models

Information

This package contains examples for the use of models that can be found in Buildings.BoundaryConditions.WeatherData.BaseClasses.

Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).

Package Content

NameDescription
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckCeilingHeight CheckCeilingHeight Test model for ceiling height check
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckRadiation CheckRadiation Test model for CheckRadiation
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure CheckPressure Test model for pressure check
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckRelativeHumidity CheckRelativeHumidity Test model for CheckRelativeHumidity
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckSkyCover CheckSkyCover Test model for checking sky cover
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckTemperature CheckTemperature Test model for CheckTemperature
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindDirection CheckWindDirection Test model for wind direction check
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindSpeed CheckWindSpeed Test model for wind speed check
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation ConvertRadiation Test model for ConvertRadiation
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity ConvertRelativeHumidity Test model for converting relative humidity and checking its validity
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTime ConvertTime Test model for converting time
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime EquationOfTime Test model for equation of time
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetAbsolutePath GetAbsolutePath Test model to get the absolute path of a URI
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetHeaderElement GetHeaderElement Test model to get header element
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime LocalCivilTime Test model for calculate local civil time
Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.SolarTime SolarTime Test model for solar time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckCeilingHeight Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckCeilingHeight

Test model for ceiling height check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckCeilingHeight

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CheckCeilingHeight "Test model for ceiling height check"
  extends Modelica.Icons.Example;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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.CheckRadiation Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckRadiation

Test model for CheckRadiation

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckRadiation

Information

Extends from Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation (Test model for ConvertRadiation).

Modelica definition

model CheckRadiation "Test model for CheckRadiation"
  extends Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckRadiation cheGloRad 
    "Check global horizontal radiation";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckRadiation cheDifRad 
    "Check diffuse horizontal radiation";
equation 

  connect(conGloRad.HOut, cheGloRad.HIn);
  connect(conDifRad.HOut, cheDifRad.HIn);
end CheckRadiation;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure

Test model for pressure check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckPressure

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CheckPressure "Test model for pressure check"
  extends Modelica.Icons.Example;

  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckPressure chePre;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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.CheckRelativeHumidity Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckRelativeHumidity

Test model for CheckRelativeHumidity

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckRelativeHumidity

Information

Extends from Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity (Test model for converting relative humidity and checking its validity).

Modelica definition

model CheckRelativeHumidity "Test model for CheckRelativeHumidity"
  extends Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity;

  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckRelativeHumidity
    cheRelHum;
equation 
  connect(conRelHum.relHumOut, cheRelHum.relHumIn);
end CheckRelativeHumidity;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckSkyCover Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckSkyCover

Test model for checking sky cover

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckSkyCover

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CheckSkyCover "Test model for checking sky cover"
  extends Modelica.Icons.Example;
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=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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.CheckTemperature Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckTemperature

Test model for CheckTemperature

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckTemperature

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CheckTemperature "Test model for CheckTemperature"
  extends Modelica.Icons.Example;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckTemperature
    cheTemDryBul "Check dry bulb temperature ";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckTemperature
    cheTemDewPoi "Check dew point temperature";
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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;
  Modelica.Blocks.Math.UnitConversions.From_degC from_degC;
  Modelica.Blocks.Math.UnitConversions.From_degC from_degC1;
equation 
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
  connect(datRea.y[1], from_degC.u);
  connect(from_degC.y, cheTemDryBul.TIn);
  connect(datRea.y[2], from_degC1.u);
  connect(from_degC1.y, cheTemDewPoi.TIn);
end CheckTemperature;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindDirection Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindDirection

Test model for wind direction check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindDirection

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CheckWindDirection "Test model for wind direction check"
  extends Modelica.Icons.Example;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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;
  Modelica.Blocks.Math.UnitConversions.From_deg from_deg;
equation 
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
  connect(datRea.y[15], from_deg.u);
  connect(from_deg.y, cheWinDir.nIn);
end CheckWindDirection;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindSpeed Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindSpeed

Test model for wind speed check

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.CheckWindSpeed

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model CheckWindSpeed "Test model for wind speed check"
  extends Modelica.Icons.Example;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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 Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation

Test model for ConvertRadiation

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ConvertRadiation "Test model for ConvertRadiation"
  extends Modelica.Icons.Example;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    conGloRad "Convert units for global horizontal radiation";
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRadiation
    conDifRad "Convert units for 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=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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], conGloRad.HIn);
  connect(datRea.y[10], conDifRad.HIn);
  connect(simTim.y, timCon.simTim);
end ConvertRadiation;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity

Test model for converting relative humidity and checking its validity

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ConvertRelativeHumidity 
  "Test model for converting relative humidity and checking its validity"
  extends Modelica.Icons.Example;
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertRelativeHumidity
    conRelHum;
  Buildings.Utilities.SimulationTime simTim;
protected 
  Modelica.Blocks.Tables.CombiTable1Ds datRea(
    tableOnFile=true,
    tableName="tab1",
    fileName=ModelicaServices.ExternalReferences.loadResource(
       "modelica://Buildings/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], conRelHum.relHumIn);
  connect(simTim.y, conTim.simTim);
  connect(conTim.calTim, datRea.u);
end ConvertRelativeHumidity;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTime Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTime

Test model for converting time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertTime

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model ConvertTime "Test model for converting time"
  extends Modelica.Icons.Example;
  Buildings.Utilities.SimulationTime simTim;
public 
  Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
equation 
  connect(simTim.y, conTim.simTim);
end ConvertTime;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime

Test model for equation of time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.EquationOfTime

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

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

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetAbsolutePath Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetAbsolutePath

Test model to get the absolute path of a URI

Information

This model tests the function that gets the absolute path of a URI.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Stringf[:]{"file://legal.html","modeli...Name of a file that exists
StringfAbs[:]Buildings.BoundaryConditions...Absolute path of f

Modelica definition

model GetAbsolutePath "Test model to get the absolute path of a URI"
  extends Modelica.Icons.Example;
  parameter String f[:] = {"file://legal.html",
                           "modelica://Buildings/legal.html",
                           "legal.html"} "Name of a file that exists";
  parameter String fAbs[:]=
    Buildings.BoundaryConditions.WeatherData.BaseClasses.getAbsolutePath(uri=f) 
    "Absolute path of f";
  final parameter Integer dummy = size(f, 1) 
    "Dummy variable, used have a result needed for the unit tests";
initial algorithm 
  for i in 1:size(f, 1) loop
    Modelica.Utilities.Streams.print("Absolute path = " + fAbs[i]);
  end for;

end GetAbsolutePath;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetHeaderElement Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.GetHeaderElement

Test model to get header element

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Anglelongitude [rad]
Anglelatitude [rad]
TimetimeZone [s]

Modelica definition

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

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

end GetHeaderElement;

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime

Test model for calculate local civil time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.LocalCivilTime

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model LocalCivilTime "Test model for calculate local civil time"
  extends Modelica.Icons.Example;
  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 Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.SolarTime

Test model for solar time

Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.SolarTime

Information

Extends from Modelica.Icons.Example (Icon for runnable examples).

Modelica definition

model SolarTime "Test model for solar time"
  extends Modelica.Icons.Example;
  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;

Automatically generated Thu Oct 24 15:08:02 2013.