Problems in modelling and simulation

Embed Size (px)

Citation preview

  • 8/4/2019 Problems in modelling and simulation

    1/24

    Page 1

    THE USE OF MATHEMATICAL SOFTWAREPACKAGES IN CHEMICAL ENGINEERING

    INTRODUCTION

    This collection of problems wa s developed for Session 12 at th e ASE E Ch emical En gi-

    neering Su mmer School held in Snowbird, Ut ah on August 13, 1997. These pr oblems

    are int ended to ut ilize th e basic nu merical methods in problems which are a ppropri-

    ate to a variety of chemical engineering subject area s. The pr oblems ar e titled a ccord-

    ing to the chemical engineering principles which a re u sed, the problems a re a rra nged

    according to the nu merical methods which ar e applied as su mm arized in Table 1.

    The problem has been solved by each of the mathematical packages: Excel,

    Maple, Mathcad*, MATLAB, Mathematica*, and Polymath*. The CACHE Corpora-

    tion has made available this problem set as well as the individual package writeups

    * This material was originally distributed at the Chemical Engineering Summer School at Snow-bird, Utah on August 13, 1997 in Session 12 entitled The U se of Mathema tical Software in ChemicalEngineering. The Ch. E. Summer School was sponsored by the Chemical Engineering Division of theAmerican Society for E ngineering Education. This mat erial is copyrighted by th e au thors, and permis-sion m ust be obtained for du plication un less for edu cational u se within depa rtm ents of chemical engi-neering.

    Mathematical Software - Session 12*

    Micha el B. Cutlip, Depar tm ent of Chem ical En gineerin g, Box U-222, Un iversity

    of Conn ecticut , Storr s, CT 06269-3222 (mcutlip@uconnvm .uconn .edu)

    John J. Hwalek, Departm ent of Chemical Engineering, University of Maine,

    Orono, ME 04469 (hwa lek@ma ine.ma ine.edu)

    H. Eric Nutt all, Depart ment of Chemical and Nu clear E ngineering, University

    of New Mexico, Albuqu erqu e, NM 87134-1341 (nut ta ll@un m.edu )

    Mordechai Sha cham, Depart ment of Chemical Engineering, Ben-Gurion Uni-

    versity of the N egev, Beer Sheva , Isra el 84105 (sha cham @bgum ail.bgu.ac.il)

    Additional Contr ibutors:

    Joseph Bru le, J ohn Widman n, Tae H an , and Bru ce Finlayson, Departm ent of

    Chem ical E ngineer ing, Universit y of Wash ington, Sea tt le, WA 98195-1750

    ([email protected] ington.edu )

    Edwa rd M. Rosen, EMR Techn ology Group, 13022 Musk et Ct ., St. Louis, MO

    63146 (EMR ose@comp us er ve.com)

    Ross Taylor, Department of Chemical Engineering, Clarkson University, Pots-

    dam , NY 13699-5705 (taylor@sun .soe.clar kson.edu )

    A COLLECTION OF REPRESENTATIVE PROBLEMS IN CHEMICAL

    ENGINEERING FOR SOLUTION BY NUMERICAL METHODS

  • 8/4/2019 Problems in modelling and simulation

    2/24

    Page 2 MATHEMATICAL SOFTWARE PACKAGES IN CHEMICAL ENGINEERING

    an d pr oblem solutions at htt p://www.che.utexas.edu/cache/. The ma terials ar e a lso available via a non-

    ymous FTP from ftp.engr.uconn .edu in directory /pub/ASEE. The problem set an d det ails of th e vari-ous solut ions ar e given in sepa ra te documents as Adobe PDF files. Additiona lly, the problem set s a re

    available for th e various ma th emat ical pa ckage a s working files which can be downloaded for execu-

    tion with the mathematical software. This method of presentation should indicate the convenience

    an d str engths/weakn esses of each of the ma them atical softwar e packages an d provides working solu-

    tions.

    The selection of problems has been coordinated by M. B. Cutlip who served as the session chair-

    man . The par ticular co-auth or who ha s considerable experience with a par ticular mat hema tical pack-

    age is responsible for the solut ion with th at package*.

    Excel** - Edwa rd M. Rosen, EMR Technology Group

    Maple** - Ross Taylor, Clar kson Un iversity

    Mathematica** - H. Eric Nuttall, University of New Mexico

    Mathcad** - John J. Hwalek, University of Maine

    MATLAB** - Joseph Brule, John Widmann, Tae Han, and Bruce Finlayson, Department of

    Chemical Engineering, University of Washington

    POLYMATH** - Michael B. Cutlip, University of Connecticut and Mordechai Shacham, Ben-

    Gurion Un iversity of th e Negev

    This selection of problems sh ould help chemical en gineering faculty evaluat e which ma them ati-

    cal problem solving package they wish to use in their courses and should provide some typical prob-

    lems in various courses which can be utilized.

    * The CACHE Corporat ion is non-profit educational corporation supported by most chemical engineering departm entsand man y chemical corporat ion. CACHE stan ds for comput er a ides for chemical engineering. CACHE can be conta cted at P.O. Box 7939, Aust in, TX 78713-7939, Ph one: (512)471-4933 Fax: (512)295-4498, E-ma il: cache @ut s.cc.utexa s.edu , In te rn et:http://www.che.utexas.edu/cache/

    ** Excel is a trademark of Microsoft Corporation (http://www.microsoft.com), Maple is a trademark of Waterloo Maple,Inc. (http://maplesoft.com), Mathematica is a trademark of Wolfram Research, Inc. (http://www.wolfram.com), Mathcad is atrademark of Mathsoft, Inc. (http://www.mathsoft.com), MATLAB is a trademark of The Math Works, Inc. (http://www.math-works.com), and POLYMATH is copyrighted by M. B. Cutlip an d M. Sha cham (http ://www.polyma th -software.com).

  • 8/4/2019 Problems in modelling and simulation

    3/24

    Problem Page 3

    * Problem origina lly suggested by H . S. Fogler of the Univer sity of Michigan** Problem preparation assistance by N. Brauner of Tel-Aviv University

    These problem are t aken in par t from a n ew book entitled Problem Solving in Chem ical En gineering with N umer icalMethods by Michael B. Cutlip and Mordechai Shacham to be published by Prentice-Hall in 1999.

    Table 1 Selection of Problems Solutions Illustrating Mathematical Software

    COURSE PROBLEM TITLEMATHEMATICAL

    MODEL PROBLEM

    Introduction toCh. E.

    Molar Volum e an d Compres sibility Factorfrom Van Der Waa ls Equ at ion

    Single NonlinearEquation

    1

    Introduction toCh. E.

    Steady State Mat erial Balances on a Sep-ara tion Train*

    Simultaneous Lin-ear Equat ions

    2

    MathematicalMethods

    Vapor Pr essure Data Representat ion byPolynomials and Equ at ions

    Polynomial Fit -ting, Linear andNonlinear Regres-sion

    3

    Thermodynamics React ion Equil ibr ium for Mult iple Gas

    Phase Reactions*

    Simultaneous

    Nonlinear Equa -tions

    4

    F lu id Dyn am ics Ter min al Velocit y of Fa llin g P ar ticles S in gle N on lin ea rEquation

    5

    H ea t Tr an sfer Un st ea dy St at e H ea t E xch an ge in aSeries of Agitated Tanks*

    SimultaneousODEs with kn owninitial conditions.

    6

    Ma ss Tr a ns fe r Diffu sion wit h Ch em ica l Rea ct ion in aOne Dimensional Slab

    SimultaneousODEs with splitbounda ry condi-tions.

    7

    Separation

    Processes

    Binary Batch Dist illa t ion** Simultaneous Dif-

    ferential and Non-linear AlgebraicEquations

    8

    ReactionEngineering

    Reversible, Exoth ermic, Gas Ph ase Reac-tion in a Cat alytic Reactor*

    SimultaneousODEs an d Alge-braic Equations

    9

    Pr ocess Dyna micsand Control

    Dynamics of a Heat ed Tank with PI Tem-perature Control**

    Simultaneous StiffODEs

    10

    Selection

  • 8/4/2019 Problems in modelling and simulation

    4/24

    Page 4 MATHEMATICAL SOFTWARE PACKAGES IN CHEMICAL ENGINEERING

    1. MOLAR VOLUME AND COMPRESSIBILITY FACTORFROM VAN DER WAALS E

    QUATION

    1.1 Numerical Methods

    Solution of a single nonlinear algebraic equation.

    1.2 Concepts Utilized

    Use of the van der Waals equation of state to calculate molar volume and compressibility factor for a

    gas.

    1.3 Course Useage

    Intr oduction to Ch emical E ngineering, Therm odynam ics.

    1.4 Problem Statement

    The ideal gas law can repr esent t he pr essure-volume-temperat ur e (PVT) relationship of gases only at

    low (near atmospheric) pressures. For higher pressures more complex equations of state should be

    used. The calculation of the molar volume and the compressibility factor using complex equations of

    stat e typically requires a n umer ical solution when the pr essure an d tempera tur e are specified.

    The van der Waa ls equat ion of state is given by

    (1)

    where

    (2)

    and

    (3)

    The variables are defined by

    P = pressure in atm

    V

    = molar volume in liters/g-mol

    T = temperatur e in K

    R

    = gas const an t (

    R

    = 0.08206 atm

    .

    liter/g-mol

    .

    K)

    T

    c

    = critical tempera tur e (405.5 K for am monia)

    P

    c

    = critical pressu re (111.3 at m for a mmonia)

    Pa

    V2

    -------+ V b( ) R T=

    a27

    64------

    R2Tc

    2

    Pc--------------

    =

    bR Tc

    8Pc-----------=

  • 8/4/2019 Problems in modelling and simulation

    5/24

    Problem 1. MOLAR VOLUME AND COMPRESSIBILITY FACTOR FROM VAN DER WAALS EQUATION Page 5

    Reduced pressure is defined as

    (4)

    and the compressibility factor is given by

    (5)

    PrPPc------=

    ZPV

    R T---------=

    (a ) Calculate the molar volume and compressibility factor for gaseous ammonia at a pressure

    P = 56 atm and a temperature T = 450 K using th e van der Waa ls equat ion of state.

    (b ) Repeat the calculat ions for the following redu ced pr essures: Pr = 1, 2, 4, 10, and 20.

    (c ) How does the compressibility factor vary as a function ofPr.?

  • 8/4/2019 Problems in modelling and simulation

    6/24

    Page 6

    MATHEMATICAL SOFTWARE PACKAGES IN CHEMICAL ENGINEERING

    2. S

    TEADY S

    TATE M

    ATERIAL B

    ALANCES ON A S

    EPARATION

    T

    RAIN

    2.1 Numerical Methods

    Solut ion of simultan eous linear equat ions.

    2.2 Concepts Utilized

    Materia l balances on a steady st at e process with n o recycle.

    2.3 Course Useage

    Intr oduction to Chemical Engineering.

    2.4 Problem Statement

    Xylene, styrene, toluene an d benzene ar e to be separat ed with th e ar ray of distillat ion column s th at is

    shown below wher e F, D, B, D1, B1, D2 and B2 a re t he m olar flow rat es in m ol/min.

    15% Xylene

    25% Styren e

    40% Toluene

    20% Benzene

    F=70 m ol/min

    D

    B

    D1

    B1

    D2

    B2

    {

    {

    {

    {

    7% Xylene4% Styren e

    54% Toluene35% Benzene

    18% Xylene24% Styrene42% Toluene16% Benzene

    15% Xylene10% Styrene54% Toluene21% Benzene

    24% Xylene65% Styrene10% Toluene

    1% Benzene

    #1

    #2

    #3

    Figure 1 Separation Train

  • 8/4/2019 Problems in modelling and simulation

    7/24

    Problem 2. STEADY STATE MATERIAL BALANCES ON A SEPARATION TRAIN Page 7

    Mater ial balances on individual components on t he overall separa tion tra in yield th e equat ion set

    (6)

    Overall balances and individual component balances on column #2 can be used to determin e the

    molar flow rate a nd m ole fractions from th e equat ion of stream D from

    (7)

    where X

    Dx

    = mole fraction of Xylene, X

    Ds

    = mole fraction of Styrene, X

    Dt

    = mole fraction of Toluene,

    and X

    Db

    = mole fraction of Benzene.

    Similarly, overall balances and individual component balances on column #3 can be used to

    determ ine the m olar flow ra te an d mole fra ctions of stream B from th e equation set

    (8)

    Xylene: 0.07D1 0.18B1 0.15D2 0.24B2 0.15 70=+ + +

    Styrene: 0.04D1

    0.24B1

    0.10D2

    0.65B2

    0.25 70=+ + +

    Toluene: 0.54D1

    0.42B1

    0.54D2

    0.10B2

    0.40 70=+ + +

    Benzene: 0.35D1

    0.16B1

    0.21D2

    0.01B2

    0.20 70=+ + +

    Molar Flow Rat es: D = D1 + B 1

    Xylene: XDxD = 0.07D1 + 0.18B1

    Styrene: XDsD = 0.04D1 + 0.24B1Toluene: XDt D = 0.54D1 + 0.42B1Ben zen e: XDbD = 0.35D1 + 0.16B1

    Molar Flow Rat es: B = D2 + B 2

    Xylene: XBxB = 0.15D2 + 0.24B2Styrene: XBsB = 0.10D2 + 0.65B2

    Toluene: XBt B = 0.54D2 + 0.10B2Benzene: XBbB = 0.21D2 + 0.01B2

    (a ) Calculat e the molar flow rates of strea ms D1, D2, B 1 and B2.

    (b ) Determine t he molar flow rat es and compositions of strea ms B and D.

  • 8/4/2019 Problems in modelling and simulation

    8/24

    Page 8 MATHEMATICAL SOFTWARE PACKAGES IN CHEMICAL ENGINEERING

    3. VAPOR PRESSURE DATA REPRESENTATIONBY POLYNOMIALSAND EQUATIONS

    3.1 Numerical Methods

    Regression of polynomials of various degrees. Linear regression of mathematical models with variable

    tra nsforma tions. Nonlinear regression.

    3.2 Concepts Utilized

    Use of polynomials, a modified Clausiu s-Clapeyron equa tion, and t he Antoine equa tion to model vapor

    pressure versus temperatur e data

    3.3 Course Useage

    Math emat ical Meth ods, Thermodynamics.

    3.4 Problem Statement

    Table (2) presents data of vapor pressure versus temperature for benzene. Some design calculations

    require these data to be accurately correlated by various algebraic expressions which provide P in

    mmH g as a fun ction ofT in C.

    A simple polynomial is often used a s a n empirical modeling equa tion. This can be wr itten in gen-

    eral form for this problem as

    (9)

    where a0... an ar e th e par am eters (coefficients) to be determined by regression a nd n is th e degree of

    th e polynomial. Typically the degree of th e polynomial is selected which gives th e best data r epres en-

    Table 2 Vapor Pressure of Benzene (Perry3)

    Temperature, T(oC)

    Pressure, P(mm Hg)

    -36.7 1

    -19.6 5

    -11.5 10

    -2.6 20

    +7.6 40

    15.4 60

    26.1 100

    42.2 200

    60.6 400

    80.1 760

    P a0 a1T a2T2 a3T

    3 ...+an Tn+ + + +=

  • 8/4/2019 Problems in modelling and simulation

    9/24

    Problem 3. VAPOR PRESSURE DATA REPRESENTATION BY POLYNOMIALS AND EQUATIONS Page 9

    ta tion when using a least-squares objective function.

    The Clausius-Clapeyron equation which is useful for the correlation of vapor pressure data is

    given by

    (10)

    where P is the vapor pressure in mm Hg and T is the tempera tur e in C. Note tha t th e denomina tor is

    just t he absolute tempera tu re in K. Both A and B are t he par ameters of the equation which are t ypi-

    cally deter mined by regression.

    The Antoine equa tion which is widely used for t he r epresenta tion of vapor pressu re da ta is given

    by

    (11)

    where typically P is the vapor pressure in m mHg an d T is the temperatu re in C. Note tha t th is equa-

    tion has par ameters A ,B , an d Cwhich m ust be determined by nonlinear r egression a s it is not possi-

    ble to linear ize this equa tion. The Ant oine equa tion is equivalent t o the Clau sius-Clapeyron equat ion

    when C= 273.15.

    P( )log A BT 273.15+---------------------------=

    P( )log A BT C+---------------=

    (a) Regress the data with polynomials having the form of Equa tion (9). Determ ine th e degree of

    polynomial which best repr esents th e data .

    (b) Regress the data using linear regression on Equa tion (10), the Clausiu s-Clapeyron equ ation.

    (c) Regress the data using nonl inear regression on E qua tion (11), the Antoine equ ation.

  • 8/4/2019 Problems in modelling and simulation

    10/24

    Page 10 MATHEMATICAL SOFTWARE PACKAGES IN CHEMICAL ENGINEERING

    4. REACTION EQUILIBRIUMFOR MULTIPLE GAS PHASE REACTIONS

    4.1 Numerical Methods

    Solution of systems of nonlinear algebraic equations.

    4.2 Concepts Utilized

    Complex chemical equilibrium calculations involving multiple reactions.

    4.3 Course Useage

    Therm odyna mics or Rea ction En gineering.

    4.4 Problem Statement

    The following rea ctions ar e ta king place in a const an t volume, gas-pha se bat ch rea ctor.

    A system of algebraic equations describes the equilibrium of the above reactions. The nonlinear

    equilibrium relationships ut ilize the th ermodynamic equilibrium expressions, and t he linear relation-

    ships h ave been obtained from th e stoichiometry of the reactions.

    (12)

    In th is equat ion set an d are concentr at ions of th e various species at

    equilibrium resulting from initial concentrations of only CA0 and CB0. The equilibrium const an ts KC1 ,

    KC2 and KC3 ha ve known values.

    A B+ C D+B C X Y ++A X Z +

    KC1

    CCCD

    CA CB----------------= KC2

    CXCY

    CB CC

    -----------------= KC3

    CZ

    CA CX-----------------=

    CA CA 0 CD CZ= CB CB 0 CD CY=

    CC CD CY= CY CX CZ+=

    CA CB CC CD CX CY,,,,, CZ

    Solve this system of equations when CA0 = CB0 = 1.5, , an d

    star ting from four sets of initial estimat es.

    (a)

    (b)(c)

    KC1 1.06= KC2 2.63= KC3 5=

    CD CX CZ 0= = =

    CD CX CZ 1= = =CD CX CZ 10= = =

  • 8/4/2019 Problems in modelling and simulation

    11/24

    Problem 5. TERMINAL VELOCITY OF FALLING PARTICLES Page 11

    5. TERMINAL VELOCITYOF FALLING PARTICLES

    5.1 Numerical Methods

    Solution of a single nonlinear algebraic equation..

    5.2 Concepts Utilized

    Calculat ion of term ina l velocity of solid pa rt icles falling in flu ids u nder th e force of gravit y.

    5.3 Course Useage

    Fluid dyna mics.

    5.4 Problem Statement

    A simple force balance on a spherical particle reaching terminal velocity in a fluid is given by

    (13)

    wher e is th e ter mina l velocity in m/s, g is th e accelera tion of gravit y given by g = 9.80665 m/s2,

    is the particles density in kg/m 3, is the fluid density in kg/m 3, is th e diameter of the sphericalpar ticle in m a nd CD is a dimensionless drag coefficient.

    The dr ag coefficient on a spherical part icle at term inal velocity varies with th e Reynolds nu m-

    ber (Re) as follows (pp. 5-63, 5-64 in Perry3).

    (14)

    (15)

    (16)

    (17)

    where and is th e viscosity in Pa s or k g/m s.

    v t

    4 g p ( )Dp3CD

    -------------------------------------=

    v t pDp

    CD24

    R e-------= for R e 0.1