0% found this document useful (0 votes)
47 views

Process Modeling Lecture 6

The document discusses numerical integration techniques like the midpoint rule, trapezoid rule, and Simpson's rule to evaluate definite integrals that cannot be solved analytically. It also covers integral equations where the unknown function appears under the integral sign, and examples where integration is used to determine properties of distributions and solve differential equations with integral solutions.

Uploaded by

Muddys007
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

Process Modeling Lecture 6

The document discusses numerical integration techniques like the midpoint rule, trapezoid rule, and Simpson's rule to evaluate definite integrals that cannot be solved analytically. It also covers integral equations where the unknown function appears under the integral sign, and examples where integration is used to determine properties of distributions and solve differential equations with integral solutions.

Uploaded by

Muddys007
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 51

CHEM-E7130

Process Modeling

Lecture 6

1
Outline

• Numerical integration
• Integral equations and integral functions
• Distributions and their properties
• Population balances

2
Numerical integration

In numerical integration, objective is to find a value for a


definite integral (integral over a known interval)

One-dimensional integration is considered here only.


b
y   f x dx
a
How to evaluate y if a, b, and f(x) is known but cannot be
integrated analytically? 3
Midpoint and trapezoid methods
Estimate function value over the interval either by
a constant (rectangle rule) or by a trapezoid
(linear approximation through the endpoints)
3

2.5

2
Trapezoid
1.5

y=ex Rectangle
1

0.5

0
4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Midpoint and trapezoid
1
Exact value y   e dx  e  e  1.718281828
x 1 0

Rectangle ye 1/ 2
 1.648721271
4% relative error

e e 1 0
Trapezoid y  1.859140914
2 8.2% relative error
5
Midpoint and trapezoid
ba
Simpson’s rule y f 0  4f 0.5  f 1
6

e  4e  e
0 0.5 1
y  1.718861152
6
0.03 % relative error

One more function evaluation per interval


Each interval is approximated with a quadratic polynomial
(higher order method than trapezoid or rectangle) 6
Newton-Cotes formulas

• Estimate function by polynomials through points


with equal distances from each other

• Trapezoid and midpoint: first order Newton-Cotes


• Simpson’s rule: second order N-C
• 3/8 Simpson: third order N-C
• Boole’s rule: fourth order N-C
• etc...
7
Quadratures
b n
y   f x dx   w i f x i 
a i 1

• Newton-Cotes: quadrature points xi from constant


intervals
• Gauss-Legendre quadratures: quadrature points from
zeros of Legendre polynomials. This is typically
optimal way of distributing the points where the
function is evaluated
8
Gauss-Legendre quadrature
1 n
y   f x dx   w i f x i 
0 i 1
number of
points xi wi y error %
1 0.5 1 1.648721 4.048262
2 0.788675135 0.5 1.717896 0.022432
0.211324865 0.5
3 0.887298335 0.277777778 1.718281 4.8E-05
0.5 0.444444444
0.112701665 0.277777778
4 0.930568156 0.173927423 1.718282 5.43E-08
0.669990522 0.326072577
0.330009478 0.326072577
9
0.069431844 0.173927423
Gauss-Legendre quadrature
1 n
y   f x dx   w i f x i 
0 i 1
number of
points xi wi y error %
5 0.953089923 0.118463443 1.718282 3.94E-11
0.769234655 0.239314335
0.5 0.284444444
0.230765345 0.239314335
0.046910077 0.118463443
6 0.966234757 0.085662246 1.718282 7.13E-12
0.830604693 0.180380787
0.619309593 0.233956967
0.380690407 0.233956967
0.169395307 0.180380787
10
0.033765243 0.085662246
Quadratures
• In practice, quadratures are applied piece-wise in
the interval
• Division into sub-intervals could be constant or
adaptive
• For a very high number of quadrature points,
floating point calculation error starts to dominate

X=10100 + 1 What is Y = X – 10100 ?

11
Integral functions
When differential equations are solved,
integration is the final step. Sometimes there is no
analytical solution to the integral. In those cases
the solution is given in terms of integral functions

 
x
erf x  
2
  2
Error function exp t dt
0

cx, t  c
2
c(0,t)=c0 c(,t)=0
D 2
t x c(x,0)=0
”diffusion equation” 12
Integral functions
cx, t  c 2
c(0,t)=c0 c(,t)=0
D 2
t x c(x,0)=0
1.2

Analytical solution: 1

0.0001

  x 
0.8 0.001

cx , t   c 0 1  erf 


0.01

 
0.05
0.6
0.2

  2 Dt   0.4

0.2

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Also: probability theory (cumulative normal distribution)... 13


Distributions
Often variable values are somehow distributed. In these cases,
(numerical) integration is often needed to get some distribution
properties

• Distributed variable number density


• 1/Length (1/m) Distribution. Often
scaled so that the area
under the curve = 1

• Distributed variable
• Length (m) 14
Distributions Size(m)
0.001
number
1
Distribution (1/m) 0.002 3
0.003 6
0.004 10
0.005 8
0.006 5
0.007 2
0.008 1
Standard
deviation?

Particle size (m)


Median? Average?
2
 L  
 
n L  
1  2 
e
2 15
Integral equations

• Any equation where an integral appears can be


called an integral equation.
• In mathematics, an equation where unknown
function is under integral sign is called an
integral equation
• Integral functions are such where unknown is
only outside the integral sign

16
Integral equations, example
y
Overall sample property f(s) is
measured, and we know the sample
size distribution y(s,L).

Our task is to find a size-dependent L


function g(L) that models how the
distributed property contributes to
the sample property

17
Integral equations, example
Example continues. L indicates athlete’s length and y is
probability that there is such an athlete in a team. Find a
function g that predicts how well the team succeeds (f).

L tallest g(L) for a


f s    ys, LgLdL y(L) basketball
L shortest
team

team athlete contribution g(L) for a


success length function chess team
distribution
L 18
Population balances

• As an example of integral equations


• Here only particle size distributions are
considered
• Generally any distributions (with one or more
distributed variables) can be modeled

19
What is the population balance
concept?
Population balance is about counting:

6 in

20
Compare to molar concentration:
Number of per unit

is the number density, similar to concentration.

mol / m3 = NA molecules in unit volume

However, not all particles are similar, they can e.g.


vary in their size, forming a size distribution that can
be modelled based on breakage, agglomeration,
growth etc. 21
Two kinds of coordinates:
external and internal
external: internal:

y
p1

x p2

22
Every dispersed phase property that is not assumed
constant, adds one dimension

Adding one more dimension to your model typically


increases the computational load by an order of magnitude.

Choose such coordinates (internal and external) which are


the most important to overall process performance

Here only size is considered as the internal coordinate


23
Distribution properties

• Density function f(L)  f L dL  1


L 0

 nLdL
• Number density, total number
Np 
of particles (per unit volume)
L 0


• Moments of the distribution mi   n L L i
dL
L 0
24

Mean diameters from
mi   nLL dL
i

moments L 0

• mi/mi-1 is a characteristic length (if moments are


for length coordinate)

• m1/m0 number average diameter

• m2/m1 length weighted average diameter

• m3/m2 area weighted average diameter


25
Use of size distribution moments:
Mass transfer area
Size(m) number
0.001 1
0.002 3
0.003 6
0.004 10
0.005 8
0.006 5
0.007 2
0.008 1

Mass transfer area is assumed to be the total


surface area of the particles
26
Mass transfer area
NP
s A  L V 2
NP i
sV
A  sA  L  2
i
i 1
NP

L32
i 1
sV  L 3
i
i 1

where s is a shape factor


L32 is the Sauter mean diameter (m3/m2)
 is the particle phase volume fraction
V is the total volume of the dispersion
27
Other characteristic numbers
2
 m1 
Standard deviation   m 2   
 m0 

describes the width of the distribution

Also other characteristic numbers can be


calculated from the moments: skewness, kurtosis

28
Example

Calculate moments and average diameters for


bubble size distribution that follows normal
distribution with average size 0.02 m and standard
deviation 0.002 m. Use Gauss quadrature.

  L  2 
 
nL 
1  22 
 
e
2

29
250

average size
200
0.02 m
150

standard deviation 100

0.002 m
50

0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04

  L  2 
   
  1  22 
mk      
k
n L L dL e Lk dL
L 0 L 0 2 
30
How to scale the quadrature points?
250

200

150

100

50

0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Distribution Points and weights (1000) for 6-point quadrature 31


xi wi f(xi) f(xi)wi
0.966235 0.08566225 0 0
0.830605 0.18038079 0 0

0.61931 0.23395697 0 0
0.38069 0.23395697 0 0

0.169395 0.18038079 0 0
0.033765 0.08566225 1.03E-08 8.84E-10

Sum = 8.84E-10. Not correct. It should be one.

32
Scale the points from 0.013 m to 0.027 m
250

200

150

100

50

0
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04

x  0 L  a, x  1 L  b L  b  a x  a
33
What would be a linear variable transformation L=f(x)?
Scaling
L  b  a x  a This is similar what you have done

dL  b  a dx
when non-dimensionalizing models.
Here you are actually doing the other
x0 La way around, as the points were
originally non-dimensional (0 to 1), but
x 1 L  b you transform them into physical sizes

b 1
y   f L dL  b  a  f b  a x  a dx
a 0
n
 b  a  w i f b  a x i  a 
i 1 34
xi wi Li f(Li) f(Li) wi
0.966235 0.08566225 0.026527 0.970432 0.083129
0.830605 0.18038079 0.024628 13.70599 2.472297
0.61931 0.23395697 0.02167 140.7405 32.92721
0.38069 0.23395697 0.01833 140.7405 32.92721
0.169395 0.18038079 0.015372 13.70599 2.472297
0.033765 0.08566225 0.013473 0.970432 0.083129

Sum = 0.9935. Almost correct (should be 1).

In practice, use several (adaptive) sub-intervals for


numerical integration. Suitable algorithms are available, but
a clue about the correct integration limits is usually needed.

Matlab: q = integral(fun,xmin,xmax) 35
Example: Other moments and
average diameters

 n
m k   f L L dL  b  a  w i f L i L 
k k
i
0 i 1
n
b  a  w i f b  a x i  a b  a x i  a k

i 1

36
m0 0.993513837
m1 0.019870277 m
m2 0.00040156 m2
m3 8.19738E-06 m3

d10=m1/m0 0.02 m
d21=m2/m1 0.020209078 m
d32=m3/m2 0.020413829 m

2
m1 m 2  m1 
  d10  0.02m      0.002045m
m0 m0  m0  37
Population balances
In population balances, the number balance equation is
formulated for a fraction of the distribution

Material balance Population balance:


in a reactor: y
y(L)

c c  2c
 v  D 2  r
t h h
L
38
Population balance equation

Time rate of change ”reaction” i.e. birth and death


Convection
due to breakage and coalescence
n L 
   vnL   BL   DL 
t
where
v is velocity (internal + external coordinates)
B is birth rate
D is death rate
What is convection along an internal coordinate (size)?39
Solution strategies for population
balance equations
1) Lagrangian or Monte Carlo methods
- dispersed particles are tracked. Suitable for
relatively lean dispersions
2) Method of moments
- when only approximate information is needed
3) Analytical solutions
- only seldom possible
4) Discretization of the internal coordinate
- general but sometimes laborious
40
Solution strategies for population
balance equations
1) Lagrangian or Monte Carlo methods
- dispersed particles are tracked. Suitable for
relatively lean dispersions
2) Method of moments
- when only approximate information is needed
3) Analytical solutions
- only seldom possible
4) Discretization of the internal coordinate
- general but sometimes laborious
41
Continuous distribution is discretized
for computational purposes
10000000

9000000

8000000

7000000

6000000

5000000

4000000

3000000

2000000

1000000

0
10.2 14.35 20.35 28.8 40.8 57.5 81.5 115 163 230 326 460
42
”Easy” problem: initial value ODE
Linear terms Nonlinear terms
Flow in Birth by breakage Birth by agglomeration

  L , L L gL Y + L , L , L FL , L Y Y


NC NC NC
dYi
Yi ,in i j i j j i j k j k j k
dt j1 j=1 k 1

 gL Y Y  FL , L Y  
Y
NC  Li , L
NC
j G Lj Yj  Li Li
L j
i ,out i i i i j j
j1 j1
Flow out Death by Death by Growth Primary
breakage agglomeration nucleation

43
Discretization tables
Construction of these tables is characteristic to the discretization
method
Breakage Agglomeration

  L , L L gL Y + L , L , L FL , L Y Y


NC NC NC
dYi
Yi ,in i j i j j i j k j k j k
dt j1 j=1 k 1

 gL Y Y  FL , L Y  
Y
NC  Li ,
NC L j G Lj Yj  Li Li
L j
i ,out i i i i j j
j1 j1

Growth

These depend only on discretization and chosen daughter size


distribution in breakage and should be calculated prior to the
simulation
44
All phenomena occurring in the system are modeled
based on particles at discrete classes. For example
bubble coalescence:

L ab  L  L 
La Lb
3 3 1/ 3
a b 45
Generally, the size of the bubble resulting from the
coalescence does not coincide with any category. In
case of equal diameter discretization it never does.

There are different methods how to distribute the


bubble resulting from the coalescence
Distribute the new bubble only in the closest category.
Very poor method, even number and volume cannot be
conserved simultaneously.


L ab  L  L
3
a b 
3 1/ 3 46
Distribute the new bubble in two closest categories. A
reasonably good method, 2 properties can be
conserved, typically number and volume. Perhaps the
most popular method nowadays.


L ab  L  L
3
a b 
3 1/ 3

How to calculate fractions y1 and y2 that goes


to the two neighbouring categories? 47
Number and volume conserved

L ab  L  L3
a b 
3 1/ 3

fraction of the coalesced particle to be distributed into


two closest categories

y1  y 2  1 number

L3ab  y1L31  y 2 L32 and volume


are conserved

two closest category sizes 48


Distribute the new bubble in several categories.
Method order increases as more properties are
conserved (e.g. moments)


L ab  L  L
3
a b 
3 1/ 3

49
Conclusions
• There are several methods for evaluating
definite integrals numerically. The simplest
ones are not usually very effective
• Gaussian quadratures are usually quite good
• Integral equations are such where unknown
function is under integral sign
• Integral functions are such where an integral
needs to be evaluated in order to calculate the
function value
50
Conclusions
• In population balances, distributions are
considered. For example particle size
distributions, when all particles are not of the
same size
• Moments are important measures of distribution
properties
• Population balances can be solved e.g. by
discretizing the internal coordinate into several
size classes, and following number of particles
in them 51

You might also like