Name | Description |
---|---|
BaseClasses | Package with base classes for heat exchanger models |
ConstantEffectiveness | Heat exchanger with constant effectiveness |
CoolingTowers | Package with cooling tower models |
Examples | Collection of models that illustrate model use and test models |
HeaterCoolerIdeal | Ideal electric heater or cooler, no losses, no dynamics |
SensibleCoilDiscretized | Heat exchanger with discretization along the flow path |
SensibleHexHAInput | Simple heat exchanger with convective heat transfer as input |
Model for a heat exchanger with constant effectiveness.
This model transfers heat in the amount of
Q = Q_max * eps,where eps is a constant effectiveness and Q_max is the maximum heat that can be transferred.
Type | Name | Default | Description |
---|---|---|---|
Boolean | allowFlowReversal_1 | flowDirection_1 == Modelica_... | = false, if flow only from port_a to port_b, otherwise reversing flow allowed |
Boolean | allowFlowReversal_2 | flowDirection_2 == Modelica_... | = false, if flow only from port_a to port_b, otherwise reversing flow allowed |
Real | eps | 0.8 | Heat exchanger effectiveness |
Fluid 1 | |||
replaceable package Medium_1 | PartialMedium | Fluid 1 | |
Fluid 2 | |||
replaceable package Medium_2 | PartialMedium | Fluid 2 | |
Initialization | |||
MassFlowRate | m_flow_1 | Mass flow rate from port_a1 to port_b1 (m_flow_1 > 0 is design flow direction) [kg/s] | |
MassFlowRate | m_flow_2 | Mass flow rate from port_a2 to port_b2 (m_flow_2 > 0 is design flow direction) [kg/s] | |
Pressure | dp_1 | Pressure difference between port_a1 and port_b1 [Pa] | |
Pressure | dp_2 | Pressure difference between port_a2 and port_b2 [Pa] | |
Advanced | |||
Temp | flowDirection_1 | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
Temp | flowDirection_2 | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a for medium 1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b for medium 1 (positive design flow direction is from port_a to port_b) |
FluidPort_a | port_a2 | Fluid connector a for medium 2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b for medium 2 (positive design flow direction is from port_a to port_b) |
model ConstantEffectiveness "Heat exchanger with constant effectiveness" extends Fluids.Interfaces.PartialStaticFourPortHeatMassTransfer; extends Buildings.BaseClasses.BaseIcon; parameter Real eps(min=0, max=1) = 0.8 "Heat exchanger effectiveness"; Modelica.SIunits.Temperature T_in1 "Inlet temperature medium 1"; Modelica.SIunits.Temperature T_in2 "Inlet temperature medium 2"; Modelica.SIunits.ThermalConductance C_flow_1 "Heat capacity flow rate medium 1"; Modelica.SIunits.ThermalConductance C_flow_2 "Heat capacity flow rate medium 2"; Modelica.SIunits.ThermalConductance CMin_flow(min=0) "Minimum heat capacity flow rate"; Modelica.SIunits.HeatFlowRate QMax_flow "Maximum heat flow rate"; equation // definitions for heat transfer effectiveness model T_in1 = if m_flow_1 >= 0 then medium_a1.T else medium_b1.T; T_in2 = if m_flow_2 >= 0 then medium_a2.T else medium_b2.T; C_flow_1 = abs(m_flow_1) * Medium_1.specificHeatCapacityCp(Medium_1.setState_pTX(medium_a1.p, medium_a1.T, medium_a1.X)); C_flow_2 = abs(m_flow_2) * Medium_2.specificHeatCapacityCp(Medium_2.setState_pTX(medium_a2.p, medium_a2.T, medium_a2.X)); CMin_flow = min( C_flow_1, C_flow_2); QMax_flow = CMin_flow * (T_in2 - T_in1); // transferred heat Q_flow_1 = eps * QMax_flow; 0 = Q_flow_1 + Q_flow_2; // no mass exchange mXi_flow_1 = zeros(Medium_1.nXi); mXi_flow_2 = zeros(Medium_2.nXi); // no pressure drop dp_1 = 0; dp_2 = 0; end ConstantEffectiveness;
Model for an electric heater or cooler.
This model adds heat in the amount of Q_flow = u Q0_flow to the medium. The input signal u and the nominal heat flow rate Q0_flow can be positive or negative.
Note that if the mass flow rate tends to zero, the temperature difference over this component tends to infinity for non-zero Q_flow, so add proper control when using this component.
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
HeatFlowRate | Q0_flow | Heat flow rate at u=1, positive for heating [W] | |
Initialization | |||
MassFlowRate | m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) [kg/s] | |
Pressure | dp | Pressure difference between port_a and port_b [Pa] | |
Advanced | |||
Temp | flowDirection | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
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 | u |
model HeaterCoolerIdeal "Ideal electric heater or cooler, no losses, no dynamics" extends Fluids.Interfaces.PartialStaticTwoPortHeatMassTransfer; extends Buildings.BaseClasses.BaseIcon; parameter Modelica.SIunits.HeatFlowRate Q0_flow "Heat flow rate at u=1, positive for heating"; Modelica.Blocks.Interfaces.RealInput u; equation dp = 0; Q_flow = Q0_flow * u; mXi_flow = zeros(Medium.nXi); // no mass added or removed (sensible heat only) end HeaterCoolerIdeal;
Model of a discretized heat exchanger. The heat exchanger is discretized along the flow path. Each element has a state variable, modeled either using a lumped mass for the metal interface, or a fluid volume for the two flow paths.
The heat exchanger geometry is configured so that the heat exchanger has different registers. A register is a collection of parallel pipes that may be discretized along the pipe length. The pipes are perpendicular to the air flow path. When using this model, the water (or liquid) flow path needs to be connected to port_a1 and port_b1, and the air flow path need to be connected to the other two ports.
Currently, only sensible heat transfer is modeled.
Type | Name | Default | Description |
---|---|---|---|
Boolean | allowFlowReversal_1 | flowDirection_1 == Modelica_... | = false, if flow only from port_a to port_b, otherwise reversing flow allowed |
Boolean | allowFlowReversal_2 | flowDirection_2 == Modelica_... | = false, if flow only from port_a to port_b, otherwise reversing flow allowed |
Real | ReC_1 | 4000 | Reynolds number where transition to laminar starts inside pipes |
Real | ReC_2 | 4000 | Reynolds number where transition to laminar starts inside ducts |
Fluid 1 | |||
replaceable package Medium_1 | PartialMedium | Fluid 1 | |
Fluid 2 | |||
replaceable package Medium_2 | PartialMedium | Fluid 2 | |
Initialization | |||
MassFlowRate | m_flow_1 | Mass flow rate from port_a1 to port_b1 (m_flow_1 > 0 is design flow direction) [kg/s] | |
MassFlowRate | m_flow_2 | Mass flow rate from port_a2 to port_b2 (m_flow_2 > 0 is design flow direction) [kg/s] | |
Pressure | dp_1 | Pressure difference between port_a1 and port_b1 [Pa] | |
Pressure | dp_2 | Pressure difference between port_a2 and port_b2 [Pa] | |
Nominal condition | |||
Temperature | dT0 | 10 | Temperature difference [K] |
HeatFlowRate | Q0_flow | 1000 | Heat transfer at dT0 [W] |
ThermalConductance | UA0 | Q0_flow/dT0 | Thermal conductance at nominal flow, used to compute heat capacity [W/K] |
MassFlowRate | m0_flow_1 | Mass flow rate at port_a1 for all pipes [kg/s] | |
Pressure | dp0_1 | Pressure drop for all pipes [Pa] | |
MassFlowRate | m0_flow_2 | Mass flow rate at port_a_2 for duct [kg/s] | |
Pressure | dp0_2 | Pressure drop inside duct [Pa] | |
Time | tau_1 | 60 | Time constant at nominal flow for medium 1 [s] |
Time | tau_2 | 60 | Time constant at nominal flow for medium 2 [s] |
Time | tau_m | 60 | Time constant of metal at nominal UA value [s] |
Geometry | |||
Integer | nReg | 2 | Number of registers |
Integer | nPipPar | 3 | Number of parallel pipes in each register |
Integer | nPipSeg | 4 | Number of pipe segments per register used for discretization |
Length | dh_1 | 0.025 | Hydraulic diameter for a single pipe [m] |
Length | dh_2 | 1 | Hydraulic diameter for duct [m] |
Advanced | |||
Temp | flowDirection_1 | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
Temp | flowDirection_2 | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
Heat transfer | |||
HASensibleCoil | hAModel | redeclare BaseClasses.HASens... | Model for convective heat transfer coefficient |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a for medium 1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b for medium 1 (positive design flow direction is from port_a to port_b) |
FluidPort_a | port_a2 | Fluid connector a for medium 2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b for medium 2 (positive design flow direction is from port_a to port_b) |
model SensibleCoilDiscretized "Heat exchanger with discretization along the flow path" extends Fluids.Interfaces.PartialStaticFourPortInterface; extends Buildings.BaseClasses.BaseIcon; parameter Modelica.SIunits.Temperature dT0(min=0) = 10 "Temperature difference"; parameter Modelica.SIunits.HeatFlowRate Q0_flow(min=0) = 1000 "Heat transfer at dT0"; parameter Modelica.SIunits.ThermalConductance UA0(min=0) = Q0_flow/dT0 "Thermal conductance at nominal flow, used to compute heat capacity"; parameter Integer nReg(min=2)=2 "Number of registers"; parameter Integer nPipPar(min=1) = 3 "Number of parallel pipes in each register"; parameter Integer nPipSeg(min=1) = 4 "Number of pipe segments per register used for discretization"; Buildings.HeatExchangers.BaseClasses.SensibleCoilRegister hexReg[ nReg]( redeclare each package Medium_1 = Medium_1, redeclare each package Medium_2 = Medium_2, each final nPipPar=nPipPar, each final nPipSeg=nPipSeg, each final UA0=Q0_flow/dT0/nReg, each final m0_flow_1=m0_flow_1/nPipPar, each final m0_flow_2=m0_flow_1/nPipPar/nPipSeg, each tau_1=tau_1, each tau_2=tau_2, each tau_m=tau_m) "Heat exchanger register"; Buildings.HeatExchangers.BaseClasses.PipeManifoldFixedResistance pipMan_a( redeclare package Medium = Medium_1, final nPipPar=nPipPar, final m0_flow=m0_flow_1, final dp0=dp0_1, final dh=dh_1, final ReC=ReC_1) "Pipe manifold at port a"; Buildings.HeatExchangers.BaseClasses.PipeManifoldNoResistance pipMan_b( redeclare package Medium = Medium_1, final nPipPar=nPipPar) "Pipe manifold at port b"; Buildings.HeatExchangers.BaseClasses.DuctManifoldNoResistance ducMan_b( redeclare package Medium = Medium_2, final nPipPar=nPipPar, final nPipSeg=nPipSeg) "Duct manifold at port b"; Buildings.HeatExchangers.BaseClasses.DuctManifoldFixedResistance ducMan_a( redeclare package Medium = Medium_2, final nPipPar = nPipPar, final nPipSeg = nPipSeg, final m0_flow=m0_flow_2, final dp0=dp0_2, final dh=dh_2, final ReC=ReC_2) "Duct manifold at port a"; public parameter Modelica.SIunits.Length dh_1=0.025 "Hydraulic diameter for a single pipe"; parameter Real ReC_1=4000 "Reynolds number where transition to laminar starts inside pipes"; parameter Modelica.SIunits.MassFlowRate m0_flow_1 "Mass flow rate at port_a1 for all pipes"; parameter Modelica.SIunits.Pressure dp0_1 "Pressure drop for all pipes"; parameter Modelica.SIunits.Length dh_2=1 "Hydraulic diameter for duct"; parameter Real ReC_2=4000 "Reynolds number where transition to laminar starts inside ducts"; parameter Modelica.SIunits.MassFlowRate m0_flow_2 "Mass flow rate at port_a_2 for duct"; parameter Modelica.SIunits.Pressure dp0_2 "Pressure drop inside duct"; Modelica.SIunits.HeatFlowRate Q_flow_1 "Heat transfered from solid into medium 1"; Modelica.SIunits.HeatFlowRate Q_flow_2 "Heat transfered from solid into medium 2"; parameter Modelica.SIunits.Time tau_1=60 "Time constant at nominal flow for medium 1"; parameter Modelica.SIunits.Time tau_2=60 "Time constant at nominal flow for medium 2"; parameter Modelica.SIunits.Time tau_m=60 "Time constant of metal at nominal UA value"; protected BaseClasses.RegisterHeader hea1[nReg/2]( redeclare each final package Medium = Medium_1, each final nPipPar = nPipPar) if nReg > 1 "Pipe header to redirect flow into next register"; BaseClasses.RegisterHeader hea2[nReg/2-1]( redeclare each final package Medium = Medium_1, each final nPipPar = nPipPar) if nReg > 2 "Pipe header to redirect flow into next register"; Modelica.Blocks.Math.Gain gai_1(k=1/nReg) "Gain medium-side 1 to take discretization into account"; Modelica.Blocks.Math.Gain gai_2(k=1/nReg) "Gain medium-side 2 to take discretization into account"; public replaceable BaseClasses.HASensibleCoil hAModel( UA0=UA0, m0_flow_a=m0_flow_2, m0_flow_w=m0_flow_1, waterSideTemperatureDependent=true, waterSideFlowDependent=true, airSideTemperatureDependent=true, airSideFlowDependent=true) extends BaseClasses.PartialHA "Model for convective heat transfer coefficient"; protected Modelica_Fluid.Sensors.Temperature temSen_1(redeclare package Medium = Medium_1) "Temperature sensor"; Modelica_Fluid.Sensors.MassFlowRate masFloSen_1(redeclare package Medium = Medium_1) "Mass flow rate sensor"; Modelica_Fluid.Sensors.Temperature temSen_2(redeclare package Medium = Medium_2) "Temperature sensor"; Modelica_Fluid.Sensors.MassFlowRate masFloSen_2(redeclare package Medium = Medium_2) "Mass flow rate sensor"; equation Q_flow_1 = sum(hexReg[i].Q_flow_1 for i in 1:nReg); Q_flow_2 = sum(hexReg[i].Q_flow_2 for i in 1:nReg); // air stream connections for i in 2:nReg loop connect(hexReg[i].port_a2, hexReg[i-1].port_b2); end for; connect(ducMan_a.port_b, hexReg[1].port_a2); connect(hexReg[nReg].port_b2, ducMan_b.port_b); connect(pipMan_a.port_b, hexReg[1].port_a1); connect(hexReg[nReg].port_b1, pipMan_b.port_b); connect(pipMan_b.port_a, port_b1); connect(ducMan_b.port_a, port_b2); for i in 1:2:nReg loop // header after first hex register connect(hexReg[i].port_b1, hea1[(i+1)/2].port_a); connect(hea1[(i+1)/2].port_b, hexReg[i+1].port_b1); end for; // header after 2nd hex register for i in 2:2:(nReg-1) loop connect(hexReg[i].port_a1, hea2[i/2].port_a); connect(hea2[i/2].port_b, hexReg[i+1].port_a1); end for; connect(port_a1, temSen_1.port_a); connect(temSen_1.port_b, masFloSen_1.port_a); connect(masFloSen_1.port_b, pipMan_a.port_a); connect(temSen_1.T, hAModel.T_1); connect(masFloSen_1.m_flow, hAModel.m_flow_1); connect(port_a2, masFloSen_2.port_a); connect(masFloSen_2.port_b, temSen_2.port_a); connect(temSen_2.port_b, ducMan_a.port_a); connect(temSen_2.T, hAModel.T_2); connect(masFloSen_2.m_flow, hAModel.m_flow_2); connect(hAModel.hA_1, gai_1.u); connect(hAModel.hA_2, gai_2.u); for i in 1:nReg loop connect(gai_1.y, hexReg[i].Gc_1); connect(gai_2.y, hexReg[i].Gc_2); end for; end SensibleCoilDiscretized;
Simple heat exchanger with convective heat transfer as input. The hA values are an input and energy storage in the metal and in the fluid is taken into account.
Type | Name | Default | Description |
---|---|---|---|
Boolean | allowFlowReversal_1 | flowDirection_1 == Modelica_... | = false, if flow only from port_a to port_b, otherwise reversing flow allowed |
Boolean | allowFlowReversal_2 | flowDirection_2 == Modelica_... | = false, if flow only from port_a to port_b, otherwise reversing flow allowed |
Fluid 1 | |||
replaceable package Medium_1 | PartialMedium | Fluid 1 | |
Fluid 2 | |||
replaceable package Medium_2 | PartialMedium | Fluid 2 | |
Initialization | |||
MassFlowRate | m_flow_1 | Mass flow rate from port_a1 to port_b1 (m_flow_1 > 0 is design flow direction) [kg/s] | |
MassFlowRate | m_flow_2 | Mass flow rate from port_a2 to port_b2 (m_flow_2 > 0 is design flow direction) [kg/s] | |
Pressure | dp_1 | Pressure difference between port_a1 and port_b1 [Pa] | |
Pressure | dp_2 | Pressure difference between port_a2 and port_b2 [Pa] | |
Nominal condition | |||
Time | tau_1 | 60 | Time constant at nominal flow [s] |
MassFlowRate | m0_flow_1 | Mass flow rate [kg/s] | |
Time | tau_2 | 60 | Time constant at nominal flow [s] |
MassFlowRate | m0_flow_2 | Mass flow rate [kg/s] | |
ThermalConductance | UA0 | Thermal conductance at nominal flow [W/K] | |
Time | tau_m | 2 | Time constant of metal [s] |
Advanced | |||
Temp | flowDirection_1 | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
Temp | flowDirection_2 | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
Type | Name | Description |
---|---|---|
FluidPort_a | port_a1 | Fluid connector a for medium 1 (positive design flow direction is from port_a1 to port_b1) |
FluidPort_b | port_b1 | Fluid connector b for medium 1 (positive design flow direction is from port_a to port_b) |
FluidPort_a | port_a2 | Fluid connector a for medium 2 (positive design flow direction is from port_a2 to port_b2) |
FluidPort_b | port_b2 | Fluid connector b for medium 2 (positive design flow direction is from port_a to port_b) |
input RealInput | Gc_1 | Signal representing the convective thermal conductance of fluid 1 in [W/K] |
input RealInput | Gc_2 | Signal representing the convective thermal conductance of fluid 2 in [W/K] |
model SensibleHexHAInput "Simple heat exchanger with convective heat transfer as input" extends Fluids.Interfaces.PartialDynamicFourPortTransformer(final C=tau_m*UA0); extends Buildings.BaseClasses.BaseIcon; parameter Modelica.SIunits.ThermalConductance UA0(min=0) "Thermal conductance at nominal flow"; parameter Modelica.SIunits.Time tau_m(min=0) = 2 "Time constant of metal"; Modelica.Blocks.Interfaces.RealInput Gc_1(redeclare type SignalType = Modelica.SIunits.ThermalConductance) "Signal representing the convective thermal conductance of fluid 1 in [W/K]"; Modelica.Blocks.Interfaces.RealInput Gc_2(redeclare type SignalType = Modelica.SIunits.ThermalConductance) "Signal representing the convective thermal conductance of fluid 2 in [W/K]"; equation connect(Gc_1, con1.Gc); connect(Gc_2, con2.Gc); end SensibleHexHAInput;