modelDifferenceEnthalpyFlowRate

Sensor outputting the difference between two enthalpy flow rates

Extends from Fluid.Interfaces.PartialFourPortInterface (Partial model with four ports and declaration of quantities that are used by many models).

Information

This model outputs the difference in enthalpy flow rate between two different streams: ΔḢ = ṁ1 h1 - ṁ2 h2. Optionally the time integral of this quantity can be output. The sensor is ideal, i.e., it does not influence the fluid.

By default

  • the parameter tau is zero, so the specific enthalpy that is used to compute each enthalpy flow rate is computed in steady-state,
  • the medium is the same in both streams but the model allows for specifying two different media to represent for instance the gaseous and liquid state of the same substance.

Parameters

TypeNameDefaultDescription
Booleanhave_integratorfalseSet to true to output the time integral
Modelica.Units.SI.Timetau0Time constant at nominal flow rate
Assumptions
BooleanallowFlowReversal1 (from PartialFourPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 1
BooleanallowFlowReversal2 (from PartialFourPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal for medium 2
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Nominal condition
Modelica.Units.SI.MassFlowRatem1_flow_nominal (from PartialFourPortInterface)Nominal mass flow rate
Modelica.Units.SI.MassFlowRatem2_flow_nominal (from PartialFourPortInterface)Nominal mass flow rate
Modelica.Units.SI.MassFlowRatem_flow_nominalNominal mass flow rate
Advanced
Medium1.MassFlowRatem1_flow_small (from PartialFourPortInterface)1E-4*abs(m1_flow_nominal)Small mass flow rate for regularization of zero flow
Medium2.MassFlowRatem2_flow_small (from PartialFourPortInterface)1E-4*abs(m2_flow_nominal)Small mass flow rate for regularization of zero flow
Medium1.MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Advanced › Diagnostics
Booleanshow_T (from PartialFourPortInterface)false= true, if actual temperature at port is computed
Initialization
Modelica.Blocks.Types.InitinitTypeModelica.Blocks.Types.Init.InitialStateType of initialization (InitialState and InitialOutput are identical)
Modelica.Units.SI.SpecificEnthalpyh1_out_startMedium1.specificEnthalpy_pTX(p = Medium1.p_default, T = Medium1.T_default, X = Medium1.X_default)Initial or guess value of measured specific enthalpy
Modelica.Units.SI.SpecificEnthalpyh2_out_startMedium2.specificEnthalpy_pTX(p = Medium2.p_default, T = Medium2.T_default, X = Medium2.X_default)Initial or guess value of measured specific enthalpy

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a1 (from PartialFourPort)Fluid connector a1 (positive design flow direction is from port_a1 to port_b1)
Modelica.Fluid.Interfaces.FluidPort_bport_b1 (from PartialFourPort)Fluid connector b1 (positive design flow direction is from port_a1 to port_b1)
Modelica.Fluid.Interfaces.FluidPort_aport_a2 (from PartialFourPort)Fluid connector a2 (positive design flow direction is from port_a2 to port_b2)
Modelica.Fluid.Interfaces.FluidPort_bport_b2 (from PartialFourPort)Fluid connector b2 (positive design flow direction is from port_a2 to port_b2)
Buildings.Controls.OBC.CDL.Interfaces.RealOutputdH_flowDifference in enthalpy flow rate between stream 1 and 2
Buildings.Controls.OBC.CDL.Interfaces.RealOutputETime integral of enthalpy flow rate difference between stream 1 and 2

Components

TypeNameDefaultDescription
Medium1.MassFlowRatem1_flow (from PartialFourPortInterface)port_a1.m_flowMass flow rate from port_a1 to port_b1 (m1_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp1 (from PartialFourPortInterface)port_a1.p - port_b1.pPressure difference between port_a1 and port_b1
Medium2.MassFlowRatem2_flow (from PartialFourPortInterface)port_a2.m_flowMass flow rate from port_a2 to port_b2 (m2_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedp2 (from PartialFourPortInterface)port_a2.p - port_b2.pPressure difference between port_a2 and port_b2
Medium1.ThermodynamicStatesta_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.ThermodynamicStatesta_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.ThermodynamicStatesta_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.ThermodynamicStatesta_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
Fluid.Sensors.EnthalpyFlowRatesenEntFlo1Enthalpy flow rate of fluid stream 1
Fluid.Sensors.EnthalpyFlowRatesenEntFlo2Enthalpy flow rate of fluid stream 2
Buildings.Controls.OBC.CDL.Reals.SubtractdifCompute the difference
Modelica.Blocks.Continuous.IntegratorintTime integral computation

Revisions

  • October 8, 2020, by Antoine Gautier:
    First implementation.