Buildings.Fluid.CHPs.BaseClasses.Validation

Validation of the baseclasses

Information

This package contains models that validate the models in Buildings.Fluid.CHPs.BaseClasses.

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

Package Content

Name Description
Buildings.Fluid.CHPs.BaseClasses.Validation.AssertFuelFlow AssertFuelFlow Validate model AssertFuelFlow
Buildings.Fluid.CHPs.BaseClasses.Validation.AssertPower AssertPower Validate model AssertPower
Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterFlow AssertWaterFlow Validate model AssertWaterFlow
Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterTemperature AssertWaterTemperature Validate model AssertWaterTemperature
Buildings.Fluid.CHPs.BaseClasses.Validation.Controller Controller Validate model Controller
Buildings.Fluid.CHPs.BaseClasses.Validation.CoolDown CoolDown Validate model CoolDown
Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversion EnergyConversion Validate model EnergyConversion
Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionNormal EnergyConversionNormal Validate model EnergyConversionNormal
Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionWarmUp EnergyConversionWarmUp Validate model EnergyConversionWarmUp
Buildings.Fluid.CHPs.BaseClasses.Validation.EngineTemperature EngineTemperature Validate model EngineTemperature
Buildings.Fluid.CHPs.BaseClasses.Validation.FilterPower FilterPower Validate model FilterPower
Buildings.Fluid.CHPs.BaseClasses.Validation.PowerConsumption PowerConsumption Validate model PowerConsumption
Buildings.Fluid.CHPs.BaseClasses.Validation.StandBy StandBy Validate model StandBy
Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTemperature WarmUpTemperature Validate model WarmUp if warm-up by engine temperature
Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTimeDelay WarmUpTimeDelay Validate model WarmUp if warm-up by time delay
Buildings.Fluid.CHPs.BaseClasses.Validation.WaterFlowControl WaterFlowControl Validate model WaterFlowControl

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertFuelFlow Buildings.Fluid.CHPs.BaseClasses.Validation.AssertFuelFlow

Validate model AssertFuelFlow

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertFuelFlow

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.AssertFuelFlow for sending a warning message if the fuel mass flow rate is outside boundaries.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model AssertFuelFlow "Validate model AssertFuelFlow" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.AssertFuelFlow assFue( final dmFueMax_flow=per.dmFueMax_flow) "Assert if fuel mass flow rate is outside boundaries"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable mFue_flow( final table=[0,0; 300,1; 600,3.5; 900,0], final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Fuel mass flow rate"; equation connect(mFue_flow.y[1], assFue.mFue_flow); end AssertFuelFlow;

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertPower Buildings.Fluid.CHPs.BaseClasses.Validation.AssertPower

Validate model AssertPower

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertPower

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.AssertPower for sending a warning message if the electric power is outside boundaries.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model AssertPower "Validate model AssertPower" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.AssertPower assPow( PEleMax=per.PEleMax, PEleMin=per.PEleMin, use_powerRateLimit=per.use_powerRateLimit, dPEleMax=per.dPEleMax) "Assert if electric power is outside boundaries"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable PEleDem( table=[0,0; 300,500; 600,2000; 900,3001; 1200,0; 1500,6000; 2000,6000], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Electricity demand"; equation connect(PEleDem.y[1], assPow.PEleDem); end AssertPower;

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterFlow Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterFlow

Validate model AssertWaterFlow

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterFlow

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.AssertWaterFlow for sending a warning message if the water mass flow is outside boundaries.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model AssertWaterFlow "Validate model AssertWaterFlow" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.AssertWaterFlow assWatMas(mWatMin_flow=per.mWatMin_flow) "Assert if water mass flow is outside boundaries"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable mWat_flow( table=[0,0; 300,0.05; 360,0.5; 600,0.05; 900,0.05], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Water flow rate"; Modelica.Blocks.Sources.BooleanTable runSig(table={300,1000}) "Flag is true when electricity/heat demand larger than zero"; equation connect(mWat_flow.y[1], assWatMas.mWat_flow); connect(runSig.y, assWatMas.runSig); end AssertWaterFlow;

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterTemperature Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterTemperature

Validate model AssertWaterTemperature

Buildings.Fluid.CHPs.BaseClasses.Validation.AssertWaterTemperature

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.AssertWaterTemperature for sending a warning message if the water temperature is outside boundaries.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model AssertWaterTemperature "Validate model AssertWaterTemperature" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.AssertWaterTemperature assWatTem(TWatMax=per.TWatMax) "Assert if water temperature is outside boundaries"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable TWat( table=[0,273.15 + 20; 300,273.15 + 80; 600,273.15 + 100; 900,273.15 + 100], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Water temperature"; equation connect(TWat.y[1], assWatTem.TWat); end AssertWaterTemperature;

Buildings.Fluid.CHPs.BaseClasses.Validation.Controller Buildings.Fluid.CHPs.BaseClasses.Validation.Controller

Validate model Controller

Buildings.Fluid.CHPs.BaseClasses.Validation.Controller

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.Controller for switching between six operating modes.

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

Parameters

TypeNameDefaultDescription
ValidationData3per CHP performance data

Modelica definition

model Controller "Validate model Controller" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData3 per "CHP performance data"; Modelica.Blocks.Sources.BooleanTable runSig( startValue=false, table={900,960,1200,2200}) "Plant run signal"; Buildings.Fluid.CHPs.BaseClasses.Controller con(final per=per) "Operation mode controller"; Modelica.Blocks.Sources.BooleanTable avaSig( final startValue=false, table={300,600,900}) "Plant availability signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable mWat_flow( table=[0,0; 900,0.4; 1320,0; 1500,0.4; 1900,0; 1960,0.4; 2200,0; 3000,0], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Water flow rate"; protected inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; equation connect(avaSig.y, con.avaSig); connect(runSig.y, con.runSig); connect(mWat_flow.y[1], con.mWat_flow); end Controller;

Buildings.Fluid.CHPs.BaseClasses.Validation.CoolDown Buildings.Fluid.CHPs.BaseClasses.Validation.CoolDown

Validate model CoolDown

Buildings.Fluid.CHPs.BaseClasses.Validation.CoolDown

Information

This example validates the transitions to and from the cool-down operating mode.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model CoolDown "Validate model CoolDown" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.Types.Mode actMod= if norm.active then Buildings.Fluid.CHPs.BaseClasses.Types.Mode.Normal elseif cooDow.active then Buildings.Fluid.CHPs.BaseClasses.Types.Mode.CoolDown else Buildings.Fluid.CHPs.BaseClasses.Types.Mode.Off "Mode indicator"; Modelica.Blocks.Sources.BooleanTable runSig( final startValue=true, table={300,600,660,690}) "Plant run signal"; Buildings.Controls.OBC.CDL.Logical.Not notRun "Plant does not run"; Buildings.Controls.OBC.CDL.Logical.And and1 "Plant run and cool-down is optional"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant cooDowOpt( final k=per.coolDownOptional) "Cool-down is optional"; Modelica.StateGraph.StepWithSignal cooDow(nIn=2, nOut=2) "Cool-down mode"; protected Modelica.StateGraph.InitialStep norm(final nIn=2, final nOut=2) "Normal operation mode"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.TransitionWithSignal transition2 "Cool-down to off mode"; Modelica.StateGraph.TransitionWithSignal transition1 "Normal to cool-down mode"; Modelica.StateGraph.TransitionWithSignal transition4 "Cool-down to normal mode"; Modelica.StateGraph.Step off(final nIn=1, final nOut=1) "Off mode"; Modelica.StateGraph.TransitionWithSignal transition3 "Off to normal mode"; Modelica.StateGraph.Transition transition5( final condition=false, final waitTime=0); protected Buildings.Controls.OBC.CDL.Logical.Timer timer( final t=per.timeDelayCool) "Time of the plant in cool-down mode"; equation connect(transition4.outPort, norm.inPort[1]); connect(transition1.inPort, norm.outPort[1]); connect(off.inPort[1], transition2.outPort); connect(off.outPort[1], transition3.inPort); connect(transition3.outPort, norm.inPort[2]); connect(transition5.inPort, norm.outPort[2]); connect(runSig.y, notRun.u); connect(notRun.y, transition1.condition); connect(cooDowOpt.y, and1.u1); connect(runSig.y, and1.u2); connect(runSig.y, transition3.condition); connect(and1.y, transition4.condition); connect(cooDow.outPort[1], transition2.inPort); connect(cooDow.outPort[2], transition4.inPort); connect(transition1.outPort, cooDow.inPort[1]); connect(transition5.outPort, cooDow.inPort[2]); connect(cooDow.active, timer.u); connect(timer.passed, transition2.condition); end CoolDown;

Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversion Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversion

Validate model EnergyConversion

Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversion

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.EnergyConversion for defining the energy conversion control volume.

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

Parameters

TypeNameDefaultDescription
ValidationData2per CHP performance data
ValidationData2per1per1(warmUpByTimeDelay=true)CHP performance data

Modelica definition

model EnergyConversion "Validate model EnergyConversion" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData2 per "CHP performance data"; parameter Data.ValidationData2 per1(warmUpByTimeDelay=true) "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversion eneConEngTem( final per=per) "Energy conversion volume: warm-up by engine temperature"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversion eneConTimDel( final per=per1) "Energy conversion volume: warm-up by time delay"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable mWat_flow( table=[0,0; 300,0.4; 2700,0; 3000,0], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Cooling water flow rate"; Buildings.Fluid.CHPs.BaseClasses.Controller con(final per=per) "Operation mode"; Modelica.Blocks.Sources.BooleanTable runSig(startValue=false, table={300,2700}) "Plant run signal"; Modelica.Blocks.Sources.BooleanTable avaSig(startValue=true, table={3500}) "Plant availability signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp TEng( final height=90, final duration=600, final offset=273.15 + 15, final startTime=360) "Engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TWatIn( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Cooling water inlet temperature"; Modelica.Blocks.Sources.TimeTable PEle( table=[0,0; 299,0; 300,2500; 2699,2500;2700,0; 3000,0]) "Electric power demand"; Controls.OBC.CDL.Continuous.Sources.Constant TRoo( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Room temperature"; protected inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; equation connect(con.opeMod, eneConEngTem.opeMod); connect(avaSig.y, con.avaSig); connect(runSig.y, con.runSig); connect(TEng.y, con.TEng); connect(TEng.y, eneConEngTem.TEng); connect(TWatIn.y, eneConEngTem.TWatIn); connect(PEle.y, eneConEngTem.PEle); connect(mWat_flow.y[1], eneConEngTem.mWat_flow); connect(mWat_flow.y[1], con.mWat_flow); connect(TWatIn.y, eneConTimDel.TWatIn); connect(mWat_flow.y[1], eneConTimDel.mWat_flow); connect(PEle.y, eneConTimDel.PEle); connect(con.opeMod, eneConTimDel.opeMod); connect(PEle.y, con.PEle); connect(eneConEngTem.PEleNet, con.PEleNet); connect(TRoo.y, eneConEngTem.TRoo); connect(TRoo.y, eneConTimDel.TRoo); end EnergyConversion;

Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionNormal Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionNormal

Validate model EnergyConversionNormal

Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionNormal

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.EnergyConversionNormal for defining energy conversion for a typical CHP operation.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model EnergyConversionNormal "Validate model EnergyConversionNormal" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversionNormal opeModBas( final per=per) "Energy conversion for a typical CHP operation"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp PEle( final height=5000, final duration=360, final offset=0, final startTime=600) "Electric power"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant mWat_flow( final k=0.05) "Water mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TWatIn( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Water inlet temperature"; equation connect(TWatIn.y, opeModBas.TWatIn); connect(mWat_flow.y, opeModBas.mWat_flow); connect(PEle.y, opeModBas.PEle); end EnergyConversionNormal;

Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionWarmUp Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionWarmUp

Validate model EnergyConversionWarmUp

Buildings.Fluid.CHPs.BaseClasses.Validation.EnergyConversionWarmUp

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.EnergyConversionWarmUp for defining energy conversion during the warm-up mode dependent on the engine temperature.

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

Parameters

TypeNameDefaultDescription
ValidationData2per CHP performance data

Modelica definition

model EnergyConversionWarmUp "Validate model EnergyConversionWarmUp" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData2 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversionWarmUp opeModWarUpEngTem( final per=per) "Energy conversion during warm-up by engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp TEng( y(final unit="K", displayUnit="degC"), final height=90, final duration=360, final offset=273.15 + 15, final startTime=600) "Engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant mWat_flow( final k=0.05) "Water mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TWatIn( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Water inlet temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TRoo( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Room temperature"; equation connect(TWatIn.y, opeModWarUpEngTem.TWatIn); connect(mWat_flow.y, opeModWarUpEngTem.mWat_flow); connect(TRoo.y, opeModWarUpEngTem.TRoo); connect(TEng.y, opeModWarUpEngTem.TEng); end EnergyConversionWarmUp;

Buildings.Fluid.CHPs.BaseClasses.Validation.EngineTemperature Buildings.Fluid.CHPs.BaseClasses.Validation.EngineTemperature

Validate model EngineTemperature

Buildings.Fluid.CHPs.BaseClasses.Validation.EngineTemperature

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.EngineTemperature for defining the heat exchange within the engine control volume.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model EngineTemperature "Validate model EngineTemperature" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.EngineTemperature eng( final UAHex=per.UAHex, final UALos=per.UALos, final capEng=per.capEng, final TEngIni=273.15 + 20) "Heat exchange within the engine control volume"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp QGen( final height=5000, final duration=360, final offset=0, final startTime=600) "Heat generation within the engine"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TRoo( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Room temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TWat( y(final unit="K", displayUnit="degC"), final k=273.15 + 60) "Water temperature"; protected Buildings.HeatTransfer.Sources.PrescribedTemperature rooTem "Room temperature"; Buildings.HeatTransfer.Sources.PrescribedTemperature cooWatTem "Entering cooling water temperature"; equation connect(QGen.y, eng.QGen_flow); connect(rooTem.port, eng.TRoo); connect(rooTem.T, TRoo.y); connect(cooWatTem.T, TWat.y); connect(cooWatTem.port, eng.TWat); end EngineTemperature;

Buildings.Fluid.CHPs.BaseClasses.Validation.FilterPower Buildings.Fluid.CHPs.BaseClasses.Validation.FilterPower

Validate model FilterPower

Buildings.Fluid.CHPs.BaseClasses.Validation.FilterPower

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.FilerPower for applying constraints and sending a warning message if the electric power is outside boundaries. The constraints include minimum and maximum electric power and the maximum rate of change in power output.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model FilterPower "Validate model FilterPower" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable PEleDem( table=[0,0; 300,500; 600,2000; 900,3000; 1200,0; 1500,6000; 1800,6000], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Electricity demand"; Buildings.Fluid.CHPs.BaseClasses.FilterPower filPow( final PEleMax=per.PEleMax, final PEleMin=per.PEleMin, final dPEleMax=per.dPEleMax, final use_powerRateLimit=per.use_powerRateLimit) "Constraints for electric power"; equation connect(PEleDem.y[1], filPow.PEleDem); end FilterPower;

Buildings.Fluid.CHPs.BaseClasses.Validation.PowerConsumption Buildings.Fluid.CHPs.BaseClasses.Validation.PowerConsumption

Validate model PowerConsumption

Buildings.Fluid.CHPs.BaseClasses.Validation.PowerConsumption

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.PowerConsumption for calculating the power consumption during the stand-by and cool-down modes of operation.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model PowerConsumption "Validate model PowerConsumption" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable mWat_flow( table=[0,0; 300,0.4; 2700,0; 3000,0], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Water mass flow rate"; Buildings.Fluid.CHPs.BaseClasses.Controller con(final per=per); Modelica.Blocks.Sources.BooleanTable runSig( final startValue=false, final table={300,2700}) "Plant run signal"; Modelica.Blocks.Sources.BooleanTable avaSig( final startValue=true, final table={3500}) "Plant availability signal"; Buildings.Fluid.CHPs.BaseClasses.PowerConsumption powCon( final PStaBy=per.PStaBy, final PCooDow=per.PCooDow) "Internal controller for water mass flow rate"; protected inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; equation connect(avaSig.y, con.avaSig); connect(runSig.y, con.runSig); connect(con.opeMod,powCon. opeMod); connect(mWat_flow.y[1], con.mWat_flow); end PowerConsumption;

Buildings.Fluid.CHPs.BaseClasses.Validation.StandBy Buildings.Fluid.CHPs.BaseClasses.Validation.StandBy

Validate model StandBy

Buildings.Fluid.CHPs.BaseClasses.Validation.StandBy

Information

This example validates the transitions to and from the stand-by operating mode.

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model StandBy "Validate model StandBy" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant mWat_flow( final k=0.5) "Water mass flow rate"; Buildings.Fluid.CHPs.BaseClasses.Types.Mode actMod "Mode indicator"; Modelica.StateGraph.TransitionWithSignal transition1 "Off to standby mode"; Modelica.StateGraph.TransitionWithSignal transition2 "Standby to pump on mode"; Modelica.StateGraph.Step staBy(nOut=2, nIn=1) "Plant is in standby mode"; Modelica.StateGraph.Step pumOn(nIn=1, nOut=1) "Plant pump is on"; protected Modelica.Blocks.Sources.BooleanTable avaSig(table={300,600,900,1260}) "Plant availability signal"; Buildings.Controls.OBC.CDL.Logical.Not notAva "Plant not available"; Modelica.Blocks.Sources.BooleanTable runSig(table={1200,1260}) "Plant run signal"; Modelica.StateGraph.InitialStep off(nIn=2, nOut=1) "Off mode"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.TransitionWithSignal transition3( final enableTimer=true, final waitTime=60) "Pump on to off mode"; Modelica.StateGraph.TransitionWithSignal transition4 "Standby to off mode"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minWatFlo( final k=per.mWatMin_flow) "Minimum water mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Greater cheMinFlo "Check if water mass flow rate is higher than the minimum"; equation if off.active then actMod = CHPs.BaseClasses.Types.Mode.Off; elseif staBy.active then actMod = CHPs.BaseClasses.Types.Mode.StandBy; else actMod = CHPs.BaseClasses.Types.Mode.PumpOn; end if; connect(transition1.inPort, off.outPort[1]); connect(transition4.outPort, off.inPort[1]); connect(transition3.outPort, off.inPort[2]); connect(avaSig.y, transition1.condition); connect(avaSig.y, notAva.u); connect(notAva.y, transition4.condition); connect(runSig.y, transition2.condition); connect(mWat_flow.y, cheMinFlo.u1); connect(minWatFlo.y, cheMinFlo.u2); connect(cheMinFlo.y, transition3.condition); connect(pumOn.outPort[1], transition3.inPort); connect(transition2.outPort, pumOn.inPort[1]); connect(staBy.outPort[1], transition2.inPort); connect(transition1.outPort, staBy.inPort[1]); connect(staBy.outPort[2], transition4.inPort); end StandBy;

Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTemperature Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTemperature

Validate model WarmUp if warm-up by engine temperature

Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTemperature

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving. The example is for the warm-up mode dependent on the engine temperature (e.g. CHPs with Stirling engines).

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

Parameters

TypeNameDefaultDescription
ValidationData2per CHP performance data

Modelica definition

model WarmUpTemperature "Validate model WarmUp if warm-up by engine temperature" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData2 per "CHP performance data"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp TEng( final height=200, final duration=360, final offset=273.15, final startTime=0) "Engine temperature"; Modelica.Blocks.Sources.BooleanTable runSig( final startValue=true, final table={600}) "Plant run signal"; Buildings.Fluid.CHPs.BaseClasses.Types.Mode actMod "Mode indicator"; Modelica.StateGraph.TransitionWithSignal transition1 "Off to warm-up mode"; Modelica.StateGraph.TransitionWithSignal transition2 "Warm-up to normal mode"; Modelica.StateGraph.TransitionWithSignal transition3 "Normal to off mode"; Modelica.StateGraph.StepWithSignal warUp(nIn=2, nOut=2) "Plant is in warm-up mode"; Controls.OBC.CDL.Continuous.Sources.Constant PEle[2](k={1,2}) "Power output and demand"; protected Modelica.StateGraph.InitialStep off(final nIn=2, final nOut=2) "Off mode"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.TransitionWithSignal transition4 "Warm-up to off mode"; Modelica.StateGraph.Step nor(nIn=1, nOut=1) "Normal mode"; Modelica.StateGraph.Transition transition5( final condition=false, final waitTime=0); Buildings.Controls.OBC.CDL.Logical.Not notRun "Plant not run"; WarmUpLeaving warUpCtr( final timeDelayStart=per.timeDelayStart, final TEngNom=per.TEngNom, final warmUpByTimeDelay=per.warmUpByTimeDelay) "Warm-up control sequence"; equation if off.active then actMod = CHPs.BaseClasses.Types.Mode.Off; elseif warUp.active then actMod = CHPs.BaseClasses.Types.Mode.WarmUp; else actMod = CHPs.BaseClasses.Types.Mode.Normal; end if; connect(transition4.outPort, off.inPort[1]); connect(transition1.inPort, off.outPort[1]); connect(nor.inPort[1], transition2.outPort); connect(nor.outPort[1], transition3.inPort); connect(transition3.outPort, off.inPort[2]); connect(transition5.inPort, off.outPort[2]); connect(runSig.y, notRun.u); connect(runSig.y, transition1.condition); connect(notRun.y, transition3.condition); connect(notRun.y, transition4.condition); connect(warUp.active, warUpCtr.actWarUp); connect(transition1.outPort, warUp.inPort[1]); connect(warUp.outPort[1], transition2.inPort); connect(transition5.outPort, warUp.inPort[2]); connect(warUp.outPort[2], transition4.inPort); connect(TEng.y, warUpCtr.TEng); connect(warUpCtr.y, transition2.condition); connect(PEle[1].y, warUpCtr.PEleNet); connect(PEle[2].y, warUpCtr.PEle); end WarmUpTemperature;

Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTimeDelay Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTimeDelay

Validate model WarmUp if warm-up by time delay

Buildings.Fluid.CHPs.BaseClasses.Validation.WarmUpTimeDelay

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving. The example is for the warm-up mode with the static time delay (e.g. CHPs with internal combustion engines).

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

Parameters

TypeNameDefaultDescription
ValidationData1per CHP performance data

Modelica definition

model WarmUpTimeDelay "Validate model WarmUp if warm-up by time delay" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData1 per "CHP performance data"; Modelica.Blocks.Sources.BooleanTable runSig(final table={300,330,600}) "Plant run signal"; Buildings.Fluid.CHPs.BaseClasses.Types.Mode actMod "Mode indicator"; Modelica.StateGraph.TransitionWithSignal transition1 "Off to warm-up mode"; Modelica.StateGraph.TransitionWithSignal transition2 "Warm-up to normal mode"; Modelica.StateGraph.TransitionWithSignal transition3 "Normal to off mode"; Modelica.StateGraph.StepWithSignal warUp(nIn=2, nOut=2) "Plant is in warm-up mode"; protected Modelica.StateGraph.InitialStep off(nIn=2, nOut=2) "Off mode"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.StateGraph.TransitionWithSignal transition4 "Warm-up to off mode"; Modelica.StateGraph.Step nor(nIn=1, nOut=1) "Normal mode"; Modelica.StateGraph.Transition transition5( final condition=false, final waitTime=0); Buildings.Controls.OBC.CDL.Logical.Not notRun "Plant not run"; WarmUpLeaving warUpCtr( final timeDelayStart=per.timeDelayStart, final TEngNom=per.TEngNom, final PEleMax=per.PEleMax, final warmUpByTimeDelay=per.warmUpByTimeDelay) "Warm-up control sequence"; equation if off.active then actMod = CHPs.BaseClasses.Types.Mode.Off; elseif warUp.active then actMod = CHPs.BaseClasses.Types.Mode.WarmUp; else actMod = CHPs.BaseClasses.Types.Mode.Normal; end if; connect(transition4.outPort, off.inPort[1]); connect(transition1.inPort, off.outPort[1]); connect(nor.inPort[1], transition2.outPort); connect(nor.outPort[1], transition3.inPort); connect(transition3.outPort, off.inPort[2]); connect(transition5.inPort, off.outPort[2]); connect(runSig.y, transition1.condition); connect(runSig.y, notRun.u); connect(notRun.y, transition3.condition); connect(notRun.y, transition4.condition); connect(warUpCtr.y, transition2.condition); connect(warUp.active, warUpCtr.actWarUp); connect(transition1.outPort, warUp.inPort[1]); connect(warUp.outPort[1], transition2.inPort); connect(warUp.outPort[2], transition4.inPort); connect(transition5.outPort, warUp.inPort[2]); end WarmUpTimeDelay;

Buildings.Fluid.CHPs.BaseClasses.Validation.WaterFlowControl Buildings.Fluid.CHPs.BaseClasses.Validation.WaterFlowControl

Validate model WaterFlowControl

Buildings.Fluid.CHPs.BaseClasses.Validation.WaterFlowControl

Information

This example validates Buildings.Fluid.CHPs.BaseClasses.WaterFlowControl for calculating the optimum cooling water flow rate based on internal contol.

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

Parameters

TypeNameDefaultDescription
ValidationData2per CHP performance data

Modelica definition

model WaterFlowControl "Validate model WaterFlowControl" extends Modelica.Icons.Example; parameter Buildings.Fluid.CHPs.Data.ValidationData2 per "CHP performance data"; Buildings.Fluid.CHPs.BaseClasses.WaterFlowControl conWat(final per=per) "Internal controller for water mass flow rate"; protected inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable mWat_flow( table=[0,0; 300,0.4; 2700,0; 3000,0], smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Water mass flow rate"; Buildings.Fluid.CHPs.BaseClasses.Controller con(final per=per) "Operation mode controller"; Modelica.Blocks.Sources.BooleanTable runSig( final startValue=false, final table={300,2700}) "Plant run signal"; Modelica.Blocks.Sources.BooleanTable avaSig( final startValue=true, final table={3500}) "Plant availability signal"; Buildings.Controls.OBC.CDL.Continuous.Sources.Ramp TEng( y(final unit="K", displayUnit="degC"), final height=90, final duration=300, final offset=273.15 + 15, final startTime=360) "Engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TWatIn( y(final unit="K", displayUnit="degC"), final k=273.15 + 15) "Water inlet temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.TimeTable PEle( final table=[0,0; 300,2500; 2700,0; 3000,0], final smoothness=Buildings.Controls.OBC.CDL.Types.Smoothness.ConstantSegments) "Electric power demand"; equation connect(avaSig.y, con.avaSig); connect(runSig.y, con.runSig); connect(TEng.y, con.TEng); connect(con.opeMod, conWat.opeMod); connect(TWatIn.y, conWat.TWatIn); connect(mWat_flow.y[1], con.mWat_flow); connect(PEle.y[1], conWat.PEle); connect(PEle.y[1], con.PEle); connect(PEle.y[1], con.PEleNet); end WaterFlowControl;