2463
2463
2463
net/publication/224627963
CITATIONS READS
47 1,978
2 authors:
All content following this page was uploaded by Francesco Casella on 26 May 2014.
Abstract— This paper presents and discusses the application II. OBJECT-ORIENTED PHYSICAL SYSTEM
of the object-oriented modelling paradigm to thermo-hydraulic MODELLING WITH MODELICA
systems, with particular reference to fossil-fired and nuclear
power plants. As a result, a particular modelling approach The Modelica language was introduced in 1997 [1], as
is proposed and motivated. The paper also presents the the product of an international cooperative effort to define
ThermoPower Modelica library, developed at the Politecnico an object-oriented language for the modelling of generic
di Milano along the proposed approach, and made available
to the scientific and professional community within the terms
physical models, described by algebraic and differential
of the Modelica license. Some application cases involving equations. The features of the language which are relevant
ThermoPower are briefly reported. in the context of this paper are summarised here.
I. INTRODUCTION A. A-causal, declarative modelling
Dynamic simulation is a very important tool in the design
The model of each physical component (e.g. a pipe, a
of power plant control systems, particularly when innovative
pump, a valve, or a turbine) is described by a set of alge-
plants, or innovative control strategies are considered. Sim-
braic, differential, and event-triggered difference equations;
ulation can play a role from the initial design stages, when
these describe how the modelled object behaves, rather
the control strategies and the required instrumentation are
than how the equations are to be numerically solved. The
evaluated, to the validation of the controller tuning, up to
boundary conditions (pressures, temperatures, flow rates)
the plant commissioning phase, not to mention personnel
are not necessarily declared a-priori as input or outputs:
training. Dynamic modelling and transient analysis efforts
this is essential to achieve truly object-oriented modelling
can be very cost-effective, both during design, when it can
of physical systems, since the model of a physical is always
catch flaws which would result in later costly interventions,
the same, irrespective of what is connected to it. This marks
and during the commissioning phase, when the savings in
a fundamental difference with conventional block-diagram-
terms of reduced down-time can be huge.
oriented simulation languages, such as Simulink, in which
Recent advances in object-oriented modelling of dynam-
each model must have definite input and output signals.
ical systems, and in particular the development of the
Modelica language [1], bring new possibilities in this field, B. Code transparency
allowing the fast development of system simulators which
can be tailored to the different needs of the design process, The declarative approach allows to write the model
while maximising the re-use of existing information and code in a way that tightly matches the way equations are
knowledge. The flexibility of the object-oriented approach written on the paper, without bothering how the equations
is particularly well-suited to support model-based control will eventually be solved. This greatly eases the model
system design methodologies, such as Model Predictive development, documentation, modification and reuse, thus
Control. Currently there is a wide gap between full-scale providing a significant advantage over specialised power
modular plant models used for simulation, and reduced- plant simulation packages. These in fact usually provide
order hand-coded models used for controller design; as "closed" models, which can be very difficult or even im-
available computing power increases, and Modelica compil- possible to inspect, in order to understand what’s inside,
ers become more efficient, this gap will presumably become and even harder to modify, in order to adapt them to one’s
narrower in the near future, until modular (albeit simplified) specific needs.
first-principle models could possibly be used directly for
C. Encapsulation
controller design.
The paper is structured as follows: Section 2 reviews The models of system components are connected through
the key features of object-oriented modelling of dynamical rigorously defined interfaces or connectors (e.g. fluid con-
systems; in Section 3, the advantages of using object- nectors with pressure, flow rate, and enthalpy, or heat
oriented modelling in power plant simulation are discussed; connectors with temperatures and heat fluxes). Any two
Section 4 introduces the ThermoPower Modelica library; components with compatible connectors can be bound to-
example applications are reviewed in Section 5. gether, regardless of their internal details. This feature is
essential to re-use models, and to easily replace subsystems
*Dipartimento di Elettronica e Informazione, Politecnico di
Milano, 20133 Milano, Italy. [email protected], with more or less detailed counterparts, without affecting
[email protected] the rest of the system.
0-7803-9568-9/05/$20.00 ©2005 IEEE 7597
D. Inheritance B. Modularity
Model libraries can be given a hierarchical structure, in The object-oriented approach is highly modular. This
which more complex models are obtained from basic mod- means, first of all, that it is possible to build the model
els by adding specific variables, equations or even models. of a plant unit by connecting the models of its physical
It is then possible to factor out the common behaviour components in any way which makes physical sense; sec-
of a family of components (e.g. valves, or pumps) in a ondly, it allows to build a plant model by connecting the
parent model, and then to define child model which add unit model, with an arbitrary number of hierarchical levels.
their specific variables and equations. It is also possible, Besides that, the advanced features of the Modelica
e.g., to model objects with replaceable fluid models, by language allow to define replaceable components, which
separating the component model equations from the fluid can be substituted by more or less detailed counterparts,
model equations. as long as they have the same interface, i.e. the same
connectors and parameters. It becomes then much easier to
manage a whole family of simulators of the same plant, each
E. Multi-physics modelling
one characterised by a level of detail which is appropriate
The Modelica language allows modelling of generic to a specific simulation task. For example, it is possible
dynamical systems. It is then straightforward to combine to substitute a very accurate water property model with
physical models belonging to different engineering domains a much simpler one, when the system is going to be
with continuous- or discrete-time control systems models. simulated around a certain operating point; or, it is possible
to substitute the model of whole plants sub-units (e.g., the
F. Reusability feedwater systems) with more idealised counterparts (e.g.
an ideal flow source) in a systematic way.
A-causal modelling, encapsulation, and inheritance are
strong incentives toward reuse of modelling knowledge in- IV. THE THERMOPOWER MODELICA LIBRARY
side simulation projects. At the component level, it is often
The ThermoPower library has been developed to provide
possible to re-use models provided by standard libraries,
basic components for the modelling of power plants. The
while developing a few specific components with ad-hoc
scope of the library is thus narrower than that of other
(and possibly proprietary) modelling, wherever needed. At
Modelica libraries for generic thermo-fluid systems, such
the system level, it is possible to easily manage a family
as ThermoFluid [2] or the forthcoming Modelica.Fluid
of models with different accuracy and simulation speeds; in
standard library [3]. On one hand, this allows to make some
most cases, this can be obtained by slight variations of a
basic simplifying assumptions on the nature of the fluids and
"reference" system model. This greatly helps to maintain the
their phenomena: e.g., turbulent flow is always assumed to
consistency of models as they evolve throughout the project
compute pressure drops, which is a good choice in typical
life cycle, as modifications and improvements applied to the
power plant components handling water and gases, but it’s
reference model are automatically inherited by simplified
not in petrochemical plants, where oil is heavily involved.
ones.
On the other hand, it makes it possible to put more detail
and sophistication where it is really needed: for example,
III. OBJECT-ORIENTED MODELLING OF POWER pipe models use finer discretisation grids for enthalpies
PLANTS than for pressures and flow rates, since wave propagation
phenomena can usually be neglected when dealing with
A. Flexibility control-relevant power plant dynamics.
Models of power plant components can have a widely The library, described in more detail in [4], [5], is an open
varying complexity, depending on the desired degree of source project: the source code is freely available online [6].
detail. On the other hand, their boundary connections es-
sentially fall under three categories: fluid flange connections A. Library Structure
(like the inlet and outlet flanges of a pump), thermal transfer The library is structured into 5 packages. The package
between zero- or one-dimensional objects (such as heat Water provides models of components using water/steam
exchangers), and mechanical flanges (such as a turbine or a as working fluid, while the package Gas provides models
compressor shaft). It is therefore possible to define standard of components using ideal gas mixtures. The default wa-
connectors for these types of interfaces, or even to re-use ter/steam model, based on the IAPWS-IF97 formulation,
interfaces which are pre-defined in the Modelica standard and the default ideal gas mixture model, based on a NASA
library. property database, are provided by the Modelica.Media
The declarative approach leaves almost complete freedom library [3], which is a part of the standard Modelica
as to what equations should be used to describe a specific library. Those models can be replaced by any other fluid
component; on the other hand, any two components can be model, provided it is equipped with a Modelica.Media-
connected, as long as the standard connectors are used. compliant interface.
7598
V. APPLICATIONS
7602