This section is a quick primer explaining how to build a system model using Modelica.Fluid. It covers some key issues, such as the System component, the definition of medium models in the system, and the typical customizations available in the Modelica.Fluid models.
Name | Description |
---|---|
SystemComponent | System component |
MediumDefinition | Definition of the medium models |
CustomizingModel | Customizing a system model |
The Modelica.Fluid library is designed so that each model of a system must include an instance system of the System component at the top level, in the same way as the World model of the MultiBody Library. The System component contains the parameters that describe the environment surrounding the components (ambient pressure and temperature, gravity acceleration), and also provides default settings for many parameters which are used consistently by the models in the library. These parameters are then propagated to the individual components using the inner/outer variable mechanism. In case the system model is structured hieararchically, it is possible to either put a single System component at the top level, or possibly to put many of them at different levels, which will only influence the system components from that level down.
All the parameters defined in the System model are used as default values for the parameters of the individual components of the system model. Note that it is always possible to ovverride these defaults locally by changing the value of the parameters in the specific component instance.
Remember to always add a System component at the top level of your system model, otherwise you will get errors when compiling the model. The tool will automatically name it system, so that it is recognised by all other components.
All the models in Modelica.Fluid compute fluid properties by using medium models defined by Modelica.Media packages. Custom fluid models can also be used, provided they extend the interfaces defined in Modelica.Media.Interfaces.
All the components in Modelica.Fluid use a replaceable medium package, called Medium: the model is written for a generic fluid, and a specific fluid model can then be specified when building a system model by redeclaring the package. This can be done in different ways:
Once a system model has been built, it is possible to obtain different approximations by appropriately setting the defaults in the System component (and/or the settings of specific components.
The Assumptions | allowFlowReversal parameter determines whether reversing flow conditions (i.e. flow direction opposite to design direction) are modelled or not. By default, reversing flow conditions are considered by the models, but this causes a significant increase of complexity in the equations, due to the conditional equations depending on the flow direction. If you know in advance that the flow in a certain component (or in the whole system) will always be in the design direction, then setting this parameter to false will produce a much faster and possibly more robust simulation code.
The flags in the Assumptions | Dynamics tab allow different degrees of approximation on the mass, energy, and momentum equations of the components.