Modeling, Simulation and Optimization for Chemical Engineering for CH3133- CC01 and CC02 Ho Chi Minh City University of Technology TABLE OF CONTENTS Types of modeling equations Examples of solving ODE Conservation principles Assumptions Types of Modelling Equations Course: Modeling, Simulation and Optimization for Chemical Engineering Types of modeling equations Algebraic equations (AEs) Modelling Equations algebric equation with one ore more variables Ordinary differential equations (ODEs) Differential equation with only one independent variable Partial differential equations (PDEs) equation which imposes relations between the various partial derivatives of a multivariable function Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water without Changing Volume) A tank which is initially filled with 15kg of salt dissolved in 3000L of water. Brine, at a concentration of 20 grams per litre (0.02kg/L), is flowing into the tank at a rate of 10 litres per minute. It is thoroughly mixed with the solution that's already in the tank. At the bottom of the tank, there is a pipe which is draining the mixed solution at the same flow rate as the brine flowing in. How much salt is in the tank after 1 hour? 10 L/min 0.02 Kg/L 3000 L y0=15 Kg 10 L/min Rate out=? Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) A tank which is initially filled with 15kg of salt dissolved in 3000L of water. Brine, at a concentration of 20 grams per litre (0.02kg/L), is flowing into the tank at a rate of 5 litres per minute. It is thoroughly mixed with the solution that's already in the tank. At the bottom of the tank, there is a pipe which is draining the mixed solution at the same flow rate as the brine flowing in. How much salt is in the tank after 1 hour? 10 L/min 0.02 Kg/L 3000 L y0=15 Kg 5 L/min Rate out=? Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) let y(t) be the amount of salt in the tank at any given time, t. At any time, the rate of change of salt dy/dt is the difference between the rate salt coming into the tank to the rate of salt leaving the tank. Now the rate of salt coming into the tank is simply the concentration of the brine by the flow rate of the solution The rate of salt leaving the tank, after being thoroughly mixed is similarly, the concentration of the solution by its flow rate Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) we have a differential equation depicting the rate of change of salt in our tank Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) Course: Modeling, Simulation and Optimization for Chemical Engineering Solution of ODE(Mixing Salt and Water with Changing Volume) Now that we have the general solution, let's apply the initial condition where we start with 15 kg in the 3000 L tank. So, at time 0 Solution of ODE(Mixing Salt and Water with Changing Volume) Amount of salt (kg) 60 𝑦 𝑡 = 50 120𝑡 + 0.1𝑡 + 9000 600 + 𝑡 40 30 20 10 0 0 50 100 150 200 250 300 Time (t) Course: Modeling, Simulation and Optimization for Chemical Engineering 350 Modeling Conservation Equations The Conservation principle Fundamental relations: mass, molecules, energy and momentum. Describes rate of change of the properties in the system. 𝑖 𝑔𝑒𝑛 (or 𝑐 𝑜𝑛 𝑠 ) 𝑜𝑢𝑡 𝑖𝑛 = rate of an entity (mass or energy) entering the system 𝑜𝑢𝑡 = rate of an entity leaving the system 𝑔𝑒𝑛 = rate of an entity generated (or 𝑐𝑜𝑛𝑠 consumed) inside the system (reaction) = amount of an entity change within the system at any point in time (accumulation) Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations General conservation principle equation In terms of unit time Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle The liquid tank system: • The liquid tank system consists of a single tank with liquid inlet and outlet and a liquid level that may be desired to be specified. • A system of two or more liquid tanks can be arranged such that they are interacting with one another. • The flow rate entering and leaving the tank is usually defined as volume flow rate. • Liquid tank system are usually non-reactive. • Liquid tank system may be equipped with heating or cooling mechanism. Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mass Balance of non-reactive system: 𝑚 𝑖𝑛 𝑔𝑒𝑛 (or Mass is neither generated nor destroyed 𝑑𝑚 = 𝑑𝑡 𝑚 , + 𝑑𝑚 = 𝑑𝑡 𝑚 𝑚 , − 𝑚 , , − 𝑚 , − 𝑚 , Course: Modeling, Simulation and Optimization for Chemical Engineering 𝑐𝑜𝑛𝑠) 𝑚 𝑚 𝑜𝑢𝑡 Modeling Conservation Equations • The Conservation principle F0 ρo • Mass Balance of non-reactive system: • Example 1: Consider a tank of perfectly mixed liquid. A liquid stream with density of ρo feeds the tank at a volumetric rate of Fo. The liquid volume holdup of liquid in the tank is V, and its density is ρ.The volumetric flow rate outflow from the tank is F. Because the liquid inside the tank is perfectly mixed, with liquid density of the outflow from the tank is similar as the density of liquid holdup inside the tank. Course: Modeling, Simulation and Optimization for Chemical Engineering ρ V F ρ Modeling Conservation Equations • The Conservation principle • Mass Balance of non-reactive system: Example 1: Solutions 𝑜 𝑜 If constant, 𝑜 Simulation: Tank H = 1 m and D = 0.4 m, Fo = 500 mL/min and F = 0.02V. Then over time (say 60 minutes) the volume of liquid inside the tank is going to reach a steady state volume of 0.031 m3. Course: Modeling, Simulation and Optimization for Chemical Engineering Approx. 25% of the tank volume Modeling Conservation Equations The Conservation principle Mass Balance of non-reactive system: In the previous example, what happens if there is no outlet flow? 𝑑𝑚 = 𝑑𝑡 Assuming 𝑜 , then 𝑚 Simulation: Tank H = 1 m and D = 0.4 m, Fo = 500 mL/min. Time to tank overflow = 250 minutes. , 𝑜 Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mass Balance of non-reactive system: What happens if there is only outlet but no inlet flow? 𝑑𝑚 =− 𝑑𝑡 Assuming 𝑜 𝑚 , , then How long will the tank completely dries up? Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle F0 ρo 𝑐 where 𝑐 𝐷2 4 the cross sectional area of the tank. ρ V Then, F ρ 𝑜 or, 𝑑ℎ 𝑑 4 𝜋𝐷 2 𝑜 The model above describes variation of liquid height inside the tank over time. Another way of saying this is the model describes the rate of change of liquid height inside the tank. Model is more useful for process control of liquid inside tank. Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mole Balance of non-reactive system: 𝑁𝐴,1 𝑁𝐴,2 𝑁𝐵,2 𝑑𝑁 = 𝑑𝑡 𝑁 , 𝑁𝐴,3 𝑁𝐵,3 𝑁 + 𝑁 , − 𝑑𝑁𝐴 = 𝑁𝐴,1 + 𝑁𝐴,2 − 𝑁𝐴,3 𝑑𝑡 𝑁 , − 𝑁 , Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mole Balance of non-reactive system: Example 2: Consider a tank of perfectly mixed liquid. A liquid feed stream with volumetric flowrate F1 containing concentration of ethylene glycol (A) in water (B) is fed into a mixing tank together with a liquid stream F2 containing a different concentration of EG in water. The liquid volume holdup of liquid in the tank is V, and its concentration is Ci, where i = (A,B). The volumetric flow rate outflow from the tank is F. Because the liquid inside the tank is perfectly mixed, with liquid concentration of the outflow from the tank is similar as the concentration of liquid holdup inside the tank. Develop a model to describe the rate of change of ethylene glycol concentration. Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mole Balance of non-reactive system: Example 2: Solutions 𝑑𝑁 = 𝑑𝑡 𝑁, + 𝑁 C , − 𝑁, 𝑑𝐶 𝑉 = 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 𝑑𝑡 𝑉 F2 CA2 CB2 F1 CA1 CB1 𝑑𝐶 = 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 𝑑𝑡 − 𝑁 , Assumptions made: Well mixed tank. Constant liquid hold-up Course: Modeling, Simulation and Optimization for Chemical Engineering V F CA CB Modeling Conservation Equations The Conservation principle Mole Balance of non-reactive system: In Example 2, the assumption of constant hold-up of liquid inside tank makes the mathematics easy to work with. But what if the hold-up of liquid is not constant? It means what if V is a variable. The LHS of the model is then a derivative of 2 variables, 𝑖 and . Here you will apply the chain rule: 𝑑𝐶 𝑉 = 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 𝑑𝑡 𝑉 𝑑𝐶 𝑑𝑉 +𝐶 = 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 𝑑𝑡 𝑑𝑡 Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mole Balance of non-reactive system: From mass balance, it is easy to show that 𝑑𝑉 𝑑𝑡 = 𝐹1 + 𝐹2 − 𝐹 Then replacing 𝑑𝑉 in the model gives 𝑑 𝑉 𝑉 𝑑𝐶 + 𝐶 𝐹 + 𝐹 − 𝐹 = 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 𝑑𝑡 𝑑𝐶 + 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 = 𝐹 𝐶 , + 𝐹 𝐶 , − 𝐹𝐶 𝑑𝑡 𝑑𝐶 𝑉 =𝐹 𝐶, −𝐶 +𝐹 𝐶, −𝐶 𝑑𝑡 Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Mole Balance of non-reactive system: ∆𝑄 𝐸𝑖𝑛 𝑑𝐸 𝑑𝑡 𝐸̇ , − 𝐸̇ ∆𝑊 𝐸 𝐸𝑜𝑢𝑡 , The law of conservation of energy states that energy can neither be created nor destroyed – only converted from one form of energy to another. Can you recall which law of thermodynamics supports this statement? Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Energy Balance of non-reactive system: Example 3: Consider a tank of perfectly mixed liquid. Water flows with volumetric flowrate F1 and temperature T1 into a tank. The liquid volume holdup of liquid in the tank is V, and its density is r. The volumetric flow rate outflow from the tank is F and temperature T. The liquid volume in the tank is heated with jacketed steam supply at Tsteam = 130oC. Develop a model to describe the rate of change of temperature inside the tank. Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Energy Balance of non-reactive system: Example 3: Solutions Assumptions: Well mixed tank. Constant liquid holdup cp is constant. Course: Modeling, Simulation and Optimization for Chemical Engineering Modeling Conservation Equations The Conservation principle Energy Balance of non-reactive system: It is also easy to show by mass balance that for constant holdup of liquid inside tank, 1 . Then, For heat transfer between steam and liquid inside tank, Therefore the final model for rate of change of temperature inside the tank, Course: Modeling, Simulation and Optimization for Chemical Engineering