PSE Summer School 2012 Process Simulation and Optimization of Chemical Plants DAAD Summer School 2012, Mexico Sponsorship: DAAD 1 1 www.dbta.tu-berlin.de Process Simulation and Optimization of Chemical Plants Dynamic Modeling Approaches Prof. Dr.-Ing. habil. Prof. h.c. Dr. h.c. G. Wozny 2 www.dbta.tu-berlin.de Simulation and Optimization of Chemical Plants Part II Aim: Introduction in Process Dynamic, Examples Step responses Modeling in MOSAIC Workflow Basic Steady state Modeling Approach Prof. Dr.-Ing. habil. Prof. h.c. Dr. h.c. G. Wozny 3 www.dbta.tu-berlin.de Process dynamic Problem solving - Systematic Approach 1 2 Output Input ? searched PFD given, Unit given given Workflow- Steady state Modeling (reduced) 0. Aim definition 1. Construction Flow Diagram (Numbering all flows) 2. Declare given Flows (Ströme und Zusammensetzung) 3. Choose suitable Balance volume for Process Unit 4. Formulation of Balance Equations 5. Determine Degree of freedom 6. Test: Number of Variables = Number of Equations? 7. Solve Balance Equation system, … 4 Process analyses aims are given MOSAIC www.dbta.tu-berlin.de Process dynamic Input given Output PFD Flowdiagram given searched Equation system: Total Material Balances Component Material Balances Summation Equations Equilibrium relationship Energy Balances If needed Momentum Balances Enthalpy Equations 1 NC NS Neq 1 +1 NS Number of Variables: Const. Parameter NE = NV = NS * ( NC + 4 ) + NK + NP + NQ + NW + … zi F, T, p, h Q W 5 DOF ND = N V - NE www.dbta.tu-berlin.de ? Steady state Modeling up to now Process Modelling Summation Equation D yi Summation Equation Phase Equilibrium Comp. 1 F zi Flash Phase Equilibrium Comp. 2 xi Summation Equation Feed Component Material Balance Comp. 1 Component Material Balance Comp. 2 6 Isothermal Flash www.dbta.tu-berlin.de B 7 MOSAIC – USER Interface www.dbta.tu-berlin.de 8 www.dbta.tu-berlin.de Process Dynamic Aims of the next lecture: - Expenditure of the modeling approach to Dynamic System - Dynamic Balance Equations - Solution Approaches - „Dynamic“ Degree of Freedom - Introduction additional methods - Judgment of Process Dynamic - Process Automation (Control) - Discussion selected Methods and Examples 9 Introduction www.dbta.tu-berlin.de Process Dynamic Input given PFD Flowdiagram given Sizing realized Output searched ? Processunit given: Dynamic Total Material Balances 1 Dynamic Component Material Balances NC Summation Equations NS Equilibrium relationship Neq Dynamic Energy Balances 1 Thermodynamic Data (e.g. Enthalpy Correlations ,..) Ns Dynamic Variables (Hold up, Internal Energy) Controller Equations If needed Dynamic Momentum Balances Number of Equations 10 2 NControl +1 NE = www.dbta.tu-berlin.de Formulation of the Model Equations Description by model equations of conservation (MESH) System is described by a system of Differential –Algebraic Equation system (DAE-System) the state variables depends from input variables and parameter E.g..: Balance for changes of inhabitants of Kuantan Balance : Inhabitants in Process Sciences (state variable T, p, x,..) Balance Volume : Berlin in Process Sciences (Apparatus, Phase,..) InhabitanB erlin movingin movingout birth deaths time Changes Transport resevoir 11 * * 0 0 0 T * * * * 0 0 p * 0 * * * 0 x * 0 0 * * * .. * 0 0 0 * * .. x A * b Matrix formulation www.dbta.tu-berlin.de Formulation of Dynamic Total Material Balances Material balance Balance : Mass Bilanzvolume : Tank Fin,1 Fin,2 HU Q Fout,1 The simple Tank model 12 www.dbta.tu-berlin.de Formulation of Dynamic Total Material Balances Bilanz für Änderung der Masse Material Balance Molar basis d HU dt = k Fin,k - Bilanzvolume : Tank Fin,1 Fout,m +/- NT 13 NT m Konvection Notation: HU=Hold up = V*/M t = time F = Flow Q=heat duty NT =Transport Term k=No. Input Flows m=No. Output Flows Fin,2 Diffusion HU Q Fout,1 The simple Tank model www.dbta.tu-berlin.de Dynamic Energy balance: Pt . m1 ea1 . u h1 ea2 m2 HU h2 . . Dynamic Energy Balance . TC Q Q = k A m . msteam . d (HU (u+ea) ) /dt = Q + Pt + m1 ( h1 + ea1 ) - m2 ( h2 + ea2 ) Controller Equation: 14 msteam – msteam,0 = kC ( Tset point - Tactuell ) www.dbta.tu-berlin.de Process dynamic Input given PFD Flowdiagram given Sizing realized Number of Equations Number of Variables: Output searched ? NE = Dynamic Terms HU U kC, TN Const. Parameter NV = NS * ( NC + 4 ) + NK + NP + NQ + NW + 1 + 1 + Ncontrol.-Param + … xi F, T, p, h Q W Heat Work Dynamic 15 DOF ND = N V - NE www.dbta.tu-berlin.de Process dynamic Feed n F1, x1,1, x1,2 F4 p n Input F1 F2 F3 x1,1 p p x2,1 Output t cooling Actors: Valve Engine speed F3 (Number of revolution) Product Lift of piston F2 x2,1, x2,2 t Sensors: Temperature Pressure Concentration Hagen, J.: Modellierung und Simulation von Chemiereaktoren – Aspekte einer zeitgemäßen Ingenieurausbildung, CIT 2005, 77, No.1-2, 25-33 16 Introduction www.dbta.tu-berlin.de Process dynamic Programms - Tools - gPROMS, ACM - Aspen Dynamics - Simusolv - MOSAIC MOSAIC - Hysis ….. ACSL MATLAB Mathcad Matrixx Simnon, .... Knowledge from Lecture one: modeling steady state Units, Processes – Solution Algebraic Equation Systems Now: Solution of Differential Algebraic Equation systems: DAE - Systems New Tasks: Expenditures of the modeling Approach Development of general Solution, Methods 17 www.dbta.tu-berlin.de Basics of Process dynamic Literature: z.B. Luyben, W.L.: Process Modeling, Simulation, and Control for Chemical Engineers, McGraw-Hill, Inc. 1990, ISBN 0-07-039159-9 Ordys, A.W.; Pike, A.W.; Johnson, M.A.; Katebi, R.M.; Grimble, M.J.: Modeling and Simulation of Power Generation Plants, Springer Verlag, ISBN 3-540-19907-1 Shelden, R.A.; Dunn, I.J.: Dynamic Simulation - Modeling Processes, The Improvement, The World CEP December 2001, S. 44-48 Dochain, D.; Vanrolleghem, P.A.: Dynamical Modeling and Estimation in Wastewater Treatment Processes IWA Publishing, , Alliance House, 12 Caxton Street, London SW1H 0QS, UK ISBN: 1 900222 50 7 Francis G. Shinskey Process Control: As Taught vs. as Practiced Ind. Eng. Chem. Res. 2002, 41,3745 -3750 T. Barz, H. Arellano-Garcia, G. Wozny, Generalization of a Tailored Approach for Dynamic Simulation and Optimization, AIChE Annual Meeting, Tuesday, November 9, 2010 Dynamic Simulation and Optimization,250 D Room (Salt Palace Convention Center) Tilman Barz, Stefan Kuntsche, Günter Wozny und Harvey Arellano-Garcia (2011). An efficient sparse approach to sensitivity generation for large-scale dynamic optimization Computers and Chemical Engineering. 35. 2053-2065 18 www.dbta.tu-berlin.de Process dynamic Searched: System behavior in dependency of dependent Variables / independent Variables (e.g. Design variables, Set Points, Disturbances, Load) Results: graphical extend of Processvariables (state varaibles) under given Parameterconditions x = f (t) Aids: Simulation programs, Tools, lab scale plants, pilot plants, Production plants Solutions: Single DGL (exact Solution , or numerical solution by Methods like: Runge Kutta, Euler,...) Systems of DE, DAE (Linearization, Gear, DASSL,. ODEPACK*, ..., library IMSL, ….) e.g. : Newton Method: xk+1= xk - f(xk) / f´(xk) for each time step, after discritization with Euler method 19 Basics *Hindmarsh A.C.(1983), ODEPACK, a Systematized Collection of ODE Solvers. In:Scientific Computing (R.S. Stepleman et al., Eds.), pp. 55-64 North Holland, Amsterdam www.dbta.tu-berlin.de Process dynamic Solution: Single DGL (exakt, Runge Kutta, Euler,...) Systems DGL, DAE (Linearization, Gear, DASSL,...,) xk+1= xk - f(xk) / f´(xk) - -k = - k -xk+1= x- k - f(x ) / f´(x ) Eigenberger, CIT 1992 Num. Methoden For remembership: Partial DGL are solved e.g. withMethod of Lines Forward Problem: Process Given: input, Process 20 Basics Searched: Output e.g.: Destillate purity Energy demand etc. www.dbta.tu-berlin.de Process dynamic Backward Problem: Process Searched: Input Given: Process-Model, Output e.g..:Disturbance Inductive Problem: Process Given: Input 21 Searched: Process-Model Or Reason for observed Behavior Basics Given: Output www.dbta.tu-berlin.de Process dynamic Question: - Output Changes for given input changes? xa(t) xe(t) t t xe(t) xa(t) t t 22 Basics www.dbta.tu-berlin.de Process dynamic Chromatography Optimization des Designs with CFD Principle of a HPLC Column Feed Produkt Outlet Inlet Distributor (Frit) Verteiler 23 Collector (Frit), Sammler A practical Example www.dbta.tu-berlin.de Process dynamic Chromatography Optimization of Design with CFD Data: Brandt et al. Film1: Simulation und Experiment of a HPLCColumn mit D=50mm without Inlet-Distributer Verteilerblech. Film3: Detail of the performance of Film2: Simulation of a HPLC-Column t D=100mm with the Inlet-Distributer Inlet- Distributor (Merck Selbstfüllstand NW 100). 24 A practical Example www.dbta.tu-berlin.de Process dynamic Question : - Output Changes for a given Input Change? xa(t) xe(t) t Input: sin , cos Output: sin , cos t Changes of Amplitude + Phasen angle See also lecture Processcontrol 25 Basics www.dbta.tu-berlin.de Process dynamic Questions: - Influence of System parameter z.B. Holdup, Pressure, (Design values - decisions) but also sometimes mathematical Solution procedure - Dynamic System output behavior for small/large disturbances of input variables e.g. cooling water flow, heating flow (steam) valve position - Dynamic behavior of closed loop systems (including controllers) (Type of controllers, coupling, recycle, heat integration, Reaction etc.) - How can the model Parameter are determined (Identification) 26 Basics of Processdynamic www.dbta.tu-berlin.de Process dynamic Approach in Dynamic Analysis : - Simulation -> Input changes (larger, smaller, step response investigation) - Experiment -> Input changes ->Observe Output , Challenges: There is a need for a suitable Model, complex, many investigations are needed,... - In a real Plant disturbances are undesired, Investigation at a Pilot plant are difficult, Scale up, (transfer from small scale to a large scale) Laplace Domain (Linearization is needed) Response behavior > Step response Transfer behavior Transfer function G(s) -> Time domain: many investigations and results, what in general? normalization, standardization Transformations are needed 27 Basics www.dbta.tu-berlin.de Process dynamic Column Dynamic An Industrial example Dest C12 C14 C16 C18 Time h Basics Processdynamic 28 Transferbehavior after Feed step changewww.dbta.tu-berlin.de Process dynamic D2 29 Time h F2 Transfer behavior of a Production plant With noises , no filtered www.dbta.tu-berlin.de Process dynamic Concentration Steam Time Step response simulated verses experiments 30 Reboiler duty (steam) changes www.dbta.tu-berlin.de Process dynamic Steam step change -5% Systemresponse (Concentration changes) xB Bottom concentration xD xD Distillate concentration Feed Steam xB 31 Time in h System response steam step change Step response simulated Steam step change www.dbta.tu-berlin.de Process dynamic Steam step change + 5% System response (Concentration changes) xD Distillate concentration xB Bottom concentration Steam Time in h System response steam step change 32 Step response simulated Steam step change www.dbta.tu-berlin.de Dynamic Flash Model V = F2 F = F1 HUV x1,1, x1,2, ..., x1,5 HUL Variable Name Dimension F Flow Kmol/s x Molar Fraction - T Temperature oC P Pressure bar HU Hold up kmol 33 x2,1, x2,2, ..., x2,5 L = F3 x3,1, x3,2, ..., x3,5 Subscript Superscript Name V Vapor L Liquid i=1,2,3 Flow j=1,…,5 Component www.dbta.tu-berlin.de Dynamic Flash Model Example: F = F1 1 Vapor HUV x1,1, x1,2, ... Liquid HUL V = F2 2 x2,1, x2,2, .... L = F3 x3,1, x3,2, …, x3,5 34 Ammonia -Process 5 Components Nitrogen Hydrogen Ammonia Argon Methane 1 2 3 4 5 3 Variable Name Dimension F Flow Kmol/s x Molar Fraction - T Temperature oC P Pressure bar www.dbta.tu-berlin.de Dynamic Flash Model Dynamic Component material balances F1 x1,1 - F2 x2,1 - F3 x3,1 (1) d ( HUL x3,2 + HUV x2,2 ) / dt = F1 x1,2 - F2 x2,2 - F3 x3,2 (2) d ( HUL x3,3 + HUV x2,3 ) / dt = F1 x1,3 - F2 x2,3 - F3 x3,3 (3) d ( HUL x3,4 + HUV x2,4 ) / dt = F1 x1,4 - F2 x2,4 - F3 x3,4 (4) d ( HUL x3,5 + HUV x2,5 ) / dt = F1 x1,5 - F2 x2,5 - F3 x3,5 (5) d ( HUL x3,1 + HUV x2,1 ) / dt = Summation equations: 1 = x1,1 + x1,2 + x1,3 + x1,4 + x1,5 (6) 1 = x2,1 + x2,2 + x2,3 + x2,4 + x2,5 (7) 1 = x3,1 + x3,2 + x3,3 + x3,4 + x3,5 (8) Phase equilibrium relationships: 35 x2,1 = K1 x3,1 (9) www.dbta.tu-berlin.de Dynamic Flash Model Phase equilibrium relationships: x2,1 = K1 x3,1 (9) x2,2 = K2 x3,2 (10) x2,3 = K3 x3,3 (11) x2,4 = K4 x3,4 (12) x2,5 = K5 x3,5 (13) T2 = T3 (14) p2 = p3 (15) Dynamic Energy balance: . d (HUL uL + HUV uV + HUMetal uMetal ) / dt = F1h1 - F2h2 - F3h3 + Q (16) Enthalpy correlations: 36 h1 = f ( T1, p1, x1,i ) (17) www.dbta.tu-berlin.de Dynamic Flash Model Dynamic Energy balance: d (HUL uL + HUV uV . + HUMetal uMetal ) / dt = F1h1 - F2h2 - F3h3 + Q (16) Enthalpy correlations: K-values: 37 h1 = f ( T1, p1, x1,i ) (17) h2 = f ( T2, p2, x2,i ) (18) h3 = f ( T3, p3, x3,i ) (19) K1 = f ( T2, p2, x2,i , x3,i ) (20) K2 = f ( T2, p2, x2,i , x3,i ) (21) K3 = f ( T2, p2, x2,i , x3,i ) (22) K4 = f ( T2, p2, x2,i , x3,i ) (23) K5 = f ( T2, p2, x2,i , x3,i ) (24) www.dbta.tu-berlin.de Dynamic Flash Model Momentum balance (pressure loss): p1 = p2 (25) Internal Energy: Hold up: 38 uV = f ( T2, v2, x2,i ) (26) uL = f ( T3, v3, x3,i ) (27) uMetal = f ( T3) (28) HUV = f ( Geometry-V,T2, p2, x2,i ) (29) HUL = f ( Geometry-L,T3, p3, x3,i ) (30) HUMetal = f ( Geometry-Metal,T3) (31) www.dbta.tu-berlin.de Dynamic Flash Model Number of variables: Internal Energy u K-Values NV = Ns (Nc + 4 ) + Np + NQ + NHU + Nz + N Geometry= 3 (5+4) +5 + 1 + 3 + 3 + 3 = 42 Number specifications (Design variables): ND = NV - NE = 42 - 31 = 11 . Design Values choosen: F1, T1, P1, x1,1 , x1,2 , x1,3, x1,4 , Q=0 (adiabat) Geometry-L, Geometry-V, Geometry Metal 39 www.dbta.tu-berlin.de Dynamic Flash Model Solution of the equation system iteratively . MOSAIC 40 www.dbta.tu-berlin.de Flow driven versus pressure driven Flow Driven: • Outlet stream pressures and flow rates of a block are determined from the inlet conditions to the block and the block specifications • Outlet stream pressures or flow rates are not affected by pressure in the downstream blocks Pressure Driven: • Take into account the effect of downstream pressures on flow rates in streams 3 Example: 4 F3 F4 K 3 p3 p4 1 2 Holdup = f(T,P,F) F1 F2 K1 p1 p2 5 41 6 F5 F6 K 5 p5 p6 www.dbta.tu-berlin.de Column Process Dynamic TC Questions: PC LC TC L FC QC D S FC F, zj,iF TC xD,i How many process variables have to be controlled? How can we determine the control variables? What is the best pairing? What is the best place for the sensors? TC LC B, xB,i = xNS,i V Control structure? Set points? Controller-Parameter? Optimization! Experience: Pressure, quality, level! Are there any more? 42 www.dbta.tu-berlin.de Column Process Dynamic 1 PC LC Reflux drum L 2 FC Balance volume 1 j-1 jj F, zj,i j+1 F Feed TC Balance volume j Boil up n 43 Balance volume n Vj+1 Lj Steam Reboiler B, xB,i Vj HUL(j) V Bottom product Lj-1 D xD,i Reflux trap Francis Weir formula Lj = 3.33 l hj3/2 www.dbta.tu-berlin.de Process Dynamic 1 D, xD Condenser Distillate Choice: Balance volume Vapor Interfacial area Liquid . . . 2 3 Feed 2 j HUj Transfer to the model of a theoretical tray F, xF n 44 . . . Reboiler www.dbta.tu-berlin.de Process Dynamic 1 . . . D, xD Condenser j-1 Distillate Vapor phase Interfacial Area 2 Liquid phase 3 Feed 2 j j Vapor phase HUj Transfer to the model of a theoretical plate F, xF Liquid phase j+1 Vapor phase Liquid phase n 45 Reboiler . . . www.dbta.tu-berlin.de Complete process model Yi,j Lj-1 Vj hj V Xi,j-1 hj-1L j URj,l Tj ; pj hj F Vapor phase Fj Uj HUjV URk,j Interfacial area Liquid phase Z( Y or X )i,jF WRn,j HUjL Wj Vj+1 Yi,j+1 with: •Y = vapor mole fraction •X = liquid mole fraction WRj,m Lj hj+1V Xi,j •V = vapor flow •L = liquid flow h jL •hV = vapor enthalpy •hL =liquid enthalpy HU = Hold up 46 Dynamic Model of a theoretical plate www.dbta.tu-berlin.de Complete Process Model Vj-1 . . . Lj-2 j-1 1. Material balances 2. Component material Vapor phase Interfacial Area Vj balances Liquid phase j Lj-1 Vapor phase Feed 3. Phase equilibrium Liquid phase Vj+1 j+1 Lj Vapor phase Liquid phase . . . + pressure loss correlation Vj+2 4. Summation equation 5. Energy balances Lj+1 + tray efficiency 47 Model of a theoretical plate Steady state www.dbta.tu-berlin.de Complete Process Model Vj-1 . . . Lj-2 j-1 Vapor phase 1. Dynamic material balance Interfacial Area Vj Plant design: Diameter, height, area, …. Liquid phase j Lj-1 2. Dynamic component material Vapor phase Feed balance Liquid phase Vj+1 j+1 Lj Vapor phase 4. Summation equation Liquid phase . . . + Pressure loss correlations, Vj+2 + Tray efficiency + Holdup correlationen, …. 48 3. Phase equilibrium Lj+1 5. Dynamic energy balances 6. Controller equation Dynamic Model af a theoretical plate www.dbta.tu-berlin.de Complete Process Model Yi,j Lj-1 Vj hj V Xi,j-1 hj-1L j Tj ; pj h jF Vapor phase Fj Z(Y or X)i,j Without sidestreams Interfacial Area Liquid phase F Vj+1 Yi,j+1 Lj hj+1V Xi,j h jL d HU /dt = Fj + Vj+1 + Lj-1 – Vj - Lj 49 Dynamic material balances www.dbta.tu-berlin.de Complete Process Model Dynamic component material balances Yi,j Lj-1 Vj hj V Xi,j-1 hj-1L j Tj ; pj hjF Vapor phase Fj Z(Y or X)i,j Assumption: HUjV<<HUjL Interfacial Area Liquid phase F Vj+1 Yi,j+1 Lj hj+1V Xi,j h jL d(HUjL Xi,j )/dt = Fj Zi,jF + Vj+1 Yi,j+1 + Lj-1 Xi,j-1 - Vj Yi,j - Lj Xi,j 50 www.dbta.tu-berlin.de Complete Process Model Phase equilibrium Yi,j Lj-1 Vj hj V Xi,j-1 hj-1L j Tj ; pj h jF Vapor phase Fj Z(Y or X)i,j Interfacial Area Liquid phase F Vj+1 Yi,j+1 Ki,j = Yi,j / Xi,j Lj hj+1V -> Xi,j h jL Gi,j = Yi,j – Ki,j Xi,j = 0 with K = equilibrium constant possibly with Murphree tray efficiency 51 Def.: Yi,j= Yi,j+1 + i,j ( Yi,,j – Ki,j+1 Xi,j+1)www.dbta.tu-berlin.de Summation equation Yi,j Lj-1 Vj hj V Xi,j-1 hj-1L j Tj ; pj h jF Vapor phase Fj Interfacial Area Z(Y or X)i,j Liquid phase F Vj+1 Yi,j+1 Lj hj+1V Xi,j NC NC SYj = 1- Yi,j = 0 i=1 52 h jL SXj = 1- Xi,j = 0 i=1 www.dbta.tu-berlin.de Dynamic energy balance Yi,j Lj-1 Vj hj V Xi,j-1 hj-1L j Tj ; pj h jF Vapor phase Fj Z(Y or X)i,j Interfacial Area Liquid phase F Qj Lj Vj+1 Yi,j+1 hj+1V Xi,j h jL d(HUjL ujL + HUjV ujV + Mmetal umetal)/ dt = Fj hjF + Vj+1 hj+1V + Lj-1 hj-1L - Vj hjV - Lj hjL +/- Qj 53 www.dbta.tu-berlin.de Dynamic energy balance d(HUjL ujL + HUjV ujV + Mmetal umetal)/ dt = Fj hjF + Vj+1 hj+1V + Lj-1 hj-1L - Vj hjV - Lj hjL +/- Qj With : HU = Holdup in kmol u molar internal energy for liquids and solids u h (molar enthalpy) The term HUjV ujV + Mmetal umetal will be in the following investigation neglected. 54 www.dbta.tu-berlin.de Dynamic model equation for a theoretical plate . conclusion Vj-1 . . j-1 Lj-2 d(HUjL /dt = Mj Vapor phase Interfacial Area Vj Vapor phase Feed 2. Component material balance Liquid phase j Lj-1 j+1 Lj Vapor phase . . . Lj+1 + Holdup Correlation Pressure loss correlation Tray efficiency correlations Flooding, entrainment (constraints) 55 Gi,j = 0 4. Summation equation Liquid phase Vj+2 d(HUjL *Xi,j ) / dt = Mi,j 3. Phase equilibrium Liquid phase Vj+1 1.Total material balance SXi,j = 0, SYi,j =0 5. Energy balances d( HUjL *hjL ) / dt = Ej 6. Controller equation (e.g. PIDType) Rl =0 l= Number controller www.dbta.tu-berlin.de Dynamic model equation for a theoretical plate . conclusion Vj-1 . . j-1 Lj-2 d(HUjL /dt = Mj Vapor phase Interfacial Area Vj Vapor phase Feed 2. Component material balance Liquid phase j Lj-1 j+1 Lj Vapor phase . . . Lj+1 + Holdup Correlation Pressure loss correlation Tray efficiency correlations Flooding, entrainment (constraints) 56 Gi,j = 0 4. Summation equation Liquid phase Vj+2 d(HUjL *Xi,j ) / dt = Mi,j 3. Phase equilibrium Liquid phase Vj+1 1.Total material balance SXi,j = 0, SYi,j =0 5. Energy balances d( HUjL *hjL ) / dt = Ej 6. Controller equation (e.g. PIDType) Rl =0 l= Number controller www.dbta.tu-berlin.de Solution Methods Reformulation of the algebraic equations (Summation equations, Phase Equilibrium Relationships) in Differential Equations Result: Set of Ordinary Differential Equation system -> ODE solvers from library can be used (e.g. Runge Kutta, etc.) Reformulation of the differential equations (Material balances, Energy Balances) in Algebraic Equations by Euler Method or Orthogonal Collocation Method Result: Set of Nonlinear Algebraic Equation system -> Iterative Methods are needed (Newton Raphson Method) 57 www.dbta.tu-berlin.de Dynamic Model equation for a theoretical plate After transformation . 1. Total material balance . . Lj-2 Mj - d(HUjL )/dt = 0 V j-1 j-1 2. Component material balance Vapor phase Interfacial area Vj j Vapor phase Feed Mi,j -d(HUjL *Xi,j ) / dt = 0 Liquid phase Lj-1 3. Phase equilibrium Gi,j Liquid phase Vj+1 j+1 Lj Vapor phase Vj+2 . . . 4. Summation equation SXj = 0, Liquid phase = 0 SYj =0 5. Energy balance Lj+1 Ej -d(HUjL *hjL ) / dt = 0 6. Controller equation (e.g.:PID Type) R(l) = 0 58 www.dbta.tu-berlin.de Complete Process Model D = D0 - KC,D (HU1,SetPoint-HU1,actual) 1 PC TC LC L 2 xD FC R(1) = 0 = D (D0 - KC,D (HU1,SP-HU1,ac)) D L1 = L1,0 - KC,L ( T2SP - T2ac) 1 j-1 j F, z Feed R(2)= L1 - L1,0 + KC,L ( T2,SP - T2,ac) j+1 1 =0 k TC TC LC n B, xB r(l)=(HU1,ac, L1, V(or Q),HUn,ac) 59 V=V0 + KC,V ( Tk,SP – Tk,ac) V R(3)=0= V-V0 - KC,V ( Tk,SP – Tk,ac) B = B0 - KC,B (HUn,SP-HUn,ac) R(4) = B-(B0 - KC,B (HUn,SP-HUn,ac)) = 0 Integration Controller Equation www.dbta.tu-berlin.de Complete Process Model D =D0 + KC,D ( Tm,SetPoint – Tm,actual) 1 PC LC TC L R(1) = .... 2 FC D xD m L1 = L1,0 - KC,L (HU1,SP - HU1,ac) 1 j-1 j j+1 F, z R(2)= L1 -(L1,0 - KC,L (HU1,SP - HU1,ac)) 1 Feed k TC LC V= V0 - KC,V (HUn,SP – HUn,ac) V TC n R(3)= V-(V0 - KC,V (HUn,SP - HUnac)) B, xB Variable: r(l) = (D, HU1,ac,HUn,ac,B) 60 B=B0 - KC,B ( Tk,SP - Tk,ac) R(4)= .... Integration Controller equation www.dbta.tu-berlin.de Dynamic Model equation for a theoretical stage Solution method 1. Total material balance The equation system is a so called DAE (Differential Algebraic Equation System). In literature you will find powerful solution methods and programs e.g. DASSL, Gear –method etc. Here we will transform the equation system like the steady state model.. The solution procedure is useful for both steady state and dynamic simulation. + Hold up correlation, pressure loss correlation, Tray efficiency correlation, constraints 61 Mj - d(HUjL )/dt = 0 2. Component material balance Mj -d(HUjL *Xi,j ) / dt= 0 3. Phase equilibrium: Gi,j = 0 4. Summation equation: SXj = 0, SYj =0 5. Energy balance: Ej -d( HUjL hjL ) / dt = 0 6. Controller equation (e.g. PID Type) : Rl = 0 www.dbta.tu-berlin.de Equation system - Matrix notation Vj-1 . . . j-1 Lj-2 Vapor phase Interfacial area Vj Liquid phase j Vapor phase Feed Lj-1 F(X) = Liquid phase Vj+1 j+1 Lj Vapor phase Liquid phase Vj+2 . . . Mi,1 –d( HU1L *Xi,1 ) /dt E1 –d (HU1L *h1L )/dt Gi,1 ... Mi,j –d(HUjL *Xi,j )/dt Ej –d(HUjL *hjL )/dt Gi,j ... Mi,n –d(HUnL *Xi,n )/dt En –d(HUnL *hnL )/ dt Gi,n Rl =0 Lj+1 F = (F1 ,...,Fj ,...Fn )T X (t) = (X1 ,...,Xj ,...Xn )T 62 =0 Xj (t) j=1,2...n = (vi,j ,li,j ,Tj )T r(l)T www.dbta.tu-berlin.de Complete Process Model Bilinear Terms will be linearized: NC l i,j = Xi,j * Lj with : l i,j = L j i=1 NC v i,j = Y i,j * V j with: v i,j = V j) i=1 Remark: The modeling with component flows has the advantage for initialization e.g. reactor is cold and empty 63 Selection of the interation variables Remarks www.dbta.tu-berlin.de Solution Method The solution of the balance equations (linearized differential equation with e.g. Euler Approximation) and the nonlinear equations is done for each time step with the - X +1 =(dF/dX)-1 F Newton Raphson method X +1 =X + X +1 = Iteration Number X = Variable Vector F = Function vector The Jacoby matrix is important! 64 ( ) = Jacobi matrix www.dbta.tu-berlin.de Complete Process Model X = Variable vector, F =Function vector,(...) = Jacoby matrix B1 C1 P1 A2 B2 C2 P2 A3 B3 C3 P3 A4 B4 C 4 P4 A5 B5 C5 P5 Aj dF ( ---- ) = dx E1 E2 E3 E4 E5 Bj Cj .......................... An-2 Bn-2 Cn-2 An-1 Bn-1 Cn-1 An Bn Ej En-2 En-1 En Pj Pn-2 Pn-1 Pn G Aj= ( dFj / dxj-1 ) Bj= ( dFj / dxj ) Cj= ( dFj / dxj+1 ) G=(dR(l)/dr(l)) 65 Solution with Sparse Matrix Method www.dbta.tu-berlin.de Complete Process Model Transformation für j=1,2,3,….,n-1, n for Step 1 - 9 -1 j n-1 -1 jn -1 Step 1: Cj = Bj Cj Step 2: Pj = Bj Pj Step 3: Fj = Bj Fj jn Step 4: Bj+1 = Bj+1 – Aj+1Cj j n-1 Step 5: Pj+1 = Pj+1 - Aj+1Pj j n-1 Step 6: Fj+1 = Fj+1 – Aj+1Fj j n-1 Step 7: Ej+1 = Ej+1 - Ej Cj j n-1 66 Solution method Sparse Matrix Method www.dbta.tu-berlin.de Complete Process Model Transformation for Step 8: Step 9: j=1,2,3,….,n-1, n for Step 1-9 G = G - Ej Pj jn R = R – Ej Fj jn Step 10: r = G-1 R Step 11: xn = Fn - Pn r Step 12: 67 xj = Fj - Cj xj+1 – Pj r Solution method Sparse Matrix Method j = n-1, n-2, …3,2,1 www.dbta.tu-berlin.de Complete Process Model X = Variable vector, F =Function vector,(...) = Jacoby matrix B1 C1 P1 A2 B2 C2 P2 O*3,n A3 B3 C3 P3 A4 B4 C 4 P4 A5 B5 C5 P5 .......................... Aj Bj Cj Oj,3 Pj dF ( --- ) = .......................... dx An-2 Bn-2 Cn-2 Pn-2 An-1 Bn-1 Cn-1 Pn-1 An Bn Pn E1 E2 E3 E4 E5 ... Ej ...En-2 En-1 En G Pj= ( dFj / dr(l)) Ej= ( dR(l) / dxj ) Oj,3=(dFj/dx3) O*3,n=(dF3/dxn) 68 Solution method Sparse Matrix Method www.dbta.tu-berlin.de o B1 A2 q p C1 B2 C2 A3 B3 A4 r Oj,3 dF ( --- ) = dx E1 69 69 E2 E3 C3 B4 C 4 A5 B5 C5 .......................... Aj j BBjj CCjj A E4 O*3,n Pj .......................... An-2 Bn-2 Cn-2 An-1 Bn-1 Cn-1 An Bn E5 ... Ej ...En-2 En-1 En Oj,3=(F Solution method j/x3) Sparse Matrix Method P1 P2 P3 P4 P5 Pn-2 Pn-1 Pn G O*3,n=(F3/xn) www.dbta.tu-berlin.de Complete Process Model Transformation für Step 1 - 3 Step 1: j=1,2,3,….,n-1, n -1 Cj = Bj Cj -1 O*j,p = Bj O*j,p -1 Fj = Bj Fj Step 2: 70 j n-1 q j p-2 jn Or,j+1 = Or,j Cj o j p-2 Or,p = Or,p – Or,j O*p,j o j p-2 und qj Or,p = Or,p – Or,j Cj j = p-1 Or,j+1 = – Or,j Cj p j r-2 Ar = Ar – Or,j Cj j = r-2 Fr = Fr – Or,j Fj o j r-2 Or,j = 0 Solution method Sparse Matrix Method www.dbta.tu-berlin.de Complete Process Model Transformation für Step 1 - 3 Step 3: 71 j=1,2,3,….,n-1, n Bj+1 = Bj+1 – Aj+1Cj j n-1 Fj+1 = Fj+1 – Aj+1Fj j n-1 O*j+1,p = O*j+1,p - Aj+1 O*j,p q j p-2 Cj+1 = Cj+1 - Aj+1 O*j,p j p-2 Solution method Sparse Matrix Method www.dbta.tu-berlin.de Complete Process Model Step 4: Step 5: xn = Fn xj = Fj - Cj xj+1 xj = Fj - Cj xj+1 – O*j,p xp xj = Fj - Cj xj+1 72 Solution method Sparse Matrix Method j = n-1, n-2, …p-2,p-1 j = p-2, p-3, …,q+1, q j = q-1, q-2, …1 www.dbta.tu-berlin.de Complete Process Model Vj-1 . . . j-1 Lj-2 - X +1 =(dF/dX)-1 F Vapor phase Interfacial Area Vj Liquid phase j Vapor phase Feed Lj-1 j+1 Lj Vapor phase Liquid phase Vj+2 . . . X +1 =X + X +1 For each time step Liquid phase Vj+1 Solution Method Newton Raphson X = Variable vector F =Function vector Lj+1 ( ) = Jacoby matrix Problems – challenges: stiffness, Initialization, Index Problem ,... 73 Simultaneous solution for each time step www.dbta.tu-berlin.de Complete Process Model Vj-1 . . . j-1 Lj-2 Vapor phase • Flow profile Vj , Lj Interfacial Area Vj Liquid phase Lj-1 j Vapor phase Feed Liquid phase Vj+1 • Concentration profile Xi,j, Yi,j Lj • Temperature profile Tj j+1 Vapor phase • Heat duty Q1 , Qn Liquid phase Vj+2 Results . . . Lj+1 • Control variables r(l) (D, V, HU, PTop) Simulation results 74 •As a Function of time www.dbta.tu-berlin.de Complete Process Model results Methanol -Water separation - Feedflow - 10% 20 trays + reboiler + condenser D= const. Qreboiler=const. 75 Simulation results step responses www.dbta.tu-berlin.de Non equilibrium Model Model : non equilibrium (rate based approach) Concentrationsprofile Yi,j Lj-1 Vj hjV Xi,j-1 hj-1L j Tj ; pj Y Vapor Film Vapor phase bulk Ni,jV Ni,jL Fj X (Interfacial Area) Ei,j Liquid Film Liquid phase bulk hjF ZF (YF or XF )i,j Vj+1 76 hj+1V Yi,j+1 Lj Xi,j For complex application hjL www.dbta.tu-berlin.de Thank you very much for Your interest! 77 www.dbta.tu-berlin.de