modelPartialTwoPortTwoMedium

Partial model with two ports with two separate medium models without storing mass or energy

Information

This partial model defines an interface for components with two ports and separate medium definitions at each port. The component transports fluid between two ports without storing mass or energy. The treatment of the design flow direction and of flow reversal are predefined based on the parameter allowFlowReversal.

This model is intended for steam heating applications, where phase change is inherently present. The split-medium approach enables a numerically-efficient liquid water model (i.e., Buildings.Media.Specialized.Water.TemperatureDependentDensity) to be implemented alongside various water/steam models for other phases. For most applications, an efficient model (i.e., Modelica.Media.Water.StandardWater is suitable as it covers the largest range of pressure-temperature conditions through its implementation of the IAPWS-IF97 water/steam formulation. If a reduce pressure-temperature range is applicable, Buildings.Media.Steam) provides a more efficient implementation. Through the split-medium approach, pressure and density calculations are decoupled, eliminating costly nonlinear systems of equations. This interface model also includes parameters for mass and energy dynamics as well as initialization.

Reference

Hinkelman, Kathryn, Saranya Anbarasu, Michael Wetter, Antoine Gautier, and Wangda Zuo. 2022. “A Fast and Accurate Modeling Approach for Water and Steam Thermodynamics with Practical Applications in District Heating System Simulation.” Preprint. February 24. doi:10.13140/RG.2.2.20710.29762.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominalNominal mass flow rate
Advanced › Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal. Used only if model has two ports.
Dynamics › Equations
Modelica.Fluid.Types.DynamicsenergyDynamicsModelica.Fluid.Types.Dynamics.DynamicFreeInitialType of energy balance: dynamic (3 initialization options) or steady state
Modelica.Fluid.Types.DynamicsmassDynamicsenergyDynamicsType of mass balance: dynamic (3 initialization options) or steady state
Initialization
Medium_b.AbsolutePressurep_startMedium_b.p_defaultStart value of pressure
Medium_b.TemperatureT_startMedium_b.T_defaultStart value of temperature

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)

Components

TypeNameDefaultDescription
Modelica.Units.SI.MassFlowRatem_flowport_a.m_flowMass flow rate from port_a to port_b (m_flow > 0 is design flow direction)
Modelica.Units.SI.PressureDifferencedpport_a.p - port_b.pPressure difference between port_a and port_b
Medium_a.ThermodynamicStatesta_aMedium_a.setState_phX(port_a.p, noEvent(actualStream(port_a.h_outflow)), noEvent(actualStream(port_a.Xi_outflow)))Medium properties in port_a
Medium_b.ThermodynamicStatesta_bMedium_b.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow)))Medium properties in port_b

Contents

NameDescription
Medium_aMedium model for port_a (inlet)
Medium_bMedium model for port_b (outlet)

Revisions

  • July 22, 2021 by Kathryn Hinkelman:
  • First implementation.