CHP 445 Notes ver1.pdf

download CHP 445 Notes ver1.pdf

of 37

Transcript of CHP 445 Notes ver1.pdf

  • 7/23/2019 CHP 445 Notes ver1.pdf

    1/37

    Moi University

    School of Engineering

    Department of Chemical & ProcessEngineering

    Osembo S Otieno

    Office: T 76

    Ext.: 496

    CHP 445:

    PROCESS MODELLING &

    SIMULATION

  • 7/23/2019 CHP 445 Notes ver1.pdf

    2/37

    2

    CHP 445: Process Modelling & Simulation

    Course Content

    Introduction: definition of a process model, model of a typical system; strategy for modeldevelopment; classes of models; procedure for model building. Physico-chemical (functional)

    models.

    Numerical solution techniques for system of algebraic equations, ordinary differential equationsand partial differential equations.

    Numerical simulation of a process system using one of the programming languages (e.gPASCAL, FORTRAN, C++).

    Computational simulation of chemical processes using the softwares (e.g. ASPEN PLUS,FLUENT, PROSIM).

    Course Plan

    Week 1 Registration

    Week 2 Introduction, classes of models, model of a typical system

    Week 3 Strategy for model development, procedure for model building

    Week 4 Physico-chemical models

    Week 5 CAT I

    Week 6 Numerical solution techniques for algebraic equations and polynomials

    Week 7 Numerical solution techniques for ODE and PDE

    Week 8 CAT II

    Week 9 Computational simulation packages review

    Week 10 Numerical simulation of a process system using programming languageWeek 11 Presentation of assignment

    Week 12 Presentation of assignment

    Week 13 Revision

    Assessment:

    S/No Item Mark, %

    1 Semester Exam 402 CAT I & II 203 Assignments 204 Class participation 20

    List of Useful Books

    1. Process Modeling, Simulation & Control for Chemical EngineersW.L. LuybenInternational Student Edition

    McGraw-Hill, London

  • 7/23/2019 CHP 445 Notes ver1.pdf

    3/37

    3

    2. Process Dynamics: Modelling, Analysis & SimulationB. Wayne Bequette

    Prentice Hall PTR, New Jersey 07458, 1998ISBN 0-13-206889-3

    3. Process Modeling

    Morton M DennLongman, 1986

    ISBN 0-582-00556-6

    4. Process Modelling & SimulationR.W. Gaikwad, Dr. DhirendraCentral Techno Publications, Nagpur, 2003

    ISBN 81-87316-71-3

    5. Chemical Process Modelling and Computer SimulationAmiya K. Jana

    Prentice-Hall of India Private Ltd, New Delhi, 2008

    ISBN 978-81-203-3196-9

    6. Problem Solving in Chemical Engineering with Numerical MethodsMichael B. Cutlip, Mordechai ShachamPrentice Hall PTR, London, 2000

    ISBN 0-13-862566-27. Numerical Methods for Engineers 3rdEd.

    Steven C. Chapra, Raymond P. Canale

    McGraw-Hill, Boston, 1998ISBN 0-07-010938-9

  • 7/23/2019 CHP 445 Notes ver1.pdf

    4/37

    4

    Chapter One

    Introduction

    Engineers, particularly process engineers, are symbolic analysts1. Process engineers use fundamental

    scientific principles as a basis for mathematical models that characterise the behaviour of a chemicalprocess. Symbols are used to represent physical variables, such as pressure temperature or concentration

    Input information is specified and numerical algorithms are used to solve the models (simulating a

    physical system). Process engineers analyse the results of these simulations to make decisions or

    recommendations regarding the design or operation of a process.

    Process engineers are responsible for technical troubleshooting in the day-to-day operations of a

    particular chemical process. Some are responsible for designing feed back control systems so thatprocess variables (such as temperature or pressure) can be maintained at desired values. Others may be

    responsible for redesigning a chemical process to provide more profitability. All these require anunderstanding of time-dependent (dynamic) behaviour of a chemical process.

    Working definition: Process Model

    A Process model is a set of equations (including necessary input data to solve the equations) that allows one topredict the behaviour of a chemical process system.

    It is presumed that each variable appearing in the equations of the model can be identified with an entityassociated with the process; each entity must be measurable, at least in principle. A quantity that can

    never be measured in principle has no physical meaning.

    1.1 Classification of Models

    There are three identifiable methodologies used to obtain the equations for a mathematical model. These

    can be categorised as follows:

    1. Fundamental: Use offundamentalor first principles models, based on known physical-chemicalrelationships. This includes the conservation of mass, conservation of energy, reaction kinetics,

    transport phenomena, and thermodynamic relationships.2. Empirical: Use direct observations to develop equations that describe the experiments. An

    empirical model is simply an equation that records the relationship between system inputs and

    outputs. An empirical model might be used if the process is too complex for fundamental model.

    3. Analogy: Use the equations describing a system believed to be analogous, with variablesidentified by analogy on one-to-one basis. The essence of modelling by analogy is identifying a

    1 Symbolic analysts solve, identify and broker problems by manipulating symbols. They simplify reality into abstract

    images that can be rearranged, juggled, experimented with, communicated to other specialists, and then, eventually,

    transformed back into reality. The manipulations are done with analytic tools, shaped by experience. The tools may be

    mathematical algorithms, legal arguments, financial gimmicks, scientific principles, psychological insights about how to

    persuade or amuse, systems of induction or deduction, or any other set of techniques for doing conceptual puzzles. (italics

    added for emphasis)

  • 7/23/2019 CHP 445 Notes ver1.pdf

    5/37

    5

    well-understood process that seems to have the essential features of the process of interest. This

    form of modelling is too specialised and intuitive.

    Generally, the preferred models are those based on fundamental knowledge of chemical-physical

    relationships. Fundamental models will generally be accurate over a much larger range of conditions

    than empirical models. Empirical models, also known as black box models, may be useful forinterpolation but are generally not used for extrapolation; i.e., an empirical model will only be used

    over the range of conditions used for the fit of the data.

    As a result focus will be on fundamental models (also known as theoretical models), with particularattention to the logical structure of model development and simplification (system analysis). However, it

    is important to note that elements of empiricism and analogy, in even the most fundamental models, are

    found. This presence is a major factor in the process of validation.

    In addition to the above classification, models can generally be grouped according to;

    Linear/non-linear

    Steady state/unsteady state Lumped parameter/distributed parameter Continuous/discrete variables

    Linear vs nonlinear models. If the output,y, of a subsystem is completely determined by the input, x

    the parameters of the subsystem and the initial and boundary conditions, in general sense can berepresent the subsystem symbolically by

    ( )xHy= 1.1

    whereHrepresents any form of conversion ofxintoy.

    Suppose that two separate inputs are applied simultaneously to the subsystem so that

    ( ) ( ) ( ) 212121 yyxHxHxxHu +=+=+= 1.2

    His then, by definition a linear operator. Operations involving inverse, square, exponential and natural

    logarithm are plotted in Fig. 1.1. It can be seen that all of them are nonlinear operators, especially forsmall values of independent variable. Therefore, equations are linear if the independent variables or their

    derivatives appear only to the first power otherwise they are nonlinear. A system is termed linear if its

    operator H is linear and the model of a linear system, which is represented by linear equations and

    boundary conditions, is called linear model. Otherwise the model is nonlinear.

  • 7/23/2019 CHP 445 Notes ver1.pdf

    6/37

    6

    Fig. 1.1. Plot of some nonlinear operations (inverse, square, exponential and logarithm)

    Steady state vs unsteady state. Steady state means that the accumulation terms in the various balances

    of interest are zero. In each balance, if the boundary conditions are time independent, the dependent

    variables within the system can gradually reach constant values with respect to time at a given point.

    Standard Chemical Engineering design techniques for unit operation, reaction kinetics and so on have

    been dealt entirely with steady state operations. When process control began to be extensivelyconsidered, it was found that non steady state operations were of significance. To design a plant on the

    basis of steady state information and then to add controls afterwards is now felt to be inadequate; both

    the units and control system should be designed together.

    A typical example of unsteady state process might be the start-up of a distillation column, which wouldeventually reach a steady state set of operating conditions. In fact, when examined in detail, the column

    always will prove to be operating in the unsteady state with minor fluctuations in temperature,composition, etc, taking place all the time, but possibly ranging about average steady state values.

    Distributed vs lumped parameter. A lumped parameter representation means that spatial variations areignored and the various properties and the state (dependent variables) of the system can be considered

    homogeneous throughout the entire system. A distributed parameter on the other hand, takes into

    account detailed variations in behaviour from point to point throughout the system. All the real systems

    are of course, distributed in that there are some variations throughout them. Many times, however, thevariations are relatively small, so they may be ignored and the system may then be lumped.

    y = x-1

    R2= 1

    0.000

    0.200

    0.400

    0.600

    0.800

    1.000

    1.200

    0 5 10 15 20 25

    y = x 2

    R2= 1

    0

    50

    100

    150

    200

    250

    300

    350

    400

    450

    0 5 10 15 20 25

    y = e x

    R2= 1

    0

    50

    100

    150

    200

    250

    300

    350

    400

    450

    0 2 4 6 8

    y = Ln(x)

    R2= 1

    0

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    0 5 10 15 20 25

  • 7/23/2019 CHP 445 Notes ver1.pdf

    7/37

    7

    It is difficult to decide whether to lump a parameter, but the rule of the thumb is that if the response of

    the element is for all practical purposes instantaneous throughout the element, then the element

    parameter can be lumped. If the response shows instantaneous differences along the element, then itshould not be. By response is meant the velocity of propagation of the input through the element.

    Continuous vs discrete variables. Continuous means that a variable can assume any value within aninterval, discrete means the variable can take only distinct values in the interval.

    Modelling can be valuable because it is an abstraction and help avoid repetitive experimentations and

    observations. However, the potential cost and time savings must be weighed against the fact that themodel only imitates reality and does not incorporate all features of the real system being modelled.

    1.2 How Models are used

    Given a set of input data, a model is used to predict the output response. A model is used to solve the

    following types of problems:

    Synthesis, what process can be used to manufacture a product? Design, what type and size of equipment is required to produce a product? Operation, what operating conditions will maximise the yield of a product? Control, how can a process input be manipulated to maintain a measured process output at a

    desired value?

    Safety, if an equipment failure occurs, what will be the impact on the operating personnel andother process equipment?

    Environment, how long will it take to biodegrade hazardous waste? Allocation, if there are several sources of raw materials, and several manufacturing plants, how

    can the raw materials be distributed among the plants, and what products can each plant

    produce? Marketing, if the price of a product is increased, how much will the demand decrease?

    Many of the models cited above are based on a steady-state analysis. Previously, chemical process

    design was based solely on steady-state analysis. However, it is important to consider the dynamic

    operability characteristics of a process during the design phase. Also, batch processes that are commonlyused in the pharmaceutical or specialty chemical industries are inherently dynamic and cannot be

    simulated with steady-state models.

    Mathematical models consist of the following types of equations (including combinations)

    Algebraic equations Ordinary differential equations (ODEs) Partial differential equations (PDEs)

    The ODEs generally result from macroscopic balances around processes, with assumption of a perfectly

    mixed system. To find the steady-state solution of a set of ODEs, then a set of algebraic equations has to

    be solved. PDE models result from microscopic balances.

  • 7/23/2019 CHP 445 Notes ver1.pdf

    8/37

    8

    Chapter Two

    Constructing a Model

    2.1 Model Building

    Model building can be divided into four phases

    Problem definition and formulation Preliminary and detailed analysis Evaluation phase Application

    Fig. 2.1. Steps in model building

    Problem definition and formulation phase. In this phase the problem to solved must be defined and

    important elements that pertain to the problem and its solution identified. The degree of accuracy needed

  • 7/23/2019 CHP 445 Notes ver1.pdf

    9/37

    9

    in the model and the potential uses of the model must be determined. One must also evaluate the

    structure and complexity of the model and ascertain

    Number of independent variables to be included in the model Number of independent equations required to describe the system Number of unknown parameters in the model

    The fundamental physical and chemical laws are used in their general form with time derivatives

    included in order to study dynamics of the system. Reasonable assumptions are made to simplify themodel without which the model could be too complex that would take a long time to develop and might

    be impossible to solve. The assumptions that are made should be carefully considered and listed. They

    pose limitations on the model that should always be kept in mind when evaluating its predicted results.

    It is usually a good idea to make sure that the number of variables equals the number of equations. This

    means that degree of freedom of the system must be zero in order to obtain a solution. Checking to see

    that the units of all terms in the equations are consistent is essential particularly the time units ofparameters in dynamic models. A sketch of a logical flow diagram for modelling is shown in Fig. 2.2.

    Before carrying out actual modelling work, it is important to evaluate the economical justification for

    the effort of modelling and the capacity of the supporting staff for carrying out such a project. The

    available solution techniques and tools must be kept in mind as a mathematical model is developed.

    Design phase. This phase involves specification of the information content, general description of the

    programming logic and algorithms necessary to develop and employ a useful model, formulation of the

    mathematical description of such model and simulation of the model.

    First define input and output variables and determine the system. Also select the specific mathematical

    representation to be used in the model, as well as the assumptions and limitations of the model resultingfrom its translation into actual computer code. Specify computer input/output media, develop program

    logic and flow-sheets and define program modules and their relationships. Use of existing subroutines

    and databases saves a lot of time.

    Evaluation phase. This phase is intended as a final check of the model. Testing of individual models

    elements should be conducted during the earlier phases. Evaluation of model is carried out according to

    the evaluation criteria and test plan established in the problem definition phase. Next carry outsensitivity testing of model inputs and parameters and determine if the apparent relationships are

    physically meaningful. Use actual data in the model when possible. This step is also referred to as

    diagnostic checking, and may entail statistical analysis of the fitted parameters.

    Model validation consists of three parts

    Validation of logic Validation of model assumptions Validation of model behaviour

  • 7/23/2019 CHP 445 Notes ver1.pdf

    10/37

  • 7/23/2019 CHP 445 Notes ver1.pdf

    11/37

    11

    variables (time and threes spatial) coordinates and model inputs. The model inputs play a different role

    in the analysis of the model response.

    Modelling of physical systems will always require the application of one or more of the fundamental

    conservation principles: conservation of mass, momentum and energy. These quantities are known as

    thefundamentaldependent variables.

    Apart from mass, the fundamental variables are not measurable, even in principle. Energy is measured

    in terms of temperature, pressure, composition, velocity etc. Similarly, the momentum is computed

    from measured velocities and masses. It is this larger collection of measurable variables thatcharacterises the fundamental quantities, and the model equations are written in terms of thesecharacterising dependent variables. It is necessary to select the minimum set of characterising

    variables2that uniquely defines the fundamental variables. This set defines the stateof the system.

    2.3Constitutive Equations

    In modelling the fundamental variables do not provide enough equations in the model to solve for all thestate variables. There are other relationships required so as to make the model completely defined, i.e

    one that has "as many equations as unknowns"3. These required relationships are known as constitutive

    equations.

    Constitutive equations are those additional relationships between state variables that are required for acomplete mathematical description. Constitutive equations are usually associated with molecular

    phenomena.

    Constitutive equations come in most cases from experiment, usually guided by some theory and perhapsdimensional analysis or other invariance arguments. Many constitutive equations are available in the

    form of dimension less engineering correlation e.g. ( )Pr,GrRe,NuNu= . Several examples ofconstitutive equation are shown in this section.

    2.3.1 Gas Law

    Process systems containing a gas will normally need a gas law expression in the model. The ideal gaslaw is commonly used to relate molar volume, pressure and temperature:

    RTPv= 2.1

    The van der Waals PvT relationship contains two parameters (a and b) that are system specific:

    2There is no generally accepted terminology called characterising variables. They are often called state variablesin control

    and systems engineering literature. However, it is important to note that the term state variable has entirely different

    meaning in the thermodynamics literature.3This is convenient and common shorthand. It is not a rigorous equivalent, as the counter example of finding real solutions

    ofxand yto the single equation 0yx 22 =+ illustrates.

  • 7/23/2019 CHP 445 Notes ver1.pdf

    12/37

    12

    ( ) RTbvv

    aP

    2 =

    + 2.2

    For other gas law, see a thermodynamics text.

    2.3.2Chemical Reactions

    The rate of reaction per unit volume is usually a function of the concentration of the reacting species

    Consider the reactionA+2B C+3D. If the rate of the reaction ofAis first order in bothAandB, thefollowing expression is used:

    BAA ckcr = 2.3

    The reaction rates are normally expressed in terms of generation of a species. As a result we have

    BAAD

    BAAC

    BAAB

    ckc3r3r

    ckcrr

    ckc2r2r

    ==

    ==

    ==

    Usually, the reaction rate coefficient, k, is a function of temperature. The most commonly usedrepresentation is the Arrhenius rate law

    ( ) RTEAeTk = 2.4

    The frequency factor (pre-experimental factor) A, and activation energy, E can be estimated from the

    date of the reaction constant as a function of reaction temperature.

    2.3.3 Equilibrium Relationships

    The relationship between the liquid and vapour compositions of component i, when the phases are in

    equilibrium, can be represented by:

    iii xKy = 2.5

    The equilibrium constant, Ki, is a function of composition and temperature.

    To simplify the vapour/liquid equilibrium models, a constant relative volatility assumption is oftenmade. In a binary system, the relationship between the vapour and liquid phases for the light componen

    often used is

    ( )x11x

    y+

    =

    2.6

  • 7/23/2019 CHP 445 Notes ver1.pdf

    13/37

  • 7/23/2019 CHP 445 Notes ver1.pdf

    14/37

    14

    generally described by PDEs while lumped systems are usually described by ODEs (or algebraic

    equations if changes in time are not of interest).

  • 7/23/2019 CHP 445 Notes ver1.pdf

    15/37

    15

    Chapter Three

    Process Modelling

    3.1 Balance Equations

    The dynamic balances material and energy balances are in the form

    =

    systema

    leavingenergy

    ormassofrate

    systema

    enteringenergy

    ormassofrate

    systemain

    onaccumulatienergy

    ormassofrate

    3.1

    The rate of mass accumulation in a system has the form dm/dtwhere mis the total mass in a system

    Similarly the rate of energy accumulation has the form dE/dtwhereEis the total energy in a system. Ifni is used to represent the moles of component i in a system, then dni/dt represents the rate of

    accumulation of component iin the system.

    When developing a dynamic model, one of two general viewpoints can be taken. One viewpoint is

    based on integral balance while the other is based on instantaneous balance. Integral balances are

    particularly useful when developing models for distributed parameter systems, which result in PDEs

    Another viewpoint is the instantaneous balance where the time rate change is written directly.

    3.1.1 Integral Balances

    An integral balance is developed by viewing a system at two different snapshots in time. Consider afinite interval,t, and perform the balance over that time interval.

    ( ) ( ) ( )

    +

    +

    =

    + tttotfrom

    systemleaving

    energyormass

    tttotfrom

    systementering

    energyormass

    tat

    systeminside

    energyormass

    ttat

    systeminside

    energyormass

    3.2

    The mean-value theorems of integral and differential calculus are then used to reduce the equations todifferential equations.

    ExampleConsider a tabular reactor where a chemical reaction changes the concentration of the fluid as it moves

    down the tube. A volume element V and a time element t is used. The total moles of species A

    contained in theVis (V)cA. The amount of speciesAentering the volume is VAFc and the amount

    of species leaving the volume is VVAFc + . The rate of A leaving by reaction (assuming a 1st order

    reaction) is ( ) VkcA .

  • 7/23/2019 CHP 445 Notes ver1.pdf

    16/37

    16

    The material balance is then

    ( ) ( ) ( )[ ]dtVkcFcFccVcVtt

    t AVVAVAtAttA

    +

    ++ =

    3.3

    The R.H.S. of (3.3) can be written using the mean value theorem of integral calculus, as

    ( )[ ] ( )( ) tVkcFcFcdtVkcFcFc ttAVVAVAtt

    t AVVAVA

    ++

    +

    + = 3.4

    where 10

  • 7/23/2019 CHP 445 Notes ver1.pdf

    17/37

  • 7/23/2019 CHP 445 Notes ver1.pdf

    18/37

    18

    =

    ktanofoutwater

    offlowratemass

    ktanointwater

    offlowratemass

    ktaninwaterofmass

    ofchangeofrate 3.16

    The total mass of water in the tank is V , the rate of change is ( ) dtVd , and the density of the outletstream is equal to the tank contents:

    ( ) FFVdt

    dff = 3.17

    Assuming that the density is constant:

    ( ) FFVdt

    df = 3.18

    State variable is V, Ffand Fare input variables. If the density is retained, then it is the parameter of the

    system in order to solve this problem the inputs Ff(t) and F(t) and the initial condition V(0)must bespecified.

    3.2 Material and Energy Balances

    Many chemical processes have important thermal effects so it is necessary to develop material and

    energy balance models. One key is that a basis must always be selected when evaluating an intensive

    property such as enthalpy.

    Proper application of conservation of energy requires the use of some basic thermodynamic concepts

    There is no way that the proper use of thermodynamics can be avoided when dealing with the energy of

    a system. There are attempts to bypass rigour and substitute intuition with a result of incorrecequation.

    3.2.1 Thermodynamic Variables

    Total energy,E, of a system is the sum of its kinetic, potential and internal energies abbreviated as K.E.P.E. and Urespectively. Thus:

    UPEKEE ++= 3.19

    Energy per unit mass will be denoted with an underbar:

    UPEKEE ++= 3.20

    Quantities per unit mole will be denoted with a double underbar:

    UPEKEE ++= 3.21

  • 7/23/2019 CHP 445 Notes ver1.pdf

    19/37

    19

    In flowing systems, it is often more convenient to work in terms of enthalpy,H, defined as

    PVUH += 3.22

    where Vis the volume and Pthe mean pressure. Enthalpy per unit mass is then

    PUH += 3.23

    and enthaly per unit mole is

    PMUH W+= 3.24

    where WM is the average molecular weight. For an ideal gas

    RTUH += 3.25

    Thermodynamic state is specified by the composition and two of the three characterising variables

    (pressure-temperature-volume, PVT). Internal energy is usually defined in terms of the volume andtemperature, while enthalpy is usually defined in terms of pressure and temperature.

    The heat capacities at constant pressure are defined to be

    ncompositio,P

    p

    ncompositio,P

    p

    T

    Hc

    T

    Hc

    =

    =

    3.26

    The heat capacities at constant volume are defined as

    ncompositio,

    v

    ncompositio,

    v

    T

    Uc

    T

    Uc

    =

    =

    3.27

    For an ideal gas, U is a function of only T. in this case

    Rcc vp += 3.28

  • 7/23/2019 CHP 445 Notes ver1.pdf

    20/37

    20

    For liquids at moderate pressures and temperatures, cpand cvare nearly equal.

    There is one more thermodynamic quantity required. Let ni be the number of moles of speciescontained in volume V. Partial molar enthalpyis defined as

    ttanconsn,P,Ti ijnHH

    == 3.29

    From the Gibbs-Duhen equation, it can be deduced that

    =i

    iiHnH 3.30

    or, equivalently,

    =i

    iiHc1H

    3.31

    where ciis the molar concentration of species i.

    In an ideal solution, molecules of species interact with molecules of all other species in the same way as

    with their own, thusi

    i HH = . In a non-ideal solutioni

    i HH and there will be enthalpy changes

    associated with the mixing of different species.

    3.2.2 Conservation of Mass and Energy

    The reaction

    ++++ NMBA 3.32

    takes place in a well-stirred tank. (There is no loss of generality in taking the stoichiometric coefficient

    of A equal to unity). Because of the well-mixed assumption, the entire tank is taken as the controvolume.

    Mass is characterized by the density, ; concentrations (in molar units) NMBA c,c,c,c etc ofA,B, M

    N, respectively; and liquid volume, V. The volumetric flow-rate is F.

    The principle of conservation of mass as applied to total mass in the system is unchanged by the fact of

    chemical reaction and is identical to Eq (3.17).

    ( ) FFVdt

    dff = 3.17

  • 7/23/2019 CHP 445 Notes ver1.pdf

    21/37

    21

    Taking rito be the net molar rate of formation of species iby chemical reaction per unit volume. The

    equation of conservation of mass for speciesAis therefore

    ( ) iififi VrFccFVcdt

    d+= 3.33

    If then ris defined as the net rate of disappearance of Aby reaction per unit volume, then Eq.(3.33) canbe written as

    ( )

    ( )

    ( )

    ( ) VrFccFVcdtd

    dtdn

    VrFccFVcdt

    d

    dt

    dn

    VrFccFVcdt

    d

    dt

    dn

    VrFccFVcdt

    d

    dt

    dn

    NfNfN

    N

    MfMfM

    M

    BfBfB

    A

    AfAfAA

    +==

    +==

    ==

    ==

    3.34

    r is often referred to as the instrinsic reaction rate.

    The principle of conservation of energy applied to this control volume is

    ( ) ( ) ( ) Teeefffff WQPEKEUFPEKEUFPEKEUdt

    d++++++=++ 3.35

    The first two terms on R.H.S. are the rates of convective flow of energy in and out respectively. The

    subscript "e" denotes the effluent stream despite perfect mixing the energy will be different from that of

    the tank. Qis the rate of heat addition through the boundaries typically from a heating or cooling coil or

    jacket, WTis the rate at which work is done on the system (i.e. power input).

    Work is done on the system when fluid is forced in and is done by the system to expel the effluent

    stream; the rate of the former is FfPfwhile the rate of the latter is FPewhere Pfand Peare the pressuresjust prior to the entrance and exit, respectively. It is convenient to separate out these work terms and

    refer to the remaining work term as Wsfor rate of shaft work. Thus Eq (3.35) is rewritten as

    s

    e

    e

    f

    f

    fff WQP

    UFP

    UF

    dt

    dU++

    +

    +=

    3.36

    KEand PEterms have been dropped since they are usually unimportant if temperature changes of even

    a few degrees can occur. From the definitions of enthalpy, Eq (3.23) Eq (3.36) can be written as

    sefff WQHFHFdt

    dU++= 3.37

  • 7/23/2019 CHP 445 Notes ver1.pdf

    22/37

    22

    Writing the Uin terms of Hand dropping the subscript "e" on eH since the enthalpy per unit mass is

    the same everywhere in the tank and will approximately equal the enthalpy of the effluent;

    ( ) sfff WQHFHFPVdt

    d

    dt

    dH++= 3.38

    The term ( ) dtPVd is neglected since it is negligible in liquid systems and it is zero if volume andpressure are constant; thus for liquid systems,

    ( ) ( ) sffff WQTHFTHFdt

    dH++= 3.39

    Eq. (3.39) is often quoted as the starting point in modelling and referred to as the "enthalpy balance"4.

    Eq (3.39) must now be expressed in terms of state variables, the first step is to refer all enthalpies to the

    same temperature, which is most conveniently taken as the tank temperature. From the definition of cp(Eq. 3.26).

    += fT

    T pffff dTc)T(H)T(H 3.40

    Approximating cpto be constant and writing the integral as )TT(c fpf , Eq 3.39 is now written as

    ( ) ( ) ( ) sffffpfff WQTHFTHFTTcFdt

    dH+++= 3.41

    H is a function of T, P and the number of moles of all component species { }in , and thus an implicitfunction of time. This it can be written

    +

    +

    =

    i

    i

    i dt

    dn

    n

    H

    dt

    dP

    P

    H

    dt

    dT

    T

    H

    dt

    dH 3.42

    The term PH can be shown to be negligible in most cases for liquid systems 5, and it is zero for ideal

    gases. TH is simply pVc , from Eq.(3.26), while inH is the definition of iH . Thus,

    4There is no such thing as "enthalpy balance" since Eq 3.39 is totally incorrect for gaseous systems. The "enthalpy balance"

    is worsen by including a term to account for the "rate of enthalpy-or energy-generation because of chemical reaction".

    Systems containing more than one phase cause particular problems for believers in "enthalpy balances".5It is shown in thermodynamics textbooks that

    ii n,Pn,T T

    VTV

    P

    H

    =

  • 7/23/2019 CHP 445 Notes ver1.pdf

    23/37

    23

    +=i

    iipdt

    dnH

    dt

    dTVc

    dt

    dH 3.43

    With Eq. (3.34), the sum in Eq. (3.43) can be written as

    [ ]BAMNi

    ii

    i

    ifif

    i

    ii HHHHVrHcFHcFdt

    dnH ++= 3.44

    Finally, using Eq. (3.31), the term HFHcFi

    ii = , while fffi

    ififf HFHcF = ; combination of

    Eq. (3.41) through (3.44) then becomes6

    ( ) [ ] ( ) ++++=i

    iififfsBAMNfpfffp HHcFWQHHHHVrTTcFdt

    dTVc 3.45

    The last term in R.H.S. of Eq. (3.45) is neglected as it is small in relative to enthalpy term multiplyingVrand is zero for ideal gases.

    The enthalpy term ++ BAMN HHHH is the enthalpy change of reaction, often called the

    heat of reaction, and denotedR

    H ;R

    H is negative for exothermic reaction and positive for

    endothermic reaction. Enthalpies of reaction can be calculated from tabulated "heats of formation" and

    "heats of combustion". The enthalpies of reaction can be measured in a calorimeter experiment. Thefinal form of energy equation is therefore;

    ( ) ( ) sRfpfffp WQVrHTTcFdt

    dT

    Vc +++=

    3.46

    This equation contains a large number of approximations none of which should be serious for

    liquid systems.

    6 i

    ififf

    i

    iiff

    HcFHcF

    [ ]

    [ ][ ] ( )

    [ ] ( )( ) ( ) ( )

    ( ) [ ] ( )

    ++++=

    +++=

    ++++

    +++=

    +++=

    +++=

    i

    iififfs

    BAMNfpfffp

    sffffpfff

    i

    ifiiff

    BAMNfffp

    i

    ifiiffBAMNfff

    i

    ififf

    i

    iiffBAMN

    i

    ii

    i

    ififf

    i

    ififf

    i

    fiiff

    BAMN

    i

    ii

    i

    iiff

    i

    ii

    HHcFWQHHHHVrTTcFdt

    dTVc

    WQTHFTHFTTcF

    HHcFHHHHVrHFHFdt

    dTVc

    HHcFHHHHVrHFHF

    HcFHcFHHHHVrHcFHcF

    HcFHcFHHHHVrHcFHcFdt

    dnH

  • 7/23/2019 CHP 445 Notes ver1.pdf

    24/37

    24

    The rate of heat transfer, Q depends on the configuration used for heating or cooling. The simples

    configuration to assume is that the reactor is jacketed and that the jacket fluid is well mixed liquid

    Using Eq (3.46)7and assuming that the jacket fluid is not reactive, then

    ( ) jjjfpjfjfjf

    j

    pjjj QTTcF

    dt

    dTcV += 3.47

    If it is assumed that there is no loss of heat to the surrounding, then QQj = . Heat transfer rates vary

    linearly with heat transfer area and with the temperature differences so it can be written that;

    ( )TThAQQ jj == 3.48

    Ais the area available for heat transfer, and his the heat transfer coefficient. Many correlations exist fo

    heat transfer coefficients.

    Taking that the liquid volume in the jacket will not change and that cpjf is independent of temperatureand that the density is constant, then Eq (3.47) can be written as

    ( ) ( )jjjfpjfjfjf

    j

    pjjj TThATTcF

    dt

    dTcV += 3.49

    3.3 Batch and Tubular Reactors

    The batch reactor is a well-stirred reactor for which 0FFf == . Assuming a constant density, implies

    that 0dtdV = and for a single reaction Eq (3.34) becomes

    rdt

    dc,r

    dt

    dc

    rdt

    dc,r

    dt

    dc

    NM

    BA

    ==

    == 3.50

    Tubular reactors behave like moving batch reactors if axial mixing is not taken into consideration. If the

    fluid is marked over a small spatial regionzwith a tracer, that fluid element will retain its integrity as it

    7Eq. (3.46) is commonly written incorrectly as

    1. ( ) ( ) s

    Rpfpfffp

    WQVrHTFcTcFVTdt

    dc +++=

    2. ( ) ( ) ( ) sRfpfffp

    WQVrHTTcFTVcdt

    d+++=

  • 7/23/2019 CHP 445 Notes ver1.pdf

    25/37

    25

    passes through the reactor. Since batch reactor equations do not depend on the size of the contro

    volume,zhere is arbitrary and can be as small as possible.

    This Lagrangian description can be converted to Eulerian description or a fixed laboratory coordinate

    system by noting that the time required to travel distance dzis vdt, where vis the mean linear velocity

    of the reactor, so vdzdt= and Eq. (3.50) becomes

    == ,rdz

    dcv,r

    dz

    dcv BA 3.51

    This assumes that the system is at steady state when viewed from a fixed laboratory frame.

    The energy equation for a batch reactor is obtained directly from Eq (3.46) by setting 0Ff = :

    ( ) sRp WQVrHdtdT

    Vc ++= 3.52

    For tubular reactors, the heat transfer term is first put in an appropriate form. Let va be the area

    available for heat transfer per unit volume of reactor. Thus VaA v= and Eq (3.52) can be written as;

    ( ) ( )TTVhaVrHdt

    dTVc jvRp += 3.53

    The shaft work is rarely relevant in a tubular reactor. If dtis replaced by vdz , then the equation for a

    tubular reactor becomes;

    ( ) ( )TTd

    hrH

    dz

    dTvc jRp +=

    4 3.54

  • 7/23/2019 CHP 445 Notes ver1.pdf

    26/37

    26

    d4av = for a tube of diameter d.

    The area per unit volume in the jacket of outer diameter djis ( )22j ddd4 , assuming concentricity andthin walls. The corresponding equation for the jacket is then

    ( )( )j22

    j

    j

    pjjj TTdd

    hd4

    dt

    dTcv

    = 3.55

    The flow is taken as counter-current if vand vjhave opposite algebraic signs, otherwise it is concurrent.

    It should be noted that this derivation of the tubular reactor equations is valid only for steady state, and it

    assumes that radial mixing is so rapid that there are no radial concentration or temperature gradients.

    3.4 Density of Liquids

    The relationship between density and concentration of a liquid system is governed by intermolecularforces. The density of a liquid mixture ofNspecies is

    N21 ccc +++= 3.56

    where { }ic are the concentrations of all species in mass units (e.g. kg/m3). In thermodynamics, the

    Gibbs-Duhen equationestablishes that the density of a liquid mixture at constant temperature is unique

    function of 1N concentrations.

    Consider a large volume V of a liquid, containing nA moles of A and nB moles of B, V is uniquely

    determined by nAand nB. At a constant temperature and pressure a differential amount ofAis added and

    the differential volume change measured; this experiment defines thepartial molar volume, AV as

  • 7/23/2019 CHP 445 Notes ver1.pdf

    27/37

    27

    A

    B

    n,P,TB

    B

    n,P,TA

    A

    nVV

    n

    VV

    =

    =

    3.57

    AV and BV are intensive properties and depend only on the molar ratio nB/nA. It is a consequence o

    the mathematics of exact differential forms or an equivalent physical argument, that

    BBAA VnVnV +=

    3.58

    It would be convenient to define thepartial densities

    B

    WB

    B

    A

    WA

    A

    V

    M,

    V

    M== 3.59

    The partial densities will be functions of the mass concentration ratio cB/cA. Now from Eq (3.56)

    +

    +=+=+=

    A

    B

    BA

    A

    B

    WBBWAA

    BA

    cc11

    cc

    1

    V

    Mn

    V

    Mncc

    3.60

    Eq. (3.60) can be rearranged as

    B

    B

    AA c1

    +=

    3.61

  • 7/23/2019 CHP 445 Notes ver1.pdf

    28/37

    28

    Since A and B are functions only of cB/cAor equivalently Bc , Eq. (3.61) establishes a unique but

    implicit relationship between and cB.

    3.5 Dimensionless Models

    Most models contain a large number of parameters and variables that may differ in value by severalorders of magnitude. It is often desirable, at least for analysis purposes, to develop models composed odimensionless parameters and variables.

    Just for illustration, consider a constant volume, isothermal CSTR modelled by a simple first-orderreaction

    ( ) AAAf

    A kcccV

    F

    dt

    dc=

    Let 0AfA ccx= ; 0Afc is nominal ( steady-state) feed concentration ofA. Thus

    xkVFx

    VF

    dtdx f +=

    Now taking = tt , where t is a scaling parameter, then dtdt = ; this implies that

    xkV

    Fx

    V

    F

    dt

    dxf

    +=

    Natural choice for t appears to be FV , the residence time, so;

  • 7/23/2019 CHP 445 Notes ver1.pdf

    29/37

    29

    xF

    kV1x

    d

    dxf

    +=

    FkV is a dimensionless number known as a Damkholer number in reaction engineering.

    Assuming that the feed concentration is constant; 1x f = and letting FkV= , the

    xx1d

    dx

    =

    Therefore a single parameter can be used to characterise the behaviour of all first order, isothermalchemical reactions.

  • 7/23/2019 CHP 445 Notes ver1.pdf

    30/37

    30

    4.Numerical Methods

    4.1 Introduction

    Process modelling leads to a system of complex model equations. It is necessary to solve the equations

    in order to investigate the process characteristics. There are two ways of finding solutions, namely,analytical method and numerical method. Where possible an analytical method produces exact solutions

    usually in the form of general mathematical expressions. On the other hand numerical methods produce

    approximate solutions in the form of discrete values or numbers.

    In order to develop a dynamic process simulator after the mathematical model development it is

    imperative to have a good knowledge of numerical methods. Some of these methods will be covered in

    this chapter.

    4.2 Iterative Convergence Methods

    4.2.1 Bisection Method (Interval Halving)

    In order to solve =() = 0 4.1the following steps according to the Bisection method can be followed

    Step 1: Find two guess values of (say 1and 2at the 1stiteration), so that one where() < 0and another where() > 0.Step 2: Find the midpoint and then evaluate

    (

    )at that midpoint.

    Step 3: Among the two guess values of , one should be replaced by the value of at midpointReplace the bracket limit that has the same sign as the function value at the midpoint,with the midpoint value.Step 4: Check for convergence. if not converged, go back to Step 2.

    If the interval shrinks below a tolerance level, an approximate value of the root has been found. The

    Bisection method is also known as interval halvingmethod since it can be halve the size of the interval

    in each iteration.

    The Bisection method actually locates a root repeatedly narrowing the distance between the two guesses

    When an interval contains a root, this simple numerical method never fails. However, the maindrawback of the Bisection technique is the slow convergence rate. Also, it is not easily extended to

    multivariable systems.

    4.2.2 Secant Method

    Although this approach is similar to the Bisection method, it is required to construct a secant line and

    find its -intercept as the next root estimate.

  • 7/23/2019 CHP 445 Notes ver1.pdf

    31/37

    31

    To solve Eq. 4.1, 1and are assumed as the two approximations to the root. Constructing a straightline (secantor chord) through points [1 ,(1)]and [ ,()]gives the slope as

    =() (1)

    1 4.2

    To compute the next approximation +1, a straight line equation is formed, thus(+1) () =(+1 ) =() (1) 1 (+1 ) 4.3For finding its -intercept at(+1) = 0. Simplifying gives

    +1 = 1() (1)() 4.4Further simplifying results

    +1 =1() (1)() (1) 4.5The iteration is done until the guess is sufficiently close to the root. If the approximations are such that()(1) < 0, then the approach, as represented by Eq. 4.4 or Eq. 4.5, is known as the FalsePosition, or Regula Falsi method. Note that the main difference between these two convergence

    techniques is that the Secant method retains the most recent two estimates, while the False Position

    method keeps the most recent estimate and the next recent one which has an opposite sign in thefunction value.

    4.2.3 Newton-Raphson Method

    The Newton-Raphson method is the most common and popular method for solving nonlinear algebraic

    equations. It is derived from Taylor series of():( +) =() + ()1! + 2()2 ()22! + 3()3 ()33! + = 0 4.6

    Neglecting all terms of order two and higher, Eq. 4.6 yields:

    ( +) =() + () = 0 4.7That means

    = ()() 4.8

  • 7/23/2019 CHP 445 Notes ver1.pdf

    32/37

    32

    Calculating the guess for at iteration + 1as a function of the value at iteration by defining+1 =+1 4.9

    thus Eq. 4.8 becomes

    +1 = ()() 4.10From Eqs. 4.9 and 4.10, the following equation is obtained

    +1 =()() 4.11Eq. 4.11 represents the Newton-Raphson convergence method for a single-variable problem. The

    extension of the Newton-Raphson algorithm to multivariable systems is fairly simple andstraightforward. Considering a multivariable system represented by:

    () = 0 4.12This equation consists of a set of by variables (1, 2, , )as:1(1, 2, ,)2(1, 2, ,)

    (

    1,

    2,

    ,

    )

    =000

    4.13The Taylor series gives for eachafter neglecting the second and higher-order derivative terms as:

    ( +) =() +()=1 = 0 4.14

    The above equation yields the following matrix form:

    (

    ) +

    = 0 4.15

    where, the Jacobian matrix

    =111

    121 2

  • 7/23/2019 CHP 445 Notes ver1.pdf

    33/37

    33

    From Eq. 4.15,

    =1() 4.16Therefore, Newton-Raphson method for multivariable is+1 = 1() 4.17The Newton-Raphson method is very efficient iterative convergence technique compared to many other

    simple methods. However, at each step, this method requires the calculation of the derivative of a

    function at the reference point, which is not always easy. It also may sometimes lead to stability

    problems particularly if the function is strongly nonlinear and if the initial guess is very poor.

    4.2.4 Muller Method

    This is an iterative convergence method based on quadratic equation. Consider a polynomial of seconddegree:

    () =02 +1 +2 = 0 4.18where 0( 0), 1and 2are three arbitrary parameters. In this convergence approach, three values ofthe unknown variable are guessed. Let 2, 1and are three approximations to the actual root of() = 0. To obtain 0, 1and 2the following conditions are used:

    2 =2 =022 +12 + 2 4.191

    =

    1=

    012 +

    11+

    2 4.19

    = =02 +1 +2 4.19and then substituting 0, 1and 2in Eq. 4.18 gives() = ( 1)( )

    (2 1)(2 )2 + ( 2)( )(1 2)(1 )1 +

    ( 2)( 1)( 2)( 1) = 0 4.20

    Eq. 4.20 can be converted to:

    ( + )1(1 +)2( + + 1)1 1 + ( +)( + +1)( +1) = 0 4.21where, = , = 1 and 1 =1 2. Further assuming = , =1 and = 1 +, Eq. 4.21 gets the form:

    2 + + = 0 4.22

  • 7/23/2019 CHP 445 Notes ver1.pdf

    34/37

  • 7/23/2019 CHP 445 Notes ver1.pdf

    35/37

    35

    =(, ) 4.28where(, )is, in general, a nonlinear function and the initial condition for is as: (0) =0at time

    = 0. Eq. 4.28 can be solved by employing the Euler method by two different ways, namely, explicit

    approach and implicit approach.

    Explicit Euler approach

    A forward difference approximation of Eq. 4.28 yields

    = +1 =(, ) 4.29The time increment is known as the step sizeor integration interval. Rearranging Eq. 4.29 gives:

    +1=

    +

    (

    ,

    ) 4.30

    That is,

    +1 = + (,) 4.31Eq. 4.30 or 4.31 represents the Explicit Eulermethod. If sufficiently small integration step size istaken, then estimate +1 will be very close to the correct value. The Euler integration approach isextremely simple to implement for solving even highly nonlinear multivariable complex systems having

    a large number of ODEs.

    Implicit Euler approachThis approach uses a backward difference approximation and accordingly, Eq. 4.28 gives:+1 =(+1, +1) 4.32Rearranging gives:

    +1 = +(+1, +1) 4.33That is,

    +1 = + ( ,) 4.34Eq. 4.33 or 4.34 represents the Implicit Euler method. This method in Eq. 4.34 indicates that the

    derivative needs to be evaluated at the next step in time +1. It is simple for a linear system but fornonlinear system, a resulting algebraic expression is solved using one of nonlinear algebraic solution

    technique such as Newton-Raphson method. The implicit method approach is stable for almost any

  • 7/23/2019 CHP 445 Notes ver1.pdf

    36/37

    36

    value of and will not oscillate. The Explicit Euler method, on the other hand, may have instabilityproblem with oscillating outputs for a large step size.

    4.3.2 Runge-Kutta Methods

    The Runge-Kutta method is commonly chosen as a better explicit integration algorithm than thestandard Explicit Euler method due to:

    truncation error per step associated with the Euler method is higher Explicit Euler technique is prone to numerical instabilities

    Note that the Euler integration technique is sometimes called the 1st-order Runge-Kutta method.

    2nd

    -order Runge-Kutta approach

    This is also known as theMidpoint Eulermethod. In this approach, first the Euler technique is employed

    to predict at the midpoint of the integration interval (step size = 2 ). The value of at the end ofthe step (step size =

    ) is estimated as:

    +1 = +2 4.35where 2 = +

    21, +

    21 =(, )

    This integration technique provides better accuracy than the Explicit Euler method but the Euler

    approach runs almost twice faster.

    4

    th

    -order Runge-Kutta approachThe 4th

    -order RK method is given by

    +1 = + 6

    [1 + 22 + 23 +4] 4.36where 4 =( +3, +)3 = +

    22, +

    2

    2=

    +

    21,

    +

    2

    1 =(, )Comparing the 2

    nd-order and 4

    th-order RK integration approaches, it is easy to observe that the

    complexity as well as computational time increases with the increase of the order. To obtain greater

    accuracy in estimation, the 4th

    -order RK method is preferred over the Euler and 2nd

    -order RK

    approaches.

  • 7/23/2019 CHP 445 Notes ver1.pdf

    37/37

    4.3.3 Runge-Kutta-Fehlberg (RKF45) Method

    Another efficient and popular technique for solving ODEs is the Runge-Kutta-Fehlberg 4th

    -5th

    -order(RKF45) method. This ODE integrator can exert some adaptive control over its own performance by

    making frequent changes in its step size. At each step, the RKF45 produces two estimates of a state

    variable (+1and +1). Here, a numerical estimate of the error, ((+1 +1) , is required to becomputed at each time step. If the estimated error is less than the tolerance level (), the step size +1, to be used in the next step to generate +2is increased to speed up the computations and viceversa. If the value of error is nearly equal to , the two estimates are in close agreement and the value ofstep size is accepted without any correction.

    In order to solve Eq. 4.28, each RKF step requires the use of the following six values:

    1 =(, ) ()

    2 =

    + 1

    4,

    +

    4

    (

    )

    3 = + 3321 + 932 2, + 38 ()4 = + 19322197

    1 72002197

    2 + 72962197

    3, + 1213 ()

    5 = + 439216

    1 82 + 36805133 845

    41044, + ()6 = 8

    271 + 22 3544

    25653 + 1859

    41044 11

    405, +

    2 ()

    The two estimates can be obtained using the following two equations:

    +1 = + 25

    216 1 +1408

    2565 3 +2197

    4104 41

    5 5 4.37+1 = + 16135

    1 + 665612825

    3 + 2856156430

    4 9505 + 2

    556 4.38

    Note that +1and +1are obtained using RK method of 4thand 5thorder respectively.The optimal step size ,can be determined using:

    ,=

    2|+1 +1|1 4

    4.39

    Even though the calculations involved in this approach are tedious and time consuming, this method

    gives more accurate results. The generalization of this method to deal with systems of coupled 1st-order

    ODEs is fairly obvious.