Buildings.Fluid.CHPs.BaseClasses

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.CHPs.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.CHPs.BaseClasses.AssertFuelFlow AssertFuelFlow Assert whether fuel flow is within boundary
Buildings.Fluid.CHPs.BaseClasses.AssertPower AssertPower Assert if electric power is outside boundaries
Buildings.Fluid.CHPs.BaseClasses.AssertWaterFlow AssertWaterFlow Assert if water flow is outside boundaries
Buildings.Fluid.CHPs.BaseClasses.AssertWaterTemperature AssertWaterTemperature Assert if water outlet temperature is outside boundaries
Buildings.Fluid.CHPs.BaseClasses.Controller Controller Define current operation mode
Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve EfficiencyCurve Efficiency curve described by a fifth order polynomial, function of three input variables
Buildings.Fluid.CHPs.BaseClasses.EnergyConversion EnergyConversion Energy conversion control volume
Buildings.Fluid.CHPs.BaseClasses.EnergyConversionNormal EnergyConversionNormal Energy conversion for typical CHP operation either in normal mode or warm-up mode based on time delay
Buildings.Fluid.CHPs.BaseClasses.EnergyConversionWarmUp EnergyConversionWarmUp Energy conversion during warm-up mode based on engine temperature
Buildings.Fluid.CHPs.BaseClasses.EngineTemperature EngineTemperature Heat exchange within the engine control volume
Buildings.Fluid.CHPs.BaseClasses.FilterPower FilterPower Constraints for electric power
Buildings.Fluid.CHPs.BaseClasses.PowerConsumption PowerConsumption Power consumption during stand-by and cool-down modes
Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving WarmUpLeaving Model evaluating the condition for transitioning from warm-up to normal mode
Buildings.Fluid.CHPs.BaseClasses.WaterFlowControl WaterFlowControl Internal controller for water flow rate
Buildings.Fluid.CHPs.BaseClasses.Functions Functions  
Buildings.Fluid.CHPs.BaseClasses.Types Types Library of CHP operation modes
Buildings.Fluid.CHPs.BaseClasses.Validation Validation Validation of the baseclasses
Buildings.Fluid.CHPs.BaseClasses.Interfaces Interfaces  

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

Assert whether fuel flow is within boundary

Buildings.Fluid.CHPs.BaseClasses.AssertFuelFlow

Information

The model sends a warning message if the rate at which the fuel mass flow rate changes is outside the boundaries defined by the manufacturer.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
RealdmFueMax_flow Maximum rate at which fuel mass flow rate can change [kg/s2]

Connectors

TypeNameDescription
input RealInputmFue_flowFuel mass flow rate [kg/s]

Modelica definition

model AssertFuelFlow "Assert whether fuel flow is within boundary" extends Modelica.Blocks.Icons.Block; parameter Real dmFueMax_flow(final unit="kg/s2") "Maximum rate at which fuel mass flow rate can change"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mFue_flow( final unit="kg/s") "Fuel mass flow rate"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( final message="Rate of change in the fuel mass flow rate is outside boundaries!") "Assert function for checking fuel flow rate"; protected Buildings.Controls.OBC.CDL.Logical.Not not1 "Check if fuel flow rate is changing slowly"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=0.99*dmFueMax_flow, final uHigh=1.01*dmFueMax_flow + 1e-6) "Check if fuel mass flow rate is changing too much"; Buildings.Controls.OBC.CDL.Continuous.Derivative floChaRat( final x_start=0) "Rate at which fuel mass flow rate changes"; Buildings.Controls.OBC.CDL.Continuous.Abs abs1 "Absolute value"; equation connect(abs1.u, floChaRat.y); connect(floChaRat.u, mFue_flow); connect(not1.y, assMes.u); connect(abs1.y, hys.u); connect(hys.y, not1.u); end AssertFuelFlow;

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

Assert if electric power is outside boundaries

Buildings.Fluid.CHPs.BaseClasses.AssertPower

Information

The model sends a warning message if the power demand is outside the boundaries defined by the manufacturer. Limits can be specified for the minimal and maximal electric power, and for the maximum rate at which the power can change.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
PowerPEleMax Maximum power output [W]
PowerPEleMin Minimum power output [W]
Booleanuse_powerRateLimit If true, the rate at which net power output can change is limited
RealdPEleMax Maximum rate at which net power output can change [W/s]

Connectors

TypeNameDescription
input RealInputPEleDemElectric power demand [W]

Modelica definition

model AssertPower "Assert if electric power is outside boundaries" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Power PEleMax "Maximum power output"; parameter Modelica.SIunits.Power PEleMin "Minimum power output"; parameter Boolean use_powerRateLimit "If true, the rate at which net power output can change is limited"; parameter Real dPEleMax(final unit="W/s") "Maximum rate at which net power output can change"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEleDem( final unit="W") "Electric power demand"; Buildings.Controls.OBC.CDL.Utilities.Assert assMesP( final message="Electric power is outside boundaries!") "Generate warning when the electric power demand is out of the range"; Buildings.Controls.OBC.CDL.Utilities.Assert assMesDP( final message="Rate of change in power output is outside boundaries!") if use_powerRateLimit "Assert function for checking power rate"; protected Buildings.Controls.OBC.CDL.Logical.Nor nor "Check if the electric power demand is out of the power production range"; Buildings.Controls.OBC.CDL.Logical.Not not2 if use_powerRateLimit "Logical Nand"; Buildings.Controls.OBC.CDL.Continuous.Derivative demRat( final x_start=0) if use_powerRateLimit "Power demand rate"; Buildings.Controls.OBC.CDL.Continuous.Abs abs1 if use_powerRateLimit "Absolute value"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold maxRat( final threshold=dPEleMax) if use_powerRateLimit "Check if demand rate is more than the maximum rate"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis maxPow( final uLow=0.99*PEleMax, final uHigh=1.01*PEleMax + 1e-6) "Check if the electric power demand is more than the maximum power production"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis minPow( final uLow=0.99*PEleMin - 1e-6, final uHigh=1.01*PEleMin) "Check if the electric power demand is larger than the minimum power production"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Check if the electric power demand is less than the minimum power production"; equation connect(abs1.u, demRat.y); connect(maxRat.u, abs1.y); connect(demRat.u, PEleDem); connect(nor.y, assMesP.u); connect(not2.y, assMesDP.u); connect(PEleDem, maxPow.u); connect(maxPow.y, nor.u1); connect(PEleDem, minPow.u); connect(minPow.y, not1.u); connect(not1.y, nor.u2); connect(maxRat.y, not2.u); end AssertPower;

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

Assert if water flow is outside boundaries

Buildings.Fluid.CHPs.BaseClasses.AssertWaterFlow

Information

The model sends a warning message if the water mass flow rate is lower than the minimum defined by the manufacturer.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
MassFlowRatemWatMin_flow Minimum cooling water mass flow rate [kg/s]

Connectors

TypeNameDescription
input BooleanInputrunSigTrue when electricity or heat demand is larger than zero
input RealInputmWat_flowWater mass flow rate [kg/s]

Modelica definition

model AssertWaterFlow "Assert if water flow is outside boundaries" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.MassFlowRate mWatMin_flow "Minimum cooling water mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput runSig "True when electricity or heat demand is larger than zero"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mWat_flow( final unit="kg/s") "Water mass flow rate"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( final message="Water flow rate is lower than the minimum!") "Assert function for checking water flow rate"; protected Buildings.Controls.OBC.CDL.Logical.Nand nand "Logical Nand"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=0.99*mWatMin_flow - 1e-6, final uHigh=1.01*mWatMin_flow) "Check if water flow rate is larger than minimum rate"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Check if water flow rate is smaller than minimum rate"; equation connect(hys.u, mWat_flow); connect(nand.u1, runSig); connect(nand.y, assMes.u); connect(nand.u2, not1.y); connect(not1.u, hys.y); end AssertWaterFlow;

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

Assert if water outlet temperature is outside boundaries

Buildings.Fluid.CHPs.BaseClasses.AssertWaterTemperature

Information

The model sends a warning message if the water outlet temperature is higher than the maximum defined by the manufacturer.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
TemperatureTWatMax Maximum cooling water temperature [K]
Advanced
TemperatureDifferenceTHys0.5Hysteresis value to check temperature difference [K]

Connectors

TypeNameDescription
input RealInputTWatWater outlet temperature [K]

Modelica definition

model AssertWaterTemperature "Assert if water outlet temperature is outside boundaries" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Temperature TWatMax "Maximum cooling water temperature"; parameter Modelica.SIunits.TemperatureDifference THys = 0.5 "Hysteresis value to check temperature difference"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWat( final unit="K", displayUnit="degC") "Water outlet temperature"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( final message="Water temperature is higher than the maximum!") "Assert function for checking water temperature"; protected Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=TWatMax -THys, final uHigh=TWatMax + THys) "Check if water temperature is larger than the maximum temperature"; Buildings.Controls.OBC.CDL.Logical.Not not1 "Check if water temperature is lower than the maximum temperature"; equation connect(hys.u, TWat); connect(hys.y, not1.u); connect(not1.y, assMes.u); end AssertWaterTemperature;

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

Define current operation mode

Buildings.Fluid.CHPs.BaseClasses.Controller

Information

The CHP plant switches between six possible operating modes depending on the current mode, control signals and plant boundary conditions. The regular transition between them is as follows:

Switching between operating modes

From the off mode:

From the stand-by mode:

From the pump-on mode:

From the warm-up mode:

From the normal mode:

From the cool-down mode:

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Genericperredeclare parameter Building...Performance data
Dynamics
TimewaitTime60Wait time before transition from pump-on mode fires [s]

Connectors

TypeNameDescription
input BooleanInputavaSigTrue when the plant is available
input BooleanInputrunSigTrue when plant should run
input RealInputmWat_flowCooling water mass flow rate [kg/s]
input RealInputTEngEngine temperature [K]
input RealInputPEleNetNet power output [W]
input RealInputPElePower demand [W]
output ModeTypeOutputopeModType of operating mode

Modelica definition

model Controller "Define current operation mode" extends Modelica.Blocks.Icons.Block; replaceable parameter Buildings.Fluid.CHPs.Data.Generic per "Performance data"; parameter Modelica.SIunits.Time waitTime=60 "Wait time before transition from pump-on mode fires"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput avaSig "True when the plant is available"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput runSig "True when plant should run"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mWat_flow( final unit="kg/s") "Cooling water mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEng( final unit="K", final displayUnit="degC") if not per.warmUpByTimeDelay "Engine temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEleNet(final unit="W") if not per.warmUpByTimeDelay "Net power output"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEle(final unit="W") if not per.warmUpByTimeDelay "Power demand"; Buildings.Fluid.CHPs.BaseClasses.Interfaces.ModeTypeOutput opeMod "Type of operating mode"; Modelica.StateGraph.Step staBy(nOut=2) "Standby step"; Modelica.StateGraph.Step pumOn(nOut=2) "Pump on step"; Modelica.StateGraph.StepWithSignal warUp(nIn=2, nOut=2) "Warm-up step"; Modelica.StateGraph.StepWithSignal cooDow(nIn=2, nOut=2) "Cool-down step"; protected Buildings.Controls.OBC.CDL.Continuous.Sources.Constant minWatFlo( final k=per.mWatMin_flow) "Minimum water mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant con( final k=0.001) "Constant value"; Buildings.Controls.OBC.CDL.Continuous.Max max "Maximum between minimum flow rate and 0.001"; Buildings.Controls.OBC.CDL.Continuous.Add add2( final k1=-1) "Mass flow rate difference between actual and minimum value"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=0.01*per.mWatMin_flow - 1e-6, final uHigh=0.015*per.mWatMin_flow) "Check if actual mass flow rate is larger than the minimum value"; Buildings.Controls.OBC.CDL.Logical.And goSig "Check if water flow rate is higher than the minimum when runSig = true"; Buildings.Controls.OBC.CDL.Logical.Not notRunSig "Plant is not running"; Buildings.Controls.OBC.CDL.Logical.Not notAvaSig "Plant is not available"; Buildings.Controls.OBC.CDL.Logical.And and1 "Warm-up mode is done and the plant could run"; Modelica.StateGraph.TransitionWithSignal transition3 "Plant should be off"; Modelica.StateGraph.TransitionWithSignal transition5 "Plant should be off"; Modelica.StateGraph.TransitionWithSignal transition9 "Run in cool-down mode"; Modelica.StateGraph.TransitionWithSignal transition7 "Run in warm-up mode"; Buildings.Controls.OBC.CDL.Logical.And and3 "Plant could run and cool-down mode is optional"; Modelica.StateGraph.TransitionWithSignal transition10 "Plant should be off"; Buildings.Controls.OBC.CDL.Logical.And and4 "Plant could run and cool-down mode is optional"; Buildings.Fluid.CHPs.BaseClasses.AssertWaterFlow assWatMas( final mWatMin_flow=per.mWatMin_flow) "Assert if water flow rate is outside boundaries"; Buildings.Fluid.CHPs.BaseClasses.Types.Mode actMod "Mode indicator"; Modelica.StateGraph.TransitionWithSignal transition1 "Plant becomes available"; Modelica.StateGraph.TransitionWithSignal transition2 "Run plant"; Modelica.StateGraph.Step nor(final nIn=1, final nOut=1) "Plant is in normal mode"; Modelica.StateGraph.TransitionWithSignal transition8 "Run in cool-down mode"; Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving warUpCtr( final timeDelayStart=per.timeDelayStart, final TEngNom=per.TEngNom, final PEleMax=per.PEleMax, final warmUpByTimeDelay=per.warmUpByTimeDelay) "Warm-up control sequence"; Modelica.StateGraph.TransitionWithSignal transition6 "Run in normal mode"; Modelica.StateGraph.InitialStep plaOff(final nIn=3) "Plant is off"; Modelica.StateGraph.TransitionWithSignal transition4( final enableTimer=true, final waitTime=waitTime) "Run in warm-up mode"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant optCooDow( final k=per.coolDownOptional) "Check if cool-down mode is optional"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold timeDel( final threshold=per.timeDelayCool) "Check if the time of plant in cool-down mode has been longer than the specified delay time"; Buildings.Controls.OBC.CDL.Logical.Timer timer "Timer"; Buildings.Controls.OBC.CDL.Logical.Not noGo "Plant should not run"; equation if plaOff.active then actMod = CHPs.BaseClasses.Types.Mode.Off; elseif staBy.active then actMod = CHPs.BaseClasses.Types.Mode.StandBy; elseif pumOn.active then actMod = CHPs.BaseClasses.Types.Mode.PumpOn; elseif warUp.active then actMod = CHPs.BaseClasses.Types.Mode.WarmUp; elseif nor.active then actMod = CHPs.BaseClasses.Types.Mode.Normal; else actMod = CHPs.BaseClasses.Types.Mode.CoolDown; end if; opeMod = actMod; connect(nor.outPort[1], transition8.inPort); connect(TEng, warUpCtr.TEng); connect(plaOff.outPort[1], transition1.inPort); connect(transition6.outPort, nor.inPort[1]); connect(assWatMas.mWat_flow, mWat_flow); connect(minWatFlo.y, max.u1); connect(con.y, max.u2); connect(max.y, add2.u1); connect(add2.y, hys.u); connect(hys.y, goSig.u1); connect(mWat_flow, add2.u2); connect(runSig, goSig.u2); connect(runSig, notRunSig.u); connect(runSig, assWatMas.runSig); connect(avaSig, transition1.condition); connect(runSig, transition2.condition); connect(avaSig, notAvaSig.u); connect(goSig.y, transition4.condition); connect(and1.y, transition6.condition); connect(notAvaSig.y, transition3.condition); connect(and3.y, transition7.condition); connect(and4.y, transition10.condition); connect(transition3.outPort, plaOff.inPort[1]); connect(transition5.outPort, plaOff.inPort[2]); connect(transition10.outPort, plaOff.inPort[3]); connect(goSig.y, and3.u2); connect(optCooDow.y, and3.u1); connect(transition1.outPort, staBy.inPort[1]); connect(staBy.outPort[1], transition2.inPort); connect(staBy.outPort[2], transition3.inPort); connect(transition2.outPort, pumOn.inPort[1]); connect(pumOn.outPort[1], transition4.inPort); connect(pumOn.outPort[2], transition5.inPort); connect(warUp.outPort[1], transition6.inPort); connect(warUp.outPort[2], transition9.inPort); connect(warUp.active, warUpCtr.actWarUp); connect(warUpCtr.y, and1.u2); connect(goSig.y, and1.u1); connect(transition4.outPort, warUp.inPort[1]); connect(transition7.outPort, warUp.inPort[2]); connect(transition8.outPort, cooDow.inPort[1]); connect(transition9.outPort, cooDow.inPort[2]); connect(cooDow.outPort[1], transition10.inPort); connect(cooDow.outPort[2], transition7.inPort); connect(timer.y, timeDel.u); connect(cooDow.active, timer.u); connect(timeDel.y, and4.u1); connect(PEleNet, warUpCtr.PEleNet); connect(PEle, warUpCtr.PEle); connect(notRunSig.y, transition5.condition); connect(goSig.y, noGo.u); connect(noGo.y, transition8.condition); connect(noGo.y, and4.u2); connect(noGo.y, transition9.condition); end Controller;

Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve

Efficiency curve described by a fifth order polynomial, function of three input variables

Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve

Information

The block computes the efficiency as a polynomial function of three input variables. The polynomial has the form

y = a1 + a2 x12 + a3 x1 + a4 x22 + a5 x2 + a6 x32 + a7 x3 + a8 x12 x22 + a9 x1 x2
+ a10 x1 x22 + a11 x12 x2 + a12 x12 x32 + a13 x1 x3 + a14 x1 x32 + a15 x12 x3 + a16 x22 x32 + a17 x2 x3 + a18 x2 x32
+ a19 x22 x3 + a20 x12 x22 x32 + a21 x12 x22 x3 + a22 x12 x2 x32 + a23 x1 x22 x32 + a24 x12 x2 x3 + a25 x1 x22 x3 + a26 x1 x2 x32 + a27 x1 x2 x3

where x1 is the net power output, x2 is the water mass flow rate, x3 is the water inlet temperature.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Reala[27] Polynomial coefficients

Connectors

TypeNameDescription
input RealInputPNetElectric power [W]
input RealInputmWat_flowWater mass flow rate [kg/s]
input RealInputTWatInWater inlet temperature [K]
output RealOutputetaEfficiency [1]

Modelica definition

block EfficiencyCurve "Efficiency curve described by a fifth order polynomial, function of three input variables" extends Modelica.Blocks.Icons.Block; parameter Real a[27] "Polynomial coefficients"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PNet( final unit="W") "Electric power"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mWat_flow( final unit="kg/s") "Water mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatIn( final unit="K") "Water inlet temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput eta( final unit="1") "Efficiency"; protected Real y(unit="1") "Efficiency"; constant Real etaSma=0.01 "Value for eta if y is zero"; equation y = Buildings.Fluid.CHPs.BaseClasses.Functions.polynomialtrivariate( a=a, x1=PNet, x2=mWat_flow, x3=TWatIn - 273.15) "Efficiency calculated as a function of power, water flow rate and water inlet temperature"; eta = Buildings.Utilities.Math.Functions.smoothMax( x1=y, x2=etaSma, deltaX=etaSma/2) "Corrected efficiency, ensuring that efficiency is not zero"; end EfficiencyCurve;

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

Energy conversion control volume

Buildings.Fluid.CHPs.BaseClasses.EnergyConversion

Information

The model defines energy conversion that occurs during the normal mode and warm-up mode. The model Buildings.Fluid.CHPs.BaseClasses.EnergyConversionWarmUp is used only for the warm-up mode dependent on the engine temperature (case of Stirling engines). The model Buildings.Fluid.CHPs.BaseClasses.EnergyConversionNormal is used for all other cases, i.e. the normal mode, and the warm-up mode based on a time delay (case of internal combustion engines).

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Genericperredeclare parameter Building...Performance data

Connectors

TypeNameDescription
input RealInputPElePower demand [W]
input ModeTypeInputopeModOperation mode
input RealInputmWat_flowWater mass flow rate [kg/s]
input RealInputTWatInWater inlet temperature [K]
input RealInputTRooRoom temperature [K]
input RealInputTEngEngine temperature [K]
output RealOutputPEleNetNet power output [W]
output RealOutputmFue_flowFuel mass flow rate [kg/s]
output RealOutputmAir_flowAir mass flow rate [kg/s]
output RealOutputQGen_flowHeat generation rate [W]

Modelica definition

model EnergyConversion "Energy conversion control volume" extends Modelica.Blocks.Icons.Block; replaceable parameter Buildings.Fluid.CHPs.Data.Generic per "Performance data"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEle( final unit="W") "Power demand"; Buildings.Fluid.CHPs.BaseClasses.Interfaces.ModeTypeInput opeMod "Operation mode"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mWat_flow( final unit="kg/s", final quantity="MassFlowRate") "Water mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatIn( final unit="K", displayUnit="degC") "Water inlet temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TRoo( final unit="K", displayUnit="degC") "Room temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEng( final unit="K", displayUnit="degC") if not per.warmUpByTimeDelay "Engine temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PEleNet( final unit="W") "Net power output"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mFue_flow( final unit="kg/s", final quantity="MassFlowRate") "Fuel mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mAir_flow( final unit="kg/s", final quantity="MassFlowRate") "Air mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput QGen_flow(final unit="W") "Heat generation rate"; protected Buildings.Fluid.CHPs.BaseClasses.AssertFuelFlow assFue( final dmFueMax_flow=per.dmFueMax_flow) if per.use_fuelRateLimit "Assert if fuel flow rate is outside boundaries"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversionNormal opeModBas(final per= per) "Typical energy conversion mode"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversionWarmUp opeModWarUpEngTem( final per=per) if not per.warmUpByTimeDelay "Warm-up by engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant const(final k=0) "Zero constant"; Buildings.Controls.OBC.CDL.Logical.Switch switch "Switch to zero power output if not in (normal or warm-up mode)"; Modelica.Blocks.Sources.BooleanExpression booExp( final y=opeMod ==CHPs.BaseClasses.Types.Mode.WarmUp or opeMod ==CHPs.BaseClasses.Types.Mode.Normal) "True if active mode is (warm-up or normal)"; Buildings.Controls.OBC.CDL.Logical.Switch switch2 "Switch between warm-up and normal value"; Buildings.Controls.OBC.CDL.Logical.Switch switch3 "Switch between warm-up and normal value"; Buildings.Controls.OBC.CDL.Logical.Switch switch4 "Switch between warm-up and normal value"; Buildings.Controls.OBC.CDL.Logical.Switch switch5 "Switch between warm-up and normal value"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant PEleTimeDel(final k=0) if per.warmUpByTimeDelay "Zero power output in case of warm-up by time delay"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant delWarUp( final k=per.warmUpByTimeDelay) "Warm-up by time delay"; Modelica.Blocks.Sources.BooleanExpression wamUpMod( final y=opeMod == CHPs.BaseClasses.Types.Mode.WarmUp) "Check whether warm-up mode is active"; Buildings.Controls.OBC.CDL.Logical.Not engTemWarUp "Warm-up based on engine temperature"; Buildings.Controls.OBC.CDL.Logical.And and1 "True if warm-up mode and warm-up based on engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant dumTimDel( final k=0) if per.warmUpByTimeDelay "Set dummy value in case of warm-up by time delay"; equation connect(opeModBas.mWat_flow, mWat_flow); connect(opeModBas.TWatIn, TWatIn); connect(opeModWarUpEngTem.TEng, TEng); connect(opeModWarUpEngTem.TWatIn, TWatIn); connect(const.y, switch.u3); connect(PEle, switch.u1); connect(booExp.y, switch.u2); connect(switch.y, opeModBas.PEle); connect(opeModWarUpEngTem.PEleNet, switch2.u1); connect(switch2.y, PEleNet); connect(switch3.y, mFue_flow); connect(switch4.y, mAir_flow); connect(switch5.y, QGen_flow); connect(opeModBas.mFue_flow, switch3.u3); connect(opeModWarUpEngTem.mFue_flow, switch3.u1); connect(opeModBas.mAir_flow, switch4.u3); connect(opeModWarUpEngTem.mAir_flow, switch4.u1); connect(opeModWarUpEngTem.QGen_flow, switch5.u1); connect(opeModBas.QGen_flow, switch5.u3); connect(mWat_flow, opeModWarUpEngTem.mWat_flow); connect(switch3.y, assFue.mFue_flow); connect(PEleTimeDel.y, switch2.u1); connect(switch.y, switch2.u3); connect(TRoo, opeModWarUpEngTem.TRoo); connect(delWarUp.y, engTemWarUp.u); connect(engTemWarUp.y, and1.u2); connect(wamUpMod.y, and1.u1); connect(and1.y, switch3.u2); connect(and1.y, switch4.u2); connect(and1.y, switch5.u2); connect(wamUpMod.y, switch2.u2); connect(dumTimDel.y, switch3.u1); connect(dumTimDel.y, switch4.u1); connect(dumTimDel.y, switch5.u1); end EnergyConversion;

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

Energy conversion for typical CHP operation either in normal mode or warm-up mode based on time delay

Buildings.Fluid.CHPs.BaseClasses.EnergyConversionNormal

Information

The model defines energy conversion for a typical CHP operation that includes the normal mode and warm-up mode based on the time delay (CHPs with internal combustion engines). Energy conversion from fuel to the electric power and heat is modeled using system's part-load electrical and thermal efficiencies, based on the empirical data from the manufacturer. The curves are described by a fifth order polynomial, a function of the electric power, water flow rate and water inlet temperature. The air flow rate is modeled using a second order polynomial, a function of the fuel flow rate.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Genericperredeclare parameter Building...Performance data

Connectors

TypeNameDescription
input RealInputPEleElectric power [W]
input RealInputmWat_flowWater mass flow rate [kg/s]
input RealInputTWatInWater inlet temperature [K]
output RealOutputmFue_flowFuel mass flow rate [kg/s]
output RealOutputmAir_flowAir mass flow rate [kg/s]
output RealOutputQGen_flowHeat generation rate within the engine [W]

Modelica definition

model EnergyConversionNormal "Energy conversion for typical CHP operation either in normal mode or warm-up mode based on time delay" extends Modelica.Blocks.Icons.Block; replaceable parameter Buildings.Fluid.CHPs.Data.Generic per "Performance data"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEle( final unit="W") "Electric power"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mWat_flow( final unit="kg/s", final quantity="MassFlowRate") "Water mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatIn( final unit="K", displayUnit="degC") "Water inlet temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mFue_flow( final unit="kg/s", final quantity="MassFlowRate") "Fuel mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mAir_flow( final unit="kg/s", final quantity="MassFlowRate") "Air mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput QGen_flow(final unit="W") "Heat generation rate within the engine"; protected Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve etaE( final a=per.coeEtaE) "Part load electrical efficiency"; Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve etaQ( final a=per.coeEtaQ) "Part load thermal efficiency"; Buildings.Controls.OBC.CDL.Continuous.Division groHea "Gross heat input into the system"; Buildings.Controls.OBC.CDL.Continuous.Product heaGen "Heat generation within the engine"; Buildings.Utilities.Math.Polynominal masFloAir(final a=per.coeMasAir) "Air mass flow rate computation"; Buildings.Controls.OBC.CDL.Continuous.Gain masFloFue(final k=1/per.LHVFue) "Fuel mass flow rate computation"; equation connect(groHea.u1, PEle); connect(heaGen.y, QGen_flow); connect(masFloAir.y, mAir_flow); connect(etaE.TWatIn, TWatIn); connect(etaE.PNet, PEle); connect(etaQ.PNet, PEle); connect(mWat_flow, etaE.mWat_flow); connect(etaQ.mWat_flow, mWat_flow); connect(etaQ.TWatIn, TWatIn); connect(etaE.eta, groHea.u2); connect(etaQ.eta, heaGen.u2); connect(groHea.y, heaGen.u1); connect(masFloFue.y, mFue_flow); connect(groHea.y, masFloFue.u); connect(masFloFue.y, masFloAir.u); end EnergyConversionNormal;

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

Energy conversion during warm-up mode based on engine temperature

Buildings.Fluid.CHPs.BaseClasses.EnergyConversionWarmUp

Information

The model defines energy conversion for the warm-up mode that is dependent on the engine temperature (e.g. CHPs with Stirling engines). The engine fuel flow rate is a function of the fuel flow rate at the maximum power output, as well as the difference between the nominal engine temperature and the actual engine temperature. Energy conversion from fuel to the electric power and heat is modeled using system's part-load electrical and thermal efficiencies, based on the empirical data from the manufacturer. The curves are described by a fifth order polynomial, a function of the electric power, water flow rate and water inlet temperature. The air flow rate is modeled using a second order polynomial, a function of the fuel flow rate.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Genericperredeclare parameter Building...Performance data

Connectors

TypeNameDescription
input RealInputmWat_flowWater mass flow rate [kg/s]
input RealInputTWatInWater inlet temperature [K]
input RealInputTRooRoom temperature [K]
input RealInputTEngEngine temperature [K]
output RealOutputPEleNetElectric power generation [W]
output RealOutputmFue_flowFuel mass flow rate [kg/s]
output RealOutputmAir_flowAir mass flow rate [kg/s]
output RealOutputQGen_flowHeat generation rate within the engine [W]

Modelica definition

model EnergyConversionWarmUp "Energy conversion during warm-up mode based on engine temperature" extends Modelica.Blocks.Icons.Block; replaceable parameter Buildings.Fluid.CHPs.Data.Generic per "Performance data"; Buildings.Controls.OBC.CDL.Interfaces.RealInput mWat_flow( final unit="kg/s", final quantity="MassFlowRate") "Water mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatIn( final unit="K", displayUnit="degC") "Water inlet temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TRoo( final unit="K", displayUnit="degC") "Room temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEng( final unit="K", displayUnit="degC") "Engine temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PEleNet( final unit="W") "Electric power generation"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mFue_flow( final unit="kg/s", final quantity="MassFlowRate") "Fuel mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mAir_flow( final unit="kg/s", final quantity="MassFlowRate") "Air mass flow rate"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput QGen_flow(final unit="W") "Heat generation rate within the engine"; protected Buildings.Utilities.Math.SmoothMax smoothMax( final deltaX=0.5) "Prevent negative value if room temperature exceeds engine nominal temperature"; Buildings.Utilities.Math.SmoothMax smoothMax2( final deltaX=0.5) "Prevent zero in denominator"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis temChe( final uLow=4.8, final uHigh=5.2) "Check if room temperature is not close to the nominal engine temperature by less than 5 Kelvin"; Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve etaE( final a=per.coeEtaE) "Part load electrical efficiency"; Buildings.Controls.OBC.CDL.Continuous.Division QGroMax "Gross heat input into the system"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant PEleMax( final k=per.PEleMax) "Maximum power"; Buildings.Controls.OBC.CDL.Continuous.Gain maxFueFlo(final k=per.rFue) "Maximum fuel mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Min fueFlo "Fuel flow"; Buildings.Controls.OBC.CDL.Continuous.Division division "First input divided by second input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant TEngNom( y(final unit="K", displayUnit="degC"), final k=per.TEngNom) "Nominal engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Add add1(final k2=-1) "Difference between nominal engine temperature and room temperature"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant min1(final k=1) "Prevent negative value if room temperature exceeds engine nominal temperature"; Buildings.Controls.OBC.CDL.Continuous.Gain gain(final k=per.kF) "Gain by factor of warm-up fuel coefficient"; Buildings.Controls.OBC.CDL.Continuous.Add add2 "Add up two inputs"; Buildings.Controls.OBC.CDL.Continuous.Product unlFueFloWarUp "Unlimited fuel mass flow rate during warm-up"; Buildings.Fluid.CHPs.BaseClasses.EfficiencyCurve etaQ( final a=per.coeEtaQ) "Part load thermal efficiency"; Buildings.Controls.OBC.CDL.Continuous.Product heaGen "Heat generation within the engine"; Buildings.Controls.OBC.CDL.Continuous.Division division1 "First input divided by second input"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant powCoe( final k=per.kP) "Warm-up power coefficient"; Buildings.Controls.OBC.CDL.Continuous.Product PEleNet1 "Generated electrical power"; Buildings.Utilities.Math.Polynominal masFloAir(final a=per.coeMasAir) "Air mass flow rate"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant min2(final k=1) "Prevent zero in denominator"; Buildings.Controls.OBC.CDL.Utilities.Assert assMes( final message="Room temperature is too close to the nominal engine temperature, simulation should be aborted") "Assert function for checking room temperature"; Buildings.Controls.OBC.CDL.Continuous.Add add(final k1=-1) "Difference between room temperature and engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Gain masFloFue(final k=1/per.LHVFue) "Fuel mass flow rate computation"; Buildings.Controls.OBC.CDL.Continuous.Gain heaGro(final k=per.LHVFue) "Gross heat input into the system"; equation connect(PEleMax.y, etaE.PNet); connect(QGroMax.u1,PEleMax. y); connect(etaE.TWatIn, TWatIn); connect(etaE.mWat_flow, mWat_flow); connect(etaE.eta, QGroMax.u2); connect(TEngNom.y, add1.u1); connect(add1.u2, TRoo); connect(division.y, gain.u); connect(gain.y, add2.u1); connect(add2.y, unlFueFloWarUp.u2); connect(etaQ.PNet,PEleMax. y); connect(etaQ.mWat_flow, mWat_flow); connect(etaQ.TWatIn, TWatIn); connect(etaQ.eta, heaGen.u1); connect(maxFueFlo.y, fueFlo.u1); connect(unlFueFloWarUp.y, fueFlo.u2); connect(division1.u1,powCoe. y); connect(division1.u2, division.y); connect(PEleNet1.u1, PEleMax.y); connect(PEleNet1.y, PEleNet); connect(heaGen.y, QGen_flow); connect(fueFlo.y, mFue_flow); connect(masFloAir.y, mAir_flow); connect(min1.y, smoothMax.u2); connect(add1.y, smoothMax.u1); connect(smoothMax.y, division.u1); connect(min2.y, smoothMax2.u2); connect(smoothMax2.y, division.u2); connect(temChe.u, add1.y); connect(division1.y, PEleNet1.u2); connect(temChe.y, assMes.u); connect(min2.y, add2.u2); connect(fueFlo.y,masFloAir. u); connect(TEng, add.u2); connect(TRoo, add.u1); connect(add.y, smoothMax2.u1); connect(QGroMax.y, masFloFue.u); connect(masFloFue.y, maxFueFlo.u); connect(masFloFue.y, unlFueFloWarUp.u1); connect(heaGro.y, heaGen.u2); connect(fueFlo.y, heaGro.u); end EnergyConversionWarmUp;

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

Heat exchange within the engine control volume

Buildings.Fluid.CHPs.BaseClasses.EngineTemperature

Information

The model defines the dynamic behavior of the CHP thermal mass (i.e. engine block, encapsulated working fluid, and internal heat exchange equipment) using a single, engine control volume. The thermal energy stored within this volume is quantified using an aggregate thermal capacitance capEng and an equivalent average engine temperature TEng. The heat transfer between the engine and the cooling water control volume is quantified using the overall thermal conductance UAHex, while the heat loss to the surroundings is quantified using the overall thermal conductance UALos.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
ThermalConductanceUAHex Thermal conductance between the engine and cooling water [W/K]
ThermalConductanceUALos Thermal conductance between the engine and surroundings [W/K]
HeatCapacitycapEng Thermal capacitance of the engine control volume [J/K]
TemperatureTEngIni Initial engine temperature [K]

Connectors

TypeNameDescription
HeatPort_aTRooHeat port for room temperature
input RealInputQGen_flowHeat generation rate within the engine [W]
HeatPort_aTWatHeat port for water volume temperature
output RealOutputTEngEngine temperature [K]

Modelica definition

model EngineTemperature "Heat exchange within the engine control volume" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.ThermalConductance UAHex "Thermal conductance between the engine and cooling water"; parameter Modelica.SIunits.ThermalConductance UALos "Thermal conductance between the engine and surroundings"; parameter Modelica.SIunits.HeatCapacity capEng "Thermal capacitance of the engine control volume"; parameter Modelica.SIunits.Temperature TEngIni "Initial engine temperature"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TRoo "Heat port for room temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealInput QGen_flow(final unit="W") "Heat generation rate within the engine"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TWat "Heat port for water volume temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput TEng( final unit="K", displayUnit="degC") "Engine temperature"; protected constant Modelica.SIunits.Density rhoWat=1000 "Water density"; constant Modelica.SIunits.SpecificHeatCapacity cWat=4180 "Water specific heat"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor theConHX( final G=UAHex) "Thermal conductance between engine and cooling water volume"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor capTheEng( final C=capEng, T(fixed=true, start=TEngIni)) "Thermal capacitance of the engine control volume"; Modelica.Thermal.HeatTransfer.Components.ThermalConductor conTheLos( final G=UALos) "Thermal conductance between the engine and surroundings"; Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow QGen1 "Heat generation within the engine"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor engTem "Engine temperature"; equation connect(capTheEng.port, theConHX.port_b); connect(QGen_flow, QGen1.Q_flow); connect(conTheLos.port_b, capTheEng.port); connect(engTem.port, capTheEng.port); connect(conTheLos.port_a, TRoo); connect(theConHX.port_a, TWat); connect(QGen1.port, capTheEng.port); connect(engTem.T, TEng); end EngineTemperature;

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

Constraints for electric power

Buildings.Fluid.CHPs.BaseClasses.FilterPower

Information

The model checks if the electric power and power rate are within the boundaries specified by the manufacturer. The constraints are applied and a warning message is sent if the electric power is outside the boundaries.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
PowerPEleMax Maximum power output [W]
PowerPEleMin Minimum power output [W]
Booleanuse_powerRateLimit If true, the rate at which net power output can change is limited
RealdPEleMax Maximum rate at which net power output can change [W/s]

Connectors

TypeNameDescription
input RealInputPEleDemElectric power demand [W]
output RealOutputPEleElectric power demand after applied constraints [W]

Modelica definition

model FilterPower "Constraints for electric power" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Power PEleMax "Maximum power output"; parameter Modelica.SIunits.Power PEleMin "Minimum power output"; parameter Boolean use_powerRateLimit "If true, the rate at which net power output can change is limited"; parameter Real dPEleMax(final unit="W/s") "Maximum rate at which net power output can change"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEleDem(final unit="W") "Electric power demand"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PEle(final unit="W") "Electric power demand after applied constraints"; Buildings.Fluid.CHPs.BaseClasses.AssertPower assPow( final PEleMax=PEleMax, final PEleMin=PEleMin, final use_powerRateLimit=use_powerRateLimit, final dPEleMax=dPEleMax) "Assert if electric power is outside boundaries"; protected Modelica.Blocks.Nonlinear.VariableLimiter PLim "Power limiter"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant PMax( final k=PEleMax) "Maximum power"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant PMin( final k=PEleMin) "Minimum power"; Buildings.Controls.OBC.CDL.Continuous.SlewRateLimiter dPLim( final raisingSlewRate(unit="W/s")=dPEleMax, final fallingSlewRate(unit="W/s")=-dPEleMax, final Td=1) "Power rate limiter"; Buildings.Controls.OBC.CDL.Logical.Switch switch; Buildings.Controls.OBC.CDL.Logical.Sources.Constant limDp( final k=use_powerRateLimit) "Check if dP is limited"; equation connect(PMax.y, PLim.limit1); connect(PMin.y, PLim.limit2); connect(PLim.u, PEleDem); connect(switch.y, PEle); connect(PLim.y, dPLim.u); connect(PLim.y, switch.u3); connect(assPow.PEleDem, PEleDem); connect(limDp.y, switch.u2); connect(dPLim.y, switch.u1); end FilterPower;

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

Power consumption during stand-by and cool-down modes

Buildings.Fluid.CHPs.BaseClasses.PowerConsumption

Information

The model calculates the power consumption during the stand-by and cool-down modes of operation.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
PowerPStaBy Standby electric power [W]
PowerPCooDow Cooldown electric power [W]

Connectors

TypeNameDescription
input ModeTypeInputopeModOperation mode
output RealOutputPConPower consumption during stand-by and cool-down modes [W]

Modelica definition

model PowerConsumption "Power consumption during stand-by and cool-down modes" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Power PStaBy "Standby electric power"; parameter Modelica.SIunits.Power PCooDow "Cooldown electric power"; Buildings.Fluid.CHPs.BaseClasses.Interfaces.ModeTypeInput opeMod "Operation mode"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PCon( final unit="W") "Power consumption during stand-by and cool-down modes"; protected Modelica.Blocks.Sources.BooleanExpression staBy( final y=opeMod == Buildings.Fluid.CHPs.BaseClasses.Types.Mode.StandBy) "Check if the operation mode is StandBy"; Modelica.Blocks.Sources.BooleanExpression cooDow( final y=opeMod == Buildings.Fluid.CHPs.BaseClasses.Types.Mode.StandBy or opeMod == Buildings.Fluid.CHPs.BaseClasses.Types.Mode.CoolDown) "Check if stand-by mode or cool-down mode"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant staByCon( final k=PStaBy) "Stand-by mode power consumption "; Buildings.Controls.OBC.CDL.Logical.Switch switch "Power consumption during stand-by or cool-down mode"; Buildings.Controls.OBC.CDL.Logical.Switch switch1 "Cool-down power consumption"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant const(final k=0) "Zero power consumption"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant cooDowCon( final k=PCooDow) "Cool-down mode power consumption "; equation connect(staByCon.y, switch.u1); connect(switch1.y, PCon); connect(staBy.y, switch.u2); connect(cooDow.y, switch1.u2); connect(const.y, switch1.u3); connect(cooDowCon.y, switch.u3); connect(switch.y, switch1.u1); end PowerConsumption;

Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving

Model evaluating the condition for transitioning from warm-up to normal mode

Buildings.Fluid.CHPs.BaseClasses.WarmUpLeaving

Information

The model computes a boolean variable which is true when warm-up is over. CHP will transition from the warm-up mode to the normal mode

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
TimetimeDelayStart Time delay between activation and power generation [s]
TemperatureTEngNom Nominal engine operating temperature [K]
PowerPEleMax0Maximum power output [W]
BooleanwarmUpByTimeDelay If true, the plant will be in warm-up mode depending on the delay time, otherwise depending on engine temperature

Connectors

TypeNameDescription
input RealInputTEngEngine temperature [K]
output BooleanOutputyTransition signal
input BooleanInputactWarUpWarm-up state active signal
input RealInputPElePower demand [W]
input RealInputPEleNetNet power output [W]

Modelica definition

model WarmUpLeaving "Model evaluating the condition for transitioning from warm-up to normal mode" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Time timeDelayStart "Time delay between activation and power generation"; parameter Modelica.SIunits.Temperature TEngNom "Nominal engine operating temperature"; parameter Modelica.SIunits.Power PEleMax=0 "Maximum power output"; parameter Boolean warmUpByTimeDelay "If true, the plant will be in warm-up mode depending on the delay time, otherwise depending on engine temperature "; Buildings.Controls.OBC.CDL.Interfaces.RealInput TEng( final unit="K", displayUnit="degC") if not warmUpByTimeDelay "Engine temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput y "Transition signal"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput actWarUp "Warm-up state active signal"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEle(final unit="W") if not warmUpByTimeDelay "Power demand"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEleNet(final unit="W") if not warmUpByTimeDelay "Net power output"; protected Buildings.Controls.OBC.CDL.Logical.Timer timer if warmUpByTimeDelay "Count the time since the warm-up mode is activated"; Buildings.Controls.OBC.CDL.Continuous.GreaterEqualThreshold timeDel( final threshold=timeDelayStart) if warmUpByTimeDelay "Check if it has been in warm-up mode by longer than specified time"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysTem(uLow=-0.5, uHigh=0) if not warmUpByTimeDelay "Check if actual engine temperature is higher than norminal value"; Buildings.Controls.OBC.CDL.Continuous.Add add(final k2=-1) if not warmUpByTimeDelay "Difference between actual engine temperature and nominal value"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant temEngNom( y(final unit="K", displayUnit="degC"), final k=TEngNom) "Nominal engine temperature"; Buildings.Controls.OBC.CDL.Continuous.Add add1(final k2=-1) if not warmUpByTimeDelay "Difference between actual power output and demand"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hysPow( final uLow=-0.01*PEleMax - 1e-6, final uHigh=0) if not warmUpByTimeDelay "Check if actual power output is higher than demand"; Buildings.Controls.OBC.CDL.Logical.Or or2 if not warmUpByTimeDelay "OR evaluation"; Buildings.Controls.OBC.CDL.Logical.Pre pre if not warmUpByTimeDelay "Infinitesimal time delay to break algebraic loop related to power output computation"; equation connect(add.y, hysTem.u); connect(TEng, add.u1); connect(temEngNom.y, add.u2); connect(actWarUp, timer.u); connect(timer.y, timeDel.u); connect(add1.y, hysPow.u); connect(PEle, add1.u2); connect(hysTem.y, or2.u1); connect(hysPow.y, or2.u2); connect(timeDel.y, y); connect(or2.y, pre.u); connect(pre.y, y); connect(PEleNet, add1.u1); end WarmUpLeaving;

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

Internal controller for water flow rate

Buildings.Fluid.CHPs.BaseClasses.WaterFlowControl

Information

The model calculates the water mass flow rate that is determined by the internal controller. In CHPs that use this type of internal control the cooling water mass flow rate is controlled to optimize engine performance and heat recovery. In the main model of the CHP unit Buildings.Fluid.CHPs.ThermalElectricalFollowing, this optimum water mass flow rate is specified as the set point signal for the external pump controller.

Implementation

The mass flow rate is computed as a biquadratic function of the net power output of the system and the water inlet temperature. Note that this implementation is a truncated version of the empirical correlation proposed in Beausoleil-Morrison (2007) which includes terms of higher order (up to four).

References

Beausoleil-Morrison, Ian and Kelly, Nick, 2007. Specifications for modelling fuel cell and combustion-based residential cogeneration device within whole-building simulation programs, Section III. [Report]

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Genericperredeclare parameter Building...Performance data

Connectors

TypeNameDescription
input ModeTypeInputopeModOperation mode
input RealInputPEleElectric power [W]
input RealInputTWatInWater inlet temperature [K]
output RealOutputmWatSet_flowWater mass flow rate set point [kg/s]

Modelica definition

model WaterFlowControl "Internal controller for water flow rate" extends Modelica.Blocks.Icons.Block; replaceable parameter Buildings.Fluid.CHPs.Data.Generic per "Performance data"; Buildings.Fluid.CHPs.BaseClasses.Interfaces.ModeTypeInput opeMod "Operation mode"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEle( final unit="W") "Electric power"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatIn( final unit="K", displayUnit="degC") "Water inlet temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mWatSet_flow( final unit="kg/s", final quantity="MassFlowRate") "Water mass flow rate set point"; protected Modelica.Blocks.Sources.BooleanExpression offStaBy( final y=opeMod == Buildings.Fluid.CHPs.BaseClasses.Types.Mode.Off or opeMod == Buildings.Fluid.CHPs.BaseClasses.Types.Mode.StandBy) "Check if off mode or stand-by mode"; Buildings.Utilities.Math.Biquadratic mWatIntCon( final a=per.coeMasWat) "Internal control of water flow rate "; Buildings.Controls.OBC.CDL.Logical.Switch watFloSet "Water flow setpoint"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant const(final k=0) "Zero flow rate"; Buildings.Controls.OBC.UnitConversions.To_degC to_degC; equation connect(mWatIntCon.y, watFloSet.u3); connect(watFloSet.y, mWatSet_flow); connect(const.y, watFloSet.u1); connect(offStaBy.y, watFloSet.u2); connect(PEle, mWatIntCon.u1); connect(TWatIn, to_degC.u); connect(mWatIntCon.u2, to_degC.y); end WaterFlowControl;