CDL.Utilities.Validation

Collection of models that validate the utilities blocks of the CDL

Information

This package contains models that validate the blocks in CDL.Utilities.

The examples plot various outputs, which have been verified against analytical solutions. These model outputs are stored as reference data to allow continuous validation whenever models in the library change.

Package Content

Name Description
CDL.Utilities.Validation.Assert Assert Validate the Assert block
CDL.Utilities.Validation.SunRiseSet SunRiseSet Test model for the block SunRiseSet
CDL.Utilities.Validation.SunRiseSetNegativeStartTime SunRiseSetNegativeStartTime Test model for the block SunRiseSet with negative start time
CDL.Utilities.Validation.SunRiseSetPositiveStartTime SunRiseSetPositiveStartTime Test model for the block SunRiseSet with positive start time

CDL.Utilities.Validation.Assert CDL.Utilities.Validation.Assert

Validate the Assert block

CDL.Utilities.Validation.Assert

Information

Validation test for the block CDL.Utilities.Assert.

Modelica definition

model Assert "Validate the Assert block" CDL.Utilities.Assert assert( message="input became false") "Trigger warning and print warning message"; CDL.Logical.Sources.Pulse booPul( period=0.5) "Output boolean pulse"; equation connect(booPul.y,assert.u); end Assert;

CDL.Utilities.Validation.SunRiseSet CDL.Utilities.Validation.SunRiseSet

Test model for the block SunRiseSet

CDL.Utilities.Validation.SunRiseSet

Information

This example includes four instances of the CDL.Utilities.SunRiseSet block: Two normal cases, an arctic and antarctic case. The normal cases are represented by San Francisco and Sydney, where there is a sunrise and sunset every day.

Above the arctic circle and below the antarctic circle, in winter and summer there is a period in which there is no sunset and sunrise for a few days. Hence, the output signals of the block remain constant.

Modelica definition

model SunRiseSet "Test model for the block SunRiseSet" CDL.Utilities.SunRiseSet sunRiseSetArctic( lat=1.2566370614359, lon=-1.2566370614359, timZon=-18000) "Arctic circle case"; CDL.Utilities.SunRiseSet sunRiseSetSf( lat=0.6457718232379, lon=-2.1293016874331, timZon=-28800) "San Francisco as an example in the northen hemisphere"; CDL.Utilities.SunRiseSet sunRiseSetAntarctic( lat=-1.3089969389957, lon=0.99483767363677, timZon=14400) "Antarctic circle case"; CDL.Utilities.SunRiseSet sunRiseSetSyd( lat=-0.59341194567807, lon=2.6354471705114, timZon=36000) "Sydney as an example in the southern hemisphere"; end SunRiseSet;

CDL.Utilities.Validation.SunRiseSetNegativeStartTime CDL.Utilities.Validation.SunRiseSetNegativeStartTime

Test model for the block SunRiseSet with negative start time

CDL.Utilities.Validation.SunRiseSetNegativeStartTime

Information

This example includes 4 tests for the CDL.Utilities.SunRiseSet block: 2 normal cases, an arctic and antarctic case. The normal cases are represented by San Francisco and Sydney, where there is a sunrise and sunset every day.

This model starts the simulation from -12 hour instead of 0.

Modelica definition

model SunRiseSetNegativeStartTime "Test model for the block SunRiseSet with negative start time" CDL.Utilities.SunRiseSet sunRiseSetArctic( lat=1.2566370614359, lon=-1.2566370614359, timZon=-18000) "Arctic circle case"; CDL.Utilities.SunRiseSet sunRiseSetSf( lat=0.6457718232379, lon=-2.1293016874331, timZon=-28800) "San Francisco as a test example in the northen hemisphere"; CDL.Utilities.SunRiseSet sunRiseSetAntarctic( lat=-1.3089969389957, lon=0.99483767363677, timZon=14400) "Antarctic circle case"; CDL.Utilities.SunRiseSet sunRiseSetSyd( lat=-0.59341194567807, lon=2.6354471705114, timZon=36000) "Sydney as a test example in the southern hemisphere"; end SunRiseSetNegativeStartTime;

CDL.Utilities.Validation.SunRiseSetPositiveStartTime CDL.Utilities.Validation.SunRiseSetPositiveStartTime

Test model for the block SunRiseSet with positive start time

CDL.Utilities.Validation.SunRiseSetPositiveStartTime

Information

This example includes 4 tests for the CDL.Utilities.SunRiseSet block: 2 normal cases, an arctic and antarctic case. The normal cases are represented by San Francisco and Sydney, where there is a sunrise and sunset every day.

This model starts the simulation from 12 hour instead of 0.

Modelica definition

model SunRiseSetPositiveStartTime "Test model for the block SunRiseSet with positive start time" CDL.Utilities.SunRiseSet sunRiseSetArctic( lat=1.2566370614359, lon=-1.2566370614359, timZon=-18000) "Arctic circle case"; CDL.Utilities.SunRiseSet sunRiseSetSf( lat=0.6457718232379, lon=-2.1293016874331, timZon=-28800) "San Francisco as a test example in the northen hemisphere"; CDL.Utilities.SunRiseSet sunRiseSetAntarctic( lat=-1.3089969389957, lon=0.99483767363677, timZon=14400) "Antarctic circle case"; CDL.Utilities.SunRiseSet sunRiseSetSyd( lat=-0.59341194567807, lon=2.6354471705114, timZon=36000) "Sydney as a test example in the southern hemisphere"; end SunRiseSetPositiveStartTime;