C APEC The Age of Computer Aided Modeling Rafiqul Gani CAPEC Department of Chemical Engineering, Technical University of Denmark, DK-2800 Lyngby, Denmark http://www.capec.kt.dtu.dk
Outline Introduction Computer Aided Modeling Methods! Modeling steps! Model construction! Model generation Computer Aided Modeling Tool! Modeling features in ICAS! Application of modeling toolbox Conclusions Rafiqul Gani, CAPEC- DTU 2
What is computer aided modeling? Problem definition Model calibration & validation System characteristics Model verification Problem data Model solution Human Model construction Computer Introduction - I 3
Why do we need models? Process/ Product Operation Environment Business Information (knowledge, data) Simulation Model Problem Design Production Planning Analysis System Introduction -II 4
Generate (create) models for the entire lifecycle of a product Region of operation of the process for the total lifecycle of the product Chemical research Process Engineering Detailed Engineering Production, planning, etc. Phenomena models Process models - I Process models - II.. Process models - III Need qualitatively correct models with large application range Need quantitatively correct models with large application range Need quantitatively correct models with limited application range Need quantitatively correct models with simple phenomena models 5
Modelling Steps MODELS MATHEMATICAL MODELS PROCESS M ODELS Derive the model equations (model generation) Translate & Analyze model equations (model translation) Solve model equations & generate model object (also, create library for use with a simulator or for on-line solution) A computer aided system assists the user in performing the above tasks Computer Aided Modeling: Methods 6
Model Construction with (process) Simulators Starting Point: Process flowsheet If the needed model is not present in the simulator library, it is not possible to construct the model new model needs to be generated a model generation system is needed! Computer Aided Modeling: Methods 7
Model construction, generation & reuse, Decomposition Aggregation Mathematical model Building block Extract equations from library * Balance Equations *Constraint Equations *Constitutive Equations Define Boundary Describe System Identify Building Block Computer aided modeling method 8
Generation of model equations Basic Macroscopic balance equations Microscopic balance equations Micro. with efficient coefficients Balance correlations Can be transferred into balance equations for other extensive quantities by symbolic manipulation Balance Constraints Population Moment Capital Closure Equilibrium Boundary Mathematical Macroscopic population equation Microscopic population equation Macroscopic moment equation Microscopic moment equation Volume sum Component sum Phase Heterogeneous Homogeneous Control Optimization Constitutive Rate Thermodynamic Balance correlations Transport Generation Retrieve matched models otherwise build new models
(a) (b) (c) (d) State of aggregation and phases within the system Perfectly mixed system (e) Fluctuating gradients, i.e., gradients in all directions Uniform time averaging gradient in one direction (turbulent flow) (i) Equilibrium phase system Fluctuating gradients, i.e., gradients in all directions Uniform time averaging gradient in one direction (flow in porous media) (j) (f) x i Uniform gradient in one direction (laminar flow) (g) Particulated system with uniform mixing (k) Perfectly mixed region Uniform gradient in two directions (laminar flow) (h) Particulated system with uniform gradient in one direction Homogeneous gradient regions Bypassing (l) Black box Accumulation is negligible x i0 Uniform gradients adjacent to the boundary Cross flow Dead space region Dead space regions Uniform sub-regions Bypassing (channeling) Uniform sub-regions
Modeling Features in ICAS Solvers Generation & analysis Modelling Tools Import, translation & code generation Computer aided modeling tool 11
Generate (create) Models 1 2 3 Describe the system (shell), the connections to the shell (streams and external mediums) Extract reference models for the shell and connections and/or introduce new reference models Combine them together to form the desired model Analyze & translate model Solve model & generate model code Computer aided modeling tool 12
Model Generation: Describe shell & connection Computer aided modeling tool 13
Model Generation: Describe shell & connection Computer aided modeling tool 14
1 Generate models for 2-phase separators 2 3 STREAM CONNECTION OBJECT Name: 3 Models for quantities: Energy (enthalpy): H 3 =@FUNC_E(2,f 3[],T 3,P 3 ) Models for the from -connection: (equilibrium) Energy connection: T 3 =T flash Momentum connection: P 3 =P flash SHELL OBJECT Name: flash Assumed phase condition: Calculate (VL) Equilibrium model: 0= f 2i / ft 2 -K flash * f 3i /ft 3, @KEQ(T flash, P flash, f 2[], f 3[], #K flash ), no accumulation, include mass & energy balance SHELL CONNECTION OBJECT Name: heater Connection models: Energy connection: Q heater =Q flash Challenges - II (Example of model generation) 15
Application of the modeling tool-box Calculator or solver Process or Model Modeling Tool-box (MoT in ICAS) Model library in simulator Connect model object to external applications Create own customized simulator Computer aided modeling tool 16
CAPE-OPEN Modeling Steps " Conversion from text to XML format (not necessary if model in XML already available) " Import XML-model to MoT (modelling tool-box in ICAS) " Analyze model, debug model, define connections (ports, etc.) " Generate PMC (process modeling component - unit plug) " Run PMC from a suitable simulation engine Model equations XML- Model Component generation Through MoT PMC Analysis Debug Define Connections Modeling through CAPE-OPEN interfaces 17
Importing/creating a model Rafiqul Gani, CAPEC- DTU 18
View of the translated model Library Explicit Implicit ODE Computer aided modeling tool 19
Analysis of the translated model equations 20
Solve the model equations Automatic mode, debug-mode After validation, generate model object 21
Visualization of the model solution Computer aided modeling tool 22
Rafiqul Gani, CAPEC- DTU 23
Construction of an operation model F1 Reactor Reaction : A B High conversion at temperature = 340 K F2 Batch Operation Model 1. Charge Feed (open F1 & close F2) 2. Close F1 3. Heat until temperature = 340 K 4. Control temperature at 340 K 5. Discharge when X B is 0.9 6.. Computer aided modeling method 24
Construction of an operation & design model F1 F3 Batch Operation/Design Model Reactor F4 Reaction : A B Maximum conversion of 50% A at T = 340 K Extract B from reactor with solvent! Solvent ID and effects need to be modeled F2 1. Charge Feed (open F1 & close F2) 2. Close F1 3. Heat until temperature = 340 K 4. Control temperature at 340 K 5. Charge solvent by opening F3 6. Extract B by opening F4 7.. Computer aided modeling method 25
Other forms of Modeling: Multi-level Properties modeling with interface to Molecular Modeling (Chem3D) Rafiqul Gani, CAPEC- DTU 26
ICAS ADD TO THE SYSTEM New Components (Property Prediction) New Reactions New Models (Model Generation) DATABANKS PROBLEM DEFINITION Flowsheet Components / Reactions Units of Measure Constitutive Models What to Solve Method of Solution Set/Initialize Variables Output (Detail/Form) INFORMATION STORAGE TOOL BOXES Design / Synthesis Solvent/Fluid Equipment Flowsheet Control Parameter Estimation Thermo-model Kinetic Model Analysis Energy Environmental Control Thermodynamic Property Phase Diagrams Expert System SIMULATOR MANAGER Model Equations Balance Equations Adaptation Linearization Analysis Degrees of Freedom Solvers AE / ODE / DAE Constraint Equations Reduction Index / Sparse Pattern PDE Constitutive relations Identification Partitioning / Ordering LP / NLP Rafiqul Gani, CAPEC- DTU MILP / MINLP 27 RHS for the units that are solved together RHS X
Application Examples Translation & analysis of published models Analysis of process models for design & control Generation of customized simulator Generation of model objects for external use Conversion of in-house legacy models models into a standard form (for creation of new model library) Modelling of bioreactors in optimization of bio-gas production Modelling of wastewater treatment plants Modelling of pesticide uptake in plants. Computer aided modeling tool 28
Conclusions & Current Work Computer aided modeling is necessary Currently available methods & tools can be used to develop such a system The human-computer interactions need to be properly defined The resulting computer aided system will be able to significantly increase the productivity of the user by reducing the total time needed to solve the problem The age of computer aided modeling has arrived! Rafiqul Gani, CAPEC- DTU 29