Base classes for active beam models
Information
This package contains base classes that are used to construct the models in
Annex60.Fluid.HeatExchangers.ActiveBeams.
Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).
Package Content
Name |
Description |
Convector
|
Heat exchanger for the water stream |
DerivativesCubicSpline
|
Cubic spline for interpolation |
ModificationFactor
|
Factor to modify nominal capacity |
Examples
|
|
Heat exchanger for the water stream
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 Annex60.Fluid.Interfaces.PartialTwoPortInterface (Partial model transporting fluid between two ports without storing mass or energy), Annex60.Fluid.Interfaces.TwoPortFlowResistanceParameters (Parameters for flow resistance for models with two ports).
Parameters
Type | Name | Default | Description |
replaceable package Medium | PartialMedium | Medium in the component |
Generic | per | | Performance data |
Integer | nBeams | | Number of beams in parallel |
Nominal condition |
MassFlowRate | m_flow_nominal | per.mWat_flow_nominal*nBeams | Nominal mass flow rate [kg/s] |
PressureDifference | dp_nominal | per.dpWat_nominal | Pressure difference [Pa] |
Assumptions |
Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
Advanced |
MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow [kg/s] |
Boolean | homotopyInitialization | true | = true, use homotopy method |
Diagnostics |
Boolean | show_T | false | = true, if actual temperature at port is computed |
Flow resistance |
Boolean | computeFlowResistance | true | =true, compute flow resistance. Set to false to assume no friction |
Boolean | from_dp | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
Boolean | linearizeFlowResistance | false | = true, use linear relation between m_flow and dp for any flow rate |
Real | deltaM | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Dynamics |
Nominal condition |
Time | tau | 30 | Time constant at nominal flow (if energyDynamics <> SteadyState) [s] |
Equations |
Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamic... | Type of energy balance: dynamic (3 initialization options) or steady state |
Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
Initialization |
AbsolutePressure | p_start | Medium.p_default | Start value of pressure [Pa] |
Temperature | T_start | Medium.T_default | Start value of temperature [K] |
MassFraction | X_start[Medium.nX] | Medium.X_default | Start value of mass fractions m_i/m [kg/kg] |
ExtraProperty | C_start[Medium.nC] | fill(0, Medium.nC) | Start value of trace substances |
Connectors
Type | Name | Description |
FluidPort_a | port_a | Fluid connector a (positive design flow direction is from port_a to port_b) |
FluidPort_b | port_b | Fluid connector b (positive design flow direction is from port_a to port_b) |
input RealInput | mAir_flow | Air mass flow rate of a single beam [kg/s] |
input RealInput | TRoo | Room air temperature [K] |
output RealOutput | Q_flow | Actual capacity of a single beam [W] |
Modelica definition
model Convector
extends Annex60.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow_nominal = per.mWat_flow_nominal*nBeams);
extends Annex60.Fluid.Interfaces.TwoPortFlowResistanceParameters(
final computeFlowResistance=true,
final dp_nominal = per.dpWat_nominal );
parameter Data.Generic per ;
parameter Integer nBeams(min=1) ;
parameter Modelica.SIunits.Time tau = 30
;
parameter Boolean homotopyInitialization = true ;
parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
;
parameter Modelica.Fluid.Types.Dynamics massDynamics=energyDynamics
;
parameter Medium.AbsolutePressure p_start = Medium.p_default
;
parameter Medium.Temperature T_start = Medium.T_default
;
parameter Medium.MassFraction X_start[Medium.nX](
final quantity=Medium.substanceNames) = Medium.X_default
;
parameter Medium.ExtraProperty C_start[Medium.nC](
final quantity=Medium.extraPropertiesNames)=
fill(0, Medium.nC)
;
Modelica.Blocks.Interfaces.RealInput mAir_flow(
final unit="kg/s") ;
Modelica.Blocks.Interfaces.RealInput TRoo(
final unit="K",
displayUnit="degC") ;
Modelica.Blocks.Interfaces.RealOutput Q_flow(
final unit="W")
;
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 massDynamics=massDynamics,
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)
;
ModificationFactor mod(
final nBeams=nBeams,
final per=per) ;
Modelica.Blocks.Sources.RealExpression senTem(
final y=
Medium.temperature(port_a_inflow))
;
Medium.ThermodynamicState port_a_inflow=
Medium.setState_phX(port_a.p,
inStream(port_a.h_outflow),
inStream(port_a.Xi_outflow))
;
Sensors.MassFlowRate senFloWatCoo(
redeclare final package Medium =
Medium) ;
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;
Cubic spline for interpolation
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
Type | Name | Default | Description |
Real | xd[:] | {0,0.5,1} | |
Real | yd[size(xd, 1)] | {0,0.75,1} | |
Connectors
Type | Name | Description |
input RealInput | u | Independent variable for interpolation |
output RealOutput | y | Interpolated value |
Modelica definition
model DerivativesCubicSpline
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
;
Modelica.Blocks.Interfaces.RealOutput y ;
protected
parameter Real[
size(xd, 1)] dMonotone(
each fixed=false) ;
Integer i ;
initial algorithm
dMonotone :=
Annex60.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;
y :=
Annex60.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;
Factor to modify nominal capacity
Information
This model determines the three modification factors described in
Annex60.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
Type | Name | Default | Description |
Integer | nBeams | | Number of beams in parallel |
Generic | per | | Performance data |
Connectors
Type | Name | Description |
input RealInput | TWat | Temperature of the water entering the beams [K] |
input RealInput | mWat_flow | Mass flow rate of the water entering the beams [kg/s] |
input RealInput | mAir_flow | Mass flow rate of the primary air entering the beams [kg/s] |
input RealInput | TRoo | Room air temperature [K] |
output RealOutput | y | Total modification factor [1] |
Modelica definition
model ModificationFactor
extends Modelica.Blocks.Icons.Block;
parameter Integer nBeams(min=1) ;
parameter Data.Generic per ;
Modelica.Blocks.Interfaces.RealInput TWat(
final unit="K",
displayUnit="degC") ;
Modelica.Blocks.Interfaces.RealInput mWat_flow(
final unit="kg/s") ;
Modelica.Blocks.Interfaces.RealInput mAir_flow(
final unit="kg/s") ;
Modelica.Blocks.Interfaces.RealInput TRoo(
final unit="K",
displayUnit="degC") ;
Modelica.Blocks.Interfaces.RealOutput y(
final unit="1")
;
protected
Modelica.Blocks.Sources.Constant temDif_nom(
final k=1/per.dT_nominal)
;
Modelica.Blocks.Sources.Constant watFlo_nom(
final k=1/(nBeams*per.mWat_flow_nominal))
;
Modelica.Blocks.Sources.Constant airFlo_nom(
final k=1/(nBeams*per.mAir_flow_nominal))
;
DerivativesCubicSpline temDif_mod(
final xd=per.dT.r_dT,
final yd=per.dT.f)
;
DerivativesCubicSpline watFlo_mod(
final xd=per.water.r_V,
final yd=per.water.f) ;
DerivativesCubicSpline airFlo_mod(
final xd=per.primaryAir.r_V,
final yd=per.primaryAir.f)
;
Modelica.Blocks.Math.Product pro_3
;
Modelica.Blocks.Math.Product pro_2 ;
Modelica.Blocks.Math.Product pro_1 ;
Modelica.Blocks.Math.MultiProduct mulPro(
final nu=3)
;
Modelica.Blocks.Math.Add add(
final k1=+1,
final k2=-1)
;
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;
http://iea-annex60.org