Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses

Base classes for active beam models

Information

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

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

Package Content

Name Description
Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Convector Convector Heat exchanger for the water stream
Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.DerivativesCubicSpline DerivativesCubicSpline Cubic spline for interpolation
Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.ModificationFactor ModificationFactor Factor to modify nominal capacity
Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Examples Examples  

Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Convector Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Convector

Heat exchanger for the water stream

Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.Convector

Information

In cooling mode, this model adds heat to the water stream. The heat added is equal to:

QBeam = Qrated fΔT fSA fW

In heating mode, the heat is removed from the water stream.

Extends from Buildings.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Genericper Performance data
IntegernBeams Number of beams in parallel
Nominal condition
MassFlowRatem_flow_nominalper.mWat_flow_nominal*nBeamsNominal mass flow rate [kg/s]
PressureDifferencedp_nominalper.dpWat_nominalPressure difference [Pa]
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
BooleancomputeFlowResistancetrue=true, compute flow resistance. Set to false to assume no friction
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]
Conservation equations
DynamicsenergyDynamicsModelica.Fluid.Types.Dynamic...Type of energy balance: dynamic (3 initialization options) or steady state
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 RealInputmAir_flowAir mass flow rate of a single beam [kg/s]
input RealInputTRooRoom air temperature [K]
output RealOutputQ_flowActual capacity of a single beam [W]

Modelica definition

model Convector "Heat exchanger for the water stream" extends Buildings.Fluid.Interfaces.PartialTwoPortInterface( final m_flow_nominal = per.mWat_flow_nominal*nBeams); extends Buildings.Fluid.Interfaces.TwoPortFlowResistanceParameters( final computeFlowResistance=true, final dp_nominal = per.dpWat_nominal "Don't multiply with nBeams, as the beams are in parallel"); constant Boolean homotopyInitialization = true "= true, use homotopy method"; parameter Data.Generic per "Performance data"; parameter Integer nBeams(min=1) "Number of beams in parallel"; parameter Modelica.Units.SI.Time tau=30 "Time constant at nominal flow (if energyDynamics <> SteadyState)"; // Dynamics parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial "Type of energy balance: dynamic (3 initialization options) or steady state"; // Initialization parameter Medium.AbsolutePressure p_start = Medium.p_default "Start value of pressure"; parameter Medium.Temperature T_start = Medium.T_default "Start value of temperature"; parameter Medium.MassFraction X_start[Medium.nX]( final quantity=Medium.substanceNames) = Medium.X_default "Start value of mass fractions m_i/m"; parameter Medium.ExtraProperty C_start[Medium.nC]( final quantity=Medium.extraPropertiesNames)=fill(0, Medium.nC) "Start value of trace substances"; Modelica.Blocks.Interfaces.RealInput mAir_flow( final unit="kg/s") "Air mass flow rate of a single beam"; Modelica.Blocks.Interfaces.RealInput TRoo( final unit="K", displayUnit="degC") "Room air temperature"; Modelica.Blocks.Interfaces.RealOutput Q_flow(final unit="W") "Actual capacity of a single beam"; protected HeaterCooler_u hex( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final m_flow_nominal=m_flow_nominal, final m_flow_small=m_flow_small, final show_T=false, final from_dp=from_dp, final dp_nominal=dp_nominal, final linearizeFlowResistance=linearizeFlowResistance, final deltaM=deltaM, final tau=tau, final homotopyInitialization=homotopyInitialization, final energyDynamics=energyDynamics, final p_start=p_start, final T_start=T_start, final X_start=X_start, final C_start=C_start, final Q_flow_nominal=-nBeams * per.Q_flow_nominal) "Heat exchanger for the water stream"; ModificationFactor mod( final nBeams=nBeams, final per=per) "Performance modification for part load"; Modelica.Blocks.Sources.RealExpression senTem(final y=Medium.temperature(port_a_inflow)) "Actual water temperature entering the beam"; Medium.ThermodynamicState port_a_inflow= Medium.setState_phX(port_a.p, inStream(port_a.h_outflow), inStream(port_a.Xi_outflow)) "state for medium inflowing through port_a"; Sensors.MassFlowRate senFloWatCoo( redeclare final package Medium = Medium) "Mass flow rate sensor"; initial equation assert(homotopyInitialization, "In " + getInstanceName() + ": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.", level = AssertionLevel.warning); equation connect(hex.Q_flow, Q_flow); connect(hex.port_b, port_b); connect(mod.y, hex.u); connect(senTem.y, mod.TWat); connect(TRoo, mod.TRoo); connect(mAir_flow, mod.mAir_flow); connect(senFloWatCoo.port_a, port_a); connect(senFloWatCoo.port_b, hex.port_a); connect(senFloWatCoo.m_flow, mod.mWat_flow); end Convector;

Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.DerivativesCubicSpline Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.DerivativesCubicSpline

Cubic spline for interpolation

Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.DerivativesCubicSpline

Information

This model calculates the output based on the cubic hermite interpolation and linear extrapolation of predefined values. The predefined values must create a monotone curve.

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

Parameters

TypeNameDefaultDescription
Realxd[:]{0,0.5,1} 
Realyd[size(xd, 1)]{0,0.75,1} 

Connectors

TypeNameDescription
input RealInputuIndependent variable for interpolation
output RealOutputyInterpolated value

Modelica definition

model DerivativesCubicSpline "Cubic spline for interpolation" extends Modelica.Blocks.Icons.Block; parameter Real[:] xd={0,0.5,1}; parameter Real[size(xd, 1)] yd={0,0.75,1}; Modelica.Blocks.Interfaces.RealInput u "Independent variable for interpolation"; Modelica.Blocks.Interfaces.RealOutput y "Interpolated value"; protected parameter Real[size(xd, 1)] dMonotone(each fixed=false) "Derivatives"; Integer i "Counter to pick the interpolation interval"; initial algorithm // Get the derivative values at the support points dMonotone := Buildings.Utilities.Math.Functions.splineDerivatives( x=xd, y=yd, ensureMonotonicity=true); algorithm i := 1; for j in 1:size(xd, 1) - 1 loop if u > xd[j] then i := j; end if; end for; // Extrapolate or interpolate the data y := Buildings.Utilities.Math.Functions.cubicHermiteLinearExtrapolation( x=u, x1=xd[i], x2=xd[i + 1], y1=yd[i], y2=yd[i + 1], y1d=dMonotone[i], y2d=dMonotone[i + 1]); end DerivativesCubicSpline;

Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.ModificationFactor Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.ModificationFactor

Factor to modify nominal capacity

Buildings.Fluid.HeatExchangers.ActiveBeams.BaseClasses.ModificationFactor

Information

This model determines the three modification factors described in Buildings.Fluid.HeatExchangers.ActiveBeams.UsersGuide by comparing the actual values of air mass flow rate, water mass flow rate and room-water temperature difference with the nominal values. The three modification factors are then multiplied. Input to this model are the total mass flow rates of all parallel beams combined.

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

Parameters

TypeNameDefaultDescription
IntegernBeams Number of beams in parallel
Genericper Performance data

Connectors

TypeNameDescription
input RealInputTWatTemperature of the water entering the beams [K]
input RealInputmWat_flowMass flow rate of the water entering the beams [kg/s]
input RealInputmAir_flowMass flow rate of the primary air entering the beams [kg/s]
input RealInputTRooRoom air temperature [K]
output RealOutputyTotal modification factor [1]

Modelica definition

model ModificationFactor "Factor to modify nominal capacity" extends Modelica.Blocks.Icons.Block; parameter Integer nBeams(min=1) "Number of beams in parallel"; parameter Data.Generic per "Performance data"; Modelica.Blocks.Interfaces.RealInput TWat( final unit="K", displayUnit="degC") "Temperature of the water entering the beams"; Modelica.Blocks.Interfaces.RealInput mWat_flow( final unit="kg/s") "Mass flow rate of the water entering the beams"; Modelica.Blocks.Interfaces.RealInput mAir_flow( final unit="kg/s") "Mass flow rate of the primary air entering the beams"; Modelica.Blocks.Interfaces.RealInput TRoo( final unit="K", displayUnit="degC") "Room air temperature"; Modelica.Blocks.Interfaces.RealOutput y(final unit="1") "Total modification factor"; protected Modelica.Blocks.Sources.Constant temDif_nom( final k=1/per.dT_nominal) "Nominal temperature difference between water and room air"; Modelica.Blocks.Sources.Constant watFlo_nom(final k=1/(nBeams*per.mWat_flow_nominal)) "Nominal water mass flow rate"; Modelica.Blocks.Sources.Constant airFlo_nom(final k=1/(nBeams*per.mAir_flow_nominal)) "Nominal water mass flow rate"; DerivativesCubicSpline temDif_mod( final xd=per.dT.r_dT, final yd=per.dT.f) "Derivatives of the cubic spline for the temperature difference between room and water"; DerivativesCubicSpline watFlo_mod( final xd=per.water.r_V, final yd=per.water.f) "Derivatives of the cubic spline for the water flow"; DerivativesCubicSpline airFlo_mod( final xd=per.primaryAir.r_V, final yd=per.primaryAir.f) "Derivatives of the cubic spline for the air flow"; Modelica.Blocks.Math.Product pro_3 "Ratio of actual/nominal temperature difference"; Modelica.Blocks.Math.Product pro_2 "Ratio of actual/nominal water flow rate"; Modelica.Blocks.Math.Product pro_1 "Ratio of actual/nominal air flow rate"; Modelica.Blocks.Math.MultiProduct mulPro(final nu=3) "Product of the three modification factors"; Modelica.Blocks.Math.Add add(final k1=+1, final k2=-1) "Temperature difference between water and room air"; equation connect(mAir_flow, pro_1.u1); connect(airFlo_nom.y, pro_1.u2); connect(pro_1.y, airFlo_mod.u); connect(mulPro.y, y); connect(mWat_flow, pro_2.u1); connect(pro_2.y, watFlo_mod.u); connect(watFlo_nom.y, pro_2.u2); connect(TWat, add.u1); connect(add.u2, TRoo); connect(temDif_nom.y, pro_3.u2); connect(add.y, pro_3.u1); connect(pro_3.y, temDif_mod.u); connect(watFlo_mod.y, mulPro.u[1]); connect(airFlo_mod.y, mulPro.u[2]); connect(temDif_mod.y, mulPro.u[3]); end ModificationFactor;