20
Computer Aided Modeling Tool - ModDev Rafiqul Gani CAPEC Department of Chemical Engineering, Technical University of Denmark, DK-2800 Lyngby, Denmark. C A P E C

Computer Aided Modeling Tool - ModDev

Embed Size (px)

DESCRIPTION

C. A. P. E. C. Computer Aided Modeling Tool - ModDev. Rafiqul Gani CAPEC Department of Chemical Engineering, Technical University of Denmark, DK-2800 Lyngby, Denmark. Purpose of ModDev. Derive the model equations Analyze model equations - PowerPoint PPT Presentation

Citation preview

Page 1: Computer Aided Modeling Tool - ModDev

Computer Aided Modeling Tool - ModDev

Rafiqul Gani

CAPECDepartment of Chemical Engineering,

Technical University of Denmark,

DK-2800 Lyngby, Denmark.

C A P E C

Page 2: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

2

Purpose of ModDev

• Derive the model equations• Analyze model equations

• Implement the model equations and integrate them to an existing simulator

MODELS

MATHEMATICALMODELS

PROCESS MODELS

A computer aided system assists the user in performing the above tasks

Page 3: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

3

Modelling Steps

Mathematicalmodel

Decomposition

AggregationBuilding block

Decomposition, creation, aggregation

* Balance Equations

*Constraint Equations

*Constitutive Equations

Page 4: Computer Aided Modeling Tool - ModDev

4

Model Objects (Building Blocks)

Balance Population

Basic

Moment

Constraints

Closure

Equilibrium

Boundary

Mathematical

Constitutive

Rate

Thermodynamic

Balance correlations

Micro. with efficient coefficients

Microscopic balance equations

Macroscopic balance equations

Microscopic population equation

Macroscopic population equation

Microscopic moment equation

Macroscopic moment equation

Component sum

Volume sum

Phase

Homogeneous

Heterogeneous

Optimization

Control

Generation

Transport

Balance correlations

Capital

Can be transferred intobalance equations for otherextensive quantities bysymbolic manipulation

Page 5: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

5

Process-Model Relation

Each process building block is represented by a set of control shells (with defined boundaries) and connections

AccumulationIn Out

Control ShellStream

Generic building blocks

Variable type Model

Fundamental building blocks

Shell Connection

Stream Shell-connection(a) (b)

Page 6: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

6

Model Generation

Each control shell & connection is associated to a set of model (fundamental) building blocks

Each model building block is either represented by a Reference Model or a generic (Created Model)

building block

Model equations available in the knowledge base

Model equations not available in the

knowledge base

Page 7: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

7

Control shellsTo model the various type of processes, the control shell must be

defined such that the partial gradients (with respect to T, P and fI ) within the boundaries are either:

• Negligible• Incorporated in an interface or overall flux model• Dependent on some product specification (design)

Page 8: Computer Aided Modeling Tool - ModDev
Page 9: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

9

Integrated Computer Aided System - ICAS

• ICAS is a collection of tools which have been integrated to solve various CAPE problems in an

integrated manner

• ModDev is a toolbox within ICAS

Page 10: Computer Aided Modeling Tool - ModDev

10EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

Balance EquationsBalance Equations

Constraint EquationsConstraint Equations

Constitutive relationsConstitutive relations

LinearizationLinearization

ReductionReduction

IdentificationIdentification

MANAGER

Model Equations Adaptation

AE / ODE / DAEAE / ODE / DAE

PDEPDE

LP / NLPLP / NLP

MILP / MINLPMILP / MINLP

Solvers

Degrees of FreedomDegrees of Freedom

Index / Sparse PatternIndex / Sparse Pattern

Partitioning / OrderingPartitioning / Ordering

Analysis

FlowsheetComponents / ReactionsUnits of MeasureConstitutive ModelsWhat to SolveMethod of SolutionSet/Initialize VariablesOutput (Detail/Form)

PROBLEM DEFINITION

ADD TO THE SYSTEM

TOOL BOXES

ICAS

DATABANKS

New Models(Model Generation)

New Models(Model Generation)

New Components(Property Prediction)New Components(Property Prediction)

New ReactionsNew Reactions

PropertyProperty

Solvent/FluidSolvent/Fluid

EquipmentEquipment

FlowsheetFlowsheet

ControlControl

Phase DiagramsPhase Diagrams

Design / Synthesis

Thermodynamic

EnergyEnergy

EnvironmentalEnvironmental

ControlControl

Analysis

INFORMATIONSTORAGE

RHS for the units that are solved together RHSX

SIMULATOR

Expert SystemExpert System

Parameter Estimation

Thermo-model

Kinetic Model

Page 11: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

11

Model Generation with ModDev

• Draw Objects

• Describe Objects

• Screen equations

• Analyze/Modify model equations

• Translate model equations into a language that is integrated to the numerical routines

Page 12: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

12

Tools & options in ModDev (ModGen)

Fundamental shell object

Fundamental stream object

Fundamental shell connection object

Interphase with solver

Select external solver

ModDefDraw modeling objects

Analyze andmanipulate themodel equations

Page 13: Computer Aided Modeling Tool - ModDev

13

Tools & options in ModDev (ModGen)

Page 14: Computer Aided Modeling Tool - ModDev

14

Tools & options in ModDev (ModGen)

Page 15: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

15

Tools & options in ModDev (ModGen)

Page 16: Computer Aided Modeling Tool - ModDev

16

Tools & options in ModDev (ModGen)

Page 17: Computer Aided Modeling Tool - ModDev

Example - Steady state flash - I

1

2

3

SHELL OBJECTName: flash

Assumed phase condition: Calculate (VL) Equilibrium model: 0= f2i/ ft2- Kflash * f3i/ft3i, @KEQ(Tflash, Pflash,

f2[], f3[], #Kflash)

STREAM CONNECTION OBJECTName: 3

Models for quantities: Energy (enthalpy): H3=@FUNC_E(2,f3[],T3,P3)Models for the “from”-connection: (equilibrium)

Energy connection: T3=Tflash

Momentum connection: P3=Pflash

SHELL CONNECTION OBJECTName: heater

Connection models: Energy connection: Qheater=Qflash

Page 18: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

18

Example - Steady state flash - II

Page 19: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

19

Example - Steady state flash - III

Specify feed streamT=200 KP= 1 atm1 kmole/hr Methane1 kmole/hr Ethane1 kmole/hr Propane

Specify feed streamT=200 KP= 1 atm1 kmole/hr Methane1 kmole/hr Ethane1 kmole/hr Propane

Specify unit variablesT=180 KP=1 atm

Specify unit variablesT=180 KP=1 atm

Select ComponentsMethane,Ethane,Propane

Select ComponentsMethane,Ethane,Propane

Run the simulationRun the simulation

View ResultsView Results

Select Thermodynamic modelSRK+QMR+Default

Select Thermodynamic modelSRK+QMR+Default

Initialize stream 31 kmole/hr Ethane1 kmole/hr Propane

Initialize stream 31 kmole/hr Ethane1 kmole/hr Propane

Page 20: Computer Aided Modeling Tool - ModDev

EURECHA Workshop on Computer Aided Modeling, Vezsprem, Hungary, June 3-4, 1999

20

Tutorial Exercises

• Part-I: Model generation (steady state tank mixer, dynamic tank mixer,

CSTR with different kinetics)

• Part-II: Model analysis & translation (for each generated model check degrees of freedom, incidence

matrix, generate code, …..)