Buildings.Controls.OBC.CDL.Continuous.Sources.Validation

Collection of models that validate the continuous sources blocks of the CDL

Information

This package contains models that validate the blocks in Buildings.Controls.OBC.CDL.Continuous.Sources.

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
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths CalendarTimeMonths Validation model for the calendar time model
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus CalendarTimeMonthsMinus Validation model for the calendar time model with start time slightly below the full hour
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus CalendarTimeMonthsPlus Validation model for the calendar time model with start time slightly higher than the full hour
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Constant Constant Validate the Constant block
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Pulse Pulse Validation model for the Pulse block
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Ramp Ramp Validation model for the Ramp
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Sine Sine Validation model for Sine
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.StandardTime StandardTime Test model for the StandardTime block
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTable TimeTable Validation model for TimeTable block
Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime TimeTableNegativeStartTime Validation model for TimeTable block with negative start time

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths

Validation model for the calendar time model

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths

Information

This model validates the use of the Buildings.Controls.OBC.CDL.Continuous.Sources.CalendarTime block for a period of a couple of months. This shorter simulation time has been selected to store the reference results that are used in the regression tests at a resulation that makes sense for the minute and hour outputs.

Modelica definition

model CalendarTimeMonths "Validation model for the calendar time model" Buildings.Controls.OBC.CDL.Continuous.Sources.CalendarTime calTim( zerTim=Buildings.Controls.OBC.CDL.Types.ZeroTime.NY2017) "Computes date and time assuming time=0 corresponds to new year 2017"; end CalendarTimeMonths;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus

Validation model for the calendar time model with start time slightly below the full hour

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsMinus

Information

This model validates the use of the Buildings.Controls.OBC.CDL.Continuous.Sources.CalendarTime. It is identical to Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths except that the start and end time are different.

Extends from Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths (Validation model for the calendar time model).

Modelica definition

model CalendarTimeMonthsMinus "Validation model for the calendar time model with start time slightly below the full hour" extends Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths; end CalendarTimeMonthsMinus;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus

Validation model for the calendar time model with start time slightly higher than the full hour

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonthsPlus

Information

This model validates the use of the Buildings.Controls.OBC.CDL.Continuous.Sources.CalendarTime. It is identical to Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths except that the start and end time are different.

Extends from Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths (Validation model for the calendar time model).

Modelica definition

model CalendarTimeMonthsPlus "Validation model for the calendar time model with start time slightly higher than the full hour" extends Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.CalendarTimeMonths; end CalendarTimeMonthsPlus;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Constant Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Constant

Validate the Constant block

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Constant

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sources.Constant.

Modelica definition

model Constant "Validate the Constant block" Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con(k=2.5) "Block output real constant value"; end Constant;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Pulse Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Pulse

Validation model for the Pulse block

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Pulse

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sources.Pulse.

Modelica definition

model Pulse "Validation model for the Pulse block" Buildings.Controls.OBC.CDL.Continuous.Sources.Pulse pulse( amplitude = 2.0, width = 0.5, offset = 0.2, period = 1) "Block that generates pulse signal of type Real"; end Pulse;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Ramp Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Ramp

Validation model for the Ramp

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Ramp

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp.

Modelica definition

model Ramp "Validation model for the Ramp" Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ram( height = 2, duration = 3, offset=0.5, startTime = 1.0) "Block that generates ramp signal"; end Ramp;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Sine Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Sine

Validation model for Sine

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.Sine

Information

Validation test for the block Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp.

Modelica definition

model Sine "Validation model for Sine" Buildings.Controls.OBC.CDL.Continuous.Sources.Sine sin( amplitude=5, freqHz=1/60, phase=0, offset=10, startTime=10) "Sine source block"; end Sine;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.StandardTime Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.StandardTime

Test model for the StandardTime block

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.StandardTime

Information

This model tests the implementation of the block that outputs the model time.

Modelica definition

model StandardTime "Test model for the StandardTime block" Buildings.Controls.OBC.CDL.Continuous.Sources.ModelTime staTim "Standard time"; end StandardTime;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTable Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTable

Validation model for TimeTable block

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTable

Information

This model validates the TimeTable block. It takes as a parameter a time table of the format

table = [ 0*3600, 0;
          6*3600, 1;
         18*3600, 0.5;
         24*3600, 0];

The block timTabLin applies smoothness method of linear segments between table points, periodically repeat the table scope.

The block timTabLinHol applies smoothness method of linear segments between table points, hold the last table points when it becomes outside of table scope.

The block timTabLinDer applies smoothness method of linear segments between table points, extrapolate by using the derivative at the last table points to find points outside the table scope.

The block timTabCon applies smoothness method of constant segments between table points, periodically repeat the table scope.

The block timTabLinCon applies smoothness method of linear segments between table points, periodically repeat the table scope. Table points is different so to ensure constant zero during time range of (0*3600, 6*36000).

table = [ 0*3600, 0;
          6*3600, 0;
          6*3600, 1;
         18*3600, 0.5;
         24*3600, 0];

Modelica definition

model TimeTable "Validation model for TimeTable block" Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLin( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, table = [0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLinHol( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, extrapolation = Buildings.Controls.OBC.CDL.Types.Extrapolation.HoldLastPoint, table = [0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, hold first and last value"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLinDer( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, extrapolation = Buildings.Controls.OBC.CDL.Types.Extrapolation.LastTwoPoints, table=[0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, extrapolate with der"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabCon( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments, table=[0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of constant segments"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLinCon( smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, table=[0,0; 6*3600,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; end TimeTable;

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime

Validation model for TimeTable block with negative start time

Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTableNegativeStartTime

Information

This model validates the block Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable. The model is identical to Buildings.Controls.OBC.CDL.Continuous.Sources.Validation.TimeTable except that the start time is negative, and not a multiple of a full day.

Modelica definition

model TimeTableNegativeStartTime "Validation model for TimeTable block with negative start time" Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLin( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, table = [0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLinHol( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, extrapolation = Buildings.Controls.OBC.CDL.Types.Extrapolation.HoldLastPoint, table = [0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, hold first and last value"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLinDer( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, extrapolation = Buildings.Controls.OBC.CDL.Types.Extrapolation.LastTwoPoints, table=[0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments, extrapolate with der"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabCon( smoothness = Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments, table=[0,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of constant segments"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable timTabLinCon( smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.LinearSegments, table=[0,0; 6*3600,0; 6*3600,1; 18*3600,0.5; 24*3600,0]) "Time table with smoothness method of linear segments"; end TimeTableNegativeStartTime;