modelStaticFourPortHeatMassExchanger
Extends from Buildings.Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models), Buildings.Fluid.Interfaces.FourPortFlowResistanceParameters (Parameters for flow resistance for models with four ports).
Information
This component transports two fluid streams between four ports, without storing mass or energy. It is similar to Buildings.Fluid.Interfaces.StaticTwoPortHeatMassExchanger, but it has four ports instead of two.
If dpN_nominal > Modelica.Constants.eps,
where N denotes the fluid 1 or 2,
then the model computes
pressure drop due to flow friction in the respective fluid stream.
The pressure drop is defined by a quadratic function that goes through
the point (mN_flow_nominal, dpN_nominal).
At |mN_flow| < deltaMN * mN_flow_nominal,
the pressure drop vs. flow relation is linearized.
If the parameter linearizeFlowResistanceN is set to true,
then the whole pressure drop vs. flow resistance curve is linearized.
Implementation
This model uses inputs and constants that need to be set by models
that extend or instantiate this model.
The following inputs need to be assigned, where N denotes 1 or
2:
-
QN_flow, which is the sensible and latent heat flow rate added to the medium N. -
mWatN_flow, which is the moisture mass flow rate added to the medium N.
Set the constant sensibleOnlyN=true if the model that extends
or instantiates this model sets mWatN_flow = 0.
Note that the model does not implement 0 = Q1_flow + Q2_flow or
0 = mXi1_flow + mXi2_flow. If there is no heat or mass transfer
with the environment, then a model that extends this model needs to provide these
equations.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | prescribedHeatFlowRate1 | false | Set to true if the heat flow rate into fluid 1 is not a function of the component temperature |
| Boolean | prescribedHeatFlowRate2 | false | Set to true if the heat flow rate into fluid 2 is not a function of the component temperature |
| Boolean | homotopyInitialization | true | = true, use homotopy method |
| Boolean | sensibleOnly1 | Set to true if sensible exchange only for medium 1 | |
| Boolean | sensibleOnly2 | Set to true if sensible exchange only for medium 2 | |
| Assumptions | |||
| Boolean | allowFlowReversal1 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1 |
| Boolean | allowFlowReversal2 (from PartialFourPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2 |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m1_flow_nominal (from PartialFourPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.MassFlowRate | m2_flow_nominal (from PartialFourPortInterface) | Nominal mass flow rate | |
| Modelica.Units.SI.PressureDifference | dp1_nominal (from FourPortFlowResistanceParameters) | Pressure difference | |
| Modelica.Units.SI.PressureDifference | dp2_nominal (from FourPortFlowResistanceParameters) | Pressure difference | |
| Advanced | |||
| Medium1.MassFlowRate | m1_flow_small (from PartialFourPortInterface) | 1E-4*abs(m1_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Medium2.MassFlowRate | m2_flow_small (from PartialFourPortInterface) | 1E-4*abs(m2_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Advanced › Diagnostics | |||
| Boolean | show_T (from PartialFourPortInterface) | false | = true, if actual temperature at port is computed |
| Flow resistance › Medium 1 | |||
| Boolean | computeFlowResistance1 (from FourPortFlowResistanceParameters) | true | =true, compute flow resistance. Set to false to assume no friction |
| Boolean | from_dp1 (from FourPortFlowResistanceParameters) | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n1 (from FourPortFlowResistanceParameters) | 2 | Flow exponent for side 1, n=1 for laminar, n=2 for turbulent |
| Boolean | linearizeFlowResistance1 (from FourPortFlowResistanceParameters) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Real | deltaM1 (from FourPortFlowResistanceParameters) | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
| Flow resistance › Medium 2 | |||
| Boolean | computeFlowResistance2 (from FourPortFlowResistanceParameters) | true | =true, compute flow resistance. Set to false to assume no friction |
| Boolean | from_dp2 (from FourPortFlowResistanceParameters) | false | = true, use m_flow = f(dp) else dp = f(m_flow) |
| Real | n2 (from FourPortFlowResistanceParameters) | 2 | Flow exponent for side 2, n=1 for laminar, n=2 for turbulent |
| Boolean | linearizeFlowResistance2 (from FourPortFlowResistanceParameters) | false | = true, use linear relation between m_flow and dp for any flow rate |
| Real | deltaM2 (from FourPortFlowResistanceParameters) | 0.1 | Fraction of nominal flow rate where flow transitions to laminar |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a1 (from PartialFourPort) | Fluid connector a1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b1 (from PartialFourPort) | Fluid connector b1 (positive design flow direction is from port_a1 to port_b1) | |
| Modelica.Fluid.Interfaces.FluidPort_a | port_a2 (from PartialFourPort) | Fluid connector a2 (positive design flow direction is from port_a2 to port_b2) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b2 (from PartialFourPort) | Fluid connector b2 (positive design flow direction is from port_a2 to port_b2) |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Medium1.MassFlowRate | m1_flow (from PartialFourPortInterface) | port_a1.m_flow | Mass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp1 (from PartialFourPortInterface) | port_a1.p - port_b1.p | Pressure difference between port_a1 and port_b1 |
| Medium2.MassFlowRate | m2_flow (from PartialFourPortInterface) | port_a2.m_flow | Mass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp2 (from PartialFourPortInterface) | port_a2.p - port_b2.p | Pressure difference between port_a2 and port_b2 |
| Medium1.ThermodynamicState | sta_a1 (from PartialFourPortInterface) | if allowFlowReversal1 then Medium1.setState_phX(port_a1.p, noEvent(actualStream(port_a1.h_outflow)), noEvent(actualStream(port_a1.Xi_outflow))) else Medium1.setState_phX(port_a1.p, inStream(port_a1.h_outflow), inStream(port_a1.Xi_outflow)) | Medium properties in port_a1 |
| Medium1.ThermodynamicState | sta_b1 (from PartialFourPortInterface) | if allowFlowReversal1 then Medium1.setState_phX(port_b1.p, noEvent(actualStream(port_b1.h_outflow)), noEvent(actualStream(port_b1.Xi_outflow))) else Medium1.setState_phX(port_b1.p, port_b1.h_outflow, port_b1.Xi_outflow) | Medium properties in port_b1 |
| Medium2.ThermodynamicState | sta_a2 (from PartialFourPortInterface) | if allowFlowReversal2 then Medium2.setState_phX(port_a2.p, noEvent(actualStream(port_a2.h_outflow)), noEvent(actualStream(port_a2.Xi_outflow))) else Medium2.setState_phX(port_a2.p, inStream(port_a2.h_outflow), inStream(port_a2.Xi_outflow)) | Medium properties in port_a2 |
| Medium2.ThermodynamicState | sta_b2 (from PartialFourPortInterface) | if allowFlowReversal2 then Medium2.setState_phX(port_b2.p, noEvent(actualStream(port_b2.h_outflow)), noEvent(actualStream(port_b2.Xi_outflow))) else Medium2.setState_phX(port_b2.p, port_b2.h_outflow, port_b2.Xi_outflow) | Medium properties in port_b2 |
| Modelica.Units.SI.HeatFlowRate | Q1_flow | Heat transferred into the medium 1 | |
| Medium1.MassFlowRate | mWat1_flow | Moisture mass flow rate added to the medium 1 | |
| Modelica.Units.SI.HeatFlowRate | Q2_flow | Heat transferred into the medium 2 | |
| Medium2.MassFlowRate | mWat2_flow | Moisture mass flow rate added to the medium 2 |
Revisions
-
April 14, 2020, by Michael Wetter:
ChangedhomotopyInitializationto a constant.
This is for IBPSA, #1341. -
April 11, 2017, by Michael Wetter:
Updated documentation to make clear thatQ1_flowandQ2_flowinclude latent heat flow rate.
This is for issue Buildings #704. -
January 22, 2016 by Michael Wetter:
Removed assignment ofsensibleOnlyinbal1andbal2as this constant has been removed in Buildings.Fluid.Interfaces.StaticTwoPortHeatMassExchanger. -
November 13, 2013 by Michael Wetter:
Added parameterhomotopyInitializationas it has been removed in the base class. -
November 13, 2013, by Michael Wetter:
Removedimport Modelica.Constants;statement. -
October 8, 2013, by Michael Wetter:
Removed parametershow_V_flow. -
July 30, 2013 by Michael Wetter:
Changed connectormXi_flow[Medium.nXi]to a scalar input connectormWat_flow. The reason is thatmXi_flowdoes not allow to compute the other components inmX_flowand therefore leads to an ambiguous use of the model. By only requestingmWat_flow, the mass balance and species balance can be implemented correctly. -
March 29, 2011, by Michael Wetter:
Changed energy and mass balance to avoid a division by zero ifm_flow=0. -
March 27, 2011, by Michael Wetter:
Addedhomotopyoperator. -
August 19, 2010, by Michael Wetter:
Fixed bug in energy and moisture balance that affected results if a component adds or removes moisture to the air stream. In the old implementation, the enthalpy and species outflow atport_bwas multiplied with the mass flow rate atport_a. The old implementation led to small errors that were proportional to the amount of moisture change. For example, if the moisture added by the component was0.005 kg/kg, then the error was0.5%. Also, the results for forward flow and reverse flow differed by this amount. With the new implementation, the energy and moisture balance is exact. -
March 22, 2010, by Michael Wetter:
Added constantssensibleOnly1andsensibleOnly2to simplify species balance equations. -
April 13, 2009, by Michael Wetter:
Added model to compute flow friction. -
March 25, 2008, by Michael Wetter:
First implementation.