Presentation is loading. Please wait.

Presentation is loading. Please wait.

Partial Differential Equations (PDEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Daniel Baur ETH Zurich, Institut für Chemie-

Similar presentations


Presentation on theme: "Partial Differential Equations (PDEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Daniel Baur ETH Zurich, Institut für Chemie-"— Presentation transcript:

1 Partial Differential Equations (PDEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Daniel Baur ETH Zurich, Institut für Chemie- und Bioingenieurwissenschaften ETH Hönggerberg / HCI F128 – Zürich

2 Partial Differential Equations  Problem definition: In a partial differential equation (PDE), the solution depends on more than one independent variable, e.g. space and time  The function is usually subject to both inital conditions and boundary conditions  Examples  Diffusion into semi-infinite slab:  Tubular reactor with dispersion: 2Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

3 Characterization of Second Order PDEs  Second order PDEs take the general form where A, B and C are coefficients that may depend on t and z  These PDEs fall in one of the following categories 1.B 2 – AC < 0: Elliptic PDE 2.B 2 – AC = 0: Parabolic PDE 3.B 2 – AC > 0: Hyperbolic PDE  There are specialized solvers for some types of PDEs, hence knowing its category can be useful for solving a PDE 3Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

4 Numerical Solution of PDEs  In general, it can be very difficult to solve PDEs numerically  One approach is to discretize all but one dimension of the solution; this way a system of ODEs is obtained that can be solved more easily  Note that these ODE systems are usually very stiff  There are different ways of discretizing a dimension, for example the finite differences method we saw earlier, or using arbitrary functions (polynomials, gaussians)  Sophisticated algorithms refine the discretization in places where the solution is still inaccurate pdepe  Matlab has a built-in solver for parabolic and elliptic PDEs in two dimensions, pdepe 4Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

5 Example: Tubular reactor  A tubular reactor with diffusion can be described with the following PDE model: 5Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE c in c out 0L Mass balance: Initial conditions: No discontinuity at outlet: Mass balance over inlet:

6 Example: Tubular reactor  Let’s take one step back: Local mass balance 6Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE c in c out 0L Convection Diffusion

7 Example: Tubular reactor 7Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Convection Diffusion

8 Initial conditions and boundary conditions  Implementing the initial conditions is straight forward, since every ODE requires an initial value (IVP)  How do we implement the boundary conditions? One solution: Create two pseudo grid points outside the grid that guarantee that the boundary conditions are fulfilled 8Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

9 The discretized tubular reactor  We end up with the following system of ODEs:  With the «boundary conditions» 9Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

10 Dimensionless tubular reactor  We can cast the model into dimensionless form by defining  Where Pe is the Peclet and Da is the Damköhler number 10Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE The numerical solution of a problem is usually much simpler if it is dimensionless (most variables will range from 0 to 1).

11 Discretized dimensionless tubular reactor  In dimensionless form, the equations read  With the «boundary conditions» 11Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

12 Assignment 1 1.Solve the dimensionless discretized model for the start-up of the tubular reactor for different values of Pe. Plot the concentration of A at the outlet against dimensionless time.  Use Da = 1, N = 100, y start = 0, tSpan = [0,1] and assume a first order reaction n = 1. Plot the profiles for 20 different values of Pe between and 100, looping over Pevec = logspace(- 4, 2, 20); What do you observe? When does the reactor reach steady state, depending on the back-mixing (large Pe = low back- mixing, small Pe = strong back-mixing)?  Use ode23s to solve the ODE system.  In your ODE function, use a for loop going from 2 to N-1; Remember that the ODEs number 1 and N have different forms than the rest due to the «boundary conditions» 12Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

13 Assignment 1 (continued) 2.What yields better steady-state conversion (1-y) for a first order reaction, a PFR (no back-mixing, Pe large) or a CSTR (infinite back-mixing, Pe small)?  Assume steady state is reached when the change from one time point to the next is smaller than 0.1% (you might have to extend tSpan). What is the conversion (1-y)? 3.Consider a second order reaction n = 2 and plot the concentration profiles for Pe = and Pe = 100.  How long does it take to reach steady state? What is the conversion?  What is better for a second order reaction, a PFR (no back-mixing, Pe large) or a CSTR (infinite back-mixing, Pe small)?  Which reaction order suffers more from choosing the wrong reactor? Calculate the ratios between the final conversions for the PFR and CSTR for first and second order reactions. 13Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE

14 Assignment 1 (continued) 4.Now consider a reaction that is fast compared to the residence time, set Da = 5. Which reactor is better? 14Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE


Download ppt "Partial Differential Equations (PDEs) 1Daniel Baur / Numerical Methods for Chemical Engineers / BVP and PDE Daniel Baur ETH Zurich, Institut für Chemie-"

Similar presentations


Ads by Google