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
| Type | Name | Default | Description |
| Modelica.Units.SI.MassFlowRate | m_flow_small | 1E-4*abs(m_flow_nominal) | Small mass flow rate for regularization of zero flow |
| Nominal condition |
| Modelica.Units.SI.MassFlowRate | m_flow_nominal | | Nominal mass flow rate |
| Advanced › Diagnostics |
| Boolean | show_T | false | = true, if actual temperature at port is computed |
| Assumptions |
| Boolean | allowFlowReversal | true | = false to simplify equations, assuming, but not enforcing, no flow reversal. Used only if model has two ports. |
| Dynamics › Equations |
| Modelica.Fluid.Types.Dynamics | energyDynamics | Modelica.Fluid.Types.Dynamics.DynamicFreeInitial | Type of energy balance: dynamic (3 initialization options) or steady state |
| Modelica.Fluid.Types.Dynamics | massDynamics | energyDynamics | Type of mass balance: dynamic (3 initialization options) or steady state |
| Initialization |
| Medium_b.AbsolutePressure | p_start | Medium_b.p_default | Start value of pressure |
| Medium_b.Temperature | T_start | Medium_b.T_default | Start value of temperature |
Components
| Type | Name | Default | Description |
| Modelica.Units.SI.MassFlowRate | m_flow | port_a.m_flow | Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction) |
| Modelica.Units.SI.PressureDifference | dp | port_a.p - port_b.p | Pressure difference between port_a and port_b |
| Medium_a.ThermodynamicState | sta_a | Medium_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.ThermodynamicState | sta_b | Medium_b.setState_phX(port_b.p, noEvent(actualStream(port_b.h_outflow)), noEvent(actualStream(port_b.Xi_outflow))) | Medium properties in port_b |
Contents
| Name | Description |
Medium_a | Medium model for port_a (inlet) |
Medium_b | Medium model for port_b (outlet) |
Revisions
- July 22, 2021 by Kathryn Hinkelman:
- First implementation.