Collection of validation models
Information
This package contains validation models for the classes in
Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.
Note that most validation models contain simple input data
which may not be realistic, but for which the correct
output can be obtained through an analytic solution.
The examples plot various outputs, which have been verified against these
solutions. These model outputs are stored as reference data and
used for continuous validation whenever models in the library change.
Package Content
Name |
Description |
OperationMode
|
Validate block OperationModeSelector |
TrimAndRespond
|
Model validates the trim and respond block |
Validate block OperationModeSelector
Information
This example validates
Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.OperationMode
for a change of zone temperature and occupancy schedule.
Modelica definition
model OperationMode
Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.OperationMode
opeModSel(
final numZon=1) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp ramp1(
final offset=0,
final height=6.2831852,
final duration=24*3600) ;
Buildings.Controls.OBC.CDL.Continuous.Sin sin1
;
Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar(
final k=12.5,
final p=273.15 + 22.5);
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TZonHeaSetUno(
final k=273.15 + 12) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TZonCooSetUno(
final k=273.15 + 30) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TZonHeaSetOcc(
final k=273.15 + 20) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TZonCooSetOcc(
final k=273.15 + 24) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant warUpTim(
final k=1800) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant cooDowTim(
final k=1800) ;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant uWinSta(
final k=false)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable occTim(
final table=[0,0; occSta,1; occEnd,0; 24*3600,0],
final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments);
Buildings.Controls.OBC.CDL.Continuous.Sources.ModelTime modTim;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con(
final k=24*3600) ;
Buildings.Controls.OBC.CDL.Continuous.Division div
;
Buildings.Controls.OBC.CDL.Continuous.Round rou(
final n=0)
;
Buildings.Controls.OBC.CDL.Continuous.Gain gai(k=24*3600)
;
Buildings.Controls.OBC.CDL.Continuous.LessEqual lesEqu
;
Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar1(
final p=-1,
final k=1) ;
Buildings.Controls.OBC.CDL.Continuous.Gain gai1(
final k=24*3600) ;
Buildings.Controls.OBC.CDL.Logical.Switch swi ;
Buildings.Controls.OBC.CDL.Continuous.Add curTim(
final k2=-1) ;
Buildings.Controls.OBC.CDL.Continuous.Add add2(
final k2=-1)
;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant occStaTim(
final k=occSta) ;
Buildings.Controls.OBC.CDL.Continuous.Add add1(
final k2=-1)
;
Buildings.Controls.OBC.CDL.Continuous.AddParameter addPar2(
final p=occSta,
final k=1)
;
Buildings.Controls.OBC.CDL.Continuous.LessEqual lesEqu1
;
Buildings.Controls.OBC.CDL.Logical.Switch swi1 ;
Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold occ(
final threshold=0.5) ;
protected
final parameter Modelica.SIunits.Time occSta = 7*3600 ;
final parameter Modelica.SIunits.Time occEnd = 19*3600 ;
equation
connect(ramp1.y, sin1.u);
connect(sin1.y, addPar.u);
connect(addPar.y, opeModSel.TZon[1]);
connect(TZonHeaSetOcc.y, opeModSel.TZonHeaSetOcc);
connect(TZonCooSetOcc.y, opeModSel.TZonCooSetOcc);
connect(TZonHeaSetUno.y, opeModSel.TZonHeaSetUno);
connect(TZonCooSetUno.y, opeModSel.TZonCooSetUno);
connect(warUpTim.y, opeModSel.warUpTim[1]);
connect(cooDowTim.y, opeModSel.cooDowTim[1]);
connect(uWinSta.y, opeModSel.uWinSta[1]);
connect(modTim.y, div.u1);
connect(con.y, div.u2);
connect(div.y, rou.u);
connect(rou.y, gai.u);
connect(gai.y, lesEqu.u1);
connect(modTim.y, lesEqu.u2);
connect(rou.y, addPar1.u);
connect(addPar1.y, gai1.u);
connect(lesEqu.y, swi.u2);
connect(gai.y, swi.u1);
connect(gai1.y, swi.u3);
connect(modTim.y, curTim.u1);
connect(swi.y, curTim.u2);
connect(occStaTim.y, add2.u1);
connect(con.y, add1.u1);
connect(add1.y, addPar2.u);
connect(occStaTim.y, lesEqu1.u2);
connect(curTim.y, lesEqu1.u1);
connect(lesEqu1.y, swi1.u2);
connect(add2.y, swi1.u1);
connect(addPar2.y, swi1.u3);
connect(occTim.y[1], occ.u);
connect(occ.y, opeModSel.uOcc);
connect(swi1.y, opeModSel.tNexOcc);
connect(curTim.y, add2.u2);
connect(curTim.y, add1.u2);
end OperationMode;
Model validates the trim and respond block
Information
This example validates
Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.TrimAndRespond.
Modelica definition
model TrimAndRespond
Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.TrimAndRespond trimRespondLogic(
iniSet=120,
minSet=37,
maxSet=370,
delTim=300,
samplePeriod=120,
numIgnReq=2,
triAmo=-10,
resAmo=15,
maxRes=37) ;
Buildings.Controls.OBC.CDL.Logical.Sources.Constant con(
k=true) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Sine sine(
amplitude=6,
freqHz=1/5400) ;
Buildings.Controls.OBC.CDL.Continuous.Abs abs
;
Buildings.Controls.OBC.ASHRAE.G36_PR1.Generic.SetPoints.TrimAndRespond trimRespondLogic1(
iniSet=120,
minSet=37,
maxSet=370,
delTim=300,
samplePeriod=120,
numIgnReq=2,
triAmo=-10,
resAmo=15,
maxRes=37) ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Sine sine1(
amplitude=6,
freqHz=1/5400) ;
Buildings.Controls.OBC.CDL.Continuous.Abs abs1
;
Buildings.Controls.OBC.CDL.Logical.Sources.Pulse booPul(
period=3600,
width=0.18333333) ;
Buildings.Controls.OBC.CDL.Logical.Not not1 ;
Buildings.Controls.OBC.CDL.Logical.Switch swi ;
Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con1(k=0)
;
Buildings.Controls.OBC.CDL.Continuous.Round round2(n=0)
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt1
;
Buildings.Controls.OBC.CDL.Continuous.Round round1(n=0)
;
Buildings.Controls.OBC.CDL.Conversions.RealToInteger reaToInt2
;
equation
connect(con.y, trimRespondLogic.uDevSta);
connect(sine.y, abs.u);
connect(not1.y, trimRespondLogic1.uDevSta);
connect(con1.y, swi.u1);
connect(sine1.y, swi.u3);
connect(swi.y, abs1.u);
connect(booPul.y, swi.u2);
connect(booPul.y, not1.u);
connect(abs.y, round2.u);
connect(round2.y, reaToInt1.u);
connect(reaToInt1.y, trimRespondLogic.numOfReq);
connect(abs1.y, round1.u);
connect(round1.y, reaToInt2.u);
connect(reaToInt2.y, trimRespondLogic1.numOfReq);
end TrimAndRespond;