EQE038 – Simulação e Otimização de Processos Químicos

85
1 EQE038 – Simulação e Otimização de Processos Químicos Argimiro R. Secchi – Aula 2 – Concepts of modeling and simulation. Object-oriented modeling in EMSO. EQ/UFRJ 30 de agosto de 2013

description

EQE038 – Simulação e Otimização de Processos Químicos. – Aula 2 – Concepts of modeling and simulation. Object-oriented modeling in EMSO. Argimiro R. Secchi. EQ/UFRJ 30 de agosto de 2013. Applications of Process Modeling. applications. tools. - PowerPoint PPT Presentation

Transcript of EQE038 – Simulação e Otimização de Processos Químicos

Page 1: EQE038 – Simulação e Otimização de Processos Químicos

1

EQE038 – Simulação e Otimização de Processos Químicos

Argimiro R. Secchi

– Aula 2 –

Concepts of modeling and simulation. Object-oriented modeling in EMSO.

EQ/UFRJ

30 de agosto de 2013

Page 2: EQE038 – Simulação e Otimização de Processos Químicos

2

Applications of Process ModelingApplications of Process Modeling

tools

applications

Page 3: EQE038 – Simulação e Otimização de Processos Químicos

3

• Market: if the price of a product increases, what will be the reduction of demand and what should be the new scheduling of production?

• Production planning: having several sources of raw material and several manufacturing plants, how to distribute the raw material among these plants and what products each plant has to produce?

• Synthesis: what process should be used for manufacturing a given product?

• Design: what type and size of equipment are necessary to produce a given product?

• Operation: what operating condition will maximize the production of a product?

• Control: how a process input can be manipulated to keep a measured process output at its desired value?

• Safety: if an equipment failure occur, what will be the impact over the operators and other equipments?

• Environment: how long will take to biodegrade a contaminated soil by dangerous waste?

Some questions that could be answered with these applications

Some questions that could be answered with these applications

Page 4: EQE038 – Simulação e Otimização de Processos Químicos

4

Difficulties in Dynamic SimulationDifficulties in Dynamic Simulation

• Reliable 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

Page 5: EQE038 – Simulação e Otimização de Processos Químicos

5

Modeling in Latin: modus = a measure, a small representation of a designed or existing object.

from dictionary: a mathematical or physical system, obeying certain specified conditions, whose behavior is used for understanding a physical, biological or social system, with analogy in some aspects. Is only an approximate representation of a real system.

Process model: a set a equations and specifications that allows to predict the behavior of a process.

empirical relationsfirst principles or mechanistic model

Concepts of Modeling and SimulationConcepts of Modeling and Simulation

Page 6: EQE038 – Simulação e Otimização de Processos Químicos

6

Model BuildingModel Building

A mathematical 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 do not match (DoF 0)

• Equations of the model are inconsistent (linear dependence, UOM, etc.)

• The number of initial conditions and DDoF do not match

Page 7: EQE038 – Simulação e Otimização de Processos Químicos

7

Modeling ToolsModeling Tools

The available tools for process modeling may be classified into:

• Block-Oriented

focus on the flowsheet topology using standardized unit models and streams to link these unit models

• Equation-Oriented

rely purely on mathematical rather than phenomena-based descriptions, making difficult to customize and reuse existing models

• Object-Oriented

Models are recursively decomposed into a hierarchy of sub-models and inheritance concepts are used to refine previously defined models into new models

(Bogusch and Marquardt, 1997)

Page 8: EQE038 – Simulação e Otimização de Processos Químicos

8

Object-Oriented ModelingObject-Oriented ModelingA process flowsheet model can be hierarchically decomposed:

Plant

Sep

arat

ion

Sys

tem

Pretreat. System

Reaction System

Separation System

Co

lum

n 1

Co

lum

n 2

Co

lum

n 3

Column

Feed Tray

Linked Trays

Linked Trays

Condenser

Splitter

Pump

Rebolier

Linked Trays

Tray

Tray

Tray

Tray

Page 9: EQE038 – Simulação e Otimização de Processos Químicos

9

Object-Oriented ModelingObject-Oriented Modeling

Tray

mass balance

energy balance

thermodynamic equilibrium

mol fraction normalizationabs

tra

ct m

ode

l

liquid flow model

vapor flow model con

cret

e m

ode

l (id

ea

l tra

y)

efficiency model

con

cret

e m

ode

l (re

al tr

ay)

Page 10: EQE038 – Simulação e Otimização de Processos Químicos

10

Object-Oriented ModelingObject-Oriented Modeling

Abstract models: are models that embody coherent and cohesive, but incomplete concepts, and in turn, make these characteristics available to their specializations via inheritance. While we would never create instances (devices) of abstract models, we most certainly would make their individual characteristics available to more specialized models via inheritance.

Concrete models: are complete models, usually derived from abstract models, ready to be instantiated, i.e., we can create devices (e.g., equipments) of concrete models.

Model types

Page 11: EQE038 – Simulação e Otimização de Processos Químicos

11

Object-Oriented ModelingObject-Oriented Modeling

Inheritance: is the process whereby one object acquires (gets, receives) characteristics from one or more other objects.

Aggregation: is the process of creating a new object from two or more other objects, or an object that is composed of two or more other objects.

OOM main concepts

Feed Tray

Linked Trays

Linked Trays

Condenser

Splitter

Pump

Rebolier

Column model = Condenser + Splitter + Pump + Linked Trays + Feed Tray + Reboiler

Page 12: EQE038 – Simulação e Otimização de Processos Químicos

12

Object-Oriented ModelingObject-Oriented Modeling

• ABACUSS II (Barton, 1999)

• ASCEND (Piela, 1989)

• Dymola (Elmqvist, 1978)

• EcosimPro (EA Int. & ESA, 1999)

• EMSO (Soares and Secchi, 2003)

• gPROMS/Speedup (Barton and Pantelides, 1994)

• Modelica (Modelica Association, 1996)

• ModKit (Bogusch et al., 2001)

• MPROSIM (Rao et al., 2004)

• Omola (Andersson, 1994)

• ProMoT (Tränkle et al., 1997)

Examples of general-purpose object-oriented modeling languages:

Page 13: EQE038 – Simulação e Otimização de Processos Químicos

13

StreamsInlet Material stream feeding the tankOutlet Material stream leaving the tankParametersk Valve constantD Hydraulic diameter of the tankVariablesA Tank cross section areaV Tank volumeh Tank levelDevices: source, tank, sink

Available model of the tank>>> Model with circular cross section>>> Model with square cross section

Object-Oriented ModelingObject-Oriented Modeling

A simpler example

Level Tank

source

sink

Page 14: EQE038 – Simulação e Otimização de Processos Químicos

14

Object-Oriented ModelingObject-Oriented Modeling

Model equations

Fin

Fin

Fin

Fout

Fout

Fout

in out

dVF F

dt mass balance:

outF k hvalve equation:

V A hliquid volume:

Inheritance

Page 15: EQE038 – Simulação e Otimização de Processos Químicos

15

Object-Oriented ModelingObject-Oriented Modeling

using "types";

Model Tank_Basic

PARAMETERS

k as Real (Brief=“Valve constant", Unit=’m^2.5/h’, Default = 12);

D as length (Brief=“Tank hydraulic diameter", Default = 4);

VARIABLES

in Fin as flow_vol (Brief=“Feed flow rate");

out Fout as flow_vol (Brief =“Output flow rate");

A as area (Brief=“Cross section area");

V as volume (Brief=“Liquid volume");

h as length (Brief=“Tank level");

EQUATIONS

“Mass balance“ Fin - Fout = diff(V);

“Valve equation“ Fout = k * sqrt(h);

“Liquid volume“ V = A * h;

end

EMSO:

Fin

Fout

Abstract model

in out

dVF F

dt mass balance:

outF k hvalve equation:

V A hliquid volume:

Page 16: EQE038 – Simulação e Otimização de Processos Químicos

16

Object-Oriented ModelingObject-Oriented Modeling

Model Tank_Square as Tank_Basic

EQUATIONS

“Cross section area“ A = D^2;

end

EMSO

Concrete models

Model Tank_Circular as Tank_Basic

PARAMETERS

Pi as Real (Default = 3.1416);

EQUATIONS

“Cross section area" A = (Pi * D^2) / 4;

end

Inheritance

FinFin

FoutFout

Page 17: EQE038 – Simulação e Otimização de Processos Químicos

17

Object-Oriented ModelingObject-Oriented Modeling

using "tank_oom";FlowSheet TanksDEVICES source as Feed; T_c as Tank_Circular; T_sq as Tank_Square; sink as Sink;CONNECTIONS source.F to T_c.Fin; T_c.Fout to T_sq.Fin; T_sq.Fout to sink.F;SET T_c.D = 3 * ’m’; T_sq.D = 3 * ’m’;SPECIFY source.F = 20 * ’m^3/h’;INITIAL T_c.h = 1 * ’m’; T_sq.h = 2 * ’m’;OPTIONS TimeStart = 0; TimeEnd = 20; TimeStep = 0.5; TimeUnit = ’h’;end

Fout

Fin

Fout

source

sink

Flowsheet EMSO:

Page 18: EQE038 – Simulação e Otimização de Processos Químicos

18

Object-Oriented ModelingObject-Oriented Modeling

Model switching

Model Tank_Section as Tank_Basic

PARAMETERS

Pi as Real (Default = 3.1416);

Section as Switcher (Valid = ["Circular", "Square"],

Default = "Circular");

EQUATIONS

switch Section

case "Circular":

“Cross section area" A = (Pi * D^2)/4;

case "Square":

“Cross section area" A = D^2;

end

end

using "tank_oom";FlowSheet Tanks2DEVICES source as Feed; T_c as Tank_Section; T_sq as Tank_Section; sink as Sink;CONNECTIONS source.F to T_c.Fin; T_c.Fout to T_sq.Fin; T_sq.Fout to sink.F;SET T_c.D = 3 * ’m’; T_sq.D = 3 * ’m’; T_c.Section = ”Circular”; T_sq.Section = ”Square”;SPECIFY source.F = 20 * ’m^3/h’;INITIAL T_c.h = 1 * ’m’; T_sq.h = 2 * ’m’;OPTIONS TimeStart = 0; TimeEnd = 20; TimeStep = 0.5; TimeUnit = ’h’;end

Page 19: EQE038 – Simulação e Otimização de Processos Químicos

19

Object-Oriented ModelingObject-Oriented Modeling

Aggregation

Level Tank

source

sink

P0

P0

P

Tank model

in out

dVF F

dt mass balance:

V A hliquid volume:

0P P g h outlet pressure:

out

PF k

g

valve equation:

Valve model

in outP P P

in outF Fmass balance:

pressure drop:

Page 20: EQE038 – Simulação e Otimização de Processos Químicos

20

Object-Oriented ModelingObject-Oriented Modeling

using "types";

Model Tank_Basic

PARAMETERS

D as length (Brief=“Tank hydraulic diameter", Default = 4);

rg as Real (Brief=“rho * g", Unit =’kg/(m*s)^2’, Default = 1e4);

VARIABLES

in Sin as stream (Brief=“Inlet stream");

out Sout as stream (Brief =“Outlet stream");

A as area (Brief=“Cross section area");

V as volume (Brief=“Liquid volume");

h as length (Brief=“Tank level");

valve as Valve (Brief=“Valve model");

CONNECTIONS

Sout to valve.Sin;

EQUATIONS

“Mass balance“ Sin.F – Sout.F = diff(V);

“Liquid volume“ V = A * h;

“Outlet pressure“ Sout.P = Sin.P + rg * h;

end

Tank model with valve Valve modelusing "types";

Model Valve

PARAMETERS

k as Real (Brief=“Valve constant",

Unit=’m^2.5/h’, Default = 12);

rg as Real (Brief=“rho * g",

Unit =’kg/(m*s)^2’, Default = 1e4);

VARIABLES

in Sin as stream (Brief=“Inlet stream");

out Sout as stream (Brief =“Outlet stream");

DP as press_delta (Brief=“Pressure drop");

EQUATIONS

“Mass balance“ Sin.F = Sout.F;

“Valve equation“ Sout.F = k * sqrt(DP/rg);

“Pressure drop“ DP = Sin.P – Sout.P;

end

Page 21: EQE038 – Simulação e Otimização de Processos Químicos

21

Object-Oriented ModelingObject-Oriented Modeling

using "tank_valve_oom";FlowSheet TanksDEVICES source as Feed; T_c as Tank_Circular; T_sq as Tank_Square; sink as Sink;CONNECTIONS source.Sout to T_c.Sin; T_c.valve.Sout to T_sq.Sin; T_sq.valve.Sout to sink.Sin;SET T_c.D = 3 * ’m’; T_sq.D = 3 * ’m’;SPECIFY source.Sout.F = 20 * ’m^3/h’; source.Sout.P = 1 * ’atm’; T_c.valve.Sout.P = 1 * ’atm’; sink.Sin.P = 1 * ’atm’;INITIAL T_c.h = 1 * ’m’; T_sq.h = 2 * ’m’;OPTIONS TimeStart = 0; TimeEnd = 20; TimeStep = 0.5; TimeUnit = ’h’;end

Flowsheet

Page 22: EQE038 – Simulação e Otimização de Processos Químicos

22

Modeling workshopModeling workshop

Model equations

in out

dVF F

dt mass balance:

outF k hvalve equation:

Fin

Fout

h

A = h (D h)

2

2 3

D hV h

liquid volume:

V A h

Fin

Fin

Fin

Fout

Fout

Fout

Page 23: EQE038 – Simulação e Otimização de Processos Químicos

23

Flowsheet

Modeling workshopModeling workshop

Fi

n

Fout

source

Fout

Fout

h

Fo

ut

sink

= 20 m3/h

D = 3 m

h(0) = 1 m

D = 3 m

h(0) = 2 m

D = 3 m

h(0) = 2.5 m

Page 24: EQE038 – Simulação e Otimização de Processos Químicos

24

Elementos Básicos na ModelagemElementos Básicos na Modelagem

1.Descrição do processo e definição do

problema

2.Teoria e aplicação das leis fundamentais

3.Hipóteses e considerações simplificadoras

4.Equacionamento

5.Análise de Consistência

6.Solução desejada

7.Matemática e computação

8.Solução e validação

Definir o Modelo

Construir o Modelo

Validar o Modelo

Page 25: EQE038 – Simulação e Otimização de Processos Químicos

25

1. Process Description and Problem Definition1. Process Description and Problem Definition

• Process Description– Process objectives– Process flowsheet– Process operation

• unit operations and control

• Problem Definition– Simulation objectives– Simulation applications

ModelingModeling

Page 26: EQE038 – Simulação e Otimização de Processos Químicos

26

Process DescriptionProcess DescriptionExample: level tank

h

Fout

Fin

V

A liquid flows in and out of a tank due to gravitational forces.

We wish to analyze the volume, height and flowrate variations in

the tank (system response) as function of feed disturbances.

ModelingModeling

Page 27: EQE038 – Simulação e Otimização de Processos Químicos

27

2. Fundamental Laws: Theory and Applications2. Fundamental Laws: Theory and Applications

t

v ( . )

advection pressure forces viscous forces gravitational forces

( )[ . ] [ . ]

vv v P g

t

2 2

advection conduction gravit. forces work pressure forces work viscous forces work

1 1ˆ ˆ. ( . ) . ( . ) ( .[ . ])2 2

U v v U v q g v Pv vt

- mass conservation

- momentum conservation

- energy conservation

• Bases to be used in the modeling

ModelingModeling

Page 28: EQE038 – Simulação e Otimização de Processos Químicos

28

Modeling Levels

Page 29: EQE038 – Simulação e Otimização de Processos Químicos

29

Modelo Microscópico

Modelo de Gradientes Múltiplos

Modelo de Máximo Gradiente

Modelo de Macroscópico

Modeling Levels

Page 30: EQE038 – Simulação e Otimização de Processos Químicos

30

3. Simplifying Assumptions3. Simplifying Assumptions

- constant specific mass

- isothermal

- perfect mixture

- outF k h

• Establish the assumptions and simplifications

• Define the model limitations

ModelingModeling

Page 31: EQE038 – Simulação e Otimização de Processos Químicos

31

4. Mathematical Model4. Mathematical Model

• Data mining for simulation– Collect data and information of the studied system– Identify the engineering unit of measurements– Specify operating procedures– Specify the operating regions of the variables

• Memory of Calculation– Mathematical model– Define unit of measurements of variables and parameters– Define and specify free variables– Define and determine values of parameters– Define and establish initial conditions

ModelingModeling

Page 32: EQE038 – Simulação e Otimização de Processos Químicos

32

Mathematical ModelMathematical Model

First Principles

Models

Conservation laws

XV

dt

dX

Fdt

dV

)T(TρVC

UAT)(T

V

F

dt

dTc

pe

Empirical Models

Neural Nets

Fuzzy Logic

Parametric

e(t)D(q)

C(q)u(t)

F(q)

B(q)y(t)A(q)

Hybrid Models

Page 33: EQE038 – Simulação e Otimização de Processos Químicos

33

• Build process equipment models– Identify and create abstract and concrete models– Declare variables and parameters– Write model equations– Compose the equipment model via inheritance and aggregation

• Build process flowsheet– Declare flowsheet devices– Define process connections– Set process parameters values– Specify process free variables– Establish initial conditions– Establish simulation options

Mathematical ModelMathematical Model

In the simulator

ModelingModeling

Page 34: EQE038 – Simulação e Otimização de Processos Químicos

34

Fin

Fin

Fin

Fout

Fout

Fout

in out

dVF F

dt mass balance:

outF k hvalve equation:

V A hliquid volume:

Mathematical ModelMathematical Model

(1)

(2)

(3)

(4)

Page 35: EQE038 – Simulação e Otimização de Processos Químicos

35

5. Consistency Analysis5. Consistency Analysis

• Model consistency analysis for unit of measurements (UOM)

• Degree of freedom analysis

• Dynamic degree of freedom analysis

variable UOM

Fin, Fout m3 h-1

V m3

A m2

h, D m

k m2.5 h-1

t h

equations

(1): [m3 h-1] – [m3 h-1] = [m3] / [h]

(2): [m3 h-1] = [m2.5 h-1] ([h])0.5

(3): [m3] = [m2] [m]

(4): [m2] = ([m])2

ModelingModeling

Page 36: EQE038 – Simulação e Otimização de Processos Químicos

36

variables: Fin, Fout, V, A, h, D, k, t 8

constants: k, D 2

specifications: t 1

driving forces: Fin 1

unknown variables: V, h, A, Fout 4

equations: 4

Degree of Freedom = variables – constants – specification – driving forces –

equations = unknown variables – equations = 8 – 2 – 1 – 1 – 4 = 0

Dynamic Degree of freedom (index < 2) = differential equations = 1

Needs 1 initial condition: h(0) 1

Consistency AnalysisConsistency Analysis

ModelingModeling

Page 37: EQE038 – Simulação e Otimização de Processos Químicos

37

For the given example and initial condition (h0 or V0), we wish to analyze h(Fin), V(Fin) and Fout(Fin).

6. Desired Solution6. Desired Solution

• Plan case studies• Define:

– Objectives of the study– Problems to be solved– Evaluation criteria

ModelingModeling

Page 38: EQE038 – Simulação e Otimização de Processos Químicos

38

7. Computation7. Computation

• Define the desired accuracy

• Specify the simulation time and reporting interval

• Verify the necessity of specialized solvers (high-index problems)

ModelingModeling

Page 39: EQE038 – Simulação e Otimização de Processos Químicos

39

• Analyze simulation results

• Analyze state variables dynamics

• Test model fitting with plant data

– Compare simulation x plant

hexp

hcalc

8. Solution and Validation8. Solution and Validation

ModelingModeling

Page 40: EQE038 – Simulação e Otimização de Processos Químicos

40

• Check output sensitivity to input disturbances

• Carry out parametric sensitivity analysis

• Analyze output data with statistical techniques

• Verify results coherence

• Document obtained results

Solution and ValidationSolution and Validation

ModelingModeling

Page 41: EQE038 – Simulação e Otimização de Processos Químicos

41

• Start with a simple model and gradually increase complexity when necessary;

• The model should have sufficient details to capture the essence of the studied system;

• It is not necessary to reproduce each element of the system;

• Models with excessive details are expensive, difficult to implement and to solve;

• Interact with people that operate the equipment;

• Deeply understand the process behavior.

RemarksRemarks

ModelingModeling

Page 42: EQE038 – Simulação e Otimização de Processos Químicos

42

– A simple in EMSO –– A simple in EMSO –

Starting EMSO

Page 43: EQE038 – Simulação e Otimização de Processos Químicos

43

Page 44: EQE038 – Simulação e Otimização de Processos Químicos

44

ModelModel

Page 45: EQE038 – Simulação e Otimização de Processos Químicos

45

EquationsEquationsThe order the equations The order the equations

appear in the model do not appear in the model do not mattermatter

Equivalent EquationsEquivalent EquationsCan be written in any Can be written in any

user desired formuser desired form

ModelLanguage – Equation-based system

ModelLanguage – Equation-based system

Page 46: EQE038 – Simulação e Otimização de Processos Químicos

46

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

SystemSystem

EquipmentEquipment

ComponentComponent

ModelLanguage – Object-Oriented Modeling

ModelLanguage – Object-Oriented Modeling

Page 47: EQE038 – Simulação e Otimização de Processos Químicos

47

Model ComponentsModel Components

Including sub- models and types

Automatic model documentation

Symbol of variable in LaTeX command for

documentation

Basic sections to create a

math. modelPort location to draw a flowsheet connection

Input and output connections

Page 48: EQE038 – Simulação e Otimização de Processos Químicos

48

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

Basic Variable Types in a ModelBasic Variable Types in a Model

Page 49: EQE038 – Simulação e Otimização de Processos Químicos

49

Building a Model: A simple example – level tank

StreamsInlet Material stream feeding the tankOutlet Material stream leaving the tankParametersk Valve constantD Hydraulic diameter of the tankVariablesA Tank cross section areaV Tank volumeh Tank levelDevices: source, tank, sink

Available model of the tank>>> Model with circular cross section>>> Model with square cross section

Page 50: EQE038 – Simulação e Otimização de Processos Químicos

50

Material Stream Modeling

The material stream carries the information entering and leaving the

equipment

VARIABLESF volumetric flowrateT temperatureP pressure

Source Source - component that has a feed material stream.It has an output connectionoutput connection

SinkSink - component that receives an output material stream. It has an input connectioninput connection

SourceSource

SinkSink

Page 51: EQE038 – Simulação e Otimização de Processos Químicos

51

Inlet Feed material stream to the tankFin inlet volumetric flowrateTin inlet temperaturePin inlet pressure

Outlet Output material stream from the tankFout outlet volumetric flowrateTout outlet temperaturePout outlet pressure

Level Tank Modeling

2

2

Mass balance

Valve equation

Thermal equilibrium

Mechanical equilibrium

Area

if circular4

if square

in out

out

in out

in out

dVF F

dt

F k h

T T

P P

DA

D

Page 52: EQE038 – Simulação e Otimização de Processos Químicos

52

Fin

Fin

Fin

Fout

Fout

Fout

Level Tank: Inheritance

Basic tank

Circular tank Square tank

Page 53: EQE038 – Simulação e Otimização de Processos Químicos

53

MenuNew

Model

File Name

Destination

Creating a MSO file for Model

Page 54: EQE038 – Simulação e Otimização de Processos Químicos

54

using including references to other files.

Model a new model is declared with the keyword Model and its name.

a model contains a few basic sections:

PARAMETERSsection which defines the

parameters of the model.VARIABLES

section which defines the variables of the model.EQUATIONS

section which describes the model equations.

Creating a Model using the template

Page 55: EQE038 – Simulação e Otimização de Processos Químicos

55

Including Including pre-defined pre-defined

types of types of EMSOEMSO

Model Model DocumentationDocumentation

selecting the selecting the desired unit of desired unit of

measure measure

Symbol of Symbol of variable variable

are LaTeX are LaTeX commandscommands

Using the types defined Using the types defined in the file “types.mso”in the file “types.mso”

Creating a Material Stream Model

Page 56: EQE038 – Simulação e Otimização de Processos Químicos

56

Using the Using the same filesame file

Output Output ConnectionConnection

Creating a Source Stream Model

Model Model DocumentationDocumentation

Page 57: EQE038 – Simulação e Otimização de Processos Químicos

57

Creating a Sink Stream Model

Using the Using the same filesame file

Input Input ConnectionConnection

Model Model DocumentationDocumentation

Page 58: EQE038 – Simulação e Otimização de Processos Químicos

58

ReferenceReference

Model Model PortsPorts

Creating new Creating new UOMUOM

EMSO Built-In FunctionEMSO Built-In FunctionEMSOquickRef.pdf

Creating a Basic Tank Model

Page 59: EQE038 – Simulação e Otimização de Processos Químicos

59

InheritanceInheritanceModel inherits all the Model inherits all the attributes of the class attributes of the class from which it derivesfrom which it derives

SETSETDefining Defining values for values for parametersparameters

EquationEquationWriting the particular Writing the particular

equations modelequations model

Creating the Circular Tank Model

Using the Using the same filesame file

Page 60: EQE038 – Simulação e Otimização de Processos Químicos

60

Creating the Square Tank Model

Using the Using the same filesame file

InheritanceInheritanceModel inherits all the Model inherits all the attributes of the class attributes of the class from which it derivesfrom which it derives

EquationEquationWriting the particular Writing the particular

equations modelequations model

Page 61: EQE038 – Simulação e Otimização de Processos Químicos

61

FlowSheetFlowSheet

Page 62: EQE038 – Simulação e Otimização de Processos Químicos

62

In EMSOEMSO the user can manipulate

various FlowSheetsFlowSheets at

same time

The equipment are called DEVICESDEVICES

A FlowSheetFlowSheet consists of a series

of unit operations or equipment

connected to each other

Process Diagram – FlowSheet

Page 63: EQE038 – Simulação e Otimização de Processos Químicos

63

streamPH

The system modeling is made by the The system modeling is made by the use, configuration and connection of use, configuration and connection of

pre-existing componentspre-existing components

FlowSheetLanguage – Component-based system

FlowSheetLanguage – Component-based system

Page 64: EQE038 – Simulação e Otimização de Processos Químicos

64

FlowSheet ComponentsFlowSheet Components

Degree of Freedom

Dynamic Degree of Freedom

Simulation options

Parameters of DEVICES

Page 65: EQE038 – Simulação e Otimização de Processos Químicos

65

Creating a MSO file for FlowSheet

Menu

NewFlowSheet

File Name

Destination

Page 66: EQE038 – Simulação e Otimização de Processos Químicos

66

using including references to other files.

FlowSheet A process diagram is declared with the keyword FlowSheet and its name.

A FlowSheet contains some basic sections:

PARAMETERSDEVICESCONNECTIONSSETSPECIFYINITIALOPTIONS. . .

Creating a FlowSheet using the template

Page 67: EQE038 – Simulação e Otimização de Processos Químicos

67

Degree of Freedom

Dynamic Degree of Freedom

Simulation options

Parameters of DEVICES

FlowSheet for the Level Tank

Page 68: EQE038 – Simulação e Otimização de Processos Químicos

68

EMSO analyzes the consistency of the system created in the

FlowSheet

Consistency Analysis of the Process

Page 69: EQE038 – Simulação e Otimização de Processos Químicos

69

Simulation details

Simulation of the Level Tank Process

Page 70: EQE038 – Simulação e Otimização de Processos Químicos

70

Horizontal axis is always the independent variable (usually time)

double-click

Level Tank Results

Page 71: EQE038 – Simulação e Otimização de Processos Químicos

71

Building a system consisting of three Building a system consisting of three tanks connected in seriestanks connected in series

Series of Level Tanks

Page 72: EQE038 – Simulação e Otimização de Processos Químicos

72

Degrees of freedom increases

Series of Level Tanks - FlowSheet

Page 73: EQE038 – Simulação e Otimização de Processos Químicos

73

Series of Level Tanks - Results

Page 74: EQE038 – Simulação e Otimização de Processos Químicos

74

Building a more interesting Model: CSTR with Van der Vusse reaction

StreamsInlet Feed material stream with molar concentrationOutlet Output material stream with molar concentrationParametersCv Valve constantk1 Constant of reaction rate 1 k2 Constant of reaction rate 2 k3 Constant of reaction rate 3 A Cross-section area

VariablesV Reactor volumer1, r2, r3 Reaction rates Ca, Cb,Cc, Cd Molar concentrations h Reactor level tau Residence time

Page 75: EQE038 – Simulação e Otimização de Processos Químicos

75

Overall mass balance

Valve equation

Thermal equilibrium

Mechanical equilibrium

Volume

in out

out V

in out

in out

dVF F

dt

F C h

T T

P P

V Ah

Van der Vusse Reactor – Modeling

Component mass balances

Reaction rates

Residence timePerfect mixing

Page 76: EQE038 – Simulação e Otimização de Processos Químicos

76

Adding molar Adding molar concentration in the concentration in the

material streammaterial stream

Van der Vusse Reactor – Stream Model

Page 77: EQE038 – Simulação e Otimização de Processos Químicos

77

Van der Vusse Reactor – Attributes

Page 78: EQE038 – Simulação e Otimização de Processos Químicos

78

Van der Vusse Reactor Model

Page 79: EQE038 – Simulação e Otimização de Processos Químicos

79

Van der Vusse Reactor – Model Equations

Page 80: EQE038 – Simulação e Otimização de Processos Químicos

80

Van der Vusse Reactor – FlowSheet

Page 81: EQE038 – Simulação e Otimização de Processos Químicos

81

Van der Vusse Reactor – Results

Page 82: EQE038 – Simulação e Otimização de Processos Químicos

82

ExercisesExercises

1) Simulate the CSTR example for different values of the valve constant to find the one that maximizes the concentration of component B at the outlet of the reactor at steady state. Comment the results;

2) Modify the reactor model by adding an opening fraction on the

outlet valve: and make this fraction vary

sinusoidally x = (1 + sin (t)) / 2, where t is given in hours. Use a

Cv value of 20 m2,5/h. Comment the results for a 20 h simulation;

3) Build a block diagram to simulate the CSTR process.

sF xCv h

Page 83: EQE038 – Simulação e Otimização de Processos Químicos

83

ReferencesReferences• Himmelblau, D. M. & Bischoff, K. B., "Process Analysis and Simulation - Deterministic Systems", John Wiley & Sons, 1968.• Felder, R. M. & Rousseau, R. W., "Elementary Principles of Chemical Processes", John Wiley & Sons, 1978.• Denn, M., "Process Modeling", Longman, New York, 1986.• Luyben, W. L., "Process Modeling, Simulation, and Control for Chemical Engineers", McGraw-Hill, 1990.• Silebi, C.A. & Schiesser, W.E., “Dynamic Modeling of Transport Process Systems”, Academic Press, Inc., 1992.• Ogunnaike, B.A. & Ray, W.H., “Process Dynamics, Modeling, and Control”, Oxford Univ. Press, New York, 1994.• Rice, R.G. & Do, D.D., “Applied Mathematics and Modeling for Chemical Engineers”, John Wiley & Sons, 1995.• Bequette, B.W., “Process Dynamics: Modeling, Analysis, and Simulation”, Prentice Hall, 1998.• Engell, S. E Klatt, K.-U. Nonlinear Control of a Non-Minimum-Phase CSTR, Proc. of American Control Conference, Los Angeles, 2041 – 2045 (1993).• 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).

Page 84: EQE038 – Simulação e Otimização de Processos Químicos

84

For helping in the preparation of this material

Special thanks to

For supporting the ALSOC Project.

Prof. Rafael de Pelegrini Soares, D.Sc.Prof. Rafael de Pelegrini Soares, D.Sc.Eng. Gerson Balbueno Bicca, M.Sc.Eng. Gerson Balbueno Bicca, M.Sc.Eng. Euclides Almeida Neto, D.Sc.Eng. Euclides Almeida Neto, D.Sc.Eng. Eduardo Moreira de Lemos, D.Sc.Eng. Eduardo Moreira de Lemos, D.Sc.Eng. Marco Antônio MüllerEng. Marco Antônio Müller

Page 85: EQE038 – Simulação e Otimização de Processos Químicos

85

... thank you for your attention!

Process Modeling, Simulation and Process Modeling, Simulation and Control LabControl Lab

• Prof. Argimiro Resende Secchi, D.Sc.Prof. Argimiro Resende Secchi, D.Sc.

• Phone: +55-21-2562-8307Phone: +55-21-2562-8307

• E-mail: [email protected]: [email protected]• http://www.peq.coppe.ufrj.br/Areas/Modelagem_e_simulacao.htmlhttp://www.peq.coppe.ufrj.br/Areas/Modelagem_e_simulacao.html

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

EP 2013

Solutions for Process Control and OptimizationSolutions for Process Control and Optimization