Chemical Process Modeling in Modelica: September 2012
Chemical Process Modeling in Modelica: September 2012
Chemical Process Modeling in Modelica: September 2012
net/publication/262602086
CITATIONS READS
5 414
2 authors, including:
Ali Baharev
University of Vienna
20 PUBLICATIONS 89 CITATIONS
SEE PROFILE
Some of the authors of this publication are also working on these related projects:
All content following this page was uploaded by Ali Baharev on 26 May 2014.
methods for solving nonlinear programming problems Nonlinear system of equations are generally solved
(NLP). The structural information retrieved from the using optimization techniques. AMPL (F OURER et al.
JModelica environment will play an important role in [12]) is the de facto standard for model representation
the development of our novel optimization methods. and exchange in the optimization community. Many
Foundations of a Modelica library for general-purpose solvers for solving nonlinear programming (NLP)
chemical process modeling have been built. Multi- problems are interfaced with the AMPL environment.
ple steady-states in ideal two-product distillation were We are aiming to create a ‘Modelica to AMPL’ con-
computed as a proof of concept. The Modelica source verter. One could use the Modelica toolchain to create
code is available at the project homepage. The issues the models conveniently on a GUI. After exporting the
encountered during modeling may be valuable to the Modelica model in AMPL format, the already existing
Modelica language designers. software environments (solvers with AMPL interface,
Keywords: separation, distillation column, tearing AMPL scripts) can be used. Thus an AMPL export fa-
methods, homotopy continuation, bifurcation cility builds a bridge between Modelica users and the
optimization community. Such an implementation ex-
ists (Å KESSON [3]) but it is no longer supported, and
1 Introduction not publicly available.
The object-oriented component-based modeling Our ultimate goal is the development of structure-
methodology in Modelica (F RITZSON [13]) is well- driven optimization methods for solving nonlinear
suited for chemical processes modeling. Accordingly, programming problems (NLP). The structural infor-
Modelica has received attention in the chemical mation (hierarchical components and the connections
engineering literature (S ANDROCK & DE VAAL between them) can be exploited to solve the underly-
[18]). Creating a component-based framework for ing process model efficiently. For example the process
chemical process modeling is one of the goals of our model of the reactive distillation column in C IRIC &
project. This framework then serves as a common M IAO [8], producing ethylene glycol from ethylene
language between mathematicians and chemical oxide and water, has 70 variables and 70 equations.
engineers. The current chemical engineering literature However, the steady-state process model can be solved
is hardly accessible to mathematicians, partly due to by solving univariate equations only, in a proper elim-
the engineering jargon and unwritten traditions. ination order (BAHAREV & N EUMAIER [5]). In other
We created a prototype Modelica implementa- words, the problem is essentially 1-dimensional. Typ-
tion of basic chemical engineering processes. Cur- ically, chemical process models are essentially low-
rently, only steady-state models are supported. dimensional even if their steady-state model is large-
Once this component library is finished, soft- scale.
ware with a graphical user interface, such as the The structural information is difficult to get from
OpenModelica Connection Editor (OMEdit), can be an AMPL source directly, one would rather try to ex-
used to build chemical process models. The process tract it from the flattened AMPL file instead. In prin-
ciple, one could recover the required structural infor- involved in are the connecting equations and specifi-
mation from the flattened model, at least to some ex- cations on their stream variables.
tent. This means that the flattening step throws away
the structural information first, then one must try to
recover it inside a solver. In contrast, the structural class Source
information is programmatically accessible in JMod- output Stream outlet;
elica (Å KESSON et al. [2]) before flattening, and we end Source;
intend to utilize this. class Sink
input Stream inlet;
end Sink;
2 Component-based modeling of che-
mical processes
Chemical processes are well-suited for component- 2.3 Types of equations
based modeling since they are networks of equip-
ments. In turn, it is natural to model the equipments These equations apply to all atomic units in subsec-
hierarchically, as a composite of smaller components. tion 2.4. Only flows of chemicals are considered. Heat
The smallest subcomponents are called atomic units. flows allowing thermal coupling or multidomain mod-
The atomic units are connected by process streams. els would need an extension.
Material balances: A system of C linear equations,
reflecting the conservation of mass.
2.1 Connector class: process streams
Heat balance: A linear equation reflecting the conser-
A process stream S consisting of C substances has vation of energy.
C + 2 independent variables. It is characterized by the Mechanical equilibrium: The outlets have the same
list of variables pressure as the unit. With the exception of the mixer
S = {S. f , S.p, S.H}, and the pressure changer, the pressure of the unit
equals the pressure of its only inlet.
where S. f is an array of size C. See also Table 1. Thermal equilibrium: The enthalpy of the outlets
variable physical meaning SI unit
corresponds to the temperature of the unit. This rela-
f [i] ≥ 0 molar flow rate of substance i = 1 : C mol/s tion is expressed by nonlinear equations (equation of
p≥0 pressure Pa state). If the temperature is not an internal variable of
H enthalpy flowrate J/s the unit then these nonlinear equations are missing.
Table 1: The C + 2 variables characterizing a process Characterizing equations: These equations charac-
stream. terize how the unit works and cannot be changed.
Connections with other units: These equations de-
The graphical representation of process streams is scribe how the units are connected by equating the cor-
by arrows, as shown in Figure 1. responding variables of the involved streams.
Specifications: These equations make the steady state
S model of the unit well-defined. They usually corre-
spond to closed loop control systems. The form of
Figure 1: The graphical representation of stream S. these equations shows large variation: they can be triv-
ial equations as well as complicated nonlinear equa-
The units are connected by streams. The streams tions.
entering the unit are called inlets, while the streams
leaving it are called outlets. The causal flows reflect
the fact that the chemical process streams are directed,
the material can only flow into the direction specified. 2.4 Atomic units
[1] Johan Åkesson, Tove Bergdahl, Magnus Gäfvert, [11] N. Duro and F. Morilla. A Modelling Methodol-
and Hubertus Tummescheit. Modeling and Opti- ogy for Distillation Columns using Dymola and
mization with Modelica and Optimica Using the Simulink. In Applied Simulation and Modelling.
JModelica.org Open Source Platform. In Pro- ACTA Press, 2003.
ceedings of the 7th International Modelica Con-
ference, Como, Italy, 20-22 September 2009, pp. [12] Robert Fourer, David M. Gay, and Brian Wilson
29–38. Linköping University Electronic Press, Kernighan. AMPL: A Modeling Language for
Linköpings universitet, 2009. Mathematical Programming. Brooks/Cole USA,
2003.
[2] Johan Åkesson, Torbjörn Ekman, and Görel
Hedin. Implementation of a Modelica compiler [13] Peter Fritzson. Principles of Object-Oriented
using JastAdd attribute grammars. Science of Modeling and Simulation with Modelica 2.1.
Computer Programming, 75:21–38, 2010. Wiley-IEEE Press, 2004.
[3] Johan Åkesson. Languages and Tools for Op- [14] E.W. Jacobsen and S. Skogestad. Multiple steady
timization of Large-Scale Systems. PhD thesis, states in ideal two-product distillation. AIChE
Regler, nov 2007. Journal, 37:499–511, 1991.
[15] Andreas Joos, Karin Dietl, and Gerhard Schmitz.
Thermal separation: An approach for a model-
ica library for absorption, adsorption and rec-
tification. In Proceedings of the 7th Interna-
tional Modelica Conference, Como, Italy, 20-22
September 2009, pp. 804–813. Linköping Uni-
versity Electronic Press, Linköpings universitet,
2009.