Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples

Examples package

Information

Package with examples showing the use of single safety control.

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

Package Content

Name Description
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.AntiFreeze AntiFreeze Example for usage of antifreeze model
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.MinimalFlowRate MinimalFlowRate Example for usage of minimal flow rate safety control
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OnOff OnOff Example for on off controller
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OperationalEnvelope OperationalEnvelope Example for usage of operational envelope model
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.Safety Safety Example for usage of all safety controls
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.BaseClasses BaseClasses Package with partial models for examples

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.AntiFreeze Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.AntiFreeze

Example for usage of antifreeze model

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.AntiFreeze

Information

This example shows the usage of the model Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.AntiFreeze.

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

Connectors

TypeNameDescription
RefrigerantMachineControlBussigBusBus-connector for the heat pump
output RealOutputySetRelative speed of compressor from 0 to 1
output RealOutputyOutRelative speed of compressor applied after safety control

Modelica definition

model AntiFreeze "Example for usage of antifreeze model" extends BaseClasses.PartialSafety; extends Modelica.Icons.Example; Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.AntiFreeze antFre "Safety control for antifreeze"; Modelica.Blocks.Sources.Pulse ySetPul(amplitude=1, period=50) "Pulse signal for ySet"; Modelica.Blocks.Sources.Pulse TConInEmu( amplitude=-10, period=20, offset=283.15, y(unit="K", displayUnit="K")) "Emulator for condenser inlet temperature"; Modelica.Blocks.Sources.Pulse TEvaOutEmu( amplitude=-10, period=15, offset=283.15, y(unit="K", displayUnit="K")) "Emulator for evaporator outlet temperature"; equation connect(antFre.sigBus, sigBus); connect(ySetPul.y, antFre.ySet); connect(TEvaOutEmu.y, sigBus.TEvaOutMea); connect(TConInEmu.y, sigBus.TConInMea); connect(hys.u, antFre.yOut); connect(antFre.yOut, yOut); connect(ySetPul.y, ySet); end AntiFreeze;

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.MinimalFlowRate Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.MinimalFlowRate

Example for usage of minimal flow rate safety control

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.MinimalFlowRate

Information

This example shows the usage of the model Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.MinimalFlowRate.

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

Connectors

TypeNameDescription
RefrigerantMachineControlBussigBusBus-connector for the heat pump
output RealOutputySetRelative speed of compressor from 0 to 1
output RealOutputyOutRelative speed of compressor applied after safety control

Modelica definition

model MinimalFlowRate "Example for usage of minimal flow rate safety control" extends BaseClasses.PartialSafety; extends Modelica.Icons.Example; Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.MinimalFlowRate minFloRatSaf( mEvaMin_flow=0.1, mConMin_flow=0.1) "Safety block for minimal flow rate safety"; Modelica.Blocks.Sources.Pulse ySetPul(amplitude=1, period=50) "Pulse signal for ySet"; Modelica.Blocks.Sources.Pulse mConEmu_flow(amplitude=1, period=20) "Emulator for condenser mass flow rate"; Modelica.Blocks.Sources.Pulse mEvaEmu_flow(amplitude=1, period=15) "Emulator for evaporator mass flow rate"; equation connect(sigBus, minFloRatSaf.sigBus); connect(minFloRatSaf.yOut, hys.u); connect(ySetPul.y, minFloRatSaf.ySet); connect(mConEmu_flow.y, sigBus.mConMea_flow); connect(mEvaEmu_flow.y, sigBus.mEvaMea_flow); connect(minFloRatSaf.yOut, yOut); connect(ySetPul.y, ySet); end MinimalFlowRate;

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OnOff Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OnOff

Example for on off controller

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OnOff

Information

This example shows the usage of the model Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.OnOff.

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

Connectors

TypeNameDescription
RefrigerantMachineControlBussigBusBus-connector for the heat pump
output RealOutputySetRelative speed of compressor from 0 to 1
output RealOutputyOutRelative speed of compressor applied after safety control

Modelica definition

model OnOff "Example for on off controller" extends BaseClasses.PartialSafety; extends Modelica.Icons.Example; Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.OnOff onOffCtr( maxCycRat=2, minOffTime(displayUnit="s") = 200, minOnTime(displayUnit="s") = 300, onOffMea_start=false, use_minOffTime=true, use_minOnTime=true, use_maxCycRat=true, ySet_small=hys.uHigh, ySetRed=0.5) "Example case for on off control"; Modelica.Blocks.Sources.Sine ySetSin( amplitude=0.5, f=1/180, offset=0.5) "Sine signal for ySet"; equation connect(onOffCtr.yOut, hys.u); connect(onOffCtr.sigBus, sigBus); connect(ySetSin.y, onOffCtr.ySet); connect(ySetSin.y, ySet); connect(onOffCtr.yOut, yOut); end OnOff;

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OperationalEnvelope Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OperationalEnvelope

Example for usage of operational envelope model

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.OperationalEnvelope

Information

This example shows the usage of the model Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.OperationalEnvelope.

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

Connectors

TypeNameDescription
RefrigerantMachineControlBussigBusBus-connector for the heat pump
output RealOutputySetRelative speed of compressor from 0 to 1
output RealOutputyOutRelative speed of compressor applied after safety control

Modelica definition

model OperationalEnvelope "Example for usage of operational envelope model" extends BaseClasses.PartialSafety; extends Modelica.Icons.Example; Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.OperationalEnvelope opeEnv( tabUppHea=[233.15,333.15; 313.15,333.15], tabLowCoo=[233.15,288.15; 313.15,288.15]) "Safety control for operational envelope"; Modelica.Blocks.Sources.Constant ySetPul(k=1) "Always on"; Modelica.Blocks.Sources.Trapezoid TConOutEmu( amplitude=60, rising=5, width=20, falling=5, period=50, offset=283.15, y(unit="K", displayUnit="degC")) "Emulator for condenser outlet temperature"; Modelica.Blocks.Sources.Pulse TEvaInEmu( amplitude=-10, period=15, offset=283.15, y(unit="K", displayUnit="degC")) "Emulator for evaporator inlet temperature"; Modelica.Blocks.Sources.BooleanStep hea(startTime=50, startValue=true) "Heating mode"; equation connect(opeEnv.sigBus, sigBus); connect(ySetPul.y, opeEnv.ySet); connect(hys.u, opeEnv.yOut); connect(opeEnv.yOut, yOut); connect(ySetPul.y, ySet); connect(TConOutEmu.y, sigBus.TConOutMea); connect(TEvaInEmu.y, sigBus.TEvaInMea); connect(hea.y, sigBus.hea); connect(TConOutEmu.y, sigBus.TConInMea); connect(TEvaInEmu.y, sigBus.TEvaOutMea); end OperationalEnvelope;

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.Safety Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.Safety

Example for usage of all safety controls

Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Examples.Safety

Information

This example shows the usage and effect of all safety controls aggregates into the model Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Safety.

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

Connectors

TypeNameDescription
RefrigerantMachineControlBussigBusBus-connector for the heat pump
output RealOutputySetRelative speed of compressor from 0 to 1
output RealOutputyOutRelative speed of compressor applied after safety control

Modelica definition

model Safety "Example for usage of all safety controls" extends BaseClasses.PartialSafety; extends Modelica.Icons.Example; Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Safety safCtr( mEva_flow_nominal=0.01, mCon_flow_nominal=0.01, ySet_small=0.01, redeclare Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021 safCtrPar( minOnTime=5, minOffTime=5, use_antFre=true, TAntFre=276.15)) "Safety control"; Modelica.Blocks.Sources.Pulse ySetPul(amplitude=1, period=50) "Pulse signal for ySet"; Modelica.Blocks.Sources.Pulse TConInEmu( amplitude=10, period=20, offset=303.15, y(unit="K", displayUnit="degC")) "Emulator for condenser inlet temperature"; Modelica.Blocks.Sources.Pulse TEvaOutEmu( amplitude=-10, period=15, offset=287.15, y(unit="K", displayUnit="degC")) "Emulator for evaporator outlet temperature"; Modelica.Blocks.Sources.Pulse TConOutEmu( amplitude=40, period=20, offset=313.15, y(unit="K", displayUnit="degC")) "Emulator for condenser outlet temperature"; Modelica.Blocks.Sources.Pulse TEvaInEmu( amplitude=-10, period=15, offset=288.15, y(unit="K", displayUnit="degC")) "Emulator for evaporator inlet temperature"; Modelica.Blocks.Sources.Pulse mConEmu_flow( amplitude=1, width=80, period=100) "Emulator for condenser mass flow rate"; Modelica.Blocks.Sources.Pulse mEvaEmu_flow(amplitude=1, period=100) "Emulator for evaporator mass flow rate"; Modelica.Blocks.Sources.BooleanConstant conHea(final k=true) "Constant heating mode"; equation connect(safCtr.sigBus, sigBus); connect(ySetPul.y, safCtr.ySet); connect(TEvaOutEmu.y, sigBus.TEvaOutMea); connect(TConInEmu.y, sigBus.TConInMea); connect(hys.u, safCtr.yOut); connect(safCtr.yOut, yOut); connect(ySetPul.y, ySet); connect(TConOutEmu.y, sigBus.TConOutMea); connect(TEvaInEmu.y, sigBus.TEvaInMea); connect(mEvaEmu_flow.y, sigBus.mEvaMea_flow); connect(mConEmu_flow.y, sigBus.mConMea_flow); connect(conHea.y, sigBus.hea); end Safety;