Model Design Principles

Created Wednesday 12 June 2013

For an early introduction to the library concepts see our publication at the 2012 Modelica Conference at Munich.

When setting up the model of a complex physical system such as a power plant, the first question to be answered is what physical fidelity is needed to cope with the given simulation task. The answer to this question refers to the level of detail necessary for each component and sub-process. The next step is to define the general physical effects to be considered for solving
the given task. Finally, the level of physical insight into the considered physical aspects must be chosen.
In what follows it will be explained how these three stages guide the model design of the ClaRa library.
For illustration the concept will be applied to the well known example of a fluid flow in a pipe.

1 Levels of Detail

The ClaRa library is intended to contain models at different levels of detail. It is mainly based on two criteria:

The model design of ClaRa has been inspired by these ideas. Moreover it aims to provide a well balanced combination of readability, modelling flexibility and avoidance of code duplication. Consequently, each component in the ClaRa library is represented by a family of freely exchangeable models. Every component family is grouped into four levels of detail:

Example: transmission line model for fluid flow in a pipe.

Example: single control volume for fluid flow in a pipe.

Example: moving boundary approach for fluid flow in a pipe.

Example: finite volume approach with spatial discretisation in flow direction for fluid flow in a pipe.


2 Physical Effects to be Considered

Once the decision for a specific detail group of models is made, the set of required physical effects to be covered by a model may still differ according to the simulation goal. For instance, in a pipe model it might be necessary to resolve the spatial flow properties but unnecessary to analyse sound waves in detail. This is reflected in the complexity of the basic physical equations underlying the model.

Notice that, although the ClaRa library is designed for dynamic simulations, it is still possible to include models, where parts of the basic physical equations correspond to the stationary behaviour of a component. Such models are often favourable with respect to computation time and stability. Their use is appropriate whenever certain aspects of the component dynamics can be neglected compared to the system dynamics under consideration. In the pipe example above this would be manifested by the fact that if only fluid flow properties (temperature profile, flow velocities, etc.) are of interest, sound wave propagation can be neglected, as long as the flow velocity is much less than the speed of sound. Consequently a stationary momentum balance for the fluid would be sufficient in this case.

In order to cope with these different needs, the ClaRa library provides component models at the same level of detail but covering different physical effects. They are distinguished by different self explaining names.


3 Level of Insight

By now, the fundamental equations of a model are defined by setting its level of detail and the physical effects of consideration. However, these equations declare which physical effects are considered, but not how they are considered. For instance, the pressure loss in a pipe may be modelled using constant nominal values or via correlations taking the flow regime and the fluid states into account. These physical effects are therefore modelled in replaceable models that complete the fundamental equations using predefined interfaces, e.g. the friction term in the momentum balance. By separating the governing model definition from the underlying submodels, the flexibility of the model is enhanced without loosing readability.

4 Model Structure

Most models are structured as illustrated below. The library follows a modular approach which means that more complex models consist of appropriate basic models structured as shown.



Backlinks: ClaRa:Basic Concepts of Modelling:Finite Volume Approach ClaRa:Basic Concepts of Modelling:Stucture of Models ClaRa:A User Guide:Revisions:v1.0.0