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
tauis 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
| Type | Name | Default | Description |
|---|---|---|---|
| Boolean | have_integrator | false | Set to true to output the time integral |
| Modelica.Units.SI.Time | tau | 0 | Time constant at nominal flow rate |
| 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 |
| Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| 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.MassFlowRate | m_flow_nominal | Nominal mass flow rate | |
| 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 |
| Medium1.MassFlowRate | m_flow_small | 1E-4*abs(m_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 |
| Initialization | |||
| Modelica.Blocks.Types.Init | initType | Modelica.Blocks.Types.Init.InitialState | Type of initialization (InitialState and InitialOutput are identical) |
| Modelica.Units.SI.SpecificEnthalpy | h1_out_start | Medium1.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.SpecificEnthalpy | h2_out_start | Medium2.specificEnthalpy_pTX(p = Medium2.p_default, T = Medium2.T_default, X = Medium2.X_default) | Initial or guess value of measured specific enthalpy |
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) | |
| Buildings.Controls.OBC.CDL.Interfaces.RealOutput | dH_flow | Difference in enthalpy flow rate between stream 1 and 2 | |
| Buildings.Controls.OBC.CDL.Interfaces.RealOutput | E | Time integral of enthalpy flow rate difference between stream 1 and 2 |
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 |
| Fluid.Sensors.EnthalpyFlowRate | senEntFlo1 | Enthalpy flow rate of fluid stream 1 | |
| Fluid.Sensors.EnthalpyFlowRate | senEntFlo2 | Enthalpy flow rate of fluid stream 2 | |
| Buildings.Controls.OBC.CDL.Reals.Subtract | dif | Compute the difference | |
| Modelica.Blocks.Continuous.Integrator | int | Time integral computation |
Revisions
-
October 8, 2020, by Antoine Gautier:
First implementation.