Buildings.Fluid.CHPs

Package with model for combined heat and power device

Information

This package contains models for combined heat and power plant.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Fluid.CHPs.ThermalElectricalFollowing ThermalElectricalFollowing  
Buildings.Fluid.CHPs.Data Data  
Buildings.Fluid.CHPs.Validation Validation Validation of the main model
Buildings.Fluid.CHPs.BaseClasses BaseClasses  

Buildings.Fluid.CHPs.ThermalElectricalFollowing Buildings.Fluid.CHPs.ThermalElectricalFollowing


Buildings.Fluid.CHPs.ThermalElectricalFollowing

Information

This model for combined heat and power device uses empirical data contained within a "performance map" to represent device-specific performance characteristics coupled with thermally massive elements to characterize the device's dynamic thermal performance. It was developed based on the specification described in Beausoleil-Morrison (2007).

Model applicability

The model is primarily intended to predict the energy performance of combustion-based cogeneration devices, such as internal combustion engine and Stirling engine units. However, the general model specification makes it applicable to any device simultaneously producing heat and power from which heat is recovered as hot water, as long as recalibration is undertaken. Fuel cell based micro-cogeneration technology is outside of the modeling scope.

The parameters required to define the governing equations can be determined from bench testing with only non intrusive measurements (e.g. fuel flow rate, cooling water flow rates and temperature, electrical production). The ability to reuse and recalibrate the component models or sub-models ensures that they are applicable to future generations of cogeneration devices.

Model topology

Three control volumes are used to model the cogeneration unit dynamic thermal characteristics.


Control_Volumes.png

Depending on the current mode, control signals and plant boundary conditions, the CHP unit switches between six possible operating modes: off mode, stand-by mode, pump-on mode, warm-up mode, normal operation mode, cool-down mode. The mode switch control is implemented in Buildings.Fluid.CHPs.BaseClasses.Controller.

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 Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger (Partial model transporting one fluid stream with storing mass or energy).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Genericperredeclare parameter Building...CHP unit performance data
BooleanswitchThermalElectricalFollowingtrueSet to true for switching between thermal and electrical following, to false for electrical following only
TemperatureTEngIniMedium.T_defaultInitial engine temperature [K]
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
PressureDifferencedp_nominal3458*m_flow_nominal + 5282Pressure difference [Pa]
Cooling water outlet temperature controller
SimpleControllerwatOutConBuildings.Controls.OBC.CDL.T...Type of controller
Realk1Gain of controller
TimeTi0.5Time constant of integrator block [s]
TimeTd0.1Time constant of derivative block [s]
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Flow resistance
Booleanfrom_dpfalse= true, use m_flow = f(dp) else dp = f(m_flow)
BooleanlinearizeFlowResistancefalse= true, use linear relation between m_flow and dp for any flow rate
RealdeltaM0.1Fraction of nominal flow rate where flow transitions to laminar
Dynamics
Nominal condition
Timetau30Time constant at nominal flow (if energyDynamics <> SteadyState) [s]
Equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
TimewaitTime60Wait time before transition from pump-on mode fires [s]
Initialization
AbsolutePressurep_startMedium.p_defaultStart value of pressure [Pa]
TemperatureT_startMedium.T_defaultStart value of temperature [K]
MassFractionX_start[Medium.nX]Medium.X_defaultStart value of mass fractions m_i/m [kg/kg]
ExtraPropertyC_start[Medium.nC]fill(0, Medium.nC)Start value of trace substances

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
input RealInputTWatOutSetWater outlet set point temperature, which is input signal for thermal following [K]
input BooleanInputtheFolEnable thermal following, false if electrical following
input RealInputPEleDemElectric power demand [W]
input BooleanInputavaSigTrue when the plant is available
HeatPort_aTRooHeat port for room temperature
output RealOutputmWatSet_flowWater mass flow rate set point based on internal control [kg/s]
output RealOutputPConPower consumption during stand-by and cool-down modes [W]
output RealOutputPEleNetElectric power generation [W]
output RealOutputmFue_flowFuel mass flow rate [kg/s]
output RealOutputQWat_flowHeat transfer rate to the water control volume [W]

Modelica definition

model ThermalElectricalFollowing extends Buildings.Fluid.Interfaces.TwoPortHeatMassExchanger( redeclare Buildings.Fluid.MixingVolumes.MixingVolume vol( final V=per.capHeaRec/rhoWat/cWat), final dp_nominal=3458*m_flow_nominal + 5282 "The correlation between nominal pressure drop and mass flow rate is derived from manufacturers data"); replaceable parameter Buildings.Fluid.CHPs.Data.Generic per "CHP unit performance data"; parameter Boolean switchThermalElectricalFollowing = true "Set to true for switching between thermal and electrical following, to false for electrical following only"; parameter Modelica.SIunits.Temperature TEngIni = Medium.T_default "Initial engine temperature"; parameter Modelica.SIunits.Time waitTime=60 "Wait time before transition from pump-on mode fires"; parameter Controls.OBC.CDL.Types.SimpleController watOutCon= Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k=1 "Gain of controller"; parameter Modelica.SIunits.Time Ti=0.5 "Time constant of integrator block"; parameter Modelica.SIunits.Time Td=0.1 "Time constant of derivative block"; Buildings.Controls.OBC.CDL.Interfaces.RealInput TWatOutSet( final unit="K", displayUnit="degC") if switchThermalElectricalFollowing "Water outlet set point temperature, which is input signal for thermal following"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput theFol if switchThermalElectricalFollowing "Enable thermal following, false if electrical following"; Buildings.Controls.OBC.CDL.Interfaces.RealInput PEleDem( final unit="W", final quantity="Power") "Electric power demand"; Buildings.Controls.OBC.CDL.Interfaces.BooleanInput avaSig "True when the plant is available"; Modelica.Thermal.HeatTransfer.Interfaces.HeatPort_a TRoo "Heat port for room temperature"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput mWatSet_flow( final unit="kg/s", final quantity="MassFlowRate") if per.compute_coolingWaterFlowRate "Water mass flow rate set point based on internal control"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PCon( final unit="W", final quantity="Power") "Power consumption during stand-by and cool-down modes"; Buildings.Controls.OBC.CDL.Interfaces.RealOutput PEleNet( final unit="W", final quantity="Power") "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 QWat_flow( final unit="W", final quantity="HeatFlowRate") "Heat transfer rate to the water control volume"; Buildings.Fluid.CHPs.BaseClasses.EnergyConversion eneCon( final per = per) "Energy conversion"; Buildings.Fluid.CHPs.BaseClasses.EngineTemperature eng( final UAHex=per.UAHex, final UALos=per.UALos, final capEng=per.capEng, final TEngIni=TEngIni) "Engine control volume"; Buildings.Fluid.CHPs.BaseClasses.Controller opeMod( final per=per, final waitTime=waitTime) "Current operation mode"; Buildings.Controls.OBC.CDL.Logical.And runSig "Run if avaFlag and PEleDem non zero"; Buildings.Controls.OBC.CDL.Continuous.Hysteresis hys( final uLow=per.PEleMax/2*10^(-3), final uHigh=per.PEleMax*10^(-3)) "Determine if demand larger than zero"; Buildings.Fluid.CHPs.BaseClasses.FilterPower fil( final PEleMax=per.PEleMax, final PEleMin=per.PEleMin, final use_powerRateLimit=per.use_powerRateLimit, final dPEleMax=per.dPEleMax) "Power after applied constraints"; Buildings.Fluid.CHPs.BaseClasses.WaterFlowControl conWat(final per=per) if per.compute_coolingWaterFlowRate "Internal controller for water mass flow rate"; Modelica.Blocks.Sources.RealExpression mWat_flow( final y=port_a.m_flow) "Water mass flow rate"; Modelica.Blocks.Sources.RealExpression TWatIn( final y=Medium.temperature(Medium.setState_phX(port_a.p, inStream(port_a.h_outflow)))) "Water inlet temperature"; Buildings.Fluid.CHPs.BaseClasses.AssertWaterTemperature assWatTem( final TWatMax=per.TWatMax) "Assert if water temperature is outside boundaries"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TWatOut "Water outlet temperature"; Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor watHea "Heat transfer from the water control volume"; Buildings.Fluid.CHPs.BaseClasses.PowerConsumption powCon( final PStaBy=per.PStaBy, final PCooDow=per.PCooDow) "Power consumption during stand-by and cool-down modes"; Modelica.Thermal.HeatTransfer.Sensors.HeatFlowSensor QLos "Heat transfer to the surrounding"; Buildings.Controls.OBC.CDL.Continuous.LimPID cooWatCon( final controllerType=watOutCon, final k=k, final Ti=Ti, final Td=Td, final yMax=1, final yMin=0, final reset=Buildings.Controls.OBC.CDL.Types.Reset.Parameter) if switchThermalElectricalFollowing "Cooling water outplet controller"; Buildings.Controls.OBC.CDL.Continuous.Gain elePowDem( final k=per.PEleMax) if switchThermalElectricalFollowing "Electric power demand if thermal following"; Buildings.Controls.OBC.CDL.Logical.Switch swi "Switch between thermal and electrical following"; Buildings.Controls.OBC.CDL.Logical.Sources.Constant optFol( final k=false) if not switchThermalElectricalFollowing "Feed false to switch block if no optional following"; Buildings.Controls.OBC.CDL.Continuous.Sources.Constant zer1( final k=0) if not switchThermalElectricalFollowing "Constant zero"; Buildings.Controls.OBC.CDL.Continuous.Gain gai(final k=-1) "Heat transfer to the water control volume"; inner Modelica.StateGraph.StateGraphRoot stateGraphRoot; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TRooSen "Room temperature"; protected constant Modelica.SIunits.Density rhoWat=1000 "Water density"; constant Modelica.SIunits.SpecificHeatCapacity cWat=4180 "Water specific heat"; equation connect(fil.PEle, hys.u); connect(runSig.y, opeMod.runSig); connect(conWat.PEle, fil.PEle); connect(mWat_flow.y, eneCon.mWat_flow); connect(eng.TEng, eneCon.TEng); connect(mWat_flow.y, opeMod.mWat_flow); connect(TWatIn.y, conWat.TWatIn); connect(eneCon.TWatIn, TWatIn.y); connect(conWat.mWatSet_flow, mWatSet_flow); connect(hys.y, runSig.u2); connect(opeMod.opeMod, eneCon.opeMod); connect(opeMod.avaSig, avaSig); connect(runSig.u1, avaSig); connect(conWat.opeMod, opeMod.opeMod); connect(TWatOut.T, assWatTem.TWat); connect(eneCon.mFue_flow, mFue_flow); connect(eneCon.PEleNet, PEleNet); connect(TWatOut.port, vol.heatPort); connect(powCon.opeMod, opeMod.opeMod); connect(powCon.PCon, PCon); connect(TRoo, QLos.port_b); connect(eng.TRoo, QLos.port_a); connect(fil.PEle, eneCon.PEle); connect(watHea.port_b, eng.TWat); connect(vol.heatPort, watHea.port_a); connect(eneCon.QGen_flow, eng.QGen_flow); connect(eng.TEng, opeMod.TEng); connect(TWatOutSet, cooWatCon.u_s); connect(cooWatCon.y, elePowDem.u); connect(theFol, swi.u2); connect(PEleDem, swi.u3); connect(TWatOut.T, cooWatCon.u_m); connect(watHea.Q_flow, gai.u); connect(gai.y, QWat_flow); connect(zer1.y, swi.u1); connect(optFol.y, swi.u2); connect(swi.y, fil.PEleDem); connect(eneCon.PEleNet, opeMod.PEleNet); connect(PEleDem, opeMod.PEle); connect(TRoo, TRooSen.port); connect(TRooSen.T, eneCon.TRoo); connect(theFol, cooWatCon.trigger); connect(elePowDem.y, swi.u1); end ThermalElectricalFollowing;