Download presentation
Presentation is loading. Please wait.
1
CHEM-E7130 Process Modeling Lecture 3
2
Lecutre 3 outline Physical models vs. mathematical similarity
Numerical methods and tools to solve initial value ordinary differential equations Programming and modeling with Matlab Stiff ordinary differential equations
3
One model from the previous lecture
What did this describe? How molar flux along the reactor was modeled? What happens at steady state? What happens if Peclet number is very high? High Pe, negligible axial dispersion: Steady state
4
A dynamic stirred tank reactor
Initially, a batch is set Reactor is stirred vigorously so that it is uniform in composition No feed or heat transfer during the batch, let’s assume isothermal operation Write a material balance for this kind of reactor
5
A dynamic stirred tank reactor
Integral form Differential form Negligible volume change
6
Comparison Dynamic stirred tank Constant volume Plug-flow reactor
Steady state Constant velocity No axial dispersion
7
Comparison Residence time in the plug flow reactor Plug-flow reactor
8
Comparison Dynamic stirred tank Plug-flow reactor
Mathematically the problem is the same The same numerical solution!
9
Some solutions Model Initial condition Closure: first order reaction
10
Separable form, analytical solution possible
11
How would you solve this numerically with e.g. Excel?
Euler’s method Explicit Euler if is calculated at tn Implicit Euler if is calculated at tn+1
12
Numerical solution: Euler’s method
For the test problem: Explicit Euler Implicit Euler
13
Numerical solution: Euler’s method
Implicit Euler For this linear test problem we have an explicit formulation Usually implicit methods require solution of a nonlinear set of equations at each time step For example, pth order reaction
14
Example c0=1 k=0.1 t=1
15
Example c0=1 k=0.5 t=1
16
Example c0=1 k=1 t=1
17
Example c0=1 k=1.5 t=1
18
Example c0=1 k=2 t=1
19
Example c0=1 k=2.5 t=1
20
Shorter time steps c0=1 k=2.5 t=0.2
21
Other options Calculate at average of tn and tn+1
22
Crank-Nicolson method
23
Crank-Nicolson method
Stable, but oscillates!
24
ODE solvers available in Matlab
Solves These Kinds of Problems Method ode45 Nonstiff differential equations Runge-Kutta ode23 ode113 Adams ode15s Stiff differential equations and DAEs NDFs (BDFs) ode23s Stiff differential equations Rosenbrock ode23t Moderately stiff differential equations and DAEs Trapezoidal rule ode23tb TR-BDF2 ode15i Fully implicit differential equations BDFs
25
A catalyst particle model
We want to study dynamical behavior of a single catalyst particle. Some assumptions: Spherical particle One phase outside the particle (vapor or liquid) Uniform and constant (time invariant) conditions (concentrations, temperature, pressure) around the particle Uniform conditions inside the particle (but different from those outside) Catalytic reaction inside the particle Heat and mass transfer resistance outside the particle
26
A sketch Particle is assumed to be spherical (this assumption needs to be stated since we need the surface area Outside region (”box”) shape is irrelevant
27
Model equations Material balance Spherical porous particle
Particle properties time invariant
28
Model equations Enthalpy balance Catalyst particle enthalpy
Guess all these If we want to reduce the number of guessed parameters, average heat capacity Guess only these
29
Model equations Review: What assumptions so far? One fluid phase
Constant heat capacity Apparent density and heat capacity Be careful with the heat of reaction convention! For multiple phases, it is advisable to use formation enthalpies
30
Model equations Material balance Enthalpy balance Reaction rate
31
General programming scheme for these models
Main program, initialization User model giving source terms or errors in the balances Solver Colors indicate how much a user needs to do/know about various blocks. Solver is typically coded already, but user model needs to be given. Initialization means initial values or initial guesses for the variables, initialization of paramters etc. Source terms typically for differential equations, errors in the balances for algebraic set of equations (e.g. CSTR) In the previous example, parameters were given in the user model, but very often they are given in the initialization and then transferred to the user model Post-processing results (graphs etc.)
32
Matlab code Explain what happens here to a person sitting next to you!
function catparticle(tint) % initial variables c0=100; % concentration (mol/m3) T0=600; % temperature (K) % tighten integration tolerances options = odeset('RelTol',1e-10,'AbsTol',1e-10); [t,st] = [0,tint], [c0,T0], options); figure(1) plot(t,st(:,1)) title('concentration (mol/m3)','FontSize',12) xlabel('time (s)','FontSize',12) figure(2) plot(t,st(:,2)) title('temperature (K)','FontSize',12)
33
Matlab code A person sitting next to you will explain this to you!
function dx=dsdt(t,x) c=x(1); % first variable is concentration (mol/m3) T=x(2); % second is temperature (K) eps=0.5; % void fraction kr=2e9; % kinetic pre-exponential factor E=100000; % activation energy (J/mol) R=8.3144; % gas constant (J/Kmol) DHr= ; % heat of reaction (J/mol) cp=1000; % average heat capacity (J/kgK) rho=2000; % average density (kg/m3) k=0.02; % mass transfer coefficient (m/s) h=600; % heat transfer coefficient (W/m2K) d=0.001; % particle diameter (m) cout=100; % outside fluid concentration same than initial Tout=600; % outside temperature rate=kr*exp(-E/(R*T))*c; dcdt=1/eps* (-rate+6*k/d*(cout-c)); dTdt=1/(cp*rho)* (-rate*DHr+6*h/d*(Tout-T)); dx(1,1)=dcdt; dx(2,1)=dTdt;
34
Some results kr=1e9
35
Some results kr=2e9
36
Some results kr= e9
37
Some results one hour kr= e9
38
Some results one day kr= e9
39
Some results one week kr= e9
40
Some results a ten second period at
6 days, 13 h, 1 min and 10 s after start kr= e9
41
Some results kr=2.4e9
42
Stiff differential equations
Formally ratio of eigenvalues In practice, if there are simultaneously very fast phenomena dictating step sizes, and very slow phenomena dictating simulation time, system is stiff. E.g. reaction: slow reaction between molecular species, perhaps mass transfer limitations... very rapid reaction approaching equilibrium, e.g. ion reactions
43
kf kr in batch reactor kf determines step size in numerical solution but kr the total simulation (reaction batch etc.) time. This case leads to ”pseudo-steady state” for cA, but sometimes this kind of simplification is not so easy.
44
kf kr in batch reactor How many variables you would need to solve this in a) isothermal case, b) adiabatic case? List some other assumptions that are needed to be done / checked Is this linear model? Can it be solved analytically? Note! Nothing is said if there are other than these three components! How many phases, if mixing is ideal etc... Yes it is, yes it can! d(c)/dt=[A](c)
45
Summary Dimensionless numbers can be obtained from
traditional dimensional analysis ratios of two dimensionally similar objects by non-dimensionalizing model equations Models can be classified in mathematical or physical point of view. There are numerous ways to classify models. Model classification helps to choose the best numerical methods for solution Simulation, design, and optimization problems are different ways of looking at the same physical process
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.