Tutorial on Equation-Oriented Dynamic Chemical Engineering - - PowerPoint PPT Presentation

tutorial on equation oriented dynamic
SMART_READER_LITE
LIVE PREVIEW

Tutorial on Equation-Oriented Dynamic Chemical Engineering - - PowerPoint PPT Presentation

PASI 2008 Pan American Advanced Studies Institute Program on Process Systems Engineering Tutorial on Equation-Oriented Dynamic Chemical Engineering Departments Simulation using EMSO Argimiro R. Secchi GIMSCOP Rafael de Pelegrini Soares


slide-1
SLIDE 1

Mar del Plata August 12th, 2008

Tutorial on Equation-Oriented Dynamic Simulation using EMSO

GIMSCOP

Group of Integration, Modeling, Simulation, Control, and Optimization

  • f Processes

PASI 2008

Pan American Advanced Studies Institute Program

  • n Process Systems Engineering

Argimiro R. Secchi Rafael de Pelegrini Soares

Chemical Engineering Departments

slide-2
SLIDE 2

U F R G S

2

The Dream of a Process Engineer – Fully-Integrated System and Tools –

M a n a g e m e n t M

  • d

e l i n g a n d S i m u l a t i

  • n

C

  • n

t r

  • l

a n d O p t i m i z a t i

  • n

K n

  • w

l e d g e B a s e

Data Validation Gross-Errors Detection Steady-State Detection Data

Reconciliation Task Planning and Sequencing

Report Generator

Configuration and Visualization

Assessment Diagnosis Prevention and Treatment Regulatory Control Supervisory Control RTO and DRTO Data Reading Sensitivity Analysis Inferences Model Updating Model Validation Model Identification Model Building Decision Making Simulation

slide-3
SLIDE 3

U F R G S

3

Unified Modeling Environment

– A Necessary Condition –

Integrated Environment Dual Space

slide-4
SLIDE 4

U F R G S

4

An Example of System Integration

In this context, the Knowledge Base is the link between the two spaces Process + Regulatory Control NMPC D-RTO / RTO data pre-processing and dynamic data reconciliation model updating for D-RTO model updating for NMPC Production Planing inferences u(t) y(t) Y(t) u*(t) y*(t)

feed specification, product and market

Model server (rigorous, empiric, hybrid, reduced) d(t)

slide-5
SLIDE 5

U F R G S

5

CAPE Tools

A movement from Sequential Modular to Equation-Oriented (EO) tools is clear Key advantages of EO:

  • Models can be inspected
  • Models can be refined or reused
  • Same model as the source for several tasks: simulation, optimization,

parameter estimation, data reconciliation, etc. integrated environment Some disadvantages:

  • Lack of assistance in model development
  • It is very difficult to fix ill-posed models
slide-6
SLIDE 6

U F R G S

6

Outline

1. What is ESMO? 2. Building dynamic models 3. EMSO tutorial 4. Dynamic Degree of Freedom 5. Debugging techniques Equation-Oriented Dynamic Simulation using EMSO:

slide-7
SLIDE 7

U F R G S

7

  • 1. What is EMSO?

EMSO stands for “Environment for Modeling Simulation and Optimization” Development started in 2001, written in C++ language Available in Windows and Linux Models are written in an object-oriented modeling language Equation-oriented simulator and optimizer Computationally efficient for dynamic and steady-state simulations Continuous improvements through ALSOC project:

http://www.enq.ufrgs.br/alsoc

slide-8
SLIDE 8

U F R G S

8

slide-9
SLIDE 9

U F R G S

9

EMSO Key Features

Open source library of models Object-oriented modeling Built-in automatic and symbolic differentiation Automatic checking and conversion of units of measurement Solve high-index problem Perform consistency analysis (DoF, DDoF, initial condition) Integrated Graphical User Interface (GUI) Building blocks to create flowsheets Discrete event handling Multitask for concurrent and real-time simulations Very modular architecture and support to sparse algebra Multiplatform: win32 and posix Interface with user code written in C/C++ or Fortran Automatic documentation of models using hypertexts and LaTeX

slide-10
SLIDE 10

U F R G S

10

Steady-state simulations Dynamic simulations Steady-state optimizations Steady-state parameter estimations Dynamic parameter estimations Steady-state data reconciliations Process follow-up and inferences with OPC communication Build bifurcation diagrams (interface with AUTO for DAEs) Dynamic simulations with SIMULINK (interface with MATLAB) Add new solvers (DAE, NLA, NLP) Add external routines using the Plugins resource

What can I do with EMSO?

Steady-state simulations Dynamic simulations Steady-state optimizations Steady-state parameter estimations Dynamic parameter estimations Steady-state data reconciliations Process follow-up and inferences with OPC communication Build bifurcation diagrams (interface with AUTO for DAEs) Dynamic simulations with SIMULINK (interface with MATLAB) Add new solvers (DAE, NLA, NLP) Add external routines using the Plugins resource

slide-11
SLIDE 11

U F R G S

11

Thermodynamic and Physical Properties – Plugin

Data bank with about 2000 pure compounds Mixture properties calculation

slide-12
SLIDE 12

U F R G S

12

How can I install EMSO?

Download EMSO and VRTherm packages from http://www.enq.ufrgs.br/alsoc Run the setup programs Run EMSO Add the physical properties package using the Config Plugins option in the menu Select and example and run it

slide-13
SLIDE 13

U F R G S

13 To use a plug-in the user needs to register it through the menu Config Plugins Windows plug-in is a DLL file, and Linux plug-in is a SO file

Configuring Plugin

– VRTherm package: vrpp –

slide-14
SLIDE 14

U F R G S

14

Integrated GUI

– Running an example –

slide-15
SLIDE 15

U F R G S

15

  • 2. Building Dynamic Models

– Where dynamic simulation is necessary –

  • Batch and semi-batch processes

(Analysis, Control, Dynamic optimization, Optimal design, Parameter estimation, Start-up operations)

  • Dynamic real-time optimization (D-RTO)

(NMPC, Plant-wide optimization, Product transitions, Model updating, Virtual analyzers)

  • Advanced process control

(Control structure design, Model reduction, Controllability and operability, Model-based control, Controller

tuning, Nonlinear dynamics)

  • Startups, shutdowns and transitions

(Start-up strategies, Safety studies, Plant shutdown, Process transitions, Troubleshooting)

  • Process intensification

(Complex systems, Oscillatory motion, Reaction/separation processes, Auto-refrigerated reactors)

  • Teaching and training

(Classroom teaching, Operators training)

slide-16
SLIDE 16

U F R G S

16

Building Dynamic Models

– Equation-Oriented models –

In Equation-Oriented (EO) simulators a model has:

  • A set of model parameters (reaction order, valve constant, etc.)
  • A set of variables (temperatures, pressures, flow rates, etc.)
  • A set of equations (algebraic and differential) relating the variables

Problems in model building:

  • Number of equations and variables does not match
  • Equations of the model are inconsistent (linear dependence, etc.)
  • The number of initial conditions does not match (dynamic simulation)
slide-17
SLIDE 17

U F R G S

17

Building Dynamic Models

– Difficulties in Dynamic Simulation –

  • Reliable models
  • Truly standard interfaces and open source models
  • High-Index DAE systems
  • Large-Scale systems
  • Model consistency:
  • Degree of Freedom (DoF)
  • Dynamic Degree of Freedom (DDoF)
  • Units of measurement
  • Structural non-singularity
  • Consistent initial condition
slide-18
SLIDE 18

U F R G S

18

Non-isothermal CSTR

Fe , CAf , CBf , Tf Fwe , Twe Fws , Tw Fs , CA , CB , T V, T A

⎯→ ⎯k

B

Building Dynamic Models

– A simple example –

slide-19
SLIDE 19

U F R G S

19

In a non-isothermal continuous stirred tank reactor, with diameter of 3.2 m and level control, pure reactant is fed at 300 K and 3.5 m3/h with concentration

  • f 300 kmol/m3. A first order reaction occur in the reactor, with frequency factor
  • f 89 s-1 and activation energy of 6 x 104 kJ/kmol, releasing 7000 kJ/kmol of

reaction heat. The reactor has a jacket to control the reactor temperature, with constant overall heat transfer coefficient of 300 kJ/(h.m2.K). Assume constant density of 1000 kg/m3 and constant specific heat of 4 kJ/(kg.K) in the reaction

  • medium. The fully-open output linear valve has a constant of 2.7 m2.5/h.

Building Dynamic Models

– CSTR: process description –

slide-20
SLIDE 20

U F R G S

20

  • perfect mixture in the reactor and jacket;
  • negligible shaft work;
  • (-rA) = k CA;
  • constant density;
  • constant overall heat transfer coefficient;
  • constant specific heat;
  • incompressible fluids;
  • negligible heat loss to surroundings;
  • Δ(internal energy) ≈ Δ(enthalpy);
  • negligible variation of potential and kinetic energies;
  • constant volume in the jacket;
  • thin metallic wall with negligible heat capacity.

Building Dynamic Models

– CSTR: model assumptions –

slide-21
SLIDE 21

U F R G S

21

dt dV F F dt V d

s e f

ρ = ρ − ρ = ρ ) (

s e

F F dt dV − =

( )

) (

A A s f A e A A A

r V C F C F dt dV C dt dC V dt VC d − − − = + =

Mass balance in the reactor Overall: Component: (2)

V r C C F dt dC V

A A f A e A

) ( ) ( − − − =

(1)

e

F V = τ

(3)

Building Dynamic Models

– CSTR: modeling –

slide-22
SLIDE 22

U F R G S

22

(4)

( )

2 2

ˆ ˆ ˆ ˆ ˆ ˆ ˆ 2 2

f s e f f f f s s r s

v v d V U K F U P V gz F U PV gz q q w dt ⎛ ⎞ ⎛ ⎞ ⎡ ⎤ ρ + + φ = ρ + + + − ρ + + + + − − ⎜ ⎟ ⎜ ⎟ ⎣ ⎦ ⎜ ⎟ ⎝ ⎠ ⎝ ⎠

ˆ ˆ ˆ H U PV = +

ˆ ˆ ( ) ˆ ˆ ˆ

e f s r

d VH dH dV V H F H F H q q dt dt dt ρ ρ ρ ρ ρ = + = − + −

Energy balance in the reactor: where

ˆ ˆ ˆ ( )

e f r

dH V F H H q q dt ρ ρ = − + − q q T T Cp F dt dT VCp

r f e

− + − ρ = ρ ) (

Building Dynamic Models

– CSTR: modeling –

slide-23
SLIDE 23

U F R G S

23

(5) where

qr = (-ΔHr) V (-rA) k = k0 exp(–E/RT) (-rA) = k CA V = A h Fs = x Cv √ h Tw = f(T)

(7) (6) (8) (10) (12) Temperature control (14)

Building Dynamic Models

– CSTR: modeling –

At = A + π D h

(11)

q = U At (T – Tw) A = π D2/4

(9)

x = f(h)

Level control (13)

slide-24
SLIDE 24

U F R G S

24 variable units of measurement Fe, Fs m3 s-1 V m3 t, τ s CA, CAf kmol m-3 rA kmol m-3 s-1 ρ kg m-3 Cp kJ kg-1 K-1 T, Tf, Tw K qr, q kJ s-1 U kJ m-2 K-1 s-1 At, A m2 h, D m Cv m2.5 h-1 x – ΔHr, E kJ kmol-1 R kJ kmol-1 K-1 k, k0 s-1

Building Dynamic Models

– CSTR: consistency analysis –

slide-25
SLIDE 25

U F R G S

25

variables: Fe, Fs, V, t, CA, CAf, rA, ρ, Cp, T, Tf, Tw, qr, q, U, At, A, h, D, Cv, x, ΔHr, E, R, k, k0,τ 27 constants: ρ, Cp, U, D, Cv, ΔHr, E, R, k0 9 specifications: t 1 driving forces: Fe, Tf, CAf 3 unknown variables: Fs, V, CA, rA, T, Tw, qr, q, A, At, h, x, k, τ 14 equations: 14 Degree of Freedom = variables – constants – specifications – driving forces – equations = unknown variables – equations = 27 – 9 – 1 – 3 – 14 = 0 Initial condition: h(0), CA(0), T(0) 3 Dynamic Degree of Freedom (index < 2) = differential equations – initial conditions = 3 – 3 = 0

Building Dynamic Models

– CSTR: consistency analysis –

slide-26
SLIDE 26

U F R G S

26

Building Dynamic Models

– CSTR: EMSO version –

Running EMSO

Open MSO file

slide-27
SLIDE 27

U F R G S

27

Consistency Analysis

Results

slide-28
SLIDE 28

U F R G S

28

slide-29
SLIDE 29

U F R G S

29

Building Dynamic Models

– Checking Units of Measurement –

incompatible units

slide-30
SLIDE 30

U F R G S

30

  • 3. EMSO Tutorial

– Modeling Structure –

EMSO has 3 main entities in the modeling structure

FlowSheet – process model, is composed by a set of DEVICES DEVICES – components of a FlowSheet, an unit operation or an equipment Model – mathematical description of a DEVICE

slide-31
SLIDE 31

U F R G S

31

Model FlowSheet

Model: equation-based FlowSheet: component-based

EMSO Tutorial

– Modeling Structure –

streamPH

slide-32
SLIDE 32

U F R G S

32

The modeling and simulation of complex systems is facilitated by the use of the Object-Oriented concept The system can be decomposed in several components, each one described separately using its constitutive equations The components of the system exchange information through the connecting ports System Equipment Component

EMSO Tutorial

– Object-Oriented Modeling Language –

slide-33
SLIDE 33

U F R G S

33

Parameters and variables are declared within their valid domains and units using types created based on the built-in types: Real, Integer, Switcher, Plugin

EMSO Tutorial

– Object-Oriented Variable Types –

slide-34
SLIDE 34

U F R G S

34

EMSO Tutorial

– Model Components –

Including sub- models and types Automatic model documentation

Symbol of variable in LaTeX command for documentation

Basic sections to create a

  • math. model

Port location to draw a flowsheet connection

Input and output connections

slide-35
SLIDE 35

U F R G S

35

EMSO Tutorial

– FlowSheet Components –

Degree of Freedom Dynamic Degree of Freedom Simulation

  • ptions

Parameters of DEVICES

slide-36
SLIDE 36

U F R G S

36

Horizontal axis is always the independent variable (usually time)

EMSO Tutorial

– Simulation Results: graphics –

double-click

slide-37
SLIDE 37

U F R G S

37

Choose the file format Right-click the mouse button and select “Export Image”

EMSO Tutorial

– Simulation Results: exporting graphics –

slide-38
SLIDE 38

U F R G S

38

EMSO Tutorial

– Simulation Results: exporting data –

Choose the file format RLT: MATLAB/SCILAB XML: EXCEL/OpenOffice click

slide-39
SLIDE 39

U F R G S

39 Using EXCEL to analyze the results Results separated by devices

EMSO Tutorial

– Simulation Results: in spreadsheets –

slide-40
SLIDE 40

U F R G S

40

EMSO Tutorial

– Simulation Results: in MATLAB/SCILAB –

Using MATLAB to analyze the results

slide-41
SLIDE 41

U F R G S

41

EMSO Tutorial

– Building Block Diagrams: create file –

Selected components from physical properties package Devices found in the model library

slide-42
SLIDE 42

U F R G S

42

EMSO Tutorial

– Building Block Diagrams: select devices –

click to create a device drag & drop ports to create a connection When making a connection, only compatible ports become available to connect

slide-43
SLIDE 43

U F R G S

43

EMSO Tutorial

– Building Block Diagrams: set case study –

double-click Variable status: unknown (Evaluate) known (Specify) initial condition (Initial) estimate (Guess)

slide-44
SLIDE 44

U F R G S

44

EMSO Tutorial

– Building Block Diagrams: thermodynamic –

right-click

Available models In development: PC-SAFT

slide-45
SLIDE 45

U F R G S

45

EMSO Tutorial

– Building Block Diagrams: simulating –

slide-46
SLIDE 46

U F R G S

46

EMSO Tutorial

– Automatic Documentation –

Note: LaTeX must be installed.

slide-47
SLIDE 47

U F R G S

47

Check → Units of measurement → Structural non-singularity → Consistent initial conditions Degree of Freedom (DoF) = 0 (for simulation) > 0 (for optimization) Dynamic Degree of Freedom (DDoF) = number of given initial conditions

  • 4. Dynamic Degree of Freedom

– Consistency Analysis –

slide-48
SLIDE 48

U F R G S

48

Dynamic Degree of Freedom

– General Concept –

Given a system of DAE: F(t, y, y’) = 0 The Dynamic Degree of Freedom (DDoF) is the number of variables in y(t0) that can be assigned arbitrarily to compute a set of consistent initial conditions {y(t0), y’(t0)} of the DAE system. Is the true number of states of the system (or the system order of the DAE). Is the number of initial conditions that must be given. For low-index DAE system (index 0 and 1) the DDoF is equal to the number of differential equations. For high-index DAE system (index > 1) the DDoF is equal to the number

  • f differential variables minus the number of hidden constraints.
slide-49
SLIDE 49

U F R G S

49

Example: classical pendulum problem

Inconsistent initial condition:

(1) (2) (3) (4) (5)

Differentiating (5) and using (1) and (2): Differentiating (6) and using (1)–(5):

(6) (7)

Differentiating (7) and using (2), (3), (4), (6):

2 2 2

(0) (0) (0) (0) w z T L g y + + ⋅ ≠ ⋅

(8)

OK!

Hidden constraints:

Dynamic Degree of Freedom

– High-Index DAE System –

slide-50
SLIDE 50

U F R G S

50

Example: classical pendulum problem

(1) (2) (3) (4) (5) (6) (7) (8)

10 variables (y, y´) 8 equations 2 DDoF

(1) (2) (3) (4) (5) (1) (2) (3) (4) (6) (1) (2) (3) (4) (7) (1) (2) (3) (4) (8) Index 3 Index 2 Index 1 Index 0

Satisfies the inconsistent I.C.

Dynamic Degree of Freedom

– High-Index DAE System –

slide-51
SLIDE 51

U F R G S

51

Three general approaches:

1) Manually modify the model to obtain a lower index equivalent model 2) Integration by specifically designed high-index solvers (e.g., PSIDE, MEBDFI, DASSLC) 3) Apply automatic index reduction algorithms

Dynamic Degree of Freedom

– High-Index DAE: solution –

slide-52
SLIDE 52

U F R G S

52

Dynamic Degree of Freedom

– High-Index DAE: modeling –

slide-53
SLIDE 53

U F R G S

53

Dynamic Degree of Freedom

– High-Index DAE: consistency analysis –

slide-54
SLIDE 54

U F R G S

54

x

index-0 solver vs index-3 solver

Drift-off effect

L = 0.9 m , g = 9.8 m/s2 ∴ I.C.: x(0) = 0.9 m and w(0) = 0

Dynamic Degree of Freedom

– High-Index DAE: simulation –

Error propagation

slide-55
SLIDE 55

U F R G S

55

  • 5. Debugging Techniques

Questions to be answered to assist the user of a CAPE tool - debugging:

  • For an under-constrained model which variables can be fixed or specified?
  • For an over-constrained model which equations should be removed?
  • For dynamic simulations, which variables can be supplied as initial conditions?
  • How to report the inconsistencies making it easy to fix?

In other words, debugging methods need to go beyond degrees of freedom and the currently available index analysis methods

slide-56
SLIDE 56

U F R G S

56

Debugging Techniques

– Current Status –

Static models - Nonlinear Algebraic (NLA) systems:

  • Several structural analysis methods available on the literature
  • Most EO tools implement a degrees of freedom (DoF) and structural solvability

analysis but user assistance is very limited when ill-posed models are found Dynamic models - Differential Algebraic Equation (DAE) systems:

  • Currently available methods are limited to index and dynamic degrees of

freedom (DDoF) analysis

  • The well-known EO commercial tools have a high-index check which can fail

even for some simple low-index problems

slide-57
SLIDE 57

U F R G S

57

Debugging Techniques

– Bipartite Graphs –

Bipartite graphs can be used to solve combinatorial problems:

  • Tasks to machines
  • Classes to rooms
  • Equations to variables
  • Bipartite graph G(V = V

e ∪ Vv , E) have two

independent sets of vertices

  • Vertices in the same partition must not be

adjacent

  • We can have alternating and augmenting paths

1 2 3 4 5 6 7 8

Matching {{1,5}, {3,7}} w/ alternating path

slide-58
SLIDE 58

U F R G S

58

Debugging Techniques

– Bipartite Graphs: variable-equations –

Graph for variable-equation relationship

f1(x1) = 0 f2(x1, x2) = 0 f3(x1, x2) = 0 f4(x2, x3, x4) = 0 f5(x4, x5) = 0 f6(x3, x4, x5) = 0 f7(x5, x6, x7) = 0

variables values

  • r equations forms

are irrelevant

Maximum Matching Multiple Solutions

slide-59
SLIDE 59

U F R G S

59

Debugging Techniques

– Nonlinear Algebraic Equations –

Debugging Nonlinear Problems

Discover if there are over or under-constrained partitions Start from unconnected vertices and walk in alternating paths Dulmage and Mendelsohn (DM) decomposition

slide-60
SLIDE 60

U F R G S

60

Debugging Techniques

– Differential-Algebraic Equations –

A Simple Example Solution:

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

1 1 2

( ) (0) ( ) ( ) ( ) ( )

t

x t x a d b t x t b t τ τ = + + =

Only two differential variables Index-1 system Requires only one initial condition Initial condition must be x1 x1 is the only state of the model

slide-61
SLIDE 61

U F R G S

61

Debugging Techniques

– Bipartite Graphs: DAE system –

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

1

x

2

x

1

x′

2

x′

1

f

2

f Classic Algorithm

  • Who are the states?
  • Which variables should be specified as initial conditions?
slide-62
SLIDE 62

U F R G S

62

Debugging Techniques

– gPROMS output –

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

If only one initial condition is given (which is correct):

slide-63
SLIDE 63

U F R G S

63

Debugging Techniques

– gPROMS output –

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

If two initial condition are given (which is wrong):

slide-64
SLIDE 64

U F R G S

64

Debugging Techniques

– AspenDynamics output –

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

slide-65
SLIDE 65

U F R G S

65

Debugging Techniques

– New Algorithm: debugging DAE system –

slide-66
SLIDE 66

U F R G S

66

Debugging Techniques

– New Algorithm: debugging DAE system –

slide-67
SLIDE 67

U F R G S

67

Debugging Techniques

– Applying the New Algorithm –

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

1

x

2

x

1

x′

2

x′

1

f

2

f

2

f ′

All equations and all x´ are connected when it finishes Free variable nodes are the real states DM decomposition can be applied to the final matching Singularities are detected (classic algorithm runs indefinitely)

1

x′

2

x′

1

f

2

f

2

f ′

Classic Algorithm

slide-68
SLIDE 68

U F R G S

68

Debugging Techniques

– EMSO output –

1 2 2

( ) ( ) x x a t x b t ′ ′ − = =

If only one initial condition is given (which is correct):

slide-69
SLIDE 69

U F R G S

69

Debugging Techniques

– Applying the New Algorithm: high-index –

(1) (2) (3) (4) (5)

  • nly two states!
slide-70
SLIDE 70

U F R G S

70

Debugging Techniques

– Applying the New Algorithm: performance –

Dynamic model of a distillation column for the separation of isobutane from a mixture of 13 compounds

* Pentium M 1.7 GHz PC with 2 MB of cache memory, Ubuntu Linux 6.06

slide-71
SLIDE 71

U F R G S

71

What is coming next?

Tools

Model updating tool and development of virtual analyzer based on Constrained Extended Kalman Filter (CEKF) Model generation tool for predictive controllers

Features

Creation of discretization functions for integral-partial differential equations Implementation of MINLP solver interfaces

Technologies

Hessian evaluation by reverse-mode automatic differentiation New resources for incremental building of flowsheets in the G.U.I.

slide-72
SLIDE 72

U F R G S

72

Challenges

Robust strategies for on-line updating of dynamic models Dynamic data reconciliation and gross error detection Parameters selection and estimation Related topics:

  • Hybrid and rigorous modeling
  • Order reduction of nonlinear models
  • Fault diagnosis
  • NMPC tuning strategies
slide-73
SLIDE 73

U F R G S

73

Challenges

DAE solvers Reliable high-index (>3) solvers Automatic/guided selection

  • f feasible set of variables

for initial condition Index reduction with trajectory projection

  • nto hidden manifold
slide-74
SLIDE 74

U F R G S

74

Challenges

Integrated tool for D-RTO Multi-level dynamic simulator Simultaneous data reconciliation and parameter estimation tool Dynamic optimizer with adaptive grid Self-tuned nonlinear model predictive controller Specialist system

slide-75
SLIDE 75

U F R G S

75

Challenges

Systems Interoperability Truly CAPE-OPEN Heterogeneity and multi-platform Unified communication protocol Multi-processing and Shared-memory advantages

slide-76
SLIDE 76

U F R G S

76

Challenges

Complex systems Advances in process simulation + CFD Multi-scale modeling + simulation tools Bifurcation + control system design Hybrid modeling

slide-77
SLIDE 77

U F R G S

77

References

  • Biegler, L.T., A.M. Cervantes and A. Wächter. Advances in Simultaneous Strategies for Dynamic Process Optimization. Chemical

Engineering Science, 57, 575–593 (2002).

  • Charpentier, J.C. and T.F. McKenna. Managing Complex Systems: Some Trends for the Future of Chemical and Process
  • Engineering. Chemical Engineering Science, 59, 1617–1640 (2004).
  • Costa Jr., E.F., R.C. Vieira, A.R. Secchi and E.C. Biscaia Jr. Dynamic Simulation of High-Index Models of Batch Distillation
  • Processes. Journal of Latin American Applied Research, 32 (2) 155–160 (2003).
  • Marquardt, W. and M. Mönnigmann. Constructive Nonlinear Dynamics in Process Systems Engineering. Computers and Chemical

Engineering, 29, 1265–1275 (2005).

  • Martinson, W.S. and P.I. Barton. Distributed Models in Plantwide Dynamic Simulators. AIChE Journal, 47 (6) 1372–1386 (2001).
  • Rodrigues, R., R.P. SOARES and A.R Secchi. Teaching Chemical Reaction Engineering Using EMSO Simulator. Computer

Applications in Engineering Education, Wiley (2008).

  • Soares, R.P. and A.R. Secchi. EMSO: A New Environment for Modeling, Simulation and Optimization. ESCAPE 13, Lappeenranta,

Finlândia, 947 – 952 (2003).

  • Soares, R.P. and A.R. Secchi. Modifications, Simplifications, and Efficiency Tests for the CAPE-OPEN Numerical Open Interfaces.

Computers and Chemical Engineering, 28, 1611–1621 (2004).

  • Soares, R.P. and A.R. Secchi, Direct Initialisation and Solution of High-Index DAE Systems, ESCAPE 15, Barcelona, Spain, 157–

162 (2005).

  • Soares, R.P. and A.R. Secchi, Debugging Static and Dynamic Rigorous Models for Equation-oriented CAPE Tools, DYCOPS 2007,

Cancún, Mexico, v.2, 291–296 (2007).

  • Valle, E.C., R.P. Soares, T.F. Finkler, A.R. Secchi. A New Tool Providing an Integrated Framework for Process Optimization,

EngOpt 2008 - International Conference on Engineering Optimization, Rio de Janeiro, Brazil (2008).

slide-78
SLIDE 78

U F R G S

78

References

DAE Solvers:

DASSL: Petzold, l.R. (1989) http://www.enq.ufrgs.br/enqlib/numeric/numeric.html DASSLC: Secchi, A.R. and F.A. Pereira (1997), http://www.enq.ufrgs.br/enqlib/numeric/numeric.html MEBDFI: Abdulla, T.J. and J.R. Cash (1999), http://www.netlib.org/ode/mebdfi.f PSIDE: Lioen, W.M., J.J.B. de Swart, and W.A. van der Veen (1997), http://www.cwi.nl/cwi/projects/PSIDE/ SUNDIALS: R. Serban et al. (2004), http://www.llnl.gov/CASC/sundials/description/description.html

slide-79
SLIDE 79

U F R G S

79

Argimiro Resende Secchi, D.Sc. Evaristo Chalbaud Biscaia Jr, D.Sc. Jorge Otávio Trierweiler, D.Sc. Nilo Sérgio Medeiros Cardozo, D.Sc. Marcelo Farenzena, D.Sc. Rafael de Pelegrini Soares, D.Sc. Adriano Giraldi Fisch, M.Sc. Débora Jung Luvizetto, M.Sc. Edson Cordeiro do Valle, M.Sc Eduardo Moreira de Lemos, M.Sc. Euclides Almeida Neto, M.Sc. Gabriela Sporleder Straatmann, M.Sc. Gérson Balbueno Bicca, M.Sc. Gustavo Alberto Neumann, M.Sc.

Research Group

GIMSCOP - 2008

Luciane da Silveira Ferreira, M.Sc. Marcelo Escobar, M.Sc. Nina Paula Gonçalves Salau, M.Sc. Paula Betio Staudt, M.Sc. Ricardo Guilherme Duraiski, M.Sc. Tiago Fiorenzano Finkler, M.Sc. Anderson de Campos Paim, Eng. Andrea Cabral Farias, Eng. Antonio José V. Nascimento, Eng. Bruna Racoski, Eng. Cristine Alessandra Kayser, Eng. Fabio Cesar Diehl, Eng. Gustavo Rodrigues Sandri, Eng. Jovani Luiz Fávero, Eng. Luciano Forgiarini, Eng. Marcos Lovato Alencastro, Eng. Rafael Busato Sartor, Eng. Rodolfo Rodrigues, Eng. Thais Machado Farias, Eng. Bruno Cardozo Mohler, I.C. Caio Felippe Curitiba Marcellos, I.C. Ivana Martins, I.C. Josias José Junges, I.C. Luiza Gueller Zardin, I.C. Maria Aparecida Paula Lima, I.C. Sara Scomazzon Masiero, I.C. Igor Rodacovski, Tec. Inf. Irma Maria Bueno, Sec.

slide-80
SLIDE 80

U F R G S

80 Process Simulation and Optimization Lab

  • Prof. Dr. Rafael de Pelegrini Soares
  • Phone: +55-51-3308-4166
  • E-mail: rafael@enq.ufrgs.br
  • http://www.enq.ufrgs.br/labs/lasim.html

... thank you for your attention! PASI 2008

Pan American Advanced Studies Institute Program

  • n Process Systems Engineering

Process Modeling, Simulation and Control Lab

  • Prof. Dr. Argimiro Resende Secchi
  • Phone: +55-21-2562-8349
  • E-mail: arge@peq.coppe.ufrj.br
  • http://www.peq.coppe.ufrj.br/Areas/Modelagem_e_simulacao.html

http://www.enq.ufrgs.br/alsoc

slide-81
SLIDE 81

U F R G S

81

Extra slides

slide-82
SLIDE 82

U F R G S

82

Flash multi-component m V, y L, x F, z, Pf, Tf

T, P

Building Dynamic Models

– Another simple example –

slide-83
SLIDE 83

U F R G S

83

A liquid-phase mixture of C hydrocarbons, at given temperature and pressure, is heated and continuously fed into a vessel drum at lower pressure, occurring partial vaporization. The liquid and vapor phases are continuously removed from the vessel through level and pressure control valves, respectively. Determine the time evolution of liquid and vapor stream composition and the vessel temperature and pressure, due to variations in the feed stream, keeping the heating rate constant.

Building Dynamic Models

– FLASH: process description –

slide-84
SLIDE 84

U F R G S

84

  • negligible vapor holdup (no dynamics in vapor phase);
  • thermodynamic equilibrium (ideal stage);
  • no droplet drag in vapor stream;
  • negligible heat loss to surroundings;
  • Δ(internal energy) ≈ Δ(liquid-phase enthalpy);
  • perfect mixture in both phases.

Building Dynamic Models

– FLASH: model assumptions –

slide-85
SLIDE 85

U F R G S

85

dm F V L dt = − −

( )

i i i i

d m x F z V y L x dt = − −

i i i

x K y =

Overall mass balance (molar base): (1) (2) i = 1, 2, ..., C Component mass balance: Equilibrium: Ki = f(T, P, x, y) (3) i = 1, 2, ..., C (4) i = 1, 2, ..., C Molar fraction:

=

=

C i i

x

1

1

(5)

Building Dynamic Models

– FLASH: modeling –

slide-86
SLIDE 86

U F R G S

86

Exercícios de Modelagem

Energy balance: (6)

( )

f

d m h F h q V H L h dt = + − −

Enthalpies: h = f(T, P, x) H = f(T, P, y) hf = f(Tf, Pf, z) (7) (8) (9) Controllers: L = f(m) V = f(P) (10) (11)

slide-87
SLIDE 87

U F R G S

87

variable units of measurement m kmol F, L, V kmol s-1 t s xi, yi, zi kmol kmol-1 Ki – T, Tf K P, Pf kPa q kJ s-1 h, H, hf kJ kmol-1

Building Dynamic Models

– FLASH: consistency analysis –

slide-88
SLIDE 88

U F R G S

88

variables: m, F, L, V, t, xi, yi, zi, Ki, T, Tf, P, Pf, q, h, H, hf 13+4C constants: 0 specifications: q, t 2 driving forces: F, zi, Tf, Pf 3+C unknown variables: m, L, V, xi, yi, Ki, T, P, h, H, hf 8+3C equations: 8+3C Degree of Freedom = variables – constants – specifications – driving forces – equations = unknown variables – equations = (13+4C) – 0 – 2 – (3+C) – (8+3C) = 0 Initial condition: m(0), xi(0), T(0) 2+C Dynamic Degree of Freedom (index < 2) = differential equations – initial conditions = (2+C) – (2+C) = 0

Building Dynamic Models

– FLASH: consistency analysis –

slide-89
SLIDE 89

U F R G S

89

Building Dynamic Models

– FLASH: EMSO version –

Running EMSO

Note: file

Sample_flash_pid.mso has

level and pressure controllers.

slide-90
SLIDE 90

U F R G S

90

slide-91
SLIDE 91

U F R G S

91

slide-92
SLIDE 92

U F R G S

92

Standard Interfaces

CAPE-OPEN

slide-93
SLIDE 93

U F R G S

93

CAPE OPEN

Example of CAPE-OPEN: DyOS (Dynamic Optimization Software) - Marquardt’s group (2000)

gPROMS

slide-94
SLIDE 94

U F R G S

94

CAPE OPEN

Another example of CAPE-OPEN: EMSO (Environment for Modeling, Simulation and Optimization) - Soares and Secchi (2004)

methanol plant

CORBA Object Bus

EMSO B EMSO A

ESO ESO

EMSO

ESO

slide-95
SLIDE 95

U F R G S

95

Other available tools and features

slide-96
SLIDE 96

U F R G S

96

Optimization

slide-97
SLIDE 97

U F R G S

97

Parameter Estimation

slide-98
SLIDE 98

U F R G S

98

Data Reconciliation

slide-99
SLIDE 99

U F R G S

99

Interface EMSO-OPC

slide-100
SLIDE 100

U F R G S

100

Interface EMSO-OPC

Simulator Plant

slide-101
SLIDE 101

U F R G S

101

Interface EMSO-AUTO

parameters System of equations Jacobian matrix First steady-state solution

slide-102
SLIDE 102

U F R G S

102

Interface EMSO-MATLAB

slide-103
SLIDE 103

U F R G S

103

Interface EMSO-MATLAB

slide-104
SLIDE 104

U F R G S

104

Interface EMSO-CFD

Momentum Balance Overall heat transfer coefficient evaluation Energy Balance Mass Balance