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
Name |
Description |
CheckBlackBodySkyTemperature
|
Test model for CheckBlackBodySkyTemperature |
CheckCeilingHeight
|
Test model for ceiling height check |
CheckPressure
|
Test model for pressure check |
CheckRadiation
|
Test model for CheckRadiation |
CheckRelativeHumidity
|
Test model for CheckRelativeHumidity |
CheckSkyCover
|
Test model for checking sky cover |
CheckTemperature
|
Test model for CheckTemperature |
CheckWindDirection
|
Test model for wind direction check |
CheckWindSpeed
|
Test model for wind speed check |
ConvertRadiation
|
Test model for ConvertRadiation |
ConvertRelativeHumidity
|
Test model for converting relative humidity and checking its validity |
ConvertTime
|
Test model for converting time |
EquationOfTime
|
Test model for equation of time |
GetAbsolutePath
|
Test model to get the absolute path of a URI |
GetHeaderElement
|
Test model to get header element |
LocalCivilTime
|
Test model for calculate local civil time |
SolarTime
|
Test model for solar time |
Test model for CheckBlackBodySkyTemperature
Information
This example tests the model that checks the black-body sky temperature.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for ceiling height check
Information
This example tests the model that constrains the ceiling height.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for pressure check
Information
This example tests the model that asserts that the pressure is within acceptable bounds.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for CheckRadiation
Information
This example tests the model that constrains the radiation.
Extends from Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRadiation (Test model for ConvertRadiation).
Modelica definition
Test model for CheckRelativeHumidity
Information
This example tests the model that constrains the relative humidity.
Extends from Buildings.BoundaryConditions.WeatherData.BaseClasses.Examples.ConvertRelativeHumidity (Test model for converting relative humidity and checking its validity).
Modelica definition
Test model for checking sky cover
Information
This example tests the model that constrains the sky cover.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model CheckSkyCover
extends Modelica.Icons.Example;
Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckSkyCover
cheTotSkyCov ;
Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckSkyCover
cheOpaSkyCov ;
protected
Buildings.Utilities.Time.ModelTime modTim ;
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) ;
Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim;
Modelica.Blocks.Math.Gain conTotSkyCov(
final k=0.1) ;
Modelica.Blocks.Math.Gain conOpaSkyCov1(
final k=0.1) ;
equation
connect(modTim.y, conTim.modTim);
connect(conTim.calTim, datRea.u);
connect(datRea.y[17], conTotSkyCov.u);
connect(datRea.y[18], conOpaSkyCov1.u);
connect(conTotSkyCov.y, cheTotSkyCov.nIn);
connect(conOpaSkyCov1.y, cheOpaSkyCov.nIn);
end CheckSkyCover;
Test model for CheckTemperature
Information
This example tests the model that checks the temperature.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
model CheckTemperature
extends Modelica.Icons.Example;
Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckTemperature
cheTemDryBul ;
Buildings.BoundaryConditions.WeatherData.BaseClasses.CheckTemperature
cheTemDewPoi ;
Buildings.Utilities.Time.ModelTime modTim ;
Buildings.BoundaryConditions.WeatherData.BaseClasses.ConvertTime conTim ;
Modelica.Blocks.Math.UnitConversions.From_degC from_degC ;
Modelica.Blocks.Math.UnitConversions.From_degC from_degC1 ;
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) ;
equation
connect(modTim.y, conTim.modTim);
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;
Test model for wind direction check
Information
This example tests the model that constrains the wind direction.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for wind speed check
Information
This example tests the model that constrains the wind speed.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for ConvertRadiation
Information
This example tests the model that converts radiation.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for converting relative humidity and checking its validity
Information
This example tests the model that converts relative humidity.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for converting time
Information
This example tests the model that converts time.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for equation of time
Information
This example tests the model that computes the equation of time.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
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
Type | Name | Default | Description |
String | f[:] | {"file://package.mo","modeli... | Name of a file that exists |
String | fAbs[:] | Buildings.BoundaryConditions... | Absolute path of f |
Modelica definition
model GetAbsolutePath
extends Modelica.Icons.Example;
parameter String f[:] = {"file://package.mo",
"modelica://Buildings/package.mo",
"package.mo"} ;
parameter String fAbs[:]=
Buildings.BoundaryConditions.WeatherData.BaseClasses.getAbsolutePath(uri=f) ;
final parameter Integer dummy =
size(f, 1) ;
initial algorithm
for i
in 1:
size(f, 1)
loop
Modelica.Utilities.Streams.print("Absolute path = " + fAbs[i]);
end for;
end GetAbsolutePath;
Test model to get header element
Information
This example tests getting the header of the TMY3 weather data file.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Parameters
Type | Name | Default | Description |
Angle | longitude | | Longitude [rad] |
Angle | latitude | | Latitude [rad] |
Time | timeZone | | Time zone [s] |
Modelica definition
model GetHeaderElement
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;
Test model for calculate local civil time
Information
This example tests the model that computes the local civil time.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
Test model for solar time
Information
This example tests the model that computes the solar time.
Extends from Modelica.Icons.Example (Icon for runnable examples).
Modelica definition
http://simulationresearch.lbl.gov/modelica