Library of 1-dim. thermo-fluid flow models using the Modelica.Media media description


Library Modelica.Fluid is a free Modelica package providing components for 1-dimensional thermo-fluid flow in networks of vessels, pipes, fluid machines, valves and fittings. A unique feature is that the component equations and the media models as well as pressure loss and heat transfer correlations are decoupled from each other. All components are implemented such that they can be used for media from the Modelica.Media library. This means especially that an incompressible or compressible medium, a single or a multiple substance medium with one or more phases might be used.

In the next figure, several features of the library are demonstrated with a simple heating system with a closed flow cycle. By just changing one configuration parameter in the system object the equations are changed between steady-state and dynamic simulation with fixed or steady-state initial conditions.


With respect to previous versions, the design of the connectors has been changed in a non-backward compatible way, using the recently developed concept of stream connectors that results in much more reliable simulations (see also Stream-Connectors-Overview-Rationale.pdf). This extension was included in Modelica 3.1.

The following parts are useful, when newly starting with this library:

Copyright © 2002-2020, Modelica Association and contributors

Extends from Modelica.Icons.Package (Icon for standard packages).

Package Content

Name Description
Modelica.Fluid.UsersGuide UsersGuide User's Guide
Modelica.Fluid.Examples Examples Demonstration of the usage of the library
Modelica.Fluid.System System System properties and default values (ambient, flow direction, initialization)
Modelica.Fluid.Vessels Vessels Devices for storing fluid
Modelica.Fluid.Pipes Pipes Devices for conveying fluid
Modelica.Fluid.Machines Machines Devices for converting between energy held in a fluid and mechanical energy
Modelica.Fluid.Valves Valves Components for the regulation and control of fluid flow
Modelica.Fluid.Fittings Fittings Adaptors for connections of fluid components and the regulation of fluid flow
Modelica.Fluid.Sources Sources Define fixed or prescribed boundary conditions
Modelica.Fluid.Sensors Sensors Ideal sensor components to extract signals from a fluid connector
Modelica.Fluid.Interfaces Interfaces Interfaces for steady state and unsteady, mixed-phase, multi-substance, incompressible and compressible flow
Modelica.Fluid.Types Types Common types for fluid models
Modelica.Fluid.Dissipation Dissipation Functions for convective heat transfer and pressure loss characteristics
Modelica.Fluid.Utilities Utilities Utility models to construct fluid components (should not be used directly)

Modelica.Fluid.System Modelica.Fluid.System

System properties and default values (ambient, flow direction, initialization)


A system component is needed in each fluid model to provide system-wide settings, such as ambient conditions and overall modeling assumptions. The system settings are propagated to the fluid models using the inner/outer mechanism.

A model should never directly use system parameters. Instead a local parameter should be declared, which uses the global setting as default. The only exceptions are:

The global system.m_flow_small and system.dp_small are classic parameters. They do not distinguish between laminar flow and regularization of zero flow. Absolute small values are error prone for models with local nominal values. Moreover dp_small can generally be obtained automatically. Consider using the new system.use_eps_Re = true (see Advanced tab).


p_ambientDefault ambient pressure [Pa]
T_ambientDefault ambient temperature [K]
gConstant gravity acceleration [m/s2]
allowFlowReversal= false to restrict to design flow direction (port_a -> port_b)
energyDynamicsDefault formulation of energy balances
massDynamicsDefault formulation of mass balances
momentumDynamicsDefault formulation of momentum balances, if options available
m_flow_startDefault start value for mass flow rates [kg/s]
p_startDefault start value for pressures [Pa]
T_startDefault start value for temperatures [K]
use_eps_Re= true to determine turbulent region automatically using Reynolds number
m_flow_nominalDefault nominal mass flow rate [kg/s]
eps_m_flowRegularization of zero flow for |m_flow| < eps_m_flow*m_flow_nominal
dp_smallDefault small pressure drop for regularization of laminar and zero flow [Pa]
m_flow_smallDefault small mass flow rate for regularization of laminar and zero flow [kg/s]
Automatically generated Thu Oct 1 16:07:56 2020.