Buildings.DHC.Loads.HotWater

Package of models for domestic hot water generation and loads served by district networks

Information

This package contains models for building domestic hot water loads served by a district heating network. These loads are typically charactersized as being from fixtures in kitchens, bathrooms, and laundry, and typically require a higher temperature water than space heating.

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

Package Content

Name Description
Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat DirectHeatExchangerWithElectricHeat A model for generating hot water using a district heat exchanger and supplemental electric resistance
Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger StorageTankWithExternalHeatExchanger A model of a storage tank with external heat exchanger to produce hot water
Buildings.DHC.Loads.HotWater.ThermostaticMixingValve ThermostaticMixingValve A model for a thermostatic mixing valve
Buildings.DHC.Loads.HotWater.Data Data Package for data related to hot water generation
Buildings.DHC.Loads.HotWater.Examples Examples Example implementations of district-integrated DHW models
Buildings.DHC.Loads.HotWater.BaseClasses BaseClasses Package with base classes that are used by multiple models

Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat

A model for generating hot water using a district heat exchanger and supplemental electric resistance

Buildings.DHC.Loads.HotWater.DirectHeatExchangerWithElectricHeat

Information

This model implements a basic domestic hot water source for a district heating network. It includes heating by the district through a heat-exchanger and optional electric resistance to bring the temperature of produced hot water to setpoint, if the district supply water is not hot enough.

image

It is based on Fig. 5 in Evaluations of different domestic hot water preparing methods with ultra-low-temperature district heating by X. Yang, H. Li, and S. Svendsen at doi.org/10.1016/j.energy.2016.04.109.

Extends from Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW (A partial model for domestic water heating).

Parameters

TypeNameDefaultDescription
replaceable package MediumDomPartialMediumMedium for domestic water in the component
replaceable package MediumHeaPartialMediumMedium for heating source in the component
Efficiencyeps0.8Heat exchanger effectiveness [1]
Booleanhave_eleHeatrueTrue if has auxiliary electric heater
HeatFlowRateQMax_flowModelica.Constants.infMaximum heat flow rate for electric heater (positive) [W]
MassFlowRatemDom_flow_nominal Nominal flow rate of domestic hot water [kg/s]
MassFlowRatemHea_flow_nominal Nominal flow rate of heating source water [kg/s]
PressureDifferencedpDom_nominal0Pressure difference in heat exchanger on domestic water side [Pa]
PressureDifferencedpHea_nominal0Pressure difference in heat exchanger on heating water side [Pa]
PressureDifferencedpEle_nominal0Pressure difference in electric reheater for domestic water [Pa]
Assumptions
BooleanallowFlowReversalDomtrue= false to simplify equations, assuming, but not enforcing, no flow reversal for domestic water
BooleanallowFlowReversalHeatrue= false to simplify equations, assuming, but not enforcing, no flow reversal for heating water

Connectors

TypeNameDescription
FluidPort_aport_aDomFluid connector for cold water (or recirculation water)
FluidPort_bport_bDomFluid connector for heated domestic hot water
FluidPort_aport_aHeaFluid connector for heating water (positive design flow direction is from port_a to port_b)
FluidPort_bport_bHeaFluid connector b for heating water (positive design flow direction is from port_a to port_b)
input RealInputTDomSetTemperature setpoint for heated domestic water [K]
output RealOutputTHexOutTemperature of hot water leaving heat exchanger
output RealOutputPEleElectric power required for electric heater [W]

Modelica definition

model DirectHeatExchangerWithElectricHeat "A model for generating hot water using a district heat exchanger and supplemental electric resistance" extends Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW; parameter Modelica.Units.SI.Efficiency eps(min=0,max=1) = 0.8 "Heat exchanger effectiveness"; parameter Boolean have_eleHea = true "True if has auxiliary electric heater"; parameter Modelica.Units.SI.HeatFlowRate QMax_flow(min=0) = Modelica.Constants.inf "Maximum heat flow rate for electric heater (positive)"; parameter Modelica.Units.SI.MassFlowRate mDom_flow_nominal "Nominal flow rate of domestic hot water"; parameter Modelica.Units.SI.MassFlowRate mHea_flow_nominal "Nominal flow rate of heating source water"; Buildings.Fluid.HeatExchangers.Heater_T heaEle( redeclare package Medium = MediumDom, m_flow_nominal=mDom_flow_nominal, dp_nominal=dpEle_nominal, QMax_flow=QMax_flow) if have_eleHea == true "Supplemental electric resistance domestic hot water heater"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemHot(redeclare package Medium = MediumDom, m_flow_nominal=mDom_flow_nominal) "Temperature sensor for hot water supply"; Buildings.Fluid.HeatExchangers.ConstantEffectiveness hex( redeclare package Medium1 = MediumDom, redeclare package Medium2 = MediumHea, m1_flow_nominal=mDom_flow_nominal, m2_flow_nominal=mHea_flow_nominal, dp1_nominal=dpDom_nominal, dp2_nominal=dpHea_nominal, eps=eps) "Domestic hot water heater heat exchanger"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemHexOut(redeclare package Medium = MediumDom, m_flow_nominal=mDom_flow_nominal) "Temperature sensor for hot water leaving heat exchanger"; parameter Modelica.Units.SI.PressureDifference dpDom_nominal=0 "Pressure difference in heat exchanger on domestic water side"; parameter Modelica.Units.SI.PressureDifference dpHea_nominal=0 "Pressure difference in heat exchanger on heating water side"; parameter Modelica.Units.SI.PressureDifference dpEle_nominal=0 "Pressure difference in electric reheater for domestic water"; Modelica.Blocks.Interfaces.RealOutput THexOut "Temperature of hot water leaving heat exchanger"; Modelica.Blocks.Interfaces.RealOutput PEle(unit="W") "Electric power required for electric heater"; Modelica.Blocks.Sources.Constant zero(k=0) if have_eleHea == false "Zero power if no heater"; protected Buildings.Fluid.FixedResistances.LosslessPipe pip( redeclare package Medium = MediumDom, final m_flow_nominal=mDom_flow_nominal, final show_T=false) if have_eleHea == false "Pipe without electric resistance"; equation connect(senTemHexOut.port_a, hex.port_b1); connect(senTemHexOut.port_b, heaEle.port_a); connect(senTemHexOut.port_b, pip.port_a); connect(heaEle.port_b, senTemHot.port_a); connect(pip.port_b, senTemHot.port_a); connect(TDomSet, heaEle.TSet); connect(senTemHexOut.T, THexOut); connect(heaEle.Q_flow, PEle); connect(zero.y, PEle); connect(port_aDom, hex.port_a1); connect(hex.port_a2, port_aHea); connect(senTemHot.port_b, port_bDom); connect(hex.port_b2, port_bHea); end DirectHeatExchangerWithElectricHeat;

Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger

A model of a storage tank with external heat exchanger to produce hot water

Buildings.DHC.Loads.HotWater.StorageTankWithExternalHeatExchanger

Information

This model implements a heating hot water tank with external heat exchanger that heats domestic hot water.

The storage tank model is described in Buildings.Fluid.Storage.StratifiedEnhancedInternalHex. The heat pump and storage tank system should be parameterized altogether using Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger.

image

It is based on Fig. 3 in Evaluations of different domestic hot water preparing methods with ultra-low-temperature district heating by X. Yang, H. Li, and S. Svendsen at doi.org/10.1016/j.energy.2016.04.109, as well as the Advanced Energy Design Guide for Multifamily Buildings-Achieving Zero Energy published by ASHRAE in 2022 at https://www.ashrae.org/technical-resources/aedgs/zero-energy-aedg-free-download.

For a model that connects this hot water system to a heat pump, see Buildings.DHC.ETS.Combined.Subsystems.HeatPumpDHWTank.

Extends from Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW (A partial model for domestic water heating).

Parameters

TypeNameDefaultDescription
replaceable package MediumDomPartialMediumMedium for domestic water in the component
replaceable package MediumHeaPartialMediumMedium for heating source in the component
GenericDomesticHotWaterWithHeatExchangerdat Performance data
Realk0.1Proportional gain of circulation pump controller
RealTi60Integrator time constant of circulation pump controller
Assumptions
BooleanallowFlowReversalDomtrue= false to simplify equations, assuming, but not enforcing, no flow reversal for domestic water
BooleanallowFlowReversalHeafalse= false to simplify equations, assuming, but not enforcing, no flow reversal for heating water
Initialization
TemperatureTTan_start323.15Start value of tank temperature [K]

Connectors

TypeNameDescription
FluidPort_aport_aDomFluid connector for cold water (or recirculation water)
FluidPort_bport_bDomFluid connector for heated domestic hot water
FluidPort_aport_aHeaFluid connector for heating water (positive design flow direction is from port_a to port_b)
FluidPort_bport_bHeaFluid connector b for heating water (positive design flow direction is from port_a to port_b)
input RealInputTDomSetTemperature setpoint for heated domestic water [K]
output RealOutputPEleElectric power required for pumping equipment [W]
output BooleanOutputchargeOutput true if tank needs to be charged, false if it is sufficiently charged

Modelica definition

model StorageTankWithExternalHeatExchanger "A model of a storage tank with external heat exchanger to produce hot water" extends Buildings.DHC.Loads.HotWater.BaseClasses.PartialFourPortDHW( final allowFlowReversalHea=false); parameter Buildings.DHC.Loads.HotWater.Data.GenericDomesticHotWaterWithHeatExchanger dat "Performance data"; parameter Real k=0.1 "Proportional gain of circulation pump controller"; parameter Real Ti=60 "Integrator time constant of circulation pump controller"; parameter Modelica.Media.Interfaces.Types.Temperature TTan_start=323.15 "Start value of tank temperature"; final parameter Real eps = dat.QHex_flow_nominal / CMin_flow_nominal / ( dat.TDom_nominal + dat.dTHexApp_nominal - dat.TCol_nominal) "Heat exchanger effectiveness"; Buildings.Fluid.Movers.Preconfigured.FlowControlled_dp pumHex( redeclare package Medium = MediumHea, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, use_inputFilter=false, riseTime=10, m_flow_nominal=dat.mHex_flow_nominal, dp_nominal=dat.dpHexHea_nominal) "Pump with head as input"; Buildings.Fluid.Storage.Stratified tan( redeclare package Medium = MediumHea, kIns=dat.kIns, final T_start=TTan_start, hTan=dat.hTan, dIns=dat.dIns, VTan=dat.VTan, nSeg=dat.nSeg, m_flow_nominal=dat.mHex_flow_nominal) "Heating water tank"; Modelica.Blocks.Interfaces.RealOutput PEle(unit="W") "Electric power required for pumping equipment"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemHot( redeclare package Medium = MediumDom, final allowFlowReversal=allowFlowReversalDom, m_flow_nominal=dat.mDom_flow_nominal) "Temperature sensor for hot water supply"; Buildings.Fluid.HeatExchangers.ConstantEffectiveness hex( redeclare package Medium1 = MediumDom, redeclare package Medium2 = MediumHea, final allowFlowReversal1=allowFlowReversalDom, m1_flow_nominal=dat.mDom_flow_nominal, m2_flow_nominal=dat.mHex_flow_nominal, dp1_nominal=dat.dpHexHea_nominal, from_dp2=true, dp2_nominal=dat.dpHexDom_nominal, eps=eps); Buildings.Fluid.FixedResistances.Junction junTop( redeclare package Medium = MediumHea, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, m_flow_nominal=dat.mHex_flow_nominal*{1,1,1}, dp_nominal=zeros(3)) "Flow junction at top of tank"; Buildings.Fluid.Sensors.MassFlowRate senMasFlo(redeclare package Medium = MediumDom) "Mass flow rate of domestic hot water"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TTanTop( T(displayUnit="degC")) "Fluid temperature at the top of the tank"; Modelica.Thermal.HeatTransfer.Sensors.TemperatureSensor TTanBot( T(displayUnit="degC")) "Fluid temperature at the bottom of the tank"; Buildings.DHC.Loads.HotWater.BaseClasses.HeatExchangerPumpController conPum(final mDom_flow_nominal=dat.mDom_flow_nominal, final dpPum_nominal=dat.dpHexHea_nominal) "Controller for pump of heat exchanger"; Buildings.DHC.Loads.HotWater.BaseClasses.TankChargingController conCha "Controller for tank charge signal"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear divVal( redeclare package Medium = MediumHea, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, use_inputFilter=false, m_flow_nominal=dat.mHex_flow_nominal, dpValve_nominal=1000) "Diversion valve to reduce mixing in tank"; Buildings.Fluid.Sensors.TemperatureTwoPort senTemRet( redeclare package Medium = MediumHea, final allowFlowReversal=allowFlowReversalDom, m_flow_nominal=dat.mHex_flow_nominal) "Temperature sensor for return heating water from heat exchanger"; Buildings.DHC.Loads.HotWater.BaseClasses.TankValveController conVal "Diversion valve controller"; Buildings.Controls.OBC.CDL.Reals.AddParameter dTHexApp(p=dat.dTHexApp_nominal) "Offset for heat exchanger approach temperature"; Buildings.Controls.OBC.CDL.Interfaces.BooleanOutput charge "Output true if tank needs to be charged, false if it is sufficiently charged"; protected parameter Modelica.Units.SI.SpecificHeatCapacity cpHea_default = MediumHea.specificHeatCapacityCp(MediumHea.setState_pTX( MediumHea.p_default, MediumHea.T_default, MediumHea.X_default)) "Specific heat capacity of heating medium at default medium state"; parameter Modelica.Units.SI.SpecificHeatCapacity cpDom_default = MediumDom.specificHeatCapacityCp(MediumDom.setState_pTX( MediumDom.p_default, MediumDom.T_default, MediumDom.X_default)) "Specific heat capacity of domestic hot water medium at default medium state"; parameter Modelica.Units.SI.ThermalConductance CMin_flow_nominal = min(dat.mHex_flow_nominal*cpHea_default, dat.mDom_flow_nominal*cpDom_default) "Minimum heat capacity flow rate"; initial equation assert(eps < 1, "In " + getInstanceName() + ": Heat exchanger effectivness must be below 1, received eps = " + String(eps) + ". Check sizing."); equation connect(tan.port_a, junTop.port_3); connect(pumHex.P, PEle); connect(junTop.port_2, port_aHea); connect(hex.port_b1, senMasFlo.port_a); connect(senMasFlo.port_b, senTemHot.port_a); connect(TTanTop.port, tan.heaPorVol[1]); connect(senMasFlo.m_flow, conPum.mDom_flow); connect(senTemHot.T, conPum.TDom); connect(conPum.TDomSet, TDomSet); connect(conCha.TTanTop, TTanTop.T); connect(conCha.charge, charge); connect(senTemHot.port_b, port_bDom); connect(conPum.dpPumHex, pumHex.dp_in); connect(port_aDom, hex.port_a1); connect(junTop.port_1, hex.port_a2); connect(hex.port_b2, pumHex.port_a); connect(senTemRet.port_b, divVal.port_2); connect(divVal.port_1, tan.fluPorVol[integer(dat.nSeg/2)]); connect(senTemRet.T, conVal.TRet); connect(conVal.y, divVal.y); connect(TTanBot.port, tan.heaPorVol[dat.nSeg]); connect(conCha.TTanTopSet, dTHexApp.y); connect(dTHexApp.u, TDomSet); connect(divVal.port_3, tan.fluPorVol[dat.nSeg]); connect(tan.port_b, port_bHea); connect(pumHex.port_b, senTemRet.port_a); connect(TTanBot.T, conCha.TTanBot); end StorageTankWithExternalHeatExchanger;

Buildings.DHC.Loads.HotWater.ThermostaticMixingValve Buildings.DHC.Loads.HotWater.ThermostaticMixingValve

A model for a thermostatic mixing valve

Buildings.DHC.Loads.HotWater.ThermostaticMixingValve

Information

This model implements a thermostatic mixing valve, which uses a PI feedback controller to mix hot and cold fluid to achieve a specified mixed water outlet temperature.

If the mixed water temperature cannot be provided within a tolerance of relTol, averaged over the whole simulation period, then an assertion warning will be written at the end of the simulation.

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.WaterWater media model
MassFlowRatemMix_flow_nominal Nominal mixed water flow rate to fixture [kg/s]
SimpleControllercontrollerTypeBuildings.Controls.OBC.CDL.T...Type of controller
Control gains
Realk1Gain of controller
RealTi0.5Time constant of integrator block [s]
RealTd0.1Time constant of derivative block [s]
Advanced
RealrelTol0.005Relative tolerance on energy balance, if not met, a warning will be issued at end of simulation

Connectors

TypeNameDescription
replaceable package MediumWater media model
FluidPort_aport_hotPort for hot water supply
FluidPort_aport_colPort for domestic cold water supply
input RealInputTMixSetTemperature setpoint of mixed water outlet [K]
input RealInputyMixSetMixed water fractional flow rate at TMixSet, as fraction of mMix_flow_nominal [1]

Modelica definition

model ThermostaticMixingValve "A model for a thermostatic mixing valve" replaceable package Medium = Buildings.Media.Water "Water media model"; parameter Modelica.Units.SI.MassFlowRate mMix_flow_nominal "Nominal mixed water flow rate to fixture"; parameter Buildings.Controls.OBC.CDL.Types.SimpleController controllerType=Buildings.Controls.OBC.CDL.Types.SimpleController.PI "Type of controller"; parameter Real k( min=100*Buildings.Controls.OBC.CDL.Constants.eps)=1 "Gain of controller"; parameter Real Ti( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps)=0.5 "Time constant of integrator block"; parameter Real Td( final quantity="Time", final unit="s", min=100*Buildings.Controls.OBC.CDL.Constants.eps)=0.1 "Time constant of derivative block"; parameter Real relTol = 0.005 "Relative tolerance on energy balance, if not met, a warning will be issued at end of simulation"; Modelica.Fluid.Interfaces.FluidPort_a port_hot(redeclare package Medium = Medium) "Port for hot water supply"; Modelica.Fluid.Interfaces.FluidPort_a port_col(redeclare package Medium = Medium) "Port for domestic cold water supply"; Modelica.Blocks.Interfaces.RealInput TMixSet( final unit="K", displayUnit="degC") "Temperature setpoint of mixed water outlet"; Modelica.Blocks.Interfaces.RealInput yMixSet(final min=0, final unit="1") "Mixed water fractional flow rate at TMixSet, as fraction of mMix_flow_nominal"; Buildings.Fluid.Sensors.TemperatureTwoPort senTHot( redeclare final package Medium = Medium, allowFlowReversal=false, final m_flow_nominal=mMix_flow_nominal, tau=0) "Hot water temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senTCol( redeclare final package Medium = Medium, allowFlowReversal=false, final m_flow_nominal=mMix_flow_nominal, tau=0) "Cold water temperature"; Buildings.Fluid.Sensors.TemperatureTwoPort senTMix( redeclare final package Medium = Medium, allowFlowReversal=false, final m_flow_nominal=mMix_flow_nominal, tau=0) "Mixed water temperature"; Buildings.Controls.OBC.CDL.Reals.PID conPID( final controllerType=controllerType, final k=k, final Ti=Ti, final Td=Td, yMax=1, yMin=0); Buildings.Controls.OBC.CDL.Reals.Divide ratEne "Ratio of actual over required energy (must be near 1 if load is satisfied)"; Buildings.Fluid.FixedResistances.Junction jun( redeclare package Medium = Medium, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, tau=1, m_flow_nominal={-mMix_flow_nominal,mMix_flow_nominal,mMix_flow_nominal}, dp_nominal={0,0,0}) "Mixing of hot water and cold water"; protected Buildings.Controls.OBC.CDL.Reals.Multiply mulMHot_flow "Multiplication to output required hot water mass flow rate"; EnergyMeter eneMetReq "Required energy"; EnergyMeter eneMetAct "Actual energy"; block EnergyMeter "Block that outputs integrated energy, bounded away from zero" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput TMix(final unit="K", displayUnit="degC") "Temperature of mixed water outlet"; Modelica.Blocks.Interfaces.RealInput TCol(final unit="K", displayUnit="degC") "Temperature of cold water"; Modelica.Blocks.Interfaces.RealInput m_flow(final unit="kg/s") "Mass flow rate"; Modelica.Blocks.Interfaces.RealOutput E(final unit="J") "Consumed energy"; Modelica.Units.SI.Energy EInt( start=0, fixed=true, unbounded=true, nominal=1E9) "Integral of H_flow"; Modelica.Units.SI.HeatFlowRate H_flow "Enthalpy flow rate"; equation der(EInt) = H_flow; H_flow = m_flow * Buildings.Utilities.Psychrometrics.Constants.cpWatLiq * (TMix-TCol); E = max(Buildings.Utilities.Psychrometrics.Constants.cpWatLiq*1, EInt); end EnergyMeter; protected parameter Modelica.Units.SI.Temperature dTSmall = 0.1 "Small temperature used to avoid division by zero"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gaiMMix_flow(final k=mMix_flow_nominal) "Gain for multiplying domestic hot water schedule"; Buildings.Fluid.Movers.BaseClasses.IdealSource floSouHot( redeclare final package Medium = Medium, allowFlowReversal=false, m_flow_small=1E-4*mMix_flow_nominal, final control_m_flow=true, final control_dp=false) "Forced mass flow rate for hot water"; Buildings.Fluid.Sources.MassFlowSource_T sinMMix( redeclare final package Medium = Medium, use_m_flow_in=true, nPorts=1) "Sink for mixed mass flow rate"; Buildings.Controls.OBC.CDL.Reals.MultiplyByParameter gaiMMix_sign(final k=-1) "Gain to invert sign"; equation connect(senTHot.port_a, port_hot); connect(port_col, senTCol.port_a); connect(yMixSet, gaiMMix_flow.u); connect(floSouHot.port_a, senTHot.port_b); connect(conPID.u_s, TMixSet); connect(senTMix.T, conPID.u_m); connect(sinMMix.m_flow_in, gaiMMix_sign.y); connect(mulMHot_flow.y, floSouHot.m_flow_in); connect(gaiMMix_flow.y, mulMHot_flow.u1); connect(conPID.y, mulMHot_flow.u2); connect(gaiMMix_flow.y, gaiMMix_sign.u); connect(senTMix.port_b, sinMMix.ports[1]); connect(eneMetReq.TMix, TMixSet); connect(eneMetReq.TCol, senTCol.T); connect(gaiMMix_flow.y, eneMetReq.m_flow); connect(eneMetAct.TMix, senTMix.T); connect(eneMetAct.TCol, senTCol.T); connect(eneMetAct.m_flow, gaiMMix_flow.y); connect(eneMetReq.E, ratEne.u2); connect(eneMetAct.E, ratEne.u1); when terminal() then assert( abs(1-ratEne.y) < relTol, "In " + getInstanceName() + ": Required domestic hot water flow rate is not met. Ratio of actual over required energy = " + String(ratEne.y), level=AssertionLevel.warning); end when; connect(floSouHot.port_b, jun.port_3); connect(senTCol.port_b, jun.port_2); connect(jun.port_1, senTMix.port_a); end ThermostaticMixingValve;

Buildings.DHC.Loads.HotWater.ThermostaticMixingValve.EnergyMeter Buildings.DHC.Loads.HotWater.ThermostaticMixingValve.EnergyMeter

Block that outputs integrated energy, bounded away from zero

Buildings.DHC.Loads.HotWater.ThermostaticMixingValve.EnergyMeter

Information

Block that outputs the integrated enthalpy flow rate.

To avoid division by zero in downstream blocks, the output is bounded away from zero.

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

Connectors

TypeNameDescription
input RealInputTMixTemperature of mixed water outlet [K]
input RealInputTColTemperature of cold water [K]
input RealInputm_flowMass flow rate [kg/s]
output RealOutputEConsumed energy [J]

Modelica definition

block EnergyMeter "Block that outputs integrated energy, bounded away from zero" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput TMix(final unit="K", displayUnit="degC") "Temperature of mixed water outlet"; Modelica.Blocks.Interfaces.RealInput TCol(final unit="K", displayUnit="degC") "Temperature of cold water"; Modelica.Blocks.Interfaces.RealInput m_flow(final unit="kg/s") "Mass flow rate"; Modelica.Blocks.Interfaces.RealOutput E(final unit="J") "Consumed energy"; Modelica.Units.SI.Energy EInt( start=0, fixed=true, unbounded=true, nominal=1E9) "Integral of H_flow"; Modelica.Units.SI.HeatFlowRate H_flow "Enthalpy flow rate"; equation der(EInt) = H_flow; H_flow = m_flow * Buildings.Utilities.Psychrometrics.Constants.cpWatLiq * (TMix-TCol); E = max(Buildings.Utilities.Psychrometrics.Constants.cpWatLiq*1, EInt); end EnergyMeter;