You are on page 1of 196

SECOND EDITION

PROCESS ENGINEERING and


DESIGN USING VISUAL BASIC®
ARUN DATTA

© 2010 Taylor & Francis Group, LLC


SECOND EDITION
PROCESS ENGINEERING and
DESIGN USING VISUAL BASIC®

© 2010 Taylor & Francis Group, LLC


SECOND EDITION
PROCESS ENGINEERING and
DESIGN USING VISUAL BASIC®
ARUN DATTA

Boca Raton London New York

CRC Press is an imprint of the


Taylor & Francis Group, an informa business
© 2010 Taylor & Francis Group, LLC
CRC Press
Taylor & Francis Group
6000 Broken Sound Parkway NW, Suite 300
Boca Raton, FL 33487-2742

© 2014 by Taylor & Francis Group, LLC


CRC Press is an imprint of Taylor & Francis Group, an Informa business

No claim to original U.S. Government works


Version Date: 20130715

International Standard Book Number-13: 978-1-4398-6281-0 (eBook - PDF)

This book contains information obtained from authentic and highly regarded sources. Reasonable efforts
have been made to publish reliable data and information, but the author and publisher cannot assume
responsibility for the validity of all materials or the consequences of their use. The authors and publishers
have attempted to trace the copyright holders of all material reproduced in this publication and apologize to
copyright holders if permission to publish in this form has not been obtained. If any copyright material has
not been acknowledged please write and let us know so we may rectify in any future reprint.

Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmit-
ted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented,
including photocopying, microfilming, and recording, or in any information storage or retrieval system,
without written permission from the publishers.

For permission to photocopy or use material electronically from this work, please access www.copyright.
com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood
Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and
registration for a variety of users. For organizations that have been granted a photocopy license by the CCC,
a separate system of payment has been arranged.

Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used
only for identification and explanation without intent to infringe.
Visit the Taylor & Francis Web site at
http://www.taylorandfrancis.com

and the CRC Press Web site at


http://www.crcpress.com
To my late mother Smt. Narayani Datta

© 2010 Taylor & Francis Group, LLC


Contents
Preface...............................................................................................................xxv
Acknowledgments....................................................................................... xxvii
Author..............................................................................................................xxix

Chapter 1 Basic mathematics........................................................................ 1


Introduction......................................................................................................... 1
Physical constants............................................................................................... 1
SI prefixes........................................................................................................ 1
Mensuration......................................................................................................... 1
Triangles.......................................................................................................... 1
Rectangles........................................................................................................ 2
Parallelogram (opposite sides parallel)....................................................... 2
Rhombus (equilateral parallelogram)......................................................... 3
Trapezoid (four sides, two parallel)............................................................. 3
Quadrilateral (four sided)............................................................................. 4
Regular polygon of n sides............................................................................ 4
Circle................................................................................................................ 4
Ellipse............................................................................................................... 6
Parabola........................................................................................................... 6
Prism................................................................................................................ 6
Pyramid........................................................................................................... 7
Right circular cylinder................................................................................... 7
Sphere............................................................................................................... 7
Right circular cone......................................................................................... 8
Dished end...................................................................................................... 8
Irregular shape............................................................................................... 8
Trapezoidal rule.............................................................................................. 8
Simpson’s rule................................................................................................. 8
Irregular volume............................................................................................ 9
Algebra................................................................................................................. 9
Factoring.......................................................................................................... 9
Arithmetic progression................................................................................. 9
Geometric progression................................................................................ 10

© 2010 Taylor & Francis Group, LLC vii


viii Contents

Infinite series (in GP)................................................................................... 10


Best-fit straight line (least squares method)............................................. 10
Binomial equation........................................................................................ 11
Polynomial equation.................................................................................... 11
Maxima/minima.......................................................................................... 12
Cubic equation.............................................................................................. 13
General procedure.............................................................................. 13
Matrix............................................................................................................. 16
Addition and multiplication of matrices......................................... 16
Addition of matrices........................................................................... 16
Multiplication of matrices................................................................. 16
Matrix properties involving addition.............................................. 17
Matrix properties involving multiplication.................................... 17
Matrix properties involving addition and
multiplication...................................................................................... 18
Transpose............................................................................................. 18
Symmetric matrix............................................................................... 18
Diagonal matrix.................................................................................. 19
Determinants................................................................................................ 19
Properties of determinants............................................................... 19
Cofactor................................................................................................ 21
Determinant and inverses................................................................. 21
Adjoint.................................................................................................. 21
Cramer’s rule................................................................................................. 22
Trigonometry..................................................................................................... 24
Functions of circular trigonometry........................................................... 24
Periodic functions........................................................................................ 25
Magic identity............................................................................................... 25
Addition formulas........................................................................................ 25
Double angle and half angle formulas...................................................... 26
Product and sum formulas......................................................................... 27
Relations between angles and sides of triangles..................................... 28
Law of sines................................................................................................... 28
Law of tangents............................................................................................ 28
Law of cosines............................................................................................... 28
Other relations.............................................................................................. 29
Inverse trigonometric functions................................................................. 29
Hyperbolic functions................................................................................... 30
Other hyperbolic functions......................................................................... 31
Inverse hyperbolic functions...................................................................... 31
Analytical geometry......................................................................................... 32
Straight line................................................................................................... 32
Straight line through two points...................................................... 32

© 2010 Taylor & Francis Group, LLC


Contents ix

Three points on one line.................................................................... 32


Circle.............................................................................................................. 33
Tangent................................................................................................. 33
Normal................................................................................................. 33
Four points on a circle........................................................................ 34
Circle through three points............................................................... 34
Conic section................................................................................................. 35
Focus..................................................................................................... 35
Eccentricity.......................................................................................... 35
Directrix............................................................................................... 35
Partial derivatives............................................................................... 35
Parabola................................................................................................ 36
Tangent line with a given slope, m................................................... 38
Ellipse................................................................................................... 38
Hyperbola............................................................................................ 40
Calculus.............................................................................................................. 42
Differential calculus..................................................................................... 42
Understanding the derivatives................................................................... 43
Standard derivatives.................................................................................... 44
Integral calculus........................................................................................... 45
Volume of horizontal dished end..................................................... 45
Volume of vertical dished end.......................................................... 47
Standard integrals........................................................................................ 48
Differential equations....................................................................................... 49
First-order differential equations............................................................... 49
Separation of variables....................................................................... 50
Second-order differential equations.......................................................... 50
Bessel function.................................................................................... 51
Partial differential equations.......................................................................... 52
Laplace transform........................................................................................ 59
Standard Laplace transforms..................................................................... 60
Fourier half-range expansions.................................................................... 61
Fourier half-range cosine series................................................................. 61
Fourier half-range sine series..................................................................... 61
Numerical analysis........................................................................................... 63
Solving linear equations (Newton’s method)........................................... 63
Newton’s method in two variables............................................................ 64
Numerical methods in linear algebra....................................................... 66
Gauss elimination............................................................................... 66
Cholesky method................................................................................ 67
Numerical integration................................................................................. 69
Trapezoidal rule.................................................................................. 69
Simpson’s rule..................................................................................... 70

© 2010 Taylor & Francis Group, LLC


x Contents

Double integration using Simpson’s rule................................................. 72


Numerical solution of first-order differential equations........................ 73
Euler’s method.................................................................................... 73
Improved Euler’s method........................................................................... 73
Runge–Kutta method......................................................................... 74
Second-order differential equations.......................................................... 76
Runge–Kutta–Nystrom method....................................................... 76
Partial differential equations...................................................................... 77
Heat conduction problem.................................................................. 78
Numerical solution....................................................................................... 79
Alternating direction implicit method............................................ 81
Unit conversions................................................................................................ 86
Programming.................................................................................................... 86
General notes for all programs.................................................................. 86
Vessel.............................................................................................................. 86
Program limitations..................................................................................... 94
Horizontal..................................................................................................... 95
Data entry...................................................................................................... 95
Inclined................................................................................................ 97
Vertical................................................................................................. 99
Conversion................................................................................................... 100
Program limitations................................................................................... 101
Procedure........................................................................................... 101
References........................................................................................................ 102

Chapter 2 Thermodynamics..................................................................... 103


Introduction..................................................................................................... 103
Heat, work, and energy.................................................................................. 103
Force............................................................................................................. 103
Kinetic and potential energy.................................................................... 104
First law of thermodynamics........................................................................ 104
Phase rule......................................................................................................... 105
Reversible process........................................................................................... 105
Heat content or enthalpy................................................................................ 106
Heat capacity at constant volume and constant pressure ........................ 106
Isothermal process.......................................................................................... 107
Adiabatic process............................................................................................ 107
Equation of state.............................................................................................. 108
Boyle’s law and Charles’s law................................................................... 108
Equation of state for real gas.....................................................................110
Comparison between PR and SRK EOSs.................................................110
Acentric factor..............................................................................................110
Vapor pressure of pure components....................................................... 112
Vapor pressure of water.............................................................................115

© 2010 Taylor & Francis Group, LLC


Contents xi

Vapor pressure calculation using EOSs...................................................116


Second law of thermodynamics.....................................................................118
Carnot’s cycle...............................................................................................119
Entropy........................................................................................................ 120
Sensible heat................................................................................................ 121
Thermodynamic properties........................................................................... 122
Isobaric specific heat of hydrocarbon ideal gases................................. 122
Isobaric specific heat of hydrocarbon real gases................................... 124
Isobaric specific heat of hydrocarbon gas mixtures.............................. 126
Joule–Thomson coefficient........................................................................ 128
Isobaric specific heat of ideal liquids....................................................... 131
Isobaric specific heat of real liquids........................................................ 131
Enthalpy of gases....................................................................................... 132
Enthalpy of gas mixtures.......................................................................... 134
Entropy of ideal gases................................................................................ 137
Entropy of real gases................................................................................. 138
Fugacity correction..................................................................................... 139
Entropy of hydrocarbon gas mixtures.................................................... 140
Viscosities of ideal liquids..........................................................................141
Viscosity of water....................................................................................... 142
Viscosity of ideal hydrocarbon vapors.................................................... 142
Liquid viscosity of defined mixtures at low pressure.......................... 142
Vapor viscosity of defined mixtures at low pressure........................... 143
Thermal conductivity of pure hydrocarbon liquids at low
pressure....................................................................................................145
Thermal conductivity of pure hydrocarbon vapors at low
pressure....................................................................................................147
Flash calculation.............................................................................................. 148
Vapor–liquid equilibrium......................................................................... 148
Programming.................................................................................................. 150
Calculation of JT effect due to drop in pressure.................................... 150
Nomenclature.................................................................................................. 151
Greek characters......................................................................................... 152
References........................................................................................................ 152

Chapter 3 Fluid mechanics....................................................................... 153


Introduction..................................................................................................... 153
Bernoulli’s theorem......................................................................................... 153
Velocity heads............................................................................................. 155
Flow measurements........................................................................................ 156
Orifice/Venturi meter................................................................................ 156
Thermal expansion factor (Fa)................................................................... 158
Coefficient of discharge (CD)..................................................................... 158
Orifice meter...................................................................................... 158

© 2010 Taylor & Francis Group, LLC


xii Contents

Venturi meter.............................................................................................. 159


Expansion factor (Y)................................................................................... 159
Orifices............................................................................................... 160
Nozzles and Venturi......................................................................... 160
Nonrecoverable pressure drop................................................................. 160
Orifices............................................................................................... 160
Venturi with 15° divergent angle................................................... 160
Venturi with 7° divergent angle..................................................... 160
Critical flow..................................................................................................161
Thickness of flow element..........................................................................162
Thickness of restriction orifice..................................................................162
Area meter: Rotameters............................................................................. 165
Flow through an open channel................................................................ 165
V notch......................................................................................................... 166
Rectangular notch...................................................................................... 166
Frictional pressure drop..................................................................................167
Darcy equation............................................................................................167
Flow in open channel................................................................................ 168
Estimation of friction factor...................................................................... 168
Friction factor: Laminar flow.......................................................... 168
Friction factor: Turbulent flow........................................................ 169
Two-K method................................................................................................. 169
K for reducer/expander............................................................................. 171
Reducer............................................................................................... 171
Expander............................................................................................ 171
Pipe entrance............................................................................................... 172
Pipe exit....................................................................................................... 172
Split flow...................................................................................................... 172
Split 1,3............................................................................................... 172
Split 1,2............................................................................................... 172
Split 3,1............................................................................................... 172
Split 1,2,3............................................................................................ 173
Split 1,3,2............................................................................................ 173
Split 3,1,2............................................................................................. 173
Hydraulics: General guidelines.....................................................................174
Roughness of pipe wall..............................................................................174
Control valve CV.........................................................................................174
Line sizing criteria for liquid lines.......................................................... 175
Line sizing for gravity flow lines..............................................................176
Downpipe sizing.........................................................................................176
Line sizing criteria for vapor lines........................................................... 177
Relief valve inlet line sizing...................................................................... 178
Relief valve outlet line sizing................................................................... 178
Line sizing criteria for two-phase flow................................................... 178

© 2010 Taylor & Francis Group, LLC


Contents xiii

Hydraulics: Compressible fluids................................................................... 179


Adiabatic flow in a pipe............................................................................ 179
Isothermal flow in a pipe.......................................................................... 181
Heat loss........................................................................................................... 182
Types of cross-country buried pipelines................................................ 183
Yellow jacket............................................................................................... 183
Coating thickness............................................................................. 183
Fusion-bonded epoxy coating.................................................................. 183
Rate of heat transfer................................................................................... 184
Film resistance (Rfilm)........................................................................ 184
Resistance of pipe (Rpipe)................................................................... 186
Resistance of coatings (Rcoating)......................................................... 186
Resistance of environment (Renv).................................................... 187
Viscosity of water....................................................................................... 189
Thermal conductivity of water................................................................. 190
Viscosity of air............................................................................................ 190
Thermal conductivity of air...................................................................... 190
Choked flow................................................................................................ 190
Limiting differential pressure.................................................................. 191
Limiting expansion factor (Y)................................................................... 191
Hydraulics: Two-phase flow.......................................................................... 193
Beggs and Brill correlations...................................................................... 195
Step 1: Estimation of flow regime................................................... 195
Step 2: Estimation of horizontal holdup........................................ 195
Step 3: Estimation of uphill holdup............................................... 196
Step 4: Estimation of downhill holdup.......................................... 197
Step 5: Estimation of friction factor................................................ 197
Step 6: Estimation of pressure drop............................................... 197
Mukherjee and Brill correlations............................................................. 198
Step 1: Estimation of flow regime................................................... 198
Step 2: Estimation of holdup........................................................... 199
Step 3: Estimation of hydrostatic head.......................................... 200
Step 4: Estimation of acceleration head......................................... 200
Step 5: Estimation of friction factor................................................ 201
Step 6: Estimation of frictional pressure drop.............................. 201
CO2 corrosion.............................................................................................. 203
CO2 corrosion mechanism........................................................................ 203
NACE requirements................................................................................... 204
Rate of corrosion......................................................................................... 204
NORSOK model................................................................................ 204
Corrosion 93 model.................................................................................... 210
Corrosion 95 model.....................................................................................211
Programming.................................................................................................. 213
Program for flow elements........................................................................ 213

© 2010 Taylor & Francis Group, LLC


xiv Contents

General overview.............................................................................. 213


Project details.....................................................................................214
Calculation form................................................................................214
Program limitations and notes................................................................. 215
Program for hydraulic calculations......................................................... 219
General overview.............................................................................. 219
Project details.................................................................................... 220
Program limitations and notes................................................................. 221
Form incompressible fluid............................................................... 221
Form compressible fluid.................................................................. 224
Pressure drop comparison.............................................................. 227
Form for two-phase flow................................................................. 227
Program for corrosion calculations......................................................... 230
General............................................................................................... 231
NORSOK model................................................................................ 232
Calculation of pH: NORSOK model.............................................. 232
Calculation of shear stress: NORSOK model............................... 233
Corrosion 93/95 model..................................................................... 233
Nomenclature.................................................................................................. 236
Greek characters......................................................................................... 239
References........................................................................................................ 240

Chapter 4 Heat transfer............................................................................. 243


Introduction..................................................................................................... 243
Conductive heat transfer................................................................................ 243
Heat conduction through a composite wall................................................ 244
Heat conduction through multiple cylindrical walls................................ 245
Heat conduction through the wall of a sphere........................................... 247
Multidimensional steady-state heat conduction......................................... 248
Rectangular coordinates........................................................................... 248
Cylindrical coordinates............................................................................. 248
Spherical coordinates................................................................................. 248
Conduction shape factors.......................................................................... 248
One-dimensional unsteady heat conduction.............................................. 250
Rectangular coordinates........................................................................... 250
Cylindrical coordinates............................................................................. 250
Spherical coordinates................................................................................. 251
Thermal conductivity of various materials/components......................... 256
Thermal conductivities of hydrocarbon liquids......................................... 256
Thermal conductivity of water (0–100°C)............................................... 264
Convective heat transfer................................................................................ 264
Free or natural convection........................................................................ 264
Free convection outside pipes and immersed body.................... 264
Free convection to air....................................................................... 265

© 2010 Taylor & Francis Group, LLC


Contents xv

Heat-transfer coefficient for immersed bodies...................................... 266


Gas quenching.................................................................................. 266
Forced convection....................................................................................... 269
Forced convection inside the tube........................................................... 269
Forced convection outside the tube......................................................... 276
Shell-side cross flow area................................................................. 276
Estimation of pressure drop.......................................................................... 280
Shell-side pressure drop............................................................................ 280
Estimation of friction factor............................................................ 281
Tube-side pressure drop............................................................................ 281
Log mean temperature difference................................................................ 283
Overall heat-transfer coefficient.................................................................... 284
Fouling resistance...................................................................................... 285
Extended surface........................................................................................ 285
Fin efficiency..................................................................................... 285
Longitudinal fins.............................................................................. 290
Impact of heat-transfer coefficient on fin efficiency.................... 291
Circular fins....................................................................................... 291
Rectangular fins................................................................................ 292
Film coefficient for finned tube................................................................ 292
Radiation heat transfer................................................................................... 293
Emissivity and absorptivity..................................................................... 293
Blackbody radiation................................................................................... 294
Emissivity of commonly used materials................................................ 294
Radiation shape factor............................................................................... 294
Parallel, equal rectangle................................................................... 294
Parallel, equal, coaxial disks........................................................... 296
Perpendicular rectangles with a common edge........................... 297
Finite, coaxial cylinders................................................................... 297
Parallel, coaxial disks....................................................................... 298
Radiation shield for large surface area................................................... 299
Double-pipe heat exchanger.......................................................................... 303
Heat exchanger nomenclature.................................................................. 307
Standard tube pattern................................................................................ 308
Tube dimensions........................................................................................ 308
Minimum unsupported tube span...........................................................310
Heat exchanger specification......................................................................... 315
Batch heating and cooling............................................................................. 315
Batch cooling, internal coil........................................................................318
Batch heating, internal coil........................................................................318
Batch cooling, counterflow external heat exchanger.............................318
Batch heating, counterflow external heat exchanger............................ 319
Batch cooling, 1−2 multipass external heat exchanger.......................... 319
Batch heating, 1–2 multipass external heat exchanger......................... 320

© 2010 Taylor & Francis Group, LLC


xvi Contents

Heat transfer in agitated vessels................................................................... 320


Viscosity correction.................................................................................... 321
Film coefficient inside the coil.................................................................. 322
Minimum metal temperature during depressuring operation................ 325
Programming.................................................................................................. 329
Program for double pipe heat exchanger................................................ 329
Program limitations and notes................................................................. 329
Checking Example 4.10 (double-pipe exchanger)........................ 329
Checking Example 4.11 (double-pipe finned exchanger)............ 329
Checking Example 4.13 (batch heating)........................................ 332
Checking Example 4.14 (batch cooling)......................................... 332
Nomenclature.................................................................................................. 334
Subscripts.................................................................................................... 335
Greek............................................................................................................ 335
References........................................................................................................ 336

Chapter 5 Distillation................................................................................ 337


Introduction..................................................................................................... 337
Relative volatility............................................................................................ 337
Vapor–liquid equilibrium.............................................................................. 338
Raoult’s law: Ideal solutions.......................................................................... 339
Material balance for two-component systems............................................ 340
Operating lines........................................................................................... 341
Reflux ratio.................................................................................................. 342
Minimum reflux ratio................................................................................ 342
Feed plate..................................................................................................... 343
McCabe–Thiele method................................................................................. 344
Smoker equations............................................................................................ 346
Approximate column sizing.......................................................................... 348
Sieve tray..................................................................................................... 348
Active hole area................................................................................. 350
Packed column.................................................................................. 350
Tray efficiency.................................................................................................. 352
Murphree tray efficiencies........................................................................ 353
Overall column efficiency......................................................................... 353
Prediction of efficiency.............................................................................. 355
Number of gas-phase transfer units........................................................ 356
Number of liquid-phase transfer units................................................... 356
Mixing factor............................................................................................... 356
Prediction of vapor diffusivity................................................................. 358
Prediction of liquid diffusivity................................................................ 358
Column hydraulics and design..................................................................... 362
Tray pressure drop.......................................................................................... 362
Sieve tray..................................................................................................... 362

© 2010 Taylor & Francis Group, LLC


Contents xvii

Dry pressure drop............................................................................ 363


Orifice coefficient (Co)....................................................................... 363
Weir liquid crest (how)........................................................................ 363
Residual head (hr)....................................................................................... 364
Valve tray..................................................................................................... 365
Dry pressure drop............................................................................ 365
Downcomer design.................................................................................... 367
Downcomer backup......................................................................... 367
Downcomer residence time............................................................. 368
Flow regimes............................................................................................... 369
Spray regime...................................................................................... 369
Froth regime...................................................................................... 369
Emulsion regime............................................................................... 369
Bubble regime................................................................................... 370
Pressure drop through packing............................................................... 370
Estimation of pressure drop........................................................... 370
Packing factor.................................................................................... 371
Height equivalent to theoretical plate.......................................................... 373
Entrainment......................................................................................................374
Weeping and dumping.................................................................................. 376
Programming.................................................................................................. 379
Program for Smoker equations................................................................ 379
References........................................................................................................ 381

Chapter 6 Separators.................................................................................. 383


Introduction..................................................................................................... 383
General principles of separation................................................................... 383
Droplet in a vertical vessel........................................................................ 383
Droplet in a horizontal vessel................................................................... 386
Gravity settling: Limiting conditions...................................................... 386
Newton’s law............................................................................................... 387
Stokes’ law................................................................................................... 387
Intermediate law........................................................................................ 387
Critical particle diameter.......................................................................... 387
Vertical vs. horizontal separators................................................................. 388
Advantages of the horizontal separator.................................................. 389
Disadvantages of the horizontal separator............................................. 389
Advantages of the vertical separator....................................................... 389
Disadvantages of the vertical separator.................................................. 389
Design of a gas–liquid separator.................................................................. 389
Critical settling velocity............................................................................ 389
Design constant, KD.................................................................................... 390
API 521 method.......................................................................................... 391
Design of liquid–liquid separators............................................................... 392

© 2010 Taylor & Francis Group, LLC


xviii Contents

Mist eliminator................................................................................................ 394


Wire mesh mist eliminator....................................................................... 394
Efficiency of the mist eliminator.................................................... 394
Inertial parameter (K)....................................................................... 395
Maximum gas velocity..................................................................... 395
Corrected pad-specific surface area (SO)...................................... 395
Impaction efficiency factor (E)........................................................ 396
Pressure drop of the mist eliminator...................................................... 397
Vane-type mist eliminator........................................................................ 397
Efficiency of vane pack.............................................................................. 398
Terminal centrifugal velocity................................................................... 398
Pressure drop through the vane pack..................................................... 398
General dimensions and setting of levels................................................... 399
The horizontal separator........................................................................... 399
Boot..................................................................................................... 402
Vertical separator....................................................................................... 403
Separator internals.......................................................................................... 404
Inlet nozzle.................................................................................................. 404
Vortex breaker............................................................................................. 405
Separator control............................................................................................. 406
Pressure and flow control......................................................................... 406
Light liquid-level control........................................................................... 407
Heavy phase liquid-level and slug control............................................. 407
High-performance separator......................................................................... 407
Salient features of GLCC........................................................................... 408
Design parameters.......................................................................................... 409
Flow rates.................................................................................................... 409
Slug length .................................................................................................. 409
Density..........................................................................................................411
Viscosity........................................................................................................411
Oil in gas droplet size................................................................................ 413
Oil in water droplet size............................................................................ 413
Water in oil droplet size............................................................................ 413
Inlet nozzle velocity................................................................................... 413
Gas outlet nozzle velocity..........................................................................414
Liquid outlet velocity..................................................................................414
Separator program...........................................................................................414
Program limitations/notes.........................................................................414
Horizontal separators................................................................................ 415
Three-phase flooded weir............................................................... 415
Three-phase nonflooded-weir separator....................................... 415
Three phase with boot separator.................................................... 415
Two-phase vapor–liquid separator................................................ 415
Two-phase liquid–liquid separator................................................ 415

© 2010 Taylor & Francis Group, LLC


Contents xix

Vertical separators.......................................................................................416
Two-phase vapor–liquid separator.................................................416
Two-phase liquid–liquid separator.................................................416
General overview of the separator.exe program....................................416
Design.......................................................................................................... 421
Slug volume................................................................................................. 421
Further checking and analysis................................................................. 422
Design.......................................................................................................... 423
Analysis....................................................................................................... 424
Nomenclature.................................................................................................. 425
Greek characters......................................................................................... 426
References........................................................................................................ 427

Chapter 7 Overpressure protection........................................................ 429


Introduction..................................................................................................... 429
Impact on plant design.............................................................................. 429
Impact on individual design.................................................................... 429
Definition......................................................................................................... 430
Accumulation.............................................................................................. 430
Atmospheric discharge............................................................................. 431
Built-up back pressure............................................................................... 431
General back pressure............................................................................... 431
Superimposed back pressure................................................................... 432
Balanced-bellows PRV............................................................................... 432
Blowdown.................................................................................................... 432
Closed discharge system........................................................................... 432
Cold differential test pressure.................................................................. 432
Conventional PRV...................................................................................... 432
Design capacity........................................................................................... 432
Design pressure.......................................................................................... 433
Maximum allowable accumulated pressure.......................................... 433
Maximum allowable working pressure.................................................. 433
Operating pressure.................................................................................... 433
Overpressure.............................................................................................. 433
Pilot-operated PRV..................................................................................... 434
Pressure relief valve................................................................................... 434
Pressure safety valve................................................................................. 434
Rated relieving capacity............................................................................ 434
Relief valve.................................................................................................. 434
Relieving conditions.................................................................................. 434
Rupture disk............................................................................................... 435
Safety relief valve....................................................................................... 435
Safety valve................................................................................................. 435
Set pressure................................................................................................. 435

© 2010 Taylor & Francis Group, LLC


xx Contents

Vapor depressuring system...................................................................... 436


Vent stack..................................................................................................... 436
Types of pressure relief valves...................................................................... 436
Conventional pressure relief valve (vapor service)............................... 436
Conventional pressure relief valve (liquid service)............................... 438
Balanced-bellows pressure relief valve................................................... 439
Pilot-operated pressure relief valve......................................................... 440
Rupture disk............................................................................................... 443
Selection of pressure relief valves................................................................ 445
Conventional pressure relief valve.......................................................... 445
Balanced-bellows pressure relief valve................................................... 445
Pilot-operated pressure relief valve......................................................... 446
Rupture disk............................................................................................... 446
PRV installation and line sizing................................................................... 447
Compressors and pumps.......................................................................... 447
Fired heaters................................................................................................ 448
Heat exchangers......................................................................................... 448
Piping........................................................................................................... 448
Pressure vessels.......................................................................................... 449
PRV isolation valves................................................................................... 449
Inlet piping to PRVs................................................................................... 451
Discharge piping from PRVs.................................................................... 453
Contingency quantification........................................................................... 454
General......................................................................................................... 454
Power failure............................................................................................... 455
Local power failure.......................................................................... 456
Failure of a distribution center....................................................... 456
Total power failure........................................................................... 457
Cooling water failure................................................................................. 457
Instrument air failure................................................................................ 458
Steam failure............................................................................................... 460
Total steam failure............................................................................ 460
Loss of steam to specific equipment.............................................. 460
Partial steam failure......................................................................... 460
Check valve failure.................................................................................... 460
Blocked outlet............................................................................................. 461
Pump or compressor discharge...................................................... 461
Multiple outlet................................................................................... 462
Block valve downstream of control valve..................................... 462
Control valve failure.................................................................................. 462
Vapor breakthrough................................................................................... 463
Maximum flow........................................................................................... 465
Thermal relief............................................................................................. 465
Modulus of elasticity of pipe material (E)..................................... 468

© 2010 Taylor & Francis Group, LLC


Contents xxi

Coefficient of linear thermal expansion (α).................................. 468


Valve leakage rate (q)........................................................................ 469
Compressibility of liquid (Z)........................................................... 469
Coefficient of cubic expansion of liquids (β)................................. 469
Installation of thermal relief valve................................................. 471
Fire exposure.............................................................................................. 471
General guidelines........................................................................... 472
Estimation of wetted surface area.................................................. 472
Fire circle.............................................................................................474
Estimation of latent heat and physical properties........................474
Liquid wet vessel.............................................................................. 475
Vessels with only gas....................................................................... 477
Two liquid phases............................................................................. 479
Heat exchanger tube rupture................................................................... 480
Contingency calculation.................................................................. 482
Reflux failure and overhead system........................................................ 484
Loss of reboiler heat................................................................................... 485
Venting of storage tanks............................................................................ 485
Venting due to liquid movements.................................................. 486
Thermal venting............................................................................... 486
Fire exposure..................................................................................... 486
Minimum flow area......................................................................... 488
Sizing procedure............................................................................................. 489
Sizing of liquid relief................................................................................. 489
Sizing of vapor relief.................................................................................. 491
Critical flow....................................................................................... 491
Subcritical flow.................................................................................. 492
Conventional and pilot-operated PRV........................................... 492
Balanced-bellows PRV..................................................................... 492
Sizing for steam relief................................................................................ 493
Sizing for two-phase fluids....................................................................... 494
Type 1 (omega method).................................................................... 496
Type 2 (omega method).................................................................... 499
Type 3 (integral method)................................................................. 501
Design of flare stack................................................................................... 503
Minimum distance..................................................................................... 504
Fraction of heat intensity transmitted (τ)................................................ 504
Fraction of heat radiated (F)...................................................................... 505
Heat release (Q)........................................................................................... 505
Sizing of a flare stack: Simple approach................................................. 505
Calculation of stack diameter......................................................... 505
Calculation of flame length............................................................. 506
Flame distortion caused by wind velocity.................................... 506
Sizing of flare stack: Brzustowski and Sommer approach................... 508

© 2010 Taylor & Francis Group, LLC


xxii Contents

Calculation of flare stack diameter................................................ 508


Location of flame center xc, yc.......................................................... 509
Lower explosive limit of mixtures................................................. 509
Vertical distance (yc)..........................................................................511
Horizontal distance (xc).....................................................................511
SIL analysis.......................................................................................................514
Definitions................................................................................................... 515
Diagnostic coverage......................................................................... 515
Final element..................................................................................... 515
MooN.................................................................................................. 515
Programmable electronics............................................................... 515
Programmable electronic system................................................... 515
Protection layer................................................................................. 515
Safety-instrumented function......................................................... 515
Safety-instrumented systems...........................................................516
Safety integrity...................................................................................516
Safety integrity level.........................................................................516
Safety life cycle...................................................................................516
Matrix for SIL determination....................................................................516
Probability of failure on demand............................................................. 517
ALARP model............................................................................................. 519
Determination of SIL........................................................................ 519
Financial...................................................................................................... 521
Health and safety....................................................................................... 522
Environment and asset.............................................................................. 522
Programming.................................................................................................. 524
Program for pressure relief valve............................................................ 524
Program limitations and notes....................................................... 525
General overview.............................................................................. 525
Project details.................................................................................... 525
File save.............................................................................................. 526
File open............................................................................................. 526
File print............................................................................................. 527
Exit...................................................................................................... 527
Specific message or warning: back pressure................................ 527
Back-pressure correction factor...................................................... 527
Pilot-operated PRV........................................................................... 527
Liquid................................................................................................. 528
Vapor.................................................................................................. 529
Two-phase type 1 calculation......................................................... 529
Two-phase type 2 calculation......................................................... 529
Two-phase type 3 calculation......................................................... 529
Program for flare stack estimation.......................................................... 531
Program limitations and notes....................................................... 531

© 2010 Taylor & Francis Group, LLC


Contents xxiii

Specific message/warning.............................................................. 532


Nomenclature.................................................................................................. 533
Greek characters......................................................................................... 533
References........................................................................................................ 534

Chapter 8 Glycol dehydration.................................................................. 537


Introduction..................................................................................................... 537
Basic scheme.................................................................................................... 537
Advantages.................................................................................................. 539
Disadvantages............................................................................................. 539
Pre-TEG coalescer....................................................................................... 539
Contactor..................................................................................................... 539
Flash separator............................................................................................ 540
Filters............................................................................................................ 540
Pumping...................................................................................................... 540
Glycol/glycol exchanger............................................................................ 541
Gas/glycol exchanger................................................................................. 541
Regenerator................................................................................................. 541
Physical properties.......................................................................................... 542
Selection of type of glycol......................................................................... 542
Common properties of glycol................................................................... 543
Densities of aqueous glycol solutions............................................ 543
Solubility of various compounds................................................... 543
Fire hazard information............................................................................ 543
Viscosities of aqueous glycol solutions.......................................... 543
Specific heats of aqueous glycol solutions.................................... 543
Thermal conductivities of aqueous glycol solutions................... 543
Design aspects................................................................................................. 544
Water content in hydrocarbon gas........................................................... 544
Equilibrium dew point.............................................................................. 545
Minimum lean-TEG concentration.......................................................... 548
Number of theoretical stages of the contactor....................................... 550
Design of contactor.................................................................................... 551
Type of internals............................................................................... 554
Liquid distributor............................................................................. 562
Flash separator............................................................................................ 563
Filters............................................................................................................ 564
Particulate filter................................................................................. 564
Carbon filter....................................................................................... 564
Glycol/glycol exchanger............................................................................ 564
Gas/glycol exchanger................................................................................. 565
Regenerator................................................................................................. 566
Still column........................................................................................ 567
Reboiler........................................................................................................ 569

© 2010 Taylor & Francis Group, LLC


xxiv Contents

Fire tube heat density....................................................................... 569


Fire tube heat flux............................................................................. 570
Lean-glycol storage.................................................................................... 570
Energy exchange pump............................................................................. 571
Burner management.................................................................................. 573
Specifications.............................................................................................. 578
Programming.................................................................................................. 578
Program limitations................................................................................... 582
General overview....................................................................................... 582
File menu............................................................................................ 582
Unit menu.......................................................................................... 583
Project details.................................................................................... 584
Data entry.......................................................................................... 584
References........................................................................................................ 585

© 2010 Taylor & Francis Group, LLC


Preface
After publishing the first edition in 2007, I received many suggestions
from professionals who encouraged me to bring out the second edi-
tion. Considering the suggestions received from end users and to make
the book more useful, I have added three more chapters to the book:
Thermodynamics, Heat Transfer, and Distillation. I have also developed
the following additional programs in Visual Basic®.

Calculation of JT effect due to drop in pressure


Double-pipe heat exchanger design
Batch heating and cooling calculation
Metal temperature calculation
Design of distillation column using Smoker equations

With an additional 5 programs, the total number of programs has


increased to 14.
Most of the existing Visual Basic® programs have been modified to
make them more user-friendly; however, the possibilities of program bugs
cannot be totally eliminated.

Arun Datta
Brisbane, Australia

© 2010 Taylor & Francis Group, LLC xxv


Acknowledgments
I wish to express my gratitude to all the professionals who encouraged
me to write the second edition of this book with additional chapters.
Special thanks to my wife, Dr. Nivedita Datta, and my daughter, Raka
Datta, whose support and encouragement were the key factors in the
­completion of this work.
I am also grateful to Anthony Buckley and Malcolm Rough of
WorleyParsons for reviewing some chapters of the book and p ­ roviding
useful suggestions. I also appreciate the contribution I received from
Dr. Pramod Mathur of Technip who reviewed some chapters and pro-
vided valuable feedback. I extend my gratitude to Haruo Kikkawa of
WorleyParsons for reviewing and checking the work-out examples of the
new chapters.
I also acknowledge the help received from the Tubular Exchanger
Manufacturers Association and Pergamon Press for permitting me to
publish relevant figures. Special thanks are also due to the editorial and
production staff of CRC Press and Techset Composition, particularly Syed
Mohamad Shajahan, Florence Kizza, and Allison Shatkin, for publishing
this work with outstanding quality.
I will thankfully acknowledge any suggestion to further improve
future editions.

Arun Datta
Brisbane, Australia

© 2010 Taylor & Francis Group, LLC xxvii


Author
Arun Datta a lead facilities engineer working with Santos, has more
than 30 years experience in the field of process engineering and design.
He holds a master’s degree in chemical engineering from the Indian
Institute of Technology, Delhi, and has worked with several process con-
sultancy organizations both in India and Australia.
Dr. Datta has been a consultant for a large number of process engi-
neering organizations, including refineries, oil and gas industries, fine
chemicals, and pharmaceuticals. His fields of expertise include heat and
mass transfer, process simulations, exchanger design, pressure vessel
design, design of safety systems, and design of control systems. Some
of his clients include BP Refinery, Caltex Refinery, Santos, ExxonMobil,
ONGC, Indian Oil, Incitec, and Oil Search.
He is a chartered professional engineer in Australia (Queensland
chapter) as well as a member of the Institute of Engineers, Australia.

© 2010 Taylor & Francis Group, LLC xxix


chapter one

Basic mathematics
Introduction
Understanding mathematics is the most fundamental requirement in
understanding engineering. Some fields in chemical engineering require
the solution of complex mathematical equations. The purpose of this
chapter is to get some idea in the field of mathematics commonly used for
chemical engineering design and includes the following:

• Physical constants
• Mensuration
• Algebra
• Trigonometry
• Analytical geometry
• Calculus
• Differential equations
• Partial differential equations
• Numerical analysis
• Equation of states
• Unit conversions
• Programming

Physical constants
The commonly used physical constants are presented in Table 1.1.

SI prefixes
The International System of Units (SI) prefixes are presented in Table 1.2.

Mensuration
Triangles
Area = 1/2 bh (1.1)

where b = base and h = altitude.

© 2010 Taylor & Francis Group, LLC 1


2 Process engineering and design using visual basic®

Table 1.1 Commonly Used Physical Constants


Name Symbol Unit Value
Speed of light c cm/s 2.99792458E10
Planck’s constant h erg⋅s 6.6260755E−27
hbar erg⋅s 1.05457266E−27
Gravitational constant G cm3/(g⋅s2) 6.67259E−8
G Nm2/kg2 6.67259E−11
Electron charge e ESU 4.8032068E−10
Mass of electron me g 9.1093897E−28
Mass of proton mp g 1.6726231E−24
Mass of neutron mn g 1.6749286E−24
Mass of hydrogen mH g 1.6733E−24
Atomic mass unit amu g 1.6605402E−24
Avogadro’s number NA 6.0221367E23
Boltzmann constant k erg/k 1.380658E−16
Electron volt eV erg 1.6021772E−12
Radiation density constant a erg/(cm3⋅K4) 7.5646E−15
Stefan–Boltzmann constant sigma erg/(cm2⋅K4⋅s) 5.67051E−5
Rydberg constant erg 2.1798741E−11
Gas constant R J/(mol⋅K) 8.31439
R cal/(mol⋅K) 1.98719
R l.atm/(mol⋅K) 0.0820567
Pi π 3.1415926536
Napierian (natural) e 2.7182818285
logarithm base
Euler’s constant Y 0.5772156649
Logarithm conversion log x 0.4342944819 ln x
Logarithm conversion ln x 2.302585093 log x
Radian 57.2957795131°
Degree 0.0174532925 rad
Minute 0.0002908882 rad
Second 0.0000048481 rad

Rectangles
Area = ab (1.2)

where a and b are the lengths of the sides.

Parallelogram (opposite sides parallel)


Area = ah = ab sin α (1.3)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 3

Table 1.2 SI Prefixes


Multiplication factor Prefix Symbol
1 000 000 000 000 000 000 = 1018 exa E
1 000 000 000 000 000 = 1015 peta P
1 000 000 000 000 = 1012 tera T
1 000 000 000 = 109 giga G
1 000 000 = 106 mega M
1 000 = 103 kilo k
100 = 102 hecto h
10 = 101 deka da
0.1 = 10−1 deci d
0.01 = 10−2 centi c
0.001 = 10−3 milli m
0.000 001 = 10−6 micro μ
0.000 000 001 = 10−9 nano n
0.000 000 000 001 = 10−12 pico p
0.000 000 000 000 001 = 10−15 femto f
0.000 000 000 000 000 001 = 10−18 atto a

b h
α
a

Figure 1.1 Parallelogram.

where a and b are the lengths of the sides, h the height, and α the angle
between the sides. See Figure 1.1.

Rhombus (equilateral parallelogram)


Area = 1/2 ab (1.4)

where a and b are the lengths of the diagonals.

Trapezoid (four sides, two parallel)


Area = 1/2(a + b)h (1.5)

where a and b are the lengths of the parallel sides, and h is the height.

© 2010 Taylor & Francis Group, LLC


4 Process engineering and design using visual basic®

Quadrilateral (four sided)


Area = 1/2 ab sin θ (1.6)

where a and b are the lengths of the diagonals, and θ is the acute angle
between them.

Regular polygon of n sides (refer to Figure 1.2)


Area = 1/4 nL2 cot(180°/n) (1.7a)

R = L/2 csc(180°/n) (1.7b)

r = L/2 cot(180°/n) (1.7c)

β = 360°/n (1.7d)

θ = (n − 2)180°/n (1.7e)

L = 2r tan(β/2) = 2R sin(β/2) (1.7f)

Circle (refer to Figure 1.3)


Let
C = circumference
r = radius
D = diameter
A = area
S = arc length subtended by θ
L = chord length subtended by θ
H = maximum rise of arc above chord, r − H = d
θ = central angle (rad) subtended by arc S

R r L
β

Figure 1.2 Regular polygon (n = 5).

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 5

θ
r d

Figure 1.3 Circle.

Then

C = 2πr = πD (1.8a)

S = rθ = 1/2 Dθ (1.8b)

L = 2 r 2 − d 2 = 2r sin(θ/2) = 2d tan(θ/2) (1.8c)

d = 1/2 4r 2 − L2 = 1/2L cot(θ/2) (1.8d)

θ = S/r = 2cos−1(d/r) = 2sin−1(L/D) (1.8e)

A(circle) = πr2 = 1/4 πD2 (1.8f)

A(sector) = 1/2 rS = 1/2 r2θ (1.8g)

A(segment) = A(sector) − A(triangle) = 1/2 r2 (θ − sin θ) (1.8h)

(r − H ) (1.8i)
= r 2cos −1 − (r − H )(2rH − H 2 )0.5
r

A(segment ) (φ/360°)(π/4) − ( h − h 2 )(0.5 − h) (1.8j)


=
A(total) π/4

where
h = H/D, h ≤ 0.5
ϕ = 2{90 − sin−1(1 − 2h)}

© 2010 Taylor & Francis Group, LLC


6 Process engineering and design using visual basic®

Figure 1.4 Ellipse.

E
G
x

Figure 1.5 Parabola.

Ellipse (refer to Figure 1.4)


Area = πab (1.9a)
Circumference = 2π{(a2 + b2)/2}0.5 (approximately) (1.9b)

Parabola (refer to Figure 1.5)


Length of arc EFG = (4x 2 + y 2 ) +
y2
2x {(
ln 2x + 4x2 + y 2 ) y} (1.10a)

Area of section EFG = 4/3 xy (1.10b)

Prism
Lateral surface area = (perimeter of right section) * (lateral edge) (1.11a)

Volume = (area of base) * (altitude) (1.11b)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 7

Pyramid
Lateral area of a regular pyramid = 1/2 (perimeter of base) * (slant height)

(1.12a)
= 1/2 (number of sides) * (length of one side) * (slant height) (1.12b)

Volume = 1/3 (area of base) * (altitude) (1.12c)

Right circular cylinder


Lateral surface area = 2π (radius) * (altitude) (1.13a)

Volume = π (radius)2 * (altitude) (1.13b)

Sphere (refer to Figure 1.6)


Area (sphere) = 4πR 2 = πD2 (1.14a)
Area (zone) = 2πRh = πDh (1.14b)
Volume (sphere) = 4/3πR3 = 1/6πD3 (1.14c)
Volume (spherical sector) = 2/3πR2 h = 1/6πh1(3r22 + h12 ) (1.14d)

Volume (spherical segment of one base) = 1/6πh1 (3r22 + h12 ) (1.14e)

Volume (spherical segment of two bases) = 1/6πh (3r12 + 3r22 + h22 ) (1.14f)

r2
r1

h1
h2

h R

Figure 1.6 Sphere.

© 2010 Taylor & Francis Group, LLC


8 Process engineering and design using visual basic®

Right circular cone


Curved surface area = πr(r2 + h2)0.5 (1.15a)

Volume = 1/3 πr2h (1.15b)

where
r = radius
h = height of the cone

Dished end
Surface area (general) = πa2 + π/2(b2/e)ln{(1 + e)/(1 − e)} (1.16a)

Surface area (ellipsoidal, b = a/2) = πa2 + (πa2/8e)ln{(1 + e)/(1 − e)} (1.16b)

= 4.336 a2

Surface area (hemispherical, b = a) = 2πa2 (1.16c)


Volume (general) = 2/3 πa2b (1.16d)
Volume (ellipsoidal) = 1/3 πa3 (1.16e)
Volume (hemispherical) = 2/3 πa3 (1.16f)

where
a = semimajor axis
b = semiminor axis
e = eccentricity = (1 − b2/a2)0.5

Irregular shape
Let y0, y1, y2, . . ., yn be the lengths of a series of equally spaced parallel
chords and h be the distance between them. The approximate area of the
figure is given by using the trapezoidal rule or by Simpson’s rule.

Trapezoidal rule
Area = h/2 {(y0 + yn) + 2(y1 + y2 + y3 + ⋯ + yn−1)} (1.17)

Simpson’s rule
Area = h/3 {(y0 + yn) + 4(y1 + y3 + y5 + ⋯ + yn−1)
+ 2(y2 + y4 + ⋯ + yn−2)} (1.18)

where n is even.
The greater the value of n, the greater the accuracy of approximation.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 9

Irregular volume
To find the irregular volume, replace y’s by cross-sectional area Aj, and use
the results in the preceding equation.

Algebra
Factoring
a2 − b2 = (a + b)(a − b) (1.19a)

a3 − b3 = (a − b)(a2 + ab + b2) (1.19b)

a3 + b3 = (a + b)(a2 − ab + b2) (1.19c)

an − bn = (a − b)(an−1 + an−2b + an−3b2 + ⋯ + bn−1) (1.19d)

(a + b)2 = a2 + 2ab + b2 (1.19e)

(a − b)2 = a2 − 2ab + b2 (1.19f)

(a + b + c)2 = a2 + b2 + c2 + 2ab + 2ac + 2bc (1.19g)

(a − b − c)2 = a2 + b2 + c2 − 2ab − 2ac + 2bc (1.19h)

(a + b)3 = a3 + 3a2b + 3ab2 + b3 (1.19i)

(a − b)3 = a3 − 3a2b + 3ab2 − b3 (1.19j)

(a + b)n = an + nan−1b + {n(n − 1)/2!}an−2b2

+ {n(n − 1)(n − 2)/3!}an−3b3 + ⋯ + bn (1.19k)

Arithmetic progression
A series is said to be in arithmetic progression (AP) if the algebraic differ-
ence between any two successive terms is the same throughout the series.
The following series is in AP:

a, a + b, a + 2b, a + 3b, . . ., nth term

where
a = first term
b = common difference

The nth term can be defined as

tn = a + (n − 1)b (1.20a)

© 2010 Taylor & Francis Group, LLC


10 Process engineering and design using visual basic®

Sum of the series

S = (n/2){2a + (n − 1)b} (1.20b)

Geometric progression
A series is said to be in geometric progression (GP) if the ratio of any
term to the preceding one is the same throughout the series. The follow-
ing series is in GP:

a, ar, ar2, ar3, . . ., nth term

where
a = first term
r = common ratio

The nth term can be defined as

tn = arn−1 (1.21a)

Sum of the series

a(1 − r n )
S= (1.21b)
(1 − r )

Infinite series (in GP)

When r < 1, the sum of the series = a/(1 − r) (1.21c)

Example
Series 1 + 1/3 + 1/9 + 1/27 + ⋯ + 1/∞

The sum = a/(1 − r) = 3/2

Best-fit straight line (least squares method)


The straight line y = a + bx should be fitted through the given points (x1,y1),
(x2,y2), . . ., (xn,yn) so that the sum of the squares of the distances of those
points from the straight line is minimum, where the distances are mea-
sured in the vertical direction (y-direction).
The values of a and b are calculated from the following equations:

an + bΣxj = Σyj (1.22a)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 11

and

aΣx j + bΣx 2j = Σx j y j (1.22b)

where n is the number of points.

Example 1.1
Let the four points be (−1,1), (−0.1,1.099), (0.2,0.808), and (1,1).

n=4
Σx j = 0.1
Σx 2j = 2.05
Σy j = 3.907
Σx j y j = 0.0517
4 a + 0.1b = 3.907
0.1a + 2.05b = 0.0517

The solution is

a = 0.9773
b = −0.0224

Therefore, the equation of the best-fit straight line is


y = 0.9773 − 0.0224x.

Binomial equation
The general equation is

ax2 + bx + c = 0 (1.23a)

General solution of Equation 1.23a

−b ± b 2 − 4 ac (1.23b)
x=
2a

Polynomial equation
General solution of the following type of polynomial equation:

y = ax2 + bx + c (1.24a)

© 2010 Taylor & Francis Group, LLC


12 Process engineering and design using visual basic®

If three values (x1,y1), (x2,y2), and (x3,y3) are known, then

( y1 − y 2 )( x2 − x3 ) − ( y 2 − y 3 )( x1 − x2 )
a= (1.24b)
( x12 − x22 )( x2 − x3 ) − ( x22 − x32 )( x1 − x2 )

b=
{( y 1 }
− y 2 ) − a( x12 − x22 ) (1.24c)
( x1 − x2 )

c = y1 − ax12 − bx1 (1.24d)

Example 1.2
Solve the equation y = ax2 + bx + c for three sets of values (1,10), (3,32),
and (5,70).

SOLUTION

(10 − 32)(3 − 5) − (32 − 70)(1 − 3)


a= =2
(1 − 9)(3 − 5) − (9 − 25)(1 − 3)

b=
{(10 − 32) − 2(1 − 9)} =3
−2

c = 10 − 2 − 3 = 5

Therefore, the general solution will be y = 2x2 + 3x + 5.

Maxima/minima
Let a function be

y = f(x) (1.25a)

If a solution for x at y′= 0 exists, then there will be either a maximum


value or a minimum value for the function.
At a value of x, where y′ = 0

If y″ is negative, then there will be a maximum value for the function.


If y″ is positive, then there will be a minimum value for the function.

Example 1.3A
Let the equation be

y = ax + b (1.25b)
y′ = a = 0

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 13

No solution exists at y′ = 0; this indicates that there will be no


maxima or minima for the function.
This is the equation of a straight line.

Example 1.3B
Let the equation be

y = x3 + x − 1 (1.25c)
y′ = 3x + 1 = 0
2 (1.25d)
or x2 = −1/3 (1.25e)

No general solution exists for Equation 1.25e, meaning that Equation


1.25c will have no general maxima or minima.

Example 1.3C
Let the equation be y = 4x3 − 3x + 2 (1.25f)
y′ = 12x − 3 = 0
2

x = ±1/2

At x = 1/2, y″ = 12 and at x = −1/2, y″ = −12.


Therefore, at x = 1/2, the value of y will be minimum. The value
of y = 1.
At x = −1/2, the value of y will be maximum. The value of y = 3.
The nature of this graph is such that for x values less than −1/2,
the value of y will decrease continuously, and for x values more than
1/2, the value of y will increase continuously.

Cubic equation
An accurate solution of a cubic equation is very important in process engi-
neering calculations. The commonly used Newton’s method (discussed
later) may not be adequate to establish all the roots of a cubic equation.
One root is always real and the other two roots can be real or imaginary
depending on the equation.

General procedure
Let the equation be
ax3 + bx2 + cx + d = 0 (1.26)
The following factors are calculated as

 3c  b  2 
p =  −   3 (1.27a)
 a  a  

© 2010 Taylor & Francis Group, LLC


14 Process engineering and design using visual basic®

  b  9bc 27 d 
3
q = 2   − 2 +  27 (1.27b)

 a  a a 

3 2
 p  q (1.27c)
∆ =  + 
 3  2

If Δ < 0, then all three roots will be real.


Otherwise, one root will be real and the other roots will be imaginary.
When Δ < 0, all roots are real

0.5
|p|3  (1.28)
v= 
 27 

 −q  (1.29)
φ = cos −1  
 2v 
0.5
|p| (1.30)
w= 
3

y1 = 2w cos(ϕ/3) (1.31a)

 φ + π (1.31b)
y 2 = −2w cos 
 3 

 φ − π (1.31c)
y 3 = −2w cos 
 3 

The final roots will be


b (1.32a)
x1 = y1 −
3a
b (1.32b)
x2 = y 2 −
3a
b (1.32c)
x3 = y 3 −
3a

When Δ >= 0, only one root is real

q
u1 = − + ∆ 0.5 (1.33a)
2

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 15

If u1 < 0, then

u = − u1
1/3 (1.33b)

Else
u = u11/3 (1.33c)
q
k1 = − − ∆ 0.5 (1.34a)
2

If k1 < 0, then
1/3
k = − k1 (1.34b)

Else
k = k11/3 (1.34c)

y1 = u + k (1.35)
The final root will be
b (1.36)
x1 = y1 −
3a

Example 1.4A
Solve the equation

x3 − x2 + 0.1x − 0.002 = 0

SOLUTION
p = −0.2333
 q = −0.04274
    Δ = −0.000013

Since the value is negative, there will be three real roots


 v = 0.02169
ϕ = 0.1722
 w = 0.27889
   y1 = 0.55685
   y2 = −0.250715
   y3 = −0.30614

The final roots will be


x1 = 0.89019
x2 = 0.08262
x3 = 0.02719

© 2010 Taylor & Francis Group, LLC


16 Process engineering and design using visual basic®

Example 1.4B
Solve the equation

3x3 − x2 + 0.1x − 0.002 = 0

SOLUTION
  p = −0.0037
   q = 0.000294
Δ = 1.9E−8
Since the value is positive, there will be one real root
     u1 = −0.00000656
u = −0.01872
   k1 = −0.000287
 k = −0.06596
y1 = −0.08468 
The final real root will be
x1 = 0.02643

Matrix
Addition and multiplication of matrices
• If two m by n matrices A and B are given, the sum A + B can be
defined as the m by n matrix, adding corresponding elements, that is

(A + B) [i,j] = A[i,j] + B[i,j] (1.37a)

• If a matrix A and a number c are given, the multiplication of the


matrix can be defined as
cA = cA[i,j] (1.37b)

Addition of matrices
a b c u v w a + u b+v c + w
i.  + =
d e f  x
 y z   d + x e+y f + z 

a b c a b c   2a 2b 2c  a b c
ii.  + = = 2
d e f  d
 e f   2d 2e 2f
d e f 

Multiplication of matrices
a b e f   ae + bg af + bh 
iii.  * =
c d  g
 h   ce + dg cf + dh 

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 17

x
a b c     ax + by + cz 
iv.  * y =
d e f     dx + ey + fz 
 z 

The multiplication of two matrices is well defined only if the number


of columns of the first matrix is the same as the number of rows of the sec-
ond matrix. If A is an m by n matrix (m rows, n columns) and B is an n by
p matrix (n rows, p columns), then their product AB is the m by p matrix
(m rows, p columns) given by (AB)[i,j] = A[i,1] * B[1,j] + A[i,2] * B[2,j] + ⋯ +
A[i,n] * B[n,j] for each pair of i and j.
Multiplication has the following properties:

• (AB)C = A(BC) for all k by m matrices A, m by n matrices B, and n by


p matrices C (associativity).
• (A + B)C = AC + BC for all m by n matrices A and B and k by m matri-
ces C (distributivity).
• In general, commutativity does not hold, meaning generally AB ≠ BA.

Matrix properties involving addition


Let A, B, and C be m by n matrices. Then

a. A + B = B + A (1.38a)
b. (A + B) + C = A + (B + C) (1.38b)
c. A + 0 = A (1.38c)

  where 0 is the m by n zero matrix (all its entries are equal to 0).

d. A + B = 0 if and only if B = −A (1.38d)

Matrix properties involving multiplication


a. Let A, B, and C be three matrices. If the products AB, (AB)C, BC, and
A(BC) then

(AB)C = A(BC) (1.39a)

b. If α and β are numbers and A is a matrix, then

α(βA) = (αβ)A (1.39b)

c. If α is a number, and A and B are two matrices such that the product
AB is possible, then

α(AB) = (αA)B = A(αB) (1.39c)

© 2010 Taylor & Francis Group, LLC


18 Process engineering and design using visual basic®

d. If A is an n by m matrix and 0 is the m by k zero matrix, then

A0 = 0 (1.39d)

Matrix properties involving addition and multiplication


a. Let A, B, and C be three matrices, then

(A + B)C = AC + BC (1.40a)
and

A(B + C) = AB + AC (1.40b)

b. If α and β are numbers and A and B are matrices, then

α(A + B) = αA + αB (1.40c)
and

(α + β)A = αA + βA (1.40d)

Transpose
The transpose of a matrix is another matrix, produced by turning rows
into columns and vice versa. The transpose of an n by m matrix A is the n
by m matrix AT defined by

AT[i,j] = A[j,i] (1.41)

For the matrix

a b c
d e f 
A=
g h i
 
j k l

the transpose

a d g j
 
A = b
T
e h k
 c f i l 

Symmetric matrix
A symmetric matrix is a matrix equal to its transpose. A symmetric matrix
must be a square matrix, for example

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 19

a b c
a b  
b and b d e
 c 
 c e f 

Diagonal matrix
A diagonal matrix is a symmetric matrix with all of its entries equal to
zero, except possibly the values of the diagonal, for example

a 0 0
a 0  
0  and 0 0 0
 b
0 0 b 

Determinants
Determinants are important in both calculus and algebra.
The determinant of a 1 × 1 matrix is the element itself: det[a] = a.
The 2 × 2 matrix

a b
A=
c d 

has the determinant

det(A) = ad − bc (1.42)

The 3 × 3 matrix

a b c
 
A = d e f
 g h i 

has the determinant

det(A) = a(ei − fh) − b(di − fg) + c(dh − eg) (1.43)

Properties of determinants
1. Any matrix A and its transpose have the same determinant, mean-
ing det A = det AT.
2. If the elements of one row (or column) of a determinant are all zero,
the value of the determinant is zero.

© 2010 Taylor & Francis Group, LLC


20 Process engineering and design using visual basic®

3. The determinant of a triangular matrix is the product of the entries


on the diagonal, that is

a b  a 0
0 = = ad
 d  b d 

4. If one determinant is obtained from another by interchanging any


two rows (or columns), the value of either is the negative of the value
of the other.

a b c d
c  = −
 d a b 

5. If the elements of one row (or column) of a determinant are multi-


plied by the same constant factor, the value of the determinant is
multiplied by this factor.

 na nb  a b  a b
c = n =
 d  c d   nc nd 

6. If two rows (or columns) of a determinant are identical, the value of


the determinant is zero.
7. If two determinants are identical except for one row (or column),
the sum of their values is given by a single determinant obtained by
adding corresponding elements of dissimilar rows (or columns) and
leaving the remaining elements unchanged.

3 2  4 2  7 2
1 + = = 19
 5  7 5   8 5 

8. The value of a determinant is not changed if a constant multiple of


the corresponding elements of any other row (or column) is added to
the elements of any row (or column).

 a + nc b + nd   a b  a b 
 c = =
 d   c d  c + na 
d + nb 

9. If all the elements but one in a row (or column) are zero, the value of
the determinant is the product of that element and its cofactor.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 21

Cofactor
Let A be an n × n matrix. The ij-th cofactor of A, denoted by Aij, will be

Aij = (−1)i+j|Mij| (1.44)

Example 1.5
Find the cofactors A32 and A24 of a 4 × 4 determinant A

1 −3 5 6
2 4 0 3 
A=
1 5 9 −2 
 
 4 0 2 7 

SOLUTION

1 5 6
 
A32 = (−1)3 + 2 M32 = −  2 0 3  = −8
 4 2 7 

1 −3 5
2+ 4  
A24 = (−1) 1 5 9  = −192
 4 0 2 

Determinant and inverses


Theorem 1

If A is invertible, then det A ≠ 0 and

det A−1 = 1/det A (1.45)

Adjoint
Let a determinant be

 A11 A12 ... A1n 


A A22 ... A2 n 
B=
21
(1.46)
     
 
 An1 An 2 ... Ann 

Let A be an n × n matrix and let B, given in Equation 1.46, denote the


matrix of its cofactors. Then the adjoint of A, written as adjA, is the trans-
pose of the n × n matrix B.

© 2010 Taylor & Francis Group, LLC


22 Process engineering and design using visual basic®

 A11 A21 ... An1 


A A22 ... An 2 
adjA = BT = 
12
(1.47)
     
 
 A1n A2 n ... Ann 

Theorem 2

Let A be an n × n matrix. Then

 detA 0 0 ... 0 
 0 detA 0 ... 0 

( A)( adjA) =  0 0 detA ... 0  = (detA)I (1.48)
 
      
 0 0 0 0 detA 

Theorem 3

Let A be an n × n matrix. Then A is invertible if and only if detA ≠ 0.


If detA ≠ 0, then

1
A −1 = adjA (1.49)
detA

Cramer’s rule
Consider a system of n equations and n unknowns.

a11x1 + a12x2 + ⋯ + a1nxn = b1


a21x1 + a22x2 + ⋯ + a2nxn = b2 (1.50a)
⋮ ⋮ ⋮ ⋮

an1x1 + an2x2 + ⋯ + annxn = bn

which can be written in the form

Ax = b (1.50b)

If detA ≠ 0, then Equation 1.50b will have a unique solution given by

x = b/A (1.50c)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 23

Let D be detA. The other matrix can be defined as

 b1 a12 ... a1n   a11 b1 ... a1n 


b a22 ... 
a2 n  a b2 ... a2 n 
A1 =  , A2 = 
2 21
, etc.
          
   
bn an 2 ... ann   an1 bn ... ann 

Let D1 = detA1, D2 = detA2 , . . ., Dn = detAn, then

D1 D D
x1 = , x2 = 2 , … , xn = n (1.51)
D D D

Example 1.6
Solve using Cramer’s rule, the system

2x1 + 4x2 + 6x3 = 18


4x1 + 5x2 + 6x3 = 24
3x1 + x2 − 2x3 = 4

SOLUTION
The determinant is calculated first as

2 4 6
 
D = 4 5 6  = 2(−10 − 6) − 4 ( −8 − 18 ) + 6 ( 4 − 15)
 3 1 −2 

= −32 + 104 − 66 = 6

Because the value of D ≠ 0, the system will have a unique solution.

18 4 6
 
D1 =  24 5 6  = 18(−10 − 6) − 4(−48 − 24)
 4 1 −2 

+ 6 ( 24 − 20 ) = 24

2 18 6
 
D2 =  4 24 6  = 2(−48 − 24) − 18(−8 − 18)
 3 4 −2 

+ 6 (16 − 72) = −12

© 2010 Taylor & Francis Group, LLC


24 Process engineering and design using visual basic®

2 4 18 
 
D3 =  4 5 24  = 2 ( 20 − 24 ) − 4 (16 − 72)
 3 1 4 

+ 18 ( 4 − 15) = 18

Therefore
x1 = D1/D = 24/6 = 4
x2 = D2/D = −12/6 = −2
x3 = D3/D = 18/6 = 3

Trigonometry
Functions of circular trigonometry
Trigonometric functions are the ratios of various sides of the reference
angles presented in Figure 1.7.
The trigonometric relationships are:

Sine of α = sin α = p/h; secant of α = sec α = h/b


Cosine of α = cos α = b/h; cosecant of α = csc α = h/p
Tangent of α = tan α = p/b; cotangent of α = cot α = b/p

The magnitude and sign of trigonometric functions are presented in


Table 1.3.

h h
p p α α α
b
b b p b p
h h

Figure 1.7 Triangles.

Table 1.3 Magnitude of Trigonometric Functions


Function 0–90° 90–180° 180–270° 270–360°
sin α +0 to +1 +1 to +0 0 to –1 −1 to −0
csc α +∞ to +1 +1 to +∞ −∞ to −1 −1 to −∞
cos α +1 to 0 −0 to −1 −1 to −0 +0 to +1
sec α +1 to +∞ −∞ to −1 −1 to −∞ +∞ to +1
tan α +0 to +∞ −∞ to −0 +0 to +∞ −∞ to −0
cot α +∞ to +0 −0 to –∞ +∞ to +0 −0 to −∞

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 25

Periodic functions
The following periodic functions are commonly used in trigonometry:

cos(α + 2π) = cos α (1.52a)

sin(α + 2π) = sin α (1.52b)

cos(α + 2nπ) = cos α, n = 0, ±1, ±2, . . . (1.52c)

sin(α + 2nπ) = sin α, n = 0, ±1, ±2, . . . (1.52d)

Magic identity
The following identities are very basic to the analysis of trigonometric
expressions:

sin2 α + cos2 α = 1 (1.53a)

1 + tan2 α = sec2 α (1.53b)

1 + cot2 α = csc2 α (1.53c)

Addition formulas
The following addition formulas are very important for the analysis of
trigonometric expressions:

cos (a + b) = cos a cos b − sin a sin b (1.54a)

cos(a − b) = cos a cos b + sin a sin b (1.54b)

sin(a + b) = sin a cos b + cos a sin b (1.54c)

sin(a − b) = sin a cos b − cos a sin b (1.54d)

tan a + tan b
tan( a + b) = (1.54e)
1 − tan a tan b

tan a − tan b (1.54f)


tan( a − b) =
1 + tan a tan b

© 2010 Taylor & Francis Group, LLC


26 Process engineering and design using visual basic®

Example 1.7
Find the exact value of cos 165°, given that cos 120° = −1/2,
sin 120° = 3 /2, and 45° = sin 45° = 2 /2 .

SOLUTION
cos 165° = cos (120° + 45°)
        = cos 120° cos 45° − sin 120° sin 45°

−1 2 3 2
= * − *
2 2 2 2
6+ 2
=−
4

Double angle and half angle formulas


Double- and half-angle formulas are very useful in trigonometry. The fol-
lowing equations are widely used:

cos(2a) = cos2 a − sin2 a = 2 cos2 a − 1 = 1 − 2sin2 a (1.55a)

sin(2a) = 2sin a cos a (1.55b)


2 tan a (1.55c)
tan(2a) =
1 − tan 2 a

 a 1 (1.55d)
cos 2   = (1 + cos a)
 2 2

 a 1 (1.55e)
sin 2   = (1 − cos a)
 2 2

 a  1 − cos a sin a (1.55f)


tan   = =
 2 sin a 1 + cos a

Example 1.8
Use the half-angle formulas to find cos(π/8) and sin(π/8).

SOLUTION
Let a = π/4, then π/8 = a/2.
Now, from the half-angle formula, we have

 π 1 π 1 2
cos 2   =  1 + cos  =  1 +
 8 2  4  2 2 

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 27

Because 0 < π/8 < π/2, the value of cos(π/8) will be positive.
Therefore

 π 2+ 2
cos   =
 8 2

Similarly

 π 2− 2
sin   =
 8 2

Product and sum formulas


The following product and sum formulas are commonly used in
trigonometry:

1
cos a cos b = {cos( a + b) + cos(a − b)} (1.56a)
2

1
sin a sin b = {cos( a − b) − cos(a + b)} (1.56b)
2

1
sin a cos b = {sin( a + b) + sin(a − b)} (1.56c)
2

1
cos a sin b = {sin( a + b) − sin(a − b)} (1.56d)
2

 a + b  a − b
cos a + cos b = 2 cos  cos  (1.56e)
 2   2 

 a + b  a − b
cos a − cos b = −2 sin  sin  (1.56f)
 2   2 

 a + b  a − b
sin a + sin b = 2 sin  cos  (1.56g)
 2   2 

 a + b  a − b
sin a − sin b = 2 cos  sin  (1.56h)
 2   2 

© 2010 Taylor & Francis Group, LLC


28 Process engineering and design using visual basic®

c
r h a

α γ
b

Figure 1.8 Triangle.

Relations between angles and sides of triangles


Refer to Figure 1.8.
Let a, b, and c be the sides of a triangle.
Let α, β, and γ be the angles opposite the sides in the triangle.

2s = a + b + c

A = area
r = radius of the inscribed circle
R = radius of the circumscribed circle
h = altitude

Law of sines
sin α/a = sin β/b = sin γ/c (1.57)

Law of tangents
a + b tan 1/2(α + β) (1.58a)
=
a−b tan 1/2(α − β)

b + c tan 1/2(β + γ )
= (1.58b)
b−c tan 1/2(β − γ )

a + c tan 1/2(α + γ ) (1.58c)


=
a−c tan 1/2(α − γ )

Law of cosines
a 2 = b 2 + c 2 − 2bc cos α (1.59a)

b 2 = a 2 + c 2 − 2ac cosβ (1.59b)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 29

c 2 = a 2 + b 2 − 2ab cos γ (1.59c)

Other relations
b 2 + c2 − a2
cos α = (1.60a)
2bc

a = bcos γ + ccos β (1.60b)

2
sin α = s(s − a)(s − b)(s − c) (1.60c)
bc

 α (s − b)(s − c)
sin   = (1.60d)
 2 bc

 α s(s − a)
cos   = (1.60e)
 2 bc

1 1 a 2 sin β sin γ
A= bh = ab sin γ = = s(s − a)(s − b)(s − c) = rs (1.60f)
2 2 2 sin α

(s − a)(s − b)(s − c)
r= (1.60g)
s

a abc
R= = (1.60h)
2 sin α 4A

2rs
h = c sin α = a sin γ = (1.60i)
b

Inverse trigonometric functions


General inverse trigonometric functions with the following restrictions:

−π/2 ≤ sin−1 x ≤ π/2


0 ≤ cos−1 x ≤ π

−π/2 ≤ tan−1x ≤ π/2


© 2010 Taylor & Francis Group, LLC


30 Process engineering and design using visual basic®

are

x 1 − x2
sin −1 x = cos −1 1 − x 2 = tan −1 = cot −1
1 − x2 x

1 1 π
= sec −1 = csc −1 = − cos −1 x (1.61a)
1− x 2 x 2

1 − x2 x 1
cos −1 x = sin −1 1 − x 2 = tan −1 = cot −1 = sec −1
x 1− x 2 x

1 π
= csc −1 = − sin −1 x (1.61b)
1− x 2 2

x 1 1
tan −1 x = sin −1 = cos −1 = cot −1
1+ x 2
1+ x 2 x

1 + x2
= sec −1 1 + x 2 = csc −1 (1.61c)
x

Hyperbolic functions
The hyperbolic functions are similar to the trigonometric functions and
are presented as follows:

ex + e−x (1.62a)
cosh x =
2

ex − e−x (1.62b)
sinh x =
2

ex − e−x (1.62c)
tanh x =
ex + e−x

ex + e−x (1.62d)
coth x =
ex − e−x

2
sech x = (1.62e)
ex + e−x

2
csch x = (1.62f)
e − e−x
x

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 31

Other hyperbolic functions


cosh2 x − sinh2 x = 1 (1.63a)

sech2 x + tanh2 x = 1 (1.63b)

coth2 x − csch2 x = 1 (1.63c)

sinh (x ± y) = sinh x cosh y ± cosh x sinh y (1.63d)

cosh (x ± y) = cosh x cosh y ± sinh x sinh y (1.63e)

2s tanh x
tanh 2x = (1.63f)
1 + tanh 2 x

Inverse hyperbolic functions


The inverse of sinh x can be established as follows:

Let y = sinh x
or 2y = ex − e−x
or 2yex = e2x − 1
or (ex)2 − 2y(ex) − 1 = 0
or e x = y ± y2 + 1

Because ex > 0 for all x, and y 2 + 1 > y for all y, we can have the solu-
tion as

ex = y + y2 + 1

Therefore

(
x = ln y + y2 + 1 )
and

(
sinh −1 x = ln x + x2 + 1 ) (1.64a)

Similarly

(
cosh −1 x = ln x + x2 − 1 ) (1.64b)

1 1+ x
tanh −1 x = ln (1.64c)
2 1− x

© 2010 Taylor & Francis Group, LLC


32 Process engineering and design using visual basic®

1 x+1 (1.64d)
coth −1 x = ln
2 x−1

 1 + 1 − x2 
sech −1x = ln   (1.64e)
 x 

 1 + 1 + x2 
csch −1x = ln   (1.64f)
 x 

Analytical geometry
Straight line
The general equation of a straight line is

ax + by + c = 0 (1.65)

If b ≠ 0, the slope is −a/b.


The intersection at the y-axis when x = 0 is −c/b.

Straight line through two points


It is possible to draw a straight line through two points. The general equa-
tion of a straight line through two points P1 (a1,b1) and P2 (a2,b2) can be
represented as

x y 1
 
 a1 b1 1 = 0 (1.66a)
 a2 b2 1

or

x(b1 − b2) − y(a1 − a2) + (a1b2 − a2b1) = 0 (1.66b)

Three points on one line


Although it is possible to draw a straight line through two points, any
three points may not fall on a straight line. Three points P1 (a1,b1), P2 (a2,b2),
and P3 (a3,b3) can be on a straight line if and only if

 a1 b1 1
 
 a2 b2 1 = 0 (1.67)
 a3 b3 1

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 33

Circle
The equation of a circle with coordinates of the center as (a,b) and radius
r is

(x − a)2 + (y − b)2 = r2 (1.68a)

Expanding Equation 1.68a, the general equation of a circle can be


developed as

x2 + y2 + 2mx + 2ny + c = 0 (1.68b)

with

m 2 + n2 − c > 0 (1.68c)

The coordinates of the center of the circle are (−m, −n) and the radius is

r= m2 + n2 − c (1.68d)

Tangent
The tangent at any point (h,k) of a circle is defined to be a straight line that
meets the circle at the specified point but, when produced, does not cut it.
This tangent is always perpendicular to the radius drawn from the center
to the point of contact.
The equation of the tangent at a point (h,k) on a circle with center (a,b)
and radius r is given by

a−h
y−k =− ( x − h) (1.69)
b−k

The slope of the line is −(a − h/b − k).

Normal
The normal at any point of a curve is the straight line that passes through
the point and is perpendicular to the tangent at that point. The general
equation of the normal with the coordinates of the center as (a,b) and that
of the point as (h,k) is

x y 1
 
a b 1 = 0 (1.70)
 h k 1

© 2010 Taylor & Francis Group, LLC


34 Process engineering and design using visual basic®

Four points on a circle


Four points can be on a circle if the following condition is satisfied. Let
the four points be (a1,b1), (a2,b2), (a3,b3), and (a4,b4). The four points can be
on a circle if

 a12 + b12 a1 b1 1
 2 
 a2 + b22 a2 b2 1
 2 2 =0 (1.71)
 a3 +b 3 a3 b3 1
 2 
 a4 + b42 a4 b4 1

Example 1.9
Check if the four points (5,0), (4.33,2.5), (2.5, −4.33), and (−3.536, −3.536)
are on the same circle.

SOLUTION
The condition of the four points on the same circle is given in Equation
1.71. The value of the matrix will be

 25 5 0 1
 25  4.33 2.5 1
 4.33 2.5 1  
= 25  2.5 −4.33 1
 25 2.5 −4.33 1
   −3.536 −3.536 1
 25 −3.536 −3.536 1

 25 2.5 1  25 4.33 2.5 


   
− 5  25 −4.33 1 − 1  25 2.5 −4.33  = −1067 + 1067 = 0
 25 −3.536 1  25 −3.536 −3.536 

Therefore, all the four points will be on the same circle.

Circle through three points


The general equation of a circle through the three points (a1,b1), (a2,b2),
and (a3,b3) (provided the three points do not fall on a straight line) can be
given as

x2 + y2 x y 1
 2 2

 a1 +b 1 a1 b1 1
 2 =0 (1.72)
 a2 +b 2
2 a2 b2 1
 2 
 a3 + b32 a3 b3 1

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 35

Conic section
The locus of a point P that moves so that its distance from a fixed point
is always in a constant ratio to its perpendicular distance from a fixed
straight line is called a conic section.

Focus
The previously mentioned fixed point is called the focus and is usually
denoted by S.

Eccentricity
The constant ratio is called eccentricity and is denoted by e.

Directrix
The fixed straight line is called the directrix.
An algebraic curve with an equation of the form

ax2 + bxy + cy2 + dxz + eyz + fz2 = 0 (1.73)

is called a conic section.


The Cartesian equation of the conic section is

ax2 + bxy + cy2 + dx + ey + f = 0 (1.74)

Partial derivatives
The three partial derivatives of the equation of a conic section are

Fx′ (x,y,z) = 2ax + by + dz (1.75a)

Fy′ (x,y,z) = bx + 2cy + ez (1.75b)

Fz′ (x,y,z) = dx + ey + 2fz (1.75c)

The matrix formed by the coefficients of x, y, and z is called Δ.

 2a b d
  (1.76)
∆ = b 2c e 
 d e 2 f 

Table 1.4 characterizes the curve represented by the equation.

Example 1.10
Establish the type of curve for the equation x2 + 2xy + y2 + 3x −
4y + 6 = 0.

© 2010 Taylor & Francis Group, LLC


36 Process engineering and design using visual basic®

Table 1.4 Conic Section


b2 − 4ac < 0 b2 − 4ac = 0 b2 − 4ac > 0
Δ≠0 aΔ < 0 Parabola Hyperbola
a ≠ c, an ellipse
a = c, a circle
aΔ > 0, no locus
Δ=0 Point Two parallel lines if Two intersecting
Q = d2 + e2 − 4(a + c)f > 0; straightlines
one straight line if Q = 0;
no locus if Q < 0

SOLUTION

2 2 3
 
∆ = 2 2 −4  = −98 ≠ 0
 3 −4 12 

b2 − 4ac = 0

Therefore, the curve will be a parabola.

Parabola
As in Figure 1.9, let AA′ be a straight line and e be a point (e is not on line
AA′). The locus of all points B such that the distance of B from line AA′ is
equal to the distance of B from point e will form a parabola.
The point e is the focus and the line AA′ is the directrix.
The general equation of a parabola is

y2 = 4ax (1.77)

A y

x
e

A′

Figure 1.9 Parabola.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 37

Parametric equations of a parabola Let a and b be two lines in a plane


with equations

x = 4at2 (1.78a)

y = 4at (1.78b)

respectively.
The real number t is a parameter.
Now, to obtain an equation of the curve, we eliminate the parameter
t from the two equations. Eliminating t from Equations 1.78a and 1.78b,
we get
2
 y
x = 4a  
 4a 

or

y2 = 4ax

which is the equation of the parabola.

Equation of tangent of a parabola The slope of a tangent line can be


obtained as

2yy′ = 4a or slope y′ = 2a/y

The slope of the tangent line at a point (x0, y0) = 2a/y0.


The equation of the tangent line will be

2a
y − y0 = ( x − x0 ) (1.79a)
y0

or

yy0 − 4ax0 = 2ax − 2ax0 (1.79b)

or

yy0 = 2a(x + x0) (1.79c)

Equation 1.79c is the equation of the tangent of the parabola y2 = 4ax


at point (x0, y0).

© 2010 Taylor & Francis Group, LLC


38 Process engineering and design using visual basic®

Tangent line with a given slope, m


For a parabola with equation y2 = 4ax, the equation of the tangent line with
a constant slope m can be presented by
a (1.80)
y = mx +
m

Ellipse (refer to Figure 1.10)


Let there be two points F and F′ such that the distance F – F′ is always less
than a fixed positive value 2a.
The locus of all points A such that distance AF + AF′ = 2a is an ellipse.
Two points F and F′ are called the foci of the ellipse.
The general equation of an ellipse is

x2 y2 (1.81)
+ 2 =1
a2 b

where
a = semimajor axis
b = semiminor axis

Parametric equations of an ellipse Take two lines l and m in a plane


with the respective equations

x = a cos t (1.82a)

y = b sin t (1.82b)

The real number t is the parameter.

x
F F′

Figure 1.10 Ellipse.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 39

Now, to obtain an equation of the curve, we eliminate the parameter


t from the two equations. Eliminating t from Equations 1.82a and 1.82b,
we get
x/a = cos t
y/b = sin t
or
x2 y2
+ 2 = cos 2 t + sin 2 t = 1
a2 b
is the general equation of the ellipse.

General properties of an ellipse


Eccentricity The eccentricity of an ellipse is defined as

b2 (1.83)
e= 1− , e<1
a2

Focus The coordinates of the focus are (±ae, 0).

Tangent to a Point P of an Ellipse The general equation of an


ellipse is
x2 y2
+ 2 =1
a2 b

The slope of the tangent line can be obtained by differentiating


implicitly
2x 2 yy ′ (1.84a)
+ 2 =0
a2 b
or
b2x (1.84b)
y′ = −
a2 y

The equation of the tangent line at point (x0, y0) is

b 2 x0
y − y0 = − ( x − x0 ) (1.84c)
a2 y0

or
x0 x y 0 y
+ 2 =1 (1.84d)
a2 b

© 2010 Taylor & Francis Group, LLC


40 Process engineering and design using visual basic®

y
P

x
F F′

Figure 1.11 Hyperbola.

Normal at a point P The equation of a normal at a point P


(x0, y0) can be given as
( x − x o )a 2 ( y − y o )b 2 (1.85)
=
xo yo

Hyperbola (refer to Figure 1.11)


Let there be two points F and F′ and a strictly positive value 2a. The locus
of all points P such that the absolute difference between PF′ and PF is 2a
will be a hyperbola.
The general equation of a hyperbola is
x2 y2 (1.86)
− =1
a2 b 2

Parametric equations of a hyperbola Take two lines l and m in a plane


with the respective equations
x = a sec t (1.87a)
y = b tan t (1.87b)
The real number t is the parameter.
Now, to obtain an equation of the curve, we eliminate the parameter
t from the two equations. Eliminating t from Equations 1.87a and 1.87b,
we get
x/a = sec t
y/b = tan t
or
x2 y2
− = sec 2 t − tan 2 t = 1
a2 b 2
is the general equation of the hyperbola.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 41

General properties of a hyperbola


Eccentricity The eccentricity of a hyperbola is defined as

b2 (1.88)
e= 1+ , e>1
a2

Focus The coordinates of the focus are (±ae, 0).


Tangent to a point P of a hyperbola The general equation of a
hyperbola is

x2 y2
− =1
a2 b 2

The slope of the tangent line can be obtained by differentiating


implicitly

2x 2 yy ’
− 2 =0 (1.89a)
a2 b

or

b2x
y’ = (1.89b)
a2 y

The equation of the tangent line at point (x0, y0) is

b 2 x0
y − y0 = ( x − x0 ) (1.89c)
a2 y0

or

x0 x y 0 y
− 2 =1 (1.89d)
a2 b

Normal at a point P The equation of a normal at a point P (x0, y0) can


be given as

( x − x 0 )a 2 ( y − y0 )b 2
=− (1.90)
x0 y0

© 2010 Taylor & Francis Group, LLC


42 Process engineering and design using visual basic®

Calculus
Differential calculus
A function f is said to be differentiable if the following limit exists:

f ( x + h) − f ( x )
lim (1.91)
h→ 0 h

If this limit exists, it is called the derivative of f at x and is denoted


by f′(x).

Example 1.11
Estimate the derivative of 1/x.

SOLUTION
The derivative can be established based on Equation 1.91 as

1 1
f ( x + h) − f ( x ) −
x + h x −1
= =
h h x( x + h)

Therefore

f ( x + h) − f ( x ) −1 −1
f ’( x) = lim = lim = 2
h→0 h h → 0 x( x + h) x

provided x ≠ 0.

Example 1.12
If f(x) = 5 − x3, establish the value of f′(2).

SOLUTION
f (2 + h) − f (2)
f ′ ( 2) = lim
h→0 h

= lim
{5 − (2 + h) } − {5 − 2 }
3 3

h→0 h

= lim
{5 − (8 + 12h + 6h 2
}
+ h3 ) + 3
h→0 h

= lim (−12 − 6 h − h 2 )
h→ 0

= −12

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 43

Understanding the derivatives


The purpose of derivatives can be explained by using the following
example.

Example 1.13
Estimate the derivative of f(x) = 2x at x = 0.

SOLUTION (SEE FIGURE 1.12)


The slope of line BA = (20 − 2−1)/1 = 1/2 and the slope of line
AC = (21 − 20)/1 = 1. Therefore, the derivative at x = 0 will be in
between 1/2 and 1.
Now, for small values of h, Table 1.5 presents the value of 2h with
the values of the difference quotients.
From Table 1.5, it is clear that difference quotients calculated for
negative h values are less than calculated for positive h values, and the
derivative is in between 0.693123 and 0.693171. If we use a value up to
three decimal places, f′(0) = 0.693.

C
2

1.5

A Tangent line
1 slope = f ′(0)
B 0.5

–1 0 1

Figure 1.12 Graph y = 2x.

Table 1.5 Solution of Example 1.13


h 2h Difference quotient: (2h − 1)/h
−0.003 0.99979 0.693075
−0.002 0.99986 0.693099
−0.001 0.99993 0.693123
0 1
0.001 1.00007 0.693171
0.002 1.00014 0.693195
0.003 1.00021 0.693219

© 2010 Taylor & Francis Group, LLC


44 Process engineering and design using visual basic®

Therefore, the equation of the tangent at point A will be

y = 0.693x + 1 (because the intercept is at 1)

Standard derivatives
d(xn) = n xn−1 dx
d(ex) = ex dx
d(ax) = ax ln a dx
d(ln x) = (1/x) dx
d(log x) = {log (e/x)} dx
d(sin x) = cos x dx
d(cos x) = −sin x dx
d(tan x) = sec2 x dx
d(cot x) = −csc2 x dx
d(sec x) = tan x sec x dx
d(csc x) = −csc x cot x dx
d(sin−1 x) = (1 − x2)−1/2 dx
d(cos−1 x) = −(1 − x2)−1/2 dx
d(tan−1 x) = (1 + x2)−1 dx
d(cot−1 x) = −(1 + x2)−1 dx
d(sec−1 x) = x−1 (x2 − 1)−1/2 dx
d(csc−1 x) = −x−1 (x2 − 1)−1/2 dx
d(sinh x) = cosh x dx
d(cosh x) = sinh x dx
d(tanh x) = sech2 x dx
d(coth x) = −csch2 x dx
d(sech x) = −sech x coth x dx
d(sinh−1 x) = (x2 + 1)−1/2 dx
d(cosh−1 x) = (x2 − 1)−1/2 dx
d(tanh−1 x) = (1 − x2)−1 dx
d(coth−1 x) = −(x2 − 1)−1 dx
d(sech−1 x) = x(1 − x2)−1/2 dx
d(csch−1 x) = −x−1 (x2 + 1)−1/2 dx

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 45

Integral calculus
Suppose f is continuous for a ≤ t ≤ b. The definite integral of f from a to b,
written as
b

∫ f (t) dt
a
(1.92)

is the limit of the left- or right-hand sums with n subdivisions of [a, b], as
n gets arbitrarily large. In other words

b
 n −1

∫ a
f (t) dt = lim(left-hand sum) = lim 
n →∞ n →∞

∑ f (t )∆t
i=0
i (1.93a)

and

b
 n


a
f (t) dt = lim(right-hand sum) = lim 
n →∞ n →∞

∑ f (t )∆t
i =1
i (1.93b)

Each of these sums is called a Riemann sum, f is called the integrand,


and a and b are called the limits of integration.

Volume of horizontal dished end (refer to Figure 1.13)


The volume of the strip is

dV = π/2 * y * d/2 * dx (1.94)

d a–x
2a
dx a
dV
x x

(0,0)
(x – a)2/a2 + y2/b2 = 1

Figure 1.13 Volume of horizontal dished end.

© 2010 Taylor & Francis Group, LLC


46 Process engineering and design using visual basic®

The volume up to a height of x is

x=x
π 1
V =
2 ∫ 2 dydx
x=0
(1.95)

(d/2)2 = a2 − (a − x)2 = 2ax − x2 (1.96a)

and

y2/b2 = 1 − (x − a)2/a2 = (2ax − x2)/a2 (1.96b)

Therefore, Equation 1.94 will become


x=x
πb
V =
2a ∫ (2ax − x ) dx
x=0
2

πb  2 x 3  (1.97)
= ax − 
2a  3

Equation 1.97 is the general equation of the horizontal dished end


volume.

Total volume (x = 2a) The total volume of the dished end

V T = 2/3 πba2 (1.98)

Elliptical dished end (b = a/2) The general equation of volume

V = π/4 (ax2 − x3/3) (1.99a)

The total volume (x = 2a)

V T = π/3 a3 (1.99b)

Hemispherical dished end (b = a) The general equation of volume

V = π/2 (ax2 − x3/3) (1.100a)

The total volume (x = 2a)

V T = 2/3 πa3 (1.100b)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 47

Volume of vertical dished end (refer to Figure 1.14)


The equation of the curve with a shifted coordinate is

x 2 ( y − b )2 (1.101)
+ =1
a2 b2
The volume up to a distance y from the bottom will be
y=y
π 2
V =

y =0
4
4 x dy (1.102)

Integrating Equation 1.102 and using the value of x2 from Equation


1.101

πa 2  2 y 3 
V = by −  (1.103)
b2  3 

Equation 1.103 is the general equation of the volume of the vertical


dished end up to a height of y from the bottom.

Total volume (y = b) The total volume of the dished end

V T = 2/3 πba2 (1.104)

Elliptical dished end (b = a/2) The general equation of volume

V = 4π (ay2/2 − y3/3) (1.105a)

The total volume (x = 2a)

V T = π/3 a3 (1.105b)

y
2a

2x dy
b
y
x
(0,0)

Figure 1.14 Volume of vertical dished end.

© 2010 Taylor & Francis Group, LLC


48 Process engineering and design using visual basic®

Hemispherical dished end (b = a) The general equation of volume

V = π (ay2 − y3/3) (1.106a)

The total volume (x = 2a)

V T = 2/3 π a3 (1.106b)

Standard integrals

∫ (du + dv + dw) = ∫ du + ∫ dv + ∫ dw
∫ adv = a∫ dv
v n +1
∫ v n dv =
n+1
+ c(n ≠ −1)

dv
∫v = ln v + c

av
∫ av dv =
ln a
+c

∫ e dv = e
v v
+c

∫ sin v dv = − cos v + c
∫ cos v dv = sin v + c
∫ sec v dv = tan v + c
2

∫ csc v dv = − cot v + c
2

∫ sec v tan v dv = sec v + c


∫ csc v cot v dv = − csc v + c
dv 1  v
∫v 2
+a 2 =
a
tan −1   + c
 a

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 49

dv  v
∫ a −v2
= sin −1   + c
2  a

dv 1 v − a
∫v 2
−a 2
= ln  +c
2a  v + a 


dv
v ± a2
2 { }
= ln v + v 2 ± a 2 + c

∫ sec v dv = ln(sec v + tan v) + c


∫ csc v dv = ln(csc v − cot v) + c
Differential equations
First-order differential equations
An equation of the following type:

dy
= 50 − y (1.107)
dx

is called a first-order differential equation because it involves the first


derivative, but no higher derivative.

Example 1.14
Solve the following first-order differential equation:

dy
= 2x
dx

SOLUTION
Integrating the preceding equation

y =
∫ 2x dx = x 2
+ C (C = constant of integration)

The solution curves are parabolas.

© 2010 Taylor & Francis Group, LLC


50 Process engineering and design using visual basic®

Separation of variables
Let us use the following equation and solve the equation using the sepa-
rating variables method:
dy
= ky
dx

Separating the variables


1
dy = k dx
y

Integrating
1
∫ y dy = ∫ k dx
The result is

ln (y) = kx + C
or

y = ekx+C = ekxeC = Aekx

Therefore, the general solution of the equation


dy
= ky
dx
is

y = Aekx (1.108)

for any value of A.

Second-order differential equations


The concept of a second-order differential equation can be expressed with
the problem of free body movement under gravity. The general equation
of a free-falling body under gravity is
d 2s (1.109a)
= −g
dt 2
where s is the distance, t is the time, and g is the acceleration due to grav-
ity. Equation 1.98a is a second-order differential equation.
Now, we know that the velocity can be expressed as v = ds/dt.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 51

Therefore, a solution of Equation 1.109a will be

ds
= − gt + v0 (1.109b)
dt

where v0 is the initial velocity. Integrating Equation 1.109b, we get

1 2
s=− gt + v0t + s0 (1.109c)
2

where s0 is the initial height.

Example 1.15
Solve the following differential equation:

d 2s
+ w 2s = 0 (1.110a)
dt 2

SOLUTION
We need to find a solution whose second derivative is the negative
of the original function. This can be achieved by using properties
s(t) = cos wt and s(t) = sin wt.

d2 d
(cos t) = (− sin t) = − cos t
dt 2 dt

and

d2 d
(sin t) = (cos t) = − sin t
dt 2 dt

Therefore, the general solution of Equation 1.110a is

s(t) = C1 cos wt + C2 sin wt (1.110b)

where C1 and C2 are arbitrary constants and the values of C1 and C2


depend on the boundary conditions.

Bessel function
Bessel’s differential is one of the most important equations in applied
mathematics, and the standard Bessel functions are used for the solution
of the following types of equations:

x2y″ + xy′ + (x2 − v2)y = 0 (1.111a)

© 2010 Taylor & Francis Group, LLC


52 Process engineering and design using visual basic®

or

1  v2 
y ′′ + y′ +  1 − 2  y = 0 (1.111b)
x  x 

The general solution of Equation 1.111a or Equation 1.111b is denoted


by Jn(x) and is given by

(−1)m x 2 m
J n ( x) = x n ∑
m=0
22 m + n m !(n + m)!
(1.111c)

The solution is called the Bessel function of the first kind of order n.
This series converges for all x, as the ratio test shows, and in fact converges
very rapidly because of the factorials in the denominator.

Bessel functions J0(x) and J1(x)



(−1)m x 2 m x2 x4 x6
J 0 ( x) = ∑2
m=0
2m
(m !) 2
= 1− 2 2 + 4
2 (1!) 2 (2 !) 2
− 6
2 (3 !)2
+ (1.112a)

This looks similar to a cosine curve.


(−1)m x 2 m + 1 x3 x5 x7

x
J1 ( x ) = = − + − + (1.112b)
m=0
22 m + 1 m !(m + 1)! 2 231! 2 ! 252 ! 3 ! 27 3 ! 4 !

This looks similar to a sine curve.

Standard Bessel functions Standard Bessel functions are very impor-


tant in applied mathematics. These are presented in Table 1.6 [1].

Partial differential equations


An equation involving one or more partial derivatives of an (unknown)
function of two or more independent variables is called a partial differential
equation. The order of the highest derivative is called the order of the equa-
tion. A few important partial differential equations are presented in the
following text:
One-dimensional wave equation:

∂ 2u 2
2 ∂ u
= c (1.113a)
∂t 2 ∂x 2

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 53

Table 1.6 Standard Bessel Functions


x J0(x) J1(x) x J0(x) J1(x) x J0(x) J1(x)
0.0 1.0000 0.0000 3.0 −0.2601 0.3991 6.0 0.1506 −0.2767
0.1 0.9975 0.0499 3.1 −0.2921 0.3009 6.1 0.1773 −0.2559
0.2 0.9900 0.0995 3.2 −0.3202 0.2613 6.2 0.2017 −0.2329
0.3 0.9776 0.1483 3.3 −0.3443 0.2207 6.3 0.2238 −0.2081
0.4 0.9604 0.1960 3.4 −0.3643 0.1792 6.4 0.2433 −0.1816
0.5 0.9385 0.2423 3.5 −0.3801 0.1374 6.5 0.2601 −0.1538
0.6 0.9120 0.2867 3.6 −0.3918 0.0955 6.6 0.2740 −0.1250
0.7 0.8812 0.3290 3.7 −0.3992 0.0538 6.7 0.2851 −0.0953
0.8 0.8463 0.3688 3.8 −0.4026 0.0128 6.8 0.2931 −0.0652
0.9 0.8075 0.4059 3.9 −0.4018 −0.0272 6.9 0.2981 −0.0349
1.0 0.7652 0.4401 4.0 −0.3971 −0.0660 7.0 0.3001 −0.0047
1.1 0.7196 0.4709 4.1 −0.3887 −0.1033 7.1 0.2991 0.0252
1.2 0.6711 0.4983 4.2 −0.3766 −0.1386 7.2 0.2951 0.0543
1.3 0.6201 0.5220 4.3 −0.3610 −0.1719 7.3 0.2882 0.0826
1.4 0.5669 0.5419 4.4 −0.3423 –0.2028 7.4 0.2786 0.1096
1.5 0.5118 0.5579 4.5 −0.3205 −0.2311 7.5 0.2663 0.1352
1.6 0.4554 0.5699 4.6 −0.2961 −0.2566 7.6 0.2516 0.1592
1.7 0.3980 0.5778 4.7 −0.2693 −0.2791 7.7 0.2346 0.1813
1.8 0.3400 0.5815 4.8 −0.2404 −0.2985 7.8 0.2154 0.2014
1.9 0.2818 0.5812 4.9 −0.2097 −0.3147 7.9 0.1944 0.2192
2.0 0.2239 0.5767 5.0 −0.1776 −0.3276 8.0 0.1717 0.2346
2.1 0.1666 0.5683 5.1 −0.1443 −0.3371 8.1 0.1475 0.2476
2.2 0.1104 0.5560 5.2 −0.1103 −0.3432 8.2 0.1222 0.2580
2.3 0.0555 0.5399 5.3 −0.0758 −0.3460 8.3 0.0960 0.2657
2.4 0.0025 0.5202 5.4 −0.0412 −0.3453 8.4 0.0692 0.2708
2.5 −0.0484 0.4971 5.5 −0.0068 −0.3414 8.5 0.0419 0.2731
2.6 −0.0968 0.4708 5.6 0.0270 −0.3343 8.6 0.0146 0.2728
2.7 −0.1424 0.4416 5.7 0.0599 −0.3241 8.7 −0.0125 0.2697
2.8 −0.1850 0.4097 5.8 0.0917 −0.3110 8.8 −0.0392 0.2641
2.9 −0.2243 0.3754 5.9 0.1220 −0.2951 8.9 −0.0653 0.2559

One-dimensional heat equation:

∂u ∂ 2u
= c2 2 (1.113b)
∂t ∂x

Two-dimensional Laplace equation:


∂ 2u ∂ 2u (1.113c)
+ =0
∂x 2 ∂y 2

© 2010 Taylor & Francis Group, LLC


54 Process engineering and design using visual basic®

Two-dimensional Poisson equation:

∂ 2u ∂ 2u
+ = f (x, y) (1.113d)
∂x 2 ∂y 2

Three-dimensional Laplace equation:

∂ 2u ∂ 2u ∂ 2u (1.113e)
+ + =0
∂x 2 ∂y 2 ∂z 2

Example 1.16
Refer to Figure 1.15 above. A string of length l is stretched between
two fixed points, and the motion is started by drawing aside, through
a small distance b, a point of the string at distance 1/5 from one end.
Establish the displacement y at distance x from the end at time t.

SOLUTION
Let us take the fixed end O of the string as the origin and the equilib-
rium position OA along the x-axis, where OA = l. OY is taken in the
plane OBA, and it is perpendicular to OX. The point A′ of the string,
which is at a distance l/5 from the origin O, is drawn aside through
a small distance b to the position B, and then released from rest. The
motion starts from the position OB and BA (A is also a fixed point)
of the string, and we measured time from this position of the string.
Boundary conditions:

1. y = 0 when x = 0 and x = l, for all t


2. y = 5bx/l for 0 ≤ x ≤ l/5, when t = 0
3. y = 5(l − x)b/(4l) for l/5 ≤ x ≤ l, when t = 0
4. ∂y/∂t = 0 for 0 ≤ x ≤ l, when t = 0

A
0 x
A′
l/5
l

Figure 1.15 Example 1.16.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 55

The differential equation for the vibrating string is the wave


equation
∂2 y 2
2 ∂ y
= c (1.114a)
∂t 2 ∂x 2
Because y = 0 when x = 0, we can assume
y = T sin mx (1.114b)
where T is a function of t only, and m ≠ 0.
Substituting Equation 1.114b in Equation 1.114a
T″ sin mx = −T m2c2 sin mx
For all values of x, sin mx ≠ 0.
Therefore
T″ + m2c2 T = 0 (1.114c)
The general solution of Equation 1.114c is
T = A cos(mct) + B sin(mct)
or
y = [A cos(mct) + B sin(mct)] sin(mx)
Because
∂y
= 0, when t = 0
∂t
0 = T′ sin mx when t = 0 or T′ = 0 when t = 0 because sin mx ≠ 0.
Now, T′ = mc [−A sin(mct) + B cos(mct)]. Given T′ = 0 when t = 0, or B = 0.
Therefore
y = A cos(mct) sin mx; m≠0 (1.114d)
Because y = 0 when x = l, from Equation 1.114b
0 = T sin ml, T≠0
Therefore, sin ml = 0 or ml = nπ, when n is any positive or nega-
tive integer. Because the positive and negative values of n will result
in identical sets of solutions of Equation 1.114a, we can assume only
positive values, that is, n = 1, 2, 3, 4, . . ., ∞.
Therefore, the general solution of Equation 1.114a will be

y = ∑ b cos(mct)sin(mx)
n =1
n


nπct nπx
= ∑ b cos
n =1
n
l
sin
l
(1.114e)

Now, y = 5bx/l, 0 ≤ x ≤ l/5 for t = 0 and y = 5b (l − x)/(4l), l/5 ≤ x ≤ l


for t = 0.

© 2010 Taylor & Francis Group, LLC


56 Process engineering and design using visual basic®

Let us assume that y = V0 when t = 0.


Therefore

nπx
V0 = ∑ b sin
n =1
n
l
(1.114f)

The right-hand side of Equation 1.114f represents the Fourier half-


range sine series for the function V0 defined in (0,l); therefore

 l/5 l 
2  5bx nπx 5b(l − x) nπx 
bn =
l ∫
0
l
sin
l
dx +

l/5
4l
sin
l
dx

25b nπ
= sin
2n 2 π 2 5

Therefore, the solution will be



nπ nπct nπx
∑n
25b 1
y = sin cos sin (1.114g)
2π 2 n =1
2
5 l l

Example 1.17
Solve the heat equation

∂u ∂ 2u
= c2 2 (1.115a)
∂t ∂x

for the following boundary conditions:


u = 0 when x = 0 and x = l
u = x when t = 0

SOLUTION
Because u = 0 when x = 0, we can assume that u = T sin mx, and T is
the function of t only for a solution of Equation 1.115a (m ≠ 0).
Substituting in Equation 1.115a

T′ sin mx = −c2Tm2 sin mx


or
T′ = −Tc2m2 (because sin mx ≠ 0)
The solution is
2m2t
T = Ae − c

Equation 1.115a will be


2m2t
u = Ae − c sin mx

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 57

Now, u = 0 when x = l.
Therefore
2m2t
0 = Ae − c sin ml
Therefore, sin ml = 0, or
m = πn/l (n = ±1, ±2, ±3, ±4, . . . , ±∞)
Therefore
2 ( nπ /l )2 t  nπ 
u = Ae − c sin   x (1.115b)
 l 

Because the positive and negative values of n will give identical


sets of solutions of Equation 1.115a, we can therefore assume either
the positive or negative values of n to have an independent set of solu-
tions of Equation 1.115a.
The general solution will be

 nπ 
u= ∑b e
n =1
n
− c 2 ( nπ / x )2 t
sin   x
 l 
(m ≠ n ≠ 0)

Now, u = x when t = 0. Therefore



nπ 
x= ∑ b sin 
n =1
n
l 
x

The right-hand side of the above equation is the Fourier half-


range sine series for the function f(x) defined in (0,l).
Therefore
l
2  nπ 
bn =
l ∫
x sin   x dx
 l 
0

2l
= (−1)n + 1

Therefore, the solution will be

(−1)n + 1 − c2 ( nπ/l )2 t  nπx 

2l
u= e sin  (1.115c)
π n  l 
n =1

Example 1.18
Solve the following Laplace equation:
∂ 2u ∂ 2u
+ =0 (1.116a)
∂x 2 ∂y 2

subject to the conditions u = 0 when x = 0, x = c, and y = b and u = u0


when y = 0.

© 2010 Taylor & Francis Group, LLC


58 Process engineering and design using visual basic®

SOLUTION
Because u = 0 when x = 0, we assume u = Y sin mx, where m ≠ 0, for a
solution of Equation 1.116a.
Substituting in Equation 1.116a
−Y m2 sin mx + Y″ sin mx = 0
or

Y″ − Y m2 = 0 (1.116b)

(sin mx cannot be zero for all values of x) whose solution is

Y = A cosh my + B sinh my

Therefore

u = (A cosh my + B sinh my) sin mx, m≠0 (1.116c)

Because u = 0 when x = c, we have 0 = Y(y) sin mc. Y(y) cannot be zero


for all values of y. Therefore, sin mc = 0 or mc = nπ, n = 0 ± 1 ± 2 ± 3 ± 4
± . . . ± ∞. u = 0 when y = b.
0 = (A cosh mb + B sinh mb) sin mx. Because x is arbitrary, there-
fore, we have 0 = A cosh mb + B sinh mb.
Therefore

 cosh mb 
u = A cosh my − sinh my  sin mx
 sinh mb 
A
= [cosh my sinh mb − cosh mb sinh my]sin mx
sinh mb
A
= sinh m(b − y )sin mx
sinh mb

Because the positive and negative values of m will result in


identical sets of solutions of Equation 1.116a, we can use either the
positive or negative values of m to have an independent set of solu-
tions of Equation 1.116a. In this case, we will use the positive values
of m.
Therefore, the general solution of Equation 1.116a will be

sinh(nπ/c)(b − y ) nπx
u= ∑A
n =1
n
sinh( nπb/c)
sin
c

Because u = u0 when y = 0, we have


nπx
u0 = ∑ A sin
n =1
n
c
(1.116d)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 59

The right-hand side of Equation 1.116d represents the Fourier


half-range sine series for all functions of u0.
Therefore
c
2 nπx
An =
c ∫
u0 sin
0
c
dx

2u0
= [1 − (−1)n ]

When n is even, the value will be zero, and when n is odd, we use
n = 2m − 1 (m = 1, 2, . . . , ∞).
4u0
A2 m − 1 =
(2m − 1)π (1.116e)

Hence, the general solution of Equation 1.116a is

2m − 1
∞ sinh π(b − y )
2m − 1

4u0 c
u= sin πx (1.116f)
( 2 m − 1)π 2m − 1 c
m =1 sinh πb
c

Laplace transform
The Laplace transform of a function x(t) is the function x (s) defined by

x (s) =
∫ x(t)e
0
− st
dt

where s > 0, and is written as L[x(t)].


Therefore, from definition

L [ x(t)] =
∫ x(t)e
0
− st
dt (1.117)

where s > 0, which is a function of x (s).

Example 1.19
Work out the Laplace transform of t.

SOLUTION
x(t) = t

L[t] =
∫ te
0
− st
dt

© 2010 Taylor & Francis Group, LLC


60 Process engineering and design using visual basic®


 e − st e − st 
= t − 2 
 −s s 0


1 te − st  e − st 
= − lim − 2 
s t →∞ 1  s 0

1 t 1
= − lim st − 2 [−1]
s t →∞ e s

1 1 1 1
= − lim st + 2 = 2 (L′ Hospital ’s rule)
s t →∞ se s s

Therefore

L[t] = 1/s2 (1.118)

Standard Laplace transforms


1
L[1] =
s

1
L[t] =
s2

n!
L[t n ] =
sn +1

1
L[e at ] =
s−a

1
L[e − at ] =
s+a

a
L[sin at] =
s + a2
2

s
L[cos at] =
s + a2
2

a
L[sinh at] =
s − a2
2

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 61

s
L[cosh at] =
s − a2
2

s2 − a 2
L[t cos at] =
( s 2 + a 2 )2

2sa
L[t sin at] =
( s 2 + a 2 )2

Fourier half-range expansions [1]


In various applications, there is a practical need to use Fourier series
in connection with function f(x) that are given on some intervals only.
We could extend f(x) periodically with period L and then represent the
extended function by a Fourier series, which in general would involve
both cosine and sine terms.

Fourier half-range cosine series


The cosine half-range expansion is


f ( x) = a0 + ∑ a cos L x
n =1
n
(1.119a)

where
L
1
a0 =
L ∫ f (x)dx
0
(1.119b)

L
2 nπx
an =
L ∫ f (x)cos
0
L
dx (1.119c)

Fourier half-range sine series


The sine half-range expansion is



f ( x) = ∑ b sin L x
n =1
n (1.120a)

© 2010 Taylor & Francis Group, LLC


62 Process engineering and design using visual basic®

where

L
2 nπx
bn =
L ∫ f (x)sin
0
L
dx (1.120b)

Example 1.20 [1]


Find the two half-range expansions of the following function:

f(x) = 2kx/L if 0 < x < L/2

and

f(x) = 2k(L − x)/L if L/2 < x < L

SOLUTION
Even periodic extension:

 L/ 2 L 
1  2k 2k k
a0 =
L L
 0

x dx +
L
L/ 2

(L − x) dx  =
 2

 L/ 2 L 
2  2k nπ 2k nπ
an =
L L
 0

x cos
L
x dx +
L
L/ 2

(L − x)cos
L
x dx 

Integrating by parts

L/ 2
nπ L2 nπ L2  nπ 
∫0
x cos
L
x dx =
2nπ
sin
2
+ 2 2  cos
nπ  2
− 1

and

L
nπ L2 nπ L2  nπ 
∫ (L − x)cos L x dx = − 2nπ sin 2
L/ 2

n 2 π 2 
cos nπ − cos 
2 

Therefore

4k  nπ 
an = 2 2 
2 cos − cos nπ − 1
nπ  2 

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 63

Thus

16k 16k
a2 = − , a4 = 0, a6 = − 2 2 , a8 = 0,…
22 π 2 6 π

Therefore, the first half-range expansion of f(x) is

k 16k  1 2π 1 6π 
f ( x) = − 2  2 cos x + 2 cos x + 
2 π 2 L 6 L 

Odd periodic extension:


Similarly, for the odd periodic extension

8k nπ
bn = sin
n2π 2 2

Hence, the second half-range expansion of f(x) is

8k  1 π 1 3π 1 5π 
f ( x) =  sin x − 3 2 sin x + 2 sin x − 
π 2  12 L L 5 L 

Numerical analysis
Solving linear equations (Newton’s method)
Given a function f(x) that is continuous and has a continuous derivative
and also, given a starting value of x0:
For n = 1, 2, 3, . . . until termination
Compute f′(xn).
If f′(xn) = 0, signal and stop.
Else, compute

f ( xn )
xn + 1 = xn − (1.121a)
f ’( xn )

Test for termination.

Example 1.21
Let the function f(x) = x3 + x − 1 = 0.

xn3 + xn − 1 2xn3 + 1
xn + 1 = xn − = (1.121b)
3 xn2 + 1 3 xn2 + 1

Starting value x0 = 1.

© 2010 Taylor & Francis Group, LLC


64 Process engineering and design using visual basic®

Therefore,

x1 = 3/4 = 0.75

2 * 0.753 + 1
x2 = = 0.686047
3 * 0.752 + 1

x3 = 0.682340

x4 = 0.682328
The value of x4 is exact to the 6th decimal. A larger number of
analyses may be required if the function does not converge rapidly.
Therefore, the solution of the function x3 + x − 1 = 0 will be
x = 0.682328.

Newton’s method in two variables [2]


Let (x0, y0) be chosen. We need to generate the sequence of vectors (xn, yn)
recursively as follows:
Let
D(x, y) = fx(x, y)gy(x, y) − f y(x, y)gx(x, y)
Then

f ( x n , y n ) g y ( x n , y n ) − f y ( x n , y n ) g( x n , y n )
xn + 1 = xn − (1.122a)
D( xn , y n )

− f ( x n , y n ) g x ( x n , y n ) + f x ( x n , y n ) g( x n , y n )
yn+1 = yn − (1.122b)
D( xn , y n )

Under suitable conditions, the sequence (xn, yn) will converge to a vec-
tor (u, v) that satisfies
f(u, v) = g(u, v) = 0 (1.122c)
Newton’s method is most likely to work when the initial vector (x0, y0)
is close to a solution. It is not necessary that the system has only one
solution.

Example 1.22
Use Newton’s method to find a solution to the system
x2 − 2x − y + 1/2 = 0
x2 + 4y2 − 4 = 0
starting at the initial vector (2,0.25).

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 65

SOLUTION
f = x2 − 2x −y + 1/2
fx = 2x − 2 and f y = −1
g = x2 + 4y2 − 4
gx = 2x and g y = 8y
D(x,y) = fx g y − f y gx = (2x − 2)(8y) − (−1)(2x)
= 2x − 16y + 16xy
fg y − f yg = (x2 − 2x − y + 1/2)(8y) − (−1)(x2 + 4y2 − 4)
= −4 + 4y + x2 − 4y2 − 16xy + 8x2y
−fgx + fxg = −(x2 − 2x − y + 1/2)(2x) + (2x − 2)(x2 + 4y2 − 4)
= 8 − 9x + 2xy + 2x2 − 8y2 + 8xy2
Thus

−4 + 4 y n + xn2 − 4 y n2 − 16 xn y n + 8 xn2 y n
xn + 1 = xn −
2xn − 16 y n + 16 xn y n

8 − 9xn + 2xn y n + 2xn2 − 8 y n2 + 8 xn y n2


yn+1 = yn −
2xn − 16 y n + 16 xn y n

Starting at x0 = 2 and y0 = 0.25


x1 = 2 − 0.75/8 = 1.90625
and
y1 = 0.25 − (−)0.5/8 = 0.3125
The first four iterations are presented in Table 1.7.
The solution is correct up to six decimal places.
The values of the above-mentioned two equations can be calcu-
lated using x = 1.900677 and y = 0.311219 from Table 1.7 as
x2 − 2x − y + 1/2 = (1.900677)2 − 2(1.900677) − 0.311219 + 0.5
= 0.000000058
x2 + 4y2 − 4 = (1.900677)2 + 4(0.311219)2 − 4 = 0.000002112

Table 1.7 Solution of Example 1.21


n xn yn xn+1 yn+1
0 2 0.25 1.90625 0.3125
1 1.90625 0.3125 1.900691 0.311213
2 1.900691 0.311213 1.900677 0.311219
3 1.900677 0.311219 1.900677 0.311219

© 2010 Taylor & Francis Group, LLC


66 Process engineering and design using visual basic®

Numerical methods in linear algebra


Gauss elimination [3]
In this method, unknowns are eliminated by combining equations such
that the n equations and n unknowns are reduced to an equivalent upper
triangular system, which is then solved by back substitution. Let us con-
sider the following system:

a11x1 a12 x2 a13 x3 = b1


a21x1 a22 x2 a23 x3 = b2 (1.123)
a31x1 a32 x2 x33 x3 = b3

For the first stage of elimination, multiply the first row of Equation
1.123 by a21/a11 and a31/a11, respectively, and subtract from the second and
third rows.

a22( 2) x2 a23( 2) x3 = b2( 2)


(1.124)
a32( 2) x2 a33( 2) x3 = b3( 2)

where
a22(2) = a22 − (a21/a11)a12
a23(2) = a23 − (a21/a11)a13
a32(2) = a32 − (a31/a11)a12
a33(2) = a33 − (a31/a11)a13
b2(2) = b2 − (a21/a11)b1
b3(2) = b3 − (a31/a11)b1

In the next stage of elimination, multiply the first row of Equation


1.124 by a32(2)/a22(2) and subtract from the second row in Equation 1.124.

a33(3) x3 = b3(3)

where
a33(3) = a33(2) − (a32(2)/a22(2))a23(2)
b3(3) = b3(2) − (a32(2)/a22(2))b2(2)

The first equation from each stage results in

a11x1 a12 x2 a13 x3 = b1


a22( 2) x2 a23( 2) x3 = b2( 2) (1.125)
a33( 3 ) x3 = b3( 3 )

The elements a11, a22(2), and a33(3), which are assumed to be nonzero, are
called pivot elements and this elimination method is called Gauss elimination.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 67

One condition of the analysis is that the pivots must be different from
zero. To achieve this, it may be required to change the order of the equa-
tions. This is called partial pivoting. In some cases, it may require not only
an interchange of equations, but also an interchange of the position of the
variables. This is called complete pivoting.

Example 1.23
Solve the following equations using Gauss elimination:
x1 + x2 + x 3 = 6
3x1 + 3x2 + 4x3 = 20
2x1 + x2 + 3x3 = 13

SOLUTION
Eliminating x1 from the last two equations
x1 + x2 + x 3 = 6
x3 = 2
−x2 + x3 = 1
In this case, the pivot point in the second equation is zero, and we
need to interchange the preceding second and third equations before
the second step. Therefore
x1 + x2 + x 3 = 6
−x2 + x3 = 1
+ x3 = 2
The solution is x3 = 2, x2 = 1, and x1 = 3.

Cholesky method
This method is also known as the square root method. If the coefficient
matrix A is symmetric and positively definite, the matrix A can be decom-
posed as A = LLT.
The popular method of solving an equation
Ax = b (1.126a)
is
A = LLT (1.126b)
or
LLTx = b (1.126c)
This can be written as
LTx = z (1.126d)
Lz = b (1.126e)

© 2010 Taylor & Francis Group, LLC


68 Process engineering and design using visual basic®

Based on the preceding equations, a matrix can be factorized as

 a11 a12 a13   m11 0 0   m11 m21 m31 


    
 a21 a22 a23  =  m21 m22 0  0 m22 m32  (1.126f)
    
 a31 a32 a33   m31 m32 m33   0 0 m33 

where

m11 = a11 (1.126g)

i −1

mii = aii − ∑m
j =1
2
ij i = 2, … , n (1.126h)

ai1
mi1 = i = 2, … , n (1.126i)
m11

1  
j −1

mij =  aij −
m jj  ∑
k =1
m jk mik 

i = j + 1, j + 2, … , n, k ≥ 2 (1.126j)

Example 1.24
Using the Cholesky method, solve the following equations:

4 −1 0 0   x1   1 
 −1 4 −1 0   x2  0 
 =
0 −1 4 −1  x3  0 
    
 0 0 −1 4   x 4  0 

The form of factorization

4 −1 0 0   m11 0 0 0   m11 m21 m31 m41 


 −1
 4 −1 0   m21 m22 0 0   0 m22 m32 m42 
=
0 −1 4 −1  m31 m32 m33 0  0 0 m33 m43 
    
 0 0 −1 4   m41 m42 m43 m44   0 0 0 m44 

Using the preceding equations

m11 = 2

m21 = −1/2 ​ ​
m22 = (15/4)0.5

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 69

m31 = 0 ​ ​m32 = −(4/15)0.5 ​ ​m33 = (56/15)0.5


m41 = 0 ​ ​m42 = 0 ​ ​m43 = −(15/56)0.5 ​ ​
m44 = (209/56)0.5
The solution for z will be

 2 0 0 0   z1   1 
    
 −1/2 15/4 0 0   z2   0 
   z  = 0 
 0 − 4/15 56/15 0  3  
 0 0 − 15/56 209/56   z4  0 

or

1 1 1 1
z1 = , z2 = , z3 = , z4 =
2 60 840 11704

The final solution for x will be

2 −1/2 0   x1   1/2 
0
    
0 15/4 − 4/15 0   x2   1/ 60 
  = 
0 0 56/15 − 15/56   x3   1/ 840 
 
0 0 0 209/56   x 4  1/ 11704 

or

1 4 15 56
x4 = , x3 = , x2 = , x1 =
209 209 209 209

Numerical integration
Two methods are extremely popular in numerical integration:

1. Trapezoidal rule
2. Simpson’s rule

Trapezoidal rule
Under this rule, the interval (a,b) is divided into N subintervals of length
h = (b − a)/N, and if the subintervals are denoted as (x0,x1), (x1,x2), (x2,x3), . . . ,
(xN−1,xN), then the general integration can be written as

b x1 x2 xN

I =
∫a
f ( x) dx =

x0
f ( x) dx +

x1
f ( x) dx +  +

xN − 1
f ( x) dx (1.127)

© 2010 Taylor & Francis Group, LLC


70 Process engineering and design using visual basic®

Evaluating each integral by the trapezoidal rule, the integration can


be written as

h
I =  f 0 + 2 ( f1 + f 2 +  + f N −1 ) + f N  (1.128)
2

Simpson’s rule
Under this rule, the interval of integration (a,b) is divided into an even
number of equal subintervals, say into N = 2M subintervals of length
h = (a − b)/2M, with end points x0 = a, x1, x2, . . . , x2M−1, x2M = b. The general
form of the integration will be

b x2 x4 x2 M

I =
∫ f (x) dx = ∫ f (x) dx + ∫
a x0 x2
f ( x) dx + … +

x2 M − 2
f ( x) dx (1.129)

Using Simpson’s rule, the final integration will be

h
I =  f 0 + 4 ( f1 + f 3 +  + f 2 M −1 ) + 2 ( f 2 + f 4 +  + f 2 M − 2 ) + f 2 M  (1.130)
3

Example 1.25
A slug catcher 60 m long, having a 0.5 m diameter, and at a 2° angle
with the horizontal plane, has a liquid-filled length of 5 m as shown
in Figure 1.16. Calculate the filled volume of the slug catcher.

SOLUTION
The volume can be calculated by integration using Simpson’s rule.

0.5 m

Angle = 2º h h

5m
60 m
2b

Figure 1.16 Slug catcher volume.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 71

The distance from the bottom corner of the slug catcher up to the
liquid level (h) can be calculated as h = 5 tan2° = 0.175 m. This is less
than the radius of the pipe. For this condition, the top view of the
surface will always look like a half-ellipse.
For a liquid length of l, if the major axis is 2x and the minor axis
is 2y (the values of x and y depend on the value of l), the surface area
(A) of the half-ellipse will be
A = πxy/2
The volume of the liquid (V) can be estimated as
l=5
πxy
V =

l=0
2
sin 2°dl (1.131a)

Now
x = l/cos2° (1.131b)
and
y = {l tan 2° (2r − l tan2°)}0.5 (1.131c)
where r = radius of the slug catcher = 0.25 m.
Therefore, the volume will be
l=5
πl
∫ 2 cos 2° * {l tan 2°(2r − l tan 2°)}
0.5
V = sin 2°dl
l=0

or
l=5

∫ l * {0.03492l * (0.5 − 0.03492l)}


0.5
V = 0.054853 dl (1.131d)
l=0

Now, a = 0 and b = 5.
The number of divisions between limits (l = 0 and l = 5), 2M = 50,
and the value of each division, h = 5/50 = 0.1.
The value of the integrals will be

f0 = 0, f50 = 0.054853 * 5{0.1746 * (0.5 − 0.1746)}0.5 = 0.06537

f1 = 0.054853 * 0.1 * {0.003492 * (0.5 − 0.003492)}0.5 = 0.000228

f 2 = 0.054853 * 0.2 * {0.006984 * (0.5 − 0.006984)}0.5 = 0.000644

and so on.
The sum of the odd integrals will be

( f1 + f3 + f5 + ⋯ + f49) = 0.701109

© 2010 Taylor & Francis Group, LLC


72 Process engineering and design using visual basic®

and the sum of the even integrals (2–48) will be

(f 2 + f4 + f6 + . . . + f48) = 0.668797

Therefore, the volume will be

0.1
V =
3
{0 + 4 * 0.701109 + 2 * 0.668797 + 0.06537} = 0.14 m 3

Double integration using Simpson’s rule [3]


A double integration in the following form:

b
d

∫∫
I =  f ( x , y )dx dy

c  a

(1.132)

can be solved using Simpson’s rule with h = (b − a)/2 and k = (d − c)/2. The
value of the integral will be

hk
I = [ f ( a, c) + f ( a, d) + f (b , c) + f (b , d) + 4{ f ( a, c + k ) + f ( a + h, c)
9
+ f ( a + h, d) + f (b , c + k )} + 16 f ( a + h, c + k )] (1.133)

Example 1.26
Using Simpson’s rule, evaluate the integral
2 2
dxdy
I =
∫ ∫ (x + y)
1 1

SOLUTION
h = 0.5 and k = 0.5.

0.25
I = [ f (1, 1) + f (1, 2) + f (2, 1) + f (2, 2) + 4{ f (1, 1.5) + f (1.5, 1)
9
+ f (11.5, 2) + f (2, 1.5)} + 16 f (1.5, 1.5)]

or

0.25  2  2 2  16 
I =  0.5 + + 0.25 + 4  + +  = 0.33988
9  3  2.5 3.5  3 

A more accurate solution is 0.339789.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 73

Numerical solution of first-order differential equations


Euler’s method [2]
This method is very simple, but the results are not very accurate. In this
method, y1 is obtained by assuming that f(x,y) varies so little in the inter-
val x0 ≤ x ≤ x1 that only a small error is made by replacing it by the con-
stant value f(x0, y0). Integrating

dy
= f (x, y)
dx

from x0 to x1, we get

x1

y( x1 ) − y0 = y( x1 ) − y( x0 ) =
∫ f (x, y)dx ≈ f (x , y )(x
x0
0 0 1 − x0 ) (1.134)

Because h = x1 − x0

y1 = y0 + hf(x0, y0)

The general equation is

yn+1 = yn + hf(xn, yn) (1.135)

Improved Euler’s method


The accuracy of Euler’s method is improved by introducing the trapezoi-
dal rule:

x1
h
∫ f (x, y)dx ≈ 2 { f (x , y ) + f (x , y(x ))}
x0
0 0 1 1 (1.136)

The value of y(x1) is not known and is estimated by Euler’s method,


which is called z1. This modification results in general equations such as

zn+1 = yn + hf(xn, yn) (1.137a)

and

h
yn+1 = yn + [ f ( xn , y n ) + f ( xn + 1 , zn + 1 )] (1.137b)
2

© 2010 Taylor & Francis Group, LLC


74 Process engineering and design using visual basic®

Example 1.27
Using Euler’s method, solve the following equation:

dy
= −2xy 2, y (0 ) = 1
dx

at the value x = 1.

SOLUTION
The value of h = 0.2 and the calculation is made by using the values of
x as 0.0, 0.2, 0.4, 0.6, 0.8, and 1.0.

z1 = y0 + hf(x0, y0) = 1
h
y1 = y 0 +  f ( x0 , y 0 ) + f ( x1 , z1 ) = 1 + 0.1 * [0 − 0.4] = 0.96
2

z2 = y1 + hf(x1, y1) = 0.96 + 0.2(−0.3686) = 0.8863

h
y 2 = y1 +  f ( x1 , y1 ) + f ( x2 , z2 ) = 0.96 + 0.1
2
* [−0.3686 − 0.6284] = 0.88603

and so on.
The results are presented in Table 1.8 (calculated value = 0.5034).
The exact solution is 0.5.

Runge–Kutta method [1]


The Runge–Kutta method is widely used as a numerical method to solve
differential equations. This method is more accurate than the improved
Euler’s method. This method computes the solution of the initial value
problem.
y′ = f(x,y), y(x0) = y0 at equidistance points
x1 = x0 + h, x2 = x0 + 2h, . . ., xN = x0 + Nh

Table 1.8 Solution of Example 1.27


xn yn f(xn, yn) zn+1 f(xn+1, zn+1) yn+1
0 1  ​0 1 −0.4 0.96
0.2 0.96 −0.3686 0.8863 −0.6284 0.8603
0.4 0.8603 −0.5921 0.7419 −0.6605 0.7350
0.6 0.7350 −0.6483 0.6053 −0.5862 0.6116
0.8 0.6116 −0.5985 0.4919 −0.4839 0.5034
1.0 0.5034

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 75

The general method of the solution is


For n = 0, 1, 2, 3, . . . , N − 1
Evaluate

k1 = hf(xn, yn) (1.138a)

k2 = hf(xn + 0.5h, yn + 0.5k1) (1.138b)

k3 = hf(xn + 0.5h, yn + 0.5k2) (1.138c)

k4 = hf(xn + h, yn + k3) (1.138d)

xn+1 = xn + h (1.138e)
1 (1.138f)
yn+1 = yn + ( k1 + 2 k 2 + 2 k 3 + k 4 )
6

This method is repeated till the solution is reached.

Example 1.28
Solve Example 1.27 using the Runge–Kutta method.

dy
= −2xy 2 , y(0) = 1
dx

at the value x = 1.

SOLUTION
For n = 0, xn = 0, yn = 1, and value of h = 0.2.
Using the preceding equations

k1 = 0.2f(0, 1) = 0

k2 = 0.2f(0.1, 1) = −0.04

k3 = 0.2f(0.1, 0.98) = −0.0384

k4 = 0.2f(0.2, 0.9616) = −0.074

x1 = 0.2

1
y1 = 1 + (0 − 0.08 − 0.0768 − 0.074) = 0.9615
6

Similarly, other values can be calculated and tabulated as in Table


1.9 (the calculated value is 0.500007).
The exact solution is 0.5.

© 2010 Taylor & Francis Group, LLC


76 Process engineering and design using visual basic®

Table 1.9 Solution of Example 1.28


n xn yn k1 k2 k3 k4 xn+1 yn+1
0 0 1  ​0 −0.04 −0.038 −0.074 0.2 0.9615
1 0.2 0.9615 −0.074 −0.103 −0.099 −0.119 0.4 0.8621
2 0.4 0.8621 −0.119 −0.129 −0.127 −0.1296 0.6 0.7353
3 0.6 0.7353 −0.13 −0.126 −0.127 −0.119 0.8 0.6098
4 0.8 0.6098 −0.119 −0.109 −0.111 −0.0995 1.0 0.500007
5 1.0 0.500007

Second-order differential equations


Runge–Kutta–Nystrom method [1]
This system computes the solution of the initial value problem for an
equation y″ = f(x, y, y′), where the initial values x0, y0, and y0′, the step size
h, and the number of steps N are known.
The general method of solution is as follows:
For n = 0, 1, 2, . . . , N − 1
Evaluate

k1 = 0.5hf ( xn , y n , y n′ ) (1.139a)

K = 0.5h( y n′ + 0.5k1 ) (1.139b)

k 2 = 0.5hf ( xn + 0.5h, y n + K , y n′ + k1 ) (1.139c)

k 3 = 0.5hf ( xn + 0.5h, y n + K , y n′ + k 2 ) (1.139d)

L = h( y n′ + k 3 ) (1.139e)

k 4 = 0.5hf ( xn + h, y n + L, y n′ + 2k 3 ) (1.139f)

xn+1 = xn + h (1.139g)

 1 
y n + 1 = y n + h  y n′ + (k1 + k 2 + k 3 ) (1.139h)
 3 

1
y n′ + 1 = y n′ + ( k1 + 2 k 2 + 2 k 3 + k 4 ) (1.139i)
3

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 77

Example 1.29
Solve the following second-order differential equation:

d2 y
= 0.5( x + y + y ′ + 2) at the value x = 1
dx 2
Initial values: x0 = 0, y0 = 0, y0′ = 0, and h = 0.2.

SOLUTION
For n = 0, xn = 0, yn = 0, yn′ = 0, and the value of h = 0.2.
Using the preceding equations
k1 = 0.1
K = 0.005
k2 = 0.11025
k3 = 0.110763
L = 0.022153
k4 = 0.122184
xn+1 = 0.2
yn+1 = 0.021401
y′n+1 = 0.221401
Similarly, other values can be calculated and tabulated as shown
in Table 1.10.
The solution up to four decimal places = 0.7183.

Partial differential equations


In chemical engineering, the solutions of partial differential equations are
often required, particularly for the problems associated with heat conduc-
tion. Different numerical methods are used for solving different types of
partial differential equations.

Table 1.10 Solution of Example 1.29


Value n xn yn yn′ xn+1 yn+1 yn′+1
0 0 0 0 0.2 0.021401 0.221401
1 0.2 0.021401 0.221401 0.4 0.091819 0.49182
2 0.4 0.091819 0.49182 0.6 0.222109 0.82211
3 0.6 0.222109 0.82211 0.8 0.425526 1.225526
4 0.8 0.425526 1.225526 1 0.718258 1.718259
5 1 0.718258 1.718259

© 2010 Taylor & Francis Group, LLC


78 Process engineering and design using visual basic®

Time row j+1

Time row j
h h

Figure 1.17 Mesh size.

Heat conduction problem [1]


Generally, the Crank–Nicolson method is used for the numerical solution
of heat conduction problems that are parabolic in nature. This method
solves a mesh with mesh size h in the x-direction and mesh size k in the
y-direction (time direction). It calculates the values of u at six points as
shown in Figure 1.17.
The equation used to solve the problem is

1 1
(ui , j + 1 − uij ) = (ui + 1, j − 2uij + ui −1, j )
k 2h2
1
+ (ui + 1, j + 1 − 2ui , j + 1 + ui −1, j + 1 ) (1.140)
2h 2

Using r = k/h2, Equation 1.140 can be modified to

(2 + 2r )ui , j + 1 − r(ui + 1, j + 1 + ui −1, j + 1 ) = (2 − 2r )uij + r(ui + 1, j + ui −1, j ) (1.141)

In Equation 1.141, the three values on the left side are unknown,
whereas the three values on the right side are known. Using the initial
and boundary conditions, most of the values can be made known except
two values. Equation 1.141 is then solved for two consecutive values of m
(m = 1,2, then m = 2,3, etc.). Under this situation, we will have two equa-
tions with two unknowns that can be solved easily.

Example 1.30
Solve the problem in Example 1.17 using theoretical and numerical
methods.
The heat equation

∂u ∂ 2u
= c2 2
∂t ∂x

Initial condition: u = x when t = 0


Boundary condition: u = 0 when x = 0 and x = l
This problem is further simplified by assuming c = 1 and l = 1.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 79

SOLUTION
Theoretical solution
The general solution assuming c = 1 and l = 1 can be obtained from
Equation 1.104c as follows:

(−1)n + 1 −( nπ )2 t

2
u= e sin( nπx)
π n =1
n

Value i = 0
Values of u = 0 for all grid points of n
Value i = 1 (x = 0.3333)
Value of j = 1 (t = 0.0278)
For n = 1
sin (nπx) = 0.866
Exp (−n2π2t) = 0.7602
Subvalue = 0.6584
For n = 2
sin (nπx) = 0.866
Exp (−n2π2t) = 0.334
Subvalue = −0.1446
For n = 3
sin (nπx) = 0
Exp (−n2π2t) = 0.0848
Subvalue = 0
For n = 4
sin (nπx) = −0.866
Exp (−n2π2t) = 0.0124
Subvalue = 0.0027
It is clear from the preceding analysis that this infinite series is
highly converging in nature, and it is adequate to calculate up to n = 4.
The sum = 0.3287.
Similarly, other values of j can be estimated as follows:
Value of j = 2 (t = 0.0556)
The sum = 0.2879
Value of j = 3 (t = 0.0833)
The sum = 0.2319
Value of j = 4 (t = 0.1111)
The sum = 0.1807 and so on.
Using the procedure given earlier, other values for i = 2, and so on
can be estimated easily.

Numerical solution
The nodal points are represented in Figure 1.18 as follows.
For the solution, the values of h and k have been assumed as h = 1/3
and k = 1/36; therefore, r = 1/4.

© 2010 Taylor & Francis Group, LLC


80 Process engineering and design using visual basic®

u1,2 u2,2 u3,2


u0,2

u1,1 u2,1 u3,1


u0,1

u1,0 u2,0 u3,0


u0,0

Figure 1.18 Representation of nodal points.

Equation 1.141 will be changed to

−0.25ui −1, j + 1 + 2.5ui , j + 1 − 0.25ui + 1, j + 1 = 0.25ui −1, j + 1.5uij + 0.25ui + 1, j (1.142)

From the initial and boundary conditions, we have

u0,0 = 0; u1,0 = 1/3; u2,0 = 2/3

u0,1 = u0,2 = u3,0 = u3,1 = u3,2 = 0

For j = 0
For i = 1

− 0.25u0,1 + 2.5u1,1 − 0.25u2,1 = 0.25u0,0 + 1.5u1,0 + 0.25u2,0


or
2.5u1,1 − 0.25u2,1 = 0.6667 (1.143a)

For i = 2

−0.25u1,1 + 2.5u2,1 − 0.25u3,1 = 0.25u1,0 + 1.5u2,0 + 0.25u3,0

or
−0.25u1,1 + 2.5u2,1 = 1.0833 (1.143b)

Solving Equations 1.143a and 1.143b, u1,1 = 0.3131 and u2,1 = 0.4646.
For j = 1
For i = 1

−0.25u0,2 + 2.5u1,2 − 0.25u2,2 = 0.25u0,1 + 1.5u1,1 + 0.25u2,1

or

2.5u1,2 − 0.25u2,2 = 0.5858 (1.144a)

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 81

Table 1.11 Example 1.29


Node Point Theoretical Numerical analysis
u1,1 0.3287 0.3131
u2,1 0.5094 0.4646
u1,2 0.2879 0.268
u2,2 0.3494 0.3369

For i = 2

−0.25u1,2 + 2.5u2,2 − 0.25u3,2 = 0.25u1,1 + 1.5u2,1 + 0.25u3,1

or
−u1,2 + 2.5u2,2 = 0.7752 (1.144b)

Solving Equations 1.144a and 1.144b, u2,2 = 0.3369 and u1,2 = 0.268.
The theoretically calculated values and values obtained through
numerical analysis are presented in Table 1.11.

Alternating direction implicit method [3]


These methods are two-step methods involving the solution of the tradi-
tional systems of equations along the lines parallel to the x- and y-axes, at
the first and second steps, respectively.
In the Peaceman–Rachford alternating direction implicit (ADI)
method, in the first step, it is advanced from tm to tm+1/2, and in the second
step, it is advanced from tm+1/2 to tm+1. The ADI method is written as

uim, j+ 1/2 − uim, j 1 1


= 2 ∂ 2x uim, j+ 1/2 + 2 ∂ 2y uim, j (1.145a)
k/2 h h

and
uim, j+ 1 − uim, j+ 1/2 1 1
= 2 ∂ 2x uim, j+ 1/2 + 2 ∂ 2y uim, j+ 1 (1.145b)
k/2 h h

The equations can also be written as

 r 2  m + 1/2  r 
 1 − ∂ x  ui , j =  1 + ∂ 2y  uim, j (1.146a)
2  2 

 r 2  m+1  r 2  m + 1/2
 1 − ∂ y  ui , j =  1 + ∂ x  ui , j (1.146b)
2 2

© 2010 Taylor & Francis Group, LLC


82 Process engineering and design using visual basic®

The intermediate values can be obtained as

 r   r 
uim, j+ 1/2 = 0.5  1 + ∂ 2y  uim, j + 0.5  1 − ∂ 2y  uim, j+ 1 (1.147)
 2   2 

The boundary conditions to obtain the solution of Equation 1.146a can


be obtained as

 r   r 
uim, j+ 1/2 = 0.5  1 + ∂ 2y  uim, j + 0.5  1 − ∂ 2y  uim, j+ 1 i = 0,, M (1.148)
 2   2 

Eliminating uim, j+1/2 from Equations 1.146a and 1.146b

 r 2  r 2  m+1  r 2  r 2 m
 1 − ∂ x   1 − ∂ y  ui , j =  1 + ∂ x   1 + ∂ y  ui , j (1.149)
2 2 2 2

Equation 1.149 can be written in the D’yakonov split form as

 r 2  * m+1  r 2  r 2 m
 1 − ∂ x  ui , j =  1 + ∂ x   1 + ∂ y  ui , j (1.150a)
2 2 2

 r 2  m+1 * m+1
 1 − ∂ y  ui , j = ui , j (1.150b)
2

Intermediate boundary conditions

 r 
u0* m, j + 1 =  1 − ∂ 2y  ( g1 )mj + 1 (1.151a)
 2 

and

* m+1  r 2
uM ,j = 1 − ∂ y  ( g 2 )mj + 1 (1.151b)
 2 

Example 1.31
Solve the following two-dimensional heat conduction equation:

∂u ∂ 2u ∂ 2u
= +
∂t ∂x 2 ∂y 2

Initial condition:

u(x, y, 0) = sin πx sin πy, 0 ≤ x, y ≤ 1

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 83

Boundary conditions:
u = 0, on the boundary for t ≥ 0
Use the ADI method. Assume h = 1/4 and k = 1/8 and integrate
for one time step.

SOLUTION
The nodal points are
i
xi = , 0≤i≤4
4

j
yj = , 0≤ j≤4
4

The initial and boundary conditions become

 πi   πj 
ui0, j = sin   sin  
 4  4

u0m, +j 1/2 = u4m, +j 1/2 = 0, 0 ≤ j ≤ 4

uim, 0+ 1 = 0 = uim, 4+ 1 , 0 ≤ i ≤ 4

The ADI method is given by

 1 2  m + 1/2  1 2 m
 1 − 16 ∂ x  ui , j = 1 + ∂ y ui , j
 16 

 1 2  m+1  1 2  m + 1/2
 1 − 16 ∂ y  ui , j =  1 + 16 ∂ x  ui , j

For m = 0, the solution for ui1,/j 2

1 1/2 9 1 1/2 1 0 7 1 0
− ui − 1, j + ui1,/j 2 − ui + 1, j = ui , j − 1 + ui0, j + ui , j + 1
16 8 16 16 8 16

For j = 1
For i = 1

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u0 ,1 + u1,1 − u2 , 1 = u1, 0 + u10,1 + u1, 2
16 8 16 16 8 16

For i = 2

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u1,1 + u2 ,1 − u3 , 1 = u2 , 0 + u20,1 + u2 , 2
16 8 16 16 8 16

© 2010 Taylor & Francis Group, LLC


84 Process engineering and design using visual basic®

For i = 3

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u2 ,1 + u3 ,1 − u4 , 1 = u3 , 0 + u30,1 + u3 , 2
16 8 16 16 8 16

Using boundary conditions

 9/8 −1/16 0  u11,/12  (7 2 + 1)/(16 2) 


    
 −1/16 9/8 −1/16  u12/,12  = (14 + 2 )/(16 2 )
 
 0 −1/16 9/8  u13/,112  (7 2 + 1)/(16 2 )
 

The solution is

u11,/12 = u13/,12 = 0.46468

u12/,12 = 0.65716

For j = 2
For i = 1

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u0 , 2 + u1, 2 − u2 , 2 = u1,1 + u10, 2 + u1, 3
16 8 16 16 8 16

For i = 2

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u1, 2 + u2 , 2 − u3 , 2 = u2 ,1 + u20, 2 + u2 , 3
16 8 16 16 8 16

For i = 3

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u2 , 2 + u3 , 2 − u4 , 2 = u3 ,1 + u30, 2 + u3 , 3
16 8 16 16 8 16

Using boundary conditions

 9/8 −1/16 0  u11,/22  (7 2 + 1)/16 


    
 −1/16 9/8 −1/16  u12/, 22  = (14 + 2 )/16 
 
 0 −1/16 9/8  u13/,222  (7 2 + 1)/16 
 

The solution is

u11,/22 = u13/, 22 = 0.65716

u12/, 22 = 0.92936

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 85

For j = 3
For i = 1

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u0 , 3 + u1, 3 − u2 , 3 = u1, 2 + u10, 3 + u1, 4
16 8 16 16 8 16

For i = 2

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u1, 3 + u2 , 3 − u3 , 3 = u2 , 2 + u20, 3 + u2 , 4
16 8 16 16 8 16

For i = 3

1 1/2 9 1/2 1 1/2 1 0 7 1 0


− u2 , 3 + u3 , 3 − u4 , 3 = u3 , 2 + u30, 3 + u3 , 4
16 8 16 16 8 16

Using boundary conditions

 9/8 −1/16 0  u11,/32  (14 + 2 )/32 


    
 −1/16 9/8 −1/16  u12/, 32  = (7 2 + 1)/32 
 
 0 −1/16 9/8  u13/,332  (14 + 2 )/32 
 

The solution is

u11,/32 = u13/, 32 = 0.46468

u12/, 32 = 0.65716

For the solution of ui1, j

1 1 9 1 1 1 1/2 7 1 1/2
− ui , j − 1 + ui1, j − ui , j + 1 = ui − 1, j + ui1,/j 2 + ui +1, j
16 8 16 16 8 16

For i = 1
For j = 1, 2, and 3

 9/8 −1/16 0   u11,1  0.44767 


    
 −1/16 9/8 −1/16   u11, 2  =  0.63310 
 0 −1/16 9/8  u11, 3  0.44767 

© 2010 Taylor & Francis Group, LLC


86 Process engineering and design using visual basic®

The solution is

u11,1 = u11, 3 = 0.43186

u11, 2 = 0.61074

This method is repeated to find the solution at each mesh point.

Unit conversions
The basic unit conversions are presented in Table 1.12. An electronic con-
version table is also included in this chapter.

Programming
General notes for all programs
• All programs have separate input and output frames.
• Most input data entry cells are white—it means that user inputs are
required.
• Some input cells are yellow—it means that the values cannot
only be calculated using this program, but can also be modified
externally.
• All output cells are red—it means that the values are calculated
results and cannot be modified externally.
• Both the SI and English units can be used for all programs, with the
SI unit being the default. These units are fixed units and cannot be
modified externally.

Vessel
The vessel.exe program has been developed to estimate the total and
filled-liquid volumes and the dry and wet surface areas for horizontal,
vertical, and inclined (e.g., slug catcher) vessels. For horizontal and verti-
cal vessels, the program also calculates the weight of the material and the
hydro test weight.
Once the vessel program executes, the form shown in Figure 1.19 will
appear. This form presents a general understanding of the program and
has three menus:

• Vessel
• Project details
• Help

© 2010 Taylor & Francis Group, LLC


Table 1.12 Unit Conversions
Con­verted from Con­verted to Multiplied by Con­verted from Con­verted to Multiplied by
Acceleration
cm/s2 free fall (g) 0.001097 cm/s2 m/s2 0.01
ft/s2 0.032808 mm/s2 10

Angle
degree grad 1.11111 degree revolution 0.0027778
min 60 sec 3600
rad 0.0174533
Chapter one: Basic mathematics

Area

© 2010 Taylor & Francis Group, LLC


acre cm2 40468564.2 acre mi2 0.0015625
ft2 43560 mm2 4046856422.4
ha 0.4046863 perch 160
in.2 6272640 square 435.6
km2 0.004046856 yd2 4840
m2 4046.856

Computer
bit byte 0.125 bit nibble 0.25
exabyte 1.0842E−19 Petabyte 1.11022E−16
Gb 1.16415E−10 terabyte 1.13687E−13
Kb 0.00012207 yottabyte 1.03398E−25
Mb 1.19209E−7 zettabyte 1.05879E−22
continued
87
Table 1.12 (continued) Unit Conversions
88

Con­verted from Con­verted to Multiplied by Con­verted from Con­verted to Multiplied by

Concentration
kmol/m3 μM/cm3 1000 kmol/m3 mmol/m3 1000000
μM/L 1000000 mol/cm3 0.001
mmol/cm3 1 mol/L 1
mmol/L 1000 mol/m3 1000

Density
g/cm3 g/m3 1000,000 g/cm3 oz/gal (E) 160.35591
kg/cm3 0.001 oz/gal (U.S.) 133.52381

© 2010 Taylor & Francis Group, LLC


kg/m3 1000 lb/ft3 62.42769
mg/cm3 1000 lb/in.3 0.0361273
mg/m3 1000,000,000

Distance
angstrom cm 1E−8 angstrom μm 0.0001
dm 1E−9 Mil 0.00000393701
Furlong 4.97097E−13 Mi 6.213712E−14
ft 3.28084E−10 mm 0.0000001
in. 3.93701E−9 nm 0.1
km 1E−13 nmi 5.39957E−14
lightyear 1.057023E−26 parsec 3.24078E−27
m 1E−10 yd 1.09361E−10
Process engineering and design using visual basic®
Energy
Btu cal 251.99 Btu kcal 0.25199
erg 10,550,600,000 kJ 1.05506
GJ 0.00000105506 kWh 0.00029307
gf-cm 10,758,575.59 N-m 1055.06
hp-h 0.000393 lbf-ft 778.1693
J 1055.03 Wh 0.29307

Flow
barrel/day barrel/h 0.0416667 barrel/day gal(U.S.)/min 0.0291667
Chapter one: Basic mathematics

cm3/h 6624.5833 gal(U.S.)/s 0.000486111

© 2010 Taylor & Francis Group, LLC


cm3/s 1.840162 L/h 6.6245833
ft3/h 0.2339458 L/s 0.001840162
ft3/s 0.000064984 m3/d 0.15899
gal(E)/d 34.973 m3/h 0.00662458
gal(E)/h 1.4572083 m3/s 0.00000184
gal(E)/min 0.0242868 mL/h 6624.58333
gal(E)/s 0.00040478 mL/s 1.840162
gal(U.S.)/d 42 oz/h 224
gal(U.S.)/h 1.75 oz/s 0.0622222

Force
dyn g-force 0.00101972 dyn N 0.00001
continued
89
Table 1.12 (continued) Unit Conversions
90

Con­verted from Con­verted to Multiplied by Con­verted from Con­verted to Multiplied by


kg-force 0.00000101972 oz-force 0.0000359694
kN 1E−8 lb-force 0.000002248
mN 0.01

Heat transfer coefficient


Btu/(h⋅ft2⋅F) Btu/(s⋅ft2⋅F) 0.00027778 Btu/(h⋅ft2⋅F) kcal/(h⋅m2⋅C) 4.88251
cal(h⋅cm2⋅C) 0.488251 kJ/(h⋅m2⋅C) 20.44175
cal/(h⋅m2⋅C) 4882.51 kW/(m2⋅K) 0.005678263
cal/(s⋅cm2⋅C) 0.000135625 W/(m2⋅K) 5.678263
cal/(s⋅m2⋅C) 1.35625

© 2010 Taylor & Francis Group, LLC


Light
Flame fc 4 flame m-cd 43.055642
lx 43.055642

Mass
Carat gr 3.08647 carat oz 0.0070548
g 0.2 lb 0.000440925
kg 0.0002 stone 0.000031494
μg 200000 t (metric) 0.0000002
mg 200

Power
Btu/h Btu/min 0.016667 Btu/h kcal/min 0.00419993
cal/min 4.199833 kW 0.00029281
Process engineering and design using visual basic®
hp 0.000392665 lb-ft/min 12.958
kcal/h 0.251996 W 0.2928104

Pressure
atm bar 1.01325 atm mbar 1013.25
in. Hg 29.9213 mm Hg 760
kg/cm2 1.0332 lb/ft2 2116.224
kg/m2 10332 lb/in.2 14.696
kPa 101.325 torr 760
MPa 0.101325
Chapter one: Basic mathematics

Speed
cm/h cm/s 0.000277778 cm/h kn

© 2010 Taylor & Francis Group, LLC


5.399E−6
ft/h 0.0328084 m/h 0.01
ft/s 0.000009113 m/s 2.777778E−6
km/h 0.00001 mi/h 6.21371E−6
km/s 2.777778E−9 mi/s 1.72603E−9

Surface Tension
dyn/cm mN/m 1 dyn/cm pdl/ft 0.002205
N/m 0.001

Temperature
°C °F °C * 1.8 + 32 °C °R °C * 1.8 + 491.67
K °C + 273.15
continued
91
Table 1.12 (continued) Unit Conversions
92

Con­verted from Con­verted to Multiplied by Con­verted from Con­verted to Multiplied by

Thermal Conductivity
Btu/(h⋅ft⋅F) Btu/(s⋅ft⋅F) 0.00027778 Btu/(h⋅ft⋅F) kcal/(h⋅m⋅C) 1.48813
cal/(h⋅cm⋅C) 14.8813 kJ/(h⋅m⋅C) 6.229312
cal/(h⋅m⋅C) 1488.13 kW/(m⋅K) 0.00173036
cal/(s⋅cm⋅C) 0.00413369 W/(m⋅K) 1.73036
cal/(s⋅m⋅C) 0.4133694

Time
century d 36525 century ms 3.15576E12

© 2010 Taylor & Francis Group, LLC


decade 10 min 52596000
fortnight 2608.9286 month 1200
h 876600 s 3155760000
leap year 25 week 5217.857
millennium 0.1 year 100

Torque
dyn-cm gf-cm 0.001019716 dyn/cm N-m 1.0E−7
kgf-m 1.01972E−8 ouncef-ft 1.180097E−6
kN-m 1.0E−10 poundf-ft 7.37561E−8
MN-m 1.0E−13 poundf-in. 8.850728E−7
mN-m 0.0001
Process engineering and design using visual basic®
Viscosity
cP g/(cm⋅s) 0.01 cP milli Pas⋅s 1
kg/(m⋅h) 3.6 N⋅s/m2 0.001
lb/(ft⋅h) 2.42 Pas⋅s 0.001
lb/(ft⋅s) 0.00067222 P 0.01
mN⋅s/m2 1

Volume
barrel cm3 158,990 barrel L 158.99
ft3 5.6147 μL 158,990,000
Chapter one: Basic mathematics

in.3 9702.202 mL 158,990

© 2010 Taylor & Francis Group, LLC


m3 0.15899 oz (E) 5595.678
yd3 0.207952 oz (U.S.) 5376.006
cup 672.0064 pt (E) 279.7834
drop 2,451,625.8 pt (U.S.) 336.0053
gal (E) 34.974 tablespoon 10,752.012
gal (U.S.) 42 teaspoon 32,256.036
93
94 Process engineering and design using visual basic®

Figure 1.19 Vessel.

The vessel menu gives the following calculation options:

• Horizontal
• Inclined
• Vertical

Program limitations
The following program limitations may be noted:

• The inclined vessel calculation is typically designed for a pipe with-


out dished ends.
• If the filled length of the inclined vessel (Figure 1.22) is less than the
total length, the value of the height must be entered as 0 (default value).
• For the inclined vessel, any value of the height will ignore the value
of the length.

The Project details menu will open a project details form as shown in
Figure 1.20. This form will enable one to enter the general details of the

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 95

Figure 1.20 Project details.

project and the calculations. This also includes the calculation done by
and the calculation checked by options along with dates. Once the details
are entered, pressing the OK button will transfer the information to the
main vessel form.

Horizontal
Once the Horizontal menu executes, the form shown in Figure 1.21 will
appear. This form is designed for horizontal vessel calculations.
This form has two menus:

• File
• Unit

The File menu is further divided into four submenus: (1) Open, (2)
Save, (3) Print, and (4) Exit.
The Unit menu is used to select a proper unit for calculations. Both the
SI and Eng units can be used for calculation, the default unit being SI. It is
not possible to change the unit of individual items.

Data entry
During data entry, care must be taken while entering the units. Because
the basic units are fixed, the data must be entered for the unit shown in the
form. The tab key is preferably used for data entry. The tab key will allow

© 2010 Taylor & Francis Group, LLC


96 Process engineering and design using visual basic®

Figure 1.21 Horizontal vessel form.

data entry in a sequential manner, and once the data entry is complete, the
tab key will select the Calculate button for the calculation.
The data entry is simple; however, the program allows the following
options:
Type of dish end:

1. Elliptical
2. Hemispherical

The selection of dish ends has a significant impact on the calculation


of the volume, the surface area, and the weight.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 97

Material of construction:

1. Aluminum
2. Copper
3. Gold
4. Iron
5. Mild steel
6. Monel
7. Nichrome
8. Platinum
9. Stainless steel

The material of construction is only used to estimate the vessel weight


and requires plate thickness for estimation. It must be noted that only the
shell thickness is entered, and it is assumed that the dish end thickness is
the same as the shell thickness. This may not be correct for all cases, and
the designer should keep this in mind. However, for a preliminary esti-
mate, the calculated weight will be adequate.
In the weight calculation, a 5% margin is added. This addition is
mainly to account for the weight of nozzles, man way, and so on.
For a particular material in the list, the density is automatically
selected by the program. However, it is not possible to modify the density.
In case the material is not present in the list, it is preferable to select one
with closely matching density.
Buttons

1. Calculate
2. Cancel

The Calculate button is used to calculate the parameters after the


completion of data entry. If the tab key is used for data entry, this will
automatically select the Calculate button once the data entry is complete.
Pressing the Calculate button will calculate the parameters.
The Cancel button is used to cancel the execution. Once the Cancel
button is pressed, the program will be transferred to the main menu for
further calculation options.

Inclined
The general format of the inclined vessel calculation is presented in Figure
1.22. The general data entry and calculation principles are as discussed for
the horizontal vessel calculation. However, the following points should
be considered:

• The height indicated on the left side of the form is the height of the
liquid at the furthest left side of the inclined vessel. The default value

© 2010 Taylor & Francis Group, LLC


98 Process engineering and design using visual basic®

Figure 1.22 Inclined vessel form.

of the height is zero. In most slug catcher type of calculations, the


volume is calculated for partially filled vessels, and for such calcula-
tions, the height must be zero. The calculation is based on the total
length and the length as indicated in the form. In general, the value
of the length is smaller than the value of the total length, and the
value of the height must be zero. If any positive value is entered for
the height, the program will ignore the value entered for the length
and will calculate the volume and surface area based on the total
length and height.
• Dished ends have not been used in this calculation. In general, for
the slug catcher type of calculations, the impact of dished ends is
negligible.

The inclined calculation does not include the calculation of the weight,
and material selection is not required for this. The calculation is only for
the total and filled volumes and the total and wet surface areas.

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 99

Vertical
The general format of the vertical vessel calculation is presented in Figure
1.23. The general data entry and calculation principles are as discussed for
the horizontal vessel calculation. However, the following points should
be considered:

Figure 1.23 Vertical vessel form.

© 2010 Taylor & Francis Group, LLC


100 Process engineering and design using visual basic®

Figure 1.24 Conversion.

• The height indicated in the form is the height above the tan line of
the vessel as almost all calculations are like this. The dished end
volume added is based on the type of dished ends. In case a negative
height is entered, the program will calculate the dished end volume
and subtract the negative shell volume. The result will not represent
the actual volume of the liquid in the dished end.
• For an elliptical dished end, the dished end volume is calculated
for a dished end height 0.25 times the vessel diameter, and for a
hemispherical dished end, the volume is calculated for a dished end
height 0.5 times the vessel diameter.

Conversion (Figure 1.24)


Unit conversion has been divided into 23 subgroups, namely

• Acceleration
• Angle

© 2010 Taylor & Francis Group, LLC


Chapter one: Basic mathematics 101

• Area
• Computer
• Concentration
• Density
• Distance
• Energy
• Flow
• Force
• Heat transfer coefficient
• Light
• Mass
• Power
• Pressure
• Speed
• Surface tension
• Temperature
• Thermal conductivity
• Time
• Torque
• Viscosity
• Volume

Program limitations
The following program limitations may be noted:

• The program calculates the output values automatically when the


input values are changed.
• The program does not calculate the output values when the input/
output sections are changed.
• If the section of the input/output parameters is changed, the value in
the input value cell must be re-entered to calculate the output value.
• Large numbers of commonly used units have been selected for each
subgroup for conversion.

Procedure
The procedure for conversion is as follows:

• Select the required subgroup (from 23 radio buttons).


• Available units will appear in both the input and output boxes.
• Select the input unit; this is the unit that is to be converted. The input
value will indicate the selected unit.
• Select the output unit; this is the unit to be converted to. The output
value will indicate the selected unit.

© 2010 Taylor & Francis Group, LLC


102 Process engineering and design using visual basic®

• Enter the value in the input value text box. The output values will
be calculated automatically. The output value text box is read-only
and cannot be modified externally. The input value is to be modified
every time a calculation is required. Changing unit selection will
not automatically recalculate the output value.

References
1. Kreyszig, E., Advanced Engineering Mathematics, 7th ed., John Wiley and Sons,
New York, 1993.
2. Grossman, S.I., Multivariable Calculus, Linear Algebra and Differential Equations,
3rd ed., Sunders College Publishing, 1994.
3. Jain, M.K., Iyengar, S.R.K., and Jain, R.K., Numerical Methods for Scientific and
Engineering Computation, Wiley Eastern Limited, New Delhi, 1985.

© 2010 Taylor & Francis Group, LLC


chapter two

Thermodynamics

Introduction
The thermodynamic approach was developed in the nineteenth century
for a better understanding of the change in the energy in steam engines.
Certain principles were developed, known as the first and second laws
of thermodynamics, to mathematically correlate the changes in heat
and energy during a particular process. An understanding of the above
is extremely important for all branches of science and engineering. The
mathematical correlations developed help us to understand how the
physical properties and energies are changed during operations such as
compression, expansion, and so on.

Heat, work, and energy


From our experience, we know that if two bodies of different tempera-
tures are brought into contact with each other, the heat is transferred from
the hot body to the cold body. In fact, the transfer of heat is directly pro-
portional to the difference in temperatures between the two bodies. A
popular unit of heat is the calorie, which is defined as the heat required
to increase the temperature of 1 g of water by 1°C. The calorie is now rec-
ognized as a unit of energy. In the SI unit, the unit of energy is the joule,
which is equal to 1 Nm or the mechanical work done when a force of 1 N
acts through a distance of 1 m. Thus, mathematically, the work can be
defined as a product of force (N) and displacement (m).

Force
Force is derived from Newton’s second law as a product of mass and accel-
eration. The SI unit of force is N. Mathematically

F = ma (2.1)

While the mass of a body is a scalar quantity that is independent of


location, force is a vector quantity that depends on the acceleration due
to gravity at any particular location. For example, if an astronaut weighs

© 2010 Taylor & Francis Group, LLC 1


2 Process engineering and design using visual basic®

750 N on Earth (a = 9.81 m/s2), his mass on Earth will be 76.45 kg and his
weight on the moon will be 127.67 N (assuming that the acceleration on
the moon is 1.67 m/s2).

Kinetic and potential energy


The concept of work, kinetic energy, and potential energy was developed
through Newton’s laws of motion. The work done is defined as

dW = madl (2.2)

Considering the definition of acceleration as velocity over time and


velocity as length over time, Equation 2.2 can be modified as

dW = mvdv (2.3)

Integrating

 v 2 − v12   mv 2 
W = m 2  = ∆ (2.4)
 2   2 

The term ½ mv2 is called the kinetic energy.

1
EK = mv 2 (2.5)
2

If a body of mass m is raised by a distance z, the work done can be


defined as

W = Δ(mzg) (2.6)

The term mzg is called the potential energy:

EP = mzg (2.7)

First law of thermodynamics


The first law of thermodynamics defines the relationship between heat
and work. According to the first law, if heat is produced from work, there
will be a relationship between the work done and heat produced or vice

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 3

versa. Alternatively, energy can exist in different forms and the total
quantity of energy is always constant. If energy disappears in one form, it
will appear in some other form simultaneously.
According to the first law of thermodynamics, the relationship among
internal energy, heat, and work in a closed system can be expressed math-
ematically as

dU = dQ + dW (2.8)

Phase rule
In a heterogeneous system, phase rule defines how the degree of freedom
(F) relates to the number of components (C) and the number of phases (P),
such as

F=C−P+2 (2.9)

As an example, water exists in two phases (liquid and vapor) at


101.3 kPa and 100°C. In this case, the degree of freedom is 1, meaning that
when water exists in the vapor and liquid phases and at 101.3 kPa pres-
sure, the temperature cannot be changed from 100°C. If we add another
component, say, glycol, the degree of freedom will be 2. This means that
even at 101.3 kPa pressure and under a two-phase condition, the tempera-
ture can be a variable depending on the composition.

Reversible process
A system can change from one state to another through either a revers-
ible or an irreversible process. In a reversible process, the change occurs
slowly in minute quantities till the total specified change happens.
If an expansion is carried out from an initial pressure P1 to a final
pressure P2 (volume from V1 to V2), the reversible work (Wr) and irrevers-
ible work (Wir) done at constant temperature are

V2 P
Wr = RT ln = RT ln 1 (2.10)
V1 P2

 P
Wir = P2 (V2 − V1 ) = RT  1 − 2  (2.11)
 P1 

© 2010 Taylor & Francis Group, LLC


4 Process engineering and design using visual basic®

The difference between reversible work and irreversible work can be


defined as

RT
Wr − Wir = (P1 − P2 )2 (2.12)
P1P2

The right-hand side of Equation 2.12 is a positive quantity, meaning


that the work done in a reversible process is always greater than the work
done in an irreversible process.

Example 2.1
1 mol air at 300 K is expanded from 500 to 100 kPa. Estimate the work
done in both reversible and irreversible processes.

SOLUTION
Reversible work
Wr = 8.314 * 300 * ln(5) = 4014.3 J
Irreversible work
Wir = 8.314 * 300 * (1 − 0.2) = 1995.4 J

Heat content or enthalpy


The enthalpy of a system is defined as

H = U + PV (2.13)

In differential form

dH = dU + PdV + VdP (2.14)

Heat capacity at constant volume and constant


pressure
The heat capacity at constant volume is defined as the change in internal
energy with the temperature at constant volume, and the heat capacity at
contact pressure is defined as the change in enthalpy with the tempera-
ture at constant pressure. Mathematically [1]

 ∂U 
CV =  (2.15a)
 ∂T  V

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 5

 ∂H 
CP =  (2.15b)
 ∂T  P

The values of two specific heats are not the same, and the relationship
between the two values can be expressed as

 ∂H   ∂U 
CP − CV =  −
 ∂T  P  ∂T  V

 ∂U   ∂V   ∂U 
=  + P  − 
 ∂T  P  ∂T  P  ∂T
T V

 ∂U   ∂U   ∂V   ∂V   ∂U 
= + + P −
 ∂T  V  ∂V  T  ∂T  P  ∂T  P  ∂T  V

(Since U = f(T,V))

  ∂U    ∂V 
=   + P  
  ∂V  T   ∂T  P

For ideal gas, (∂U/∂V)T = 0


Therefore

 ∂V  R
CP − CV = P  = P* =R (2.16)
 ∂T  P P

Isothermal process
An isothermal process is a process when the temperature remains con-
stant. The work done to increase an ideal gas pressure from P1 to P2 is
defined as
PV = constant

P2
W = RT ln (2.17)
P1

Adiabatic process
An adiabatic process is the process when there is no heat transfer between
the system and the surrounding area (dQ = 0). For this case, the work done

© 2010 Taylor & Francis Group, LLC


6 Process engineering and design using visual basic®

to increase the system pressure from P1 to P2 is defined as [1]

PV γ = constant

RT1  P2 
( γ − 1)/ γ
 (2.18)
W =   − 1
γ − 1  P1  

Example 2.2
1 kmol air is compressed from 100 kPa and 25°C to 500 kPa. Calculate
the work done if the compression is (a) isothermal and (b) adiabatic.
The ratio of specific heats for air is 1.4.

SOLUTION
a. The work done for an isothermal process

P2
W = RT ln = 8.314 * 298 * 1.609 = 3987.5 kJ
P1

b. The work done for an adiabatic process

8.314 * 298
W = (1.584 − 1) = 3616.1 kJ
0.4

Equation of state
Boyle’s law and Charles’s law
We can assume a cubical box with each side of length l (as shown in Figure
2.1) and whose three axes are x, y, and z. The velocity v can be defined as

v 2 = x 2 + y 2 + z2 (2.19)

y c
B A
x
z

Figure 2.1 Pressure in a cube.

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 7

The momentum of a gas particle, with mass m, in the x-direction will


be mx, and if we assume that the gas molecule rebounds in an elastic man-
ner, the change in momentum will be 2mx.
Now, with the distance between the two opposite walls equal to l, the
number of collisions per unit time will be x/l. The change in momentum
per unit time will be 2mx2/l. Considering all the sides, the total momen-
tum imparted per unit time will be

2m ( x 2 + y 2 + z 2 ) 2mv 2
=
l l

Now, considering N number of molecules, the total force exerted on


all the walls will be

2mNv 2
F= (2.20)
l

Again, pressure P can be defined as

F 1 mNv 2
P= = (2.21a)
6l 2 3 V

or

1
PV = mNv 2 (2.21b)
3

where
V = volume of the cube

Now

2 1
PV = N * mv 2
3 2

For a given mass of gas, 2/3 N and ½ mv2 (kinetic energy) are constant
if the temperature is constant. Otherwise, PV is constant when the tem-
perature is constant. This is Boyle’s law.
Again, at constant pressure, V/T is constant, which is Charles’s law.
Combining Boyle’s and Charles’s laws

PV = RT (2.22)

where
R = universal gas constant

© 2010 Taylor & Francis Group, LLC


8 Process engineering and design using visual basic®

Equation of state for real gas


Equation 2.22 is valid for a perfect gas. In practice, the equation is required
to be modified to represent the actual world. There are large numbers of
semi-empirical correlations available in the literature, and they are gener-
ally developed following identical logics. A gas molecule experiences uni-
form attraction in all directions when located at the center of a container.
However, the gas molecule close to the wall will experience an unbal-
anced attraction (pulling inward). This will reduce the momentum of the
gas molecule. If this decrease in pressure is denoted as p/, then the ideal
pressure will be P + p/, where P is the actual observed pressure.
Similarly, the gas molecule will occupy some space within the con-
tainer and the actual volume will be reduced to some extent. If the
reduction in volume is b, the actual volume will be V – b. With these modi-
fications, the general equation is modified as

(P + a)(V − b) = RT (2.23)

The first equation of state (EOS) was developed by J.D. van der Waals
in 1873 and presented as [1]

 a  (2.24)
 P + 2  (V − b) = RT
V

where the values of a,b typically depend on the pressure and temperature
conditions. Changing the values to zero, the equation will modify into the
equation of an ideal gas.
Various EOSs were developed to establish calculation procedures for
a and b. Out of a large number of EOSs, the following two are extensively
used in process engineering calculations:

• Peng–Robinson (PR) [2]


• Soave–Redlich–Kwong (SRK) [3]

Comparison between PR and SRK EOSs


The comparison between PR and SRK EOSs is presented in Table 2.1.

Acentric factor
One important parameter presented in the EOS is the acentric factor ω.
The acentric factor is used to correlate physical and thermodynamic prop-
erties. Mathematically, the acentric factor is defined as [4]

ω = − log pr* − 1.000 (2.26)

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 9

Table 2.1 Comparison between PR and SRK EOSs


Equation
PR SRK number

RT a RT a (2.25a)
P= − P= −
V − b V (V + b) + b(V − b) V − b V (V + b)

Z3 − Z2 + (A − B − B2)Z − (2.25b)
Z 3 − (1 − B)Z 2 + ( A − 2B − 3B2 )Z
AB = 0
− ( AB − B2 − B3 ) = 0

where
N N (2.25c)
b= ∑x b i i ∑x b
i =1
i i

i =1

RTci (2.25d)
RTci 0.08664
bi = 0.077796
Pci Pci

2
 N

2 (2.25e)
 N

a=

∑x a i i
0.5





i =1
xi ai 0.5 

i =1

ai = aciαi aciαi (2.25f)

(RTci )2 (2.25g)
(RTci )2 0.42747
aci = 0.457235
Pci Pci

1 + mi (1 − T ri0.5 ) (2.25h)
α 0i .5 = 1 + mi (1 − T 0ri.5 )

0.48 + 1.574ω i − 0.176ω 2i (2.25i)


mi = 0.37464 + 1.54226 ω i − 0.26992ω 2i

aP (2.25j)
aP
A=
(RT )2 (RT )2

bP (2.25k)
bP
B=
RT RT

Note: T = absolute temperature, P = absolute pressure, V = specific volume, Z = compress-


ibility, Tc = critical temperature, Pc = critical pressure, Tr = reduced temperature,
ω = acentric factor, a,b = parameters used in the equations, a(T) = parameter used in
the equations, ac = value of a(T) at T = Tc, α = correction factor, a/ac, m = slope of α0.5
against Tr0.5, i = component i in the mixture, N = number of components.

© 2010 Taylor & Francis Group, LLC


10 Process engineering and design using visual basic®

where
pr* = reduced vapor pressure, p*/pc
p* = vapor pressure at T = 0.7Tc, kPaA
pc = critical pressure, kPaA
T = temperature, K
Tc = critical temperature, K

For hydrocarbon mixtures, the acentric factor is calculated as

ω= ∑x ω
i =1
i i (2.27)

where
N = number of components
ωi = acentric factor of component i
xi = mole fraction of component i

Other important factors used to establish the physical and thermody-


namic properties of hydrocarbon mixtures are the Watson characteriza-
tion factor K and the critical compressibility factor zc. Table 2.2 presents
the values of the acentric factor, the Watson characterization factor, and
the critical compressibility factor. A complete list is available in the API
Technical Data Book [4].

Vapor pressure of pure components


The vapor pressure of pure components can be calculated using the
Antoine equation. The Antoine equation defines the vapor pressure of
pure components as [5]

B
ln(P) = A − (2.28)
T+C

where
P = vapor pressure, mmHg
T = temperature, K
A,B,C = constants in the Antoine equation

For the commonly used hydrocarbon vapor, the values of constants A,


B, and C along with critical pressures and temperatures are presented in
Table 2.3. A more complete list is available in the literature [1,5].

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 11

Table 2.2 Acentric Factors, Watson Characterization Factors, and Critical


Compressibility Factors of Pure Substances
Watson Critical
Acentric characterization compressibility
Components factor (ω) factor (K) factor (zc)
Nonhydrocarbons
Hydrogen −0.2153 0.305
Nitrogen 0.04 0.292
Oxygen 0.0218 0.288
Carbon monoxide 0.0663 0.295
Carbon dioxide 0.23894 0.274
Sulfur dioxide 0.2451 0.269
Hydrogen sulfide 0.081 0.284
Water 0.344 0.229
Ammonia 0.252 0.242
Paraffins
Methane 0.011498 19.54 0.288
Ethane 0.0986 19.49 0.284
Propane 0.1524 14.69 0.280
n-Butane 0.201 13.50 0.274
i-Butane 0.18479 13.78 0.282
n-Pentane 0.25389 13.03 0.269
i-Pentane 0.2224 13.01 0.270
2,2-Dimethylpropane 0.1964 13.36 0.269
n-Hexane 0.3007 12.78 0.264
i-Hexane 0.2781 12.82 0.267
3-Methylpentane 0.2773 12.65 0.273
2,2-Dimethylbutane 0.2339 12.77 0.272
2,3-Dimethylbutane 0.2476 12.62 0.269
n-Heptane 0.3494 12.68 0.263
i-Heptane 0.3282 12.72 0.261
3-Methylhexane 0.3216 12.55 0.255
3-Ethylpentane 0.3094 12.36 0.268
2,2-Dimethylpentane 0.2879 12.60 0.267
2,3-Dimethylpentane 0.2923 12.35 0.256
2,4-Dimethylpentane 0.3018 12.72 0.265
3,3-Dimethylpentane 0.2672 12.42 0.273
2,2,3-Trimethylbutane 0.2503 12.38 0.266
n-Octane 0.3962 12.68 0.259
continued

© 2010 Taylor & Francis Group, LLC


12 Process engineering and design using visual basic®

Table 2.2 (continued) Acentric Factors, Watson Characterization Factors, and


Critical Compressibility Factors of Pure Substances
Watson Critical
Acentric characterization compressibility
Components factor (ω) factor (K) factor (zc)
i-Octane 0.3768 12.64 0.261
n-Nonane 0.4368 12.64 0.255
n-Decane 0.4842 12.64 0.249

Napthenes
Cyclopropane 0.1348 11.93 0.274
Cyclobutane 0.1866 11.45 0.274
Cyclopentane 0.1943 10.94 0.273
Methylcyclopentane 0.2302 11.32 0.272
Ethylcyclopentane 0.2715 11.39 0.269
Cyclohexane 0.2149 11.00 0.273
Methylcyclohexane 0.2350 11.31 0.269
Ethylcyclohexane 0.2455 11.36 0.270
Cyclooctane 0.2536 10.89 0.270

Olefins
Ethylene 0.0852 0.277
Propylene 0.1424 14.21 0.275
1-Butene 0.1867 13.04 0.276
cis-2-Butene 0.2030 12.61 0.272
trans-2-Butene 0.2182 12.93 0.274
i-Butylene 0.1893 13.01 0.275
1-Pentene 0.2330 12.65 0.270
cis-2-Pentene 0.2406 12.48 0.279
trans-2-Pentene 0.2373 12.61 0.279
1-Hexene 0.2800 12.50 0.265
cis-2-Hexene 0.2722 12.30 0.266
trans-2-Hexene 0.2613 12.45 0.267
1-Heptene 0.3310 12.41 0.262
trans-2-Heptene 0.3389 12.39 0.256
1-Octene 0.3747 12.40 0.256
trans-2-Octene 0.3384 12.36 0.260
1-Nonene 0.4171 12.42 0.249
1-Decene 0.4645 12.46 0.247

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 13

Table 2.2 (continued) Acentric Factors, Watson Characterization Factors, and


Critical Compressibility Factors of Pure Substances
Watson Critical
Acentric characterization compressibility
Components factor (ω) factor (K) factor (zc)
Diolefins
Propadiene 0.1594 12.58 0.271
1,2-Butadiene 0.2509 12.16 0.267
1,3-Butadiene 0.1932 12.51 0.270
1,2-Pentadiene 0.2235 11.90 0.256
1,3-Pentadiene 0.0837 12.21 0.285
2,3-Pentadiene 0.2194 11.91 0.253

Acetylenes
Acetylene 0.1873 16.72 0.271
Methylacetylene 0.2161 12.34 0.276
Ethylacetylene 0.0500 12.14 0.270

Aromatics
Benzene 0.2108 9.74 0.271
Toluene 0.2641 10.11 0.264
Ethylbenzene 0.3036 10.33 0.263
o-Xylene 0.3127 10.27 0.263
m-Xylene 0.3260 10.41 0.259
p-Xylene 0.3259 10.44 0.260
n-Propylbenzene 0.3462 10.59 0.265
i-Propylbenzene 0.3377 10.54 0.262
n-Butylbenzene 0.3917 10.82 0.261
i-Butylbenzene 0.3811 10.84 0.256
Napthalene 0.3019 9.32 0.269
Source: Adapted from Technical Data Book—Petroleum Refining, 4th ed., American Petroleum
Institute, Washington, D.C., 1982.

Vapor pressure of water


A much better correlation can be developed for the estimation of water
vapor pressure by using the following equation:

P = 10(7.97−1668.2/(T−45.2)) (2.29)

where
P = vapor pressure of water, mmHg
T = temperature, K

© 2010 Taylor & Francis Group, LLC


14 Process engineering and design using visual basic®

Table 2.3 ​Values of Antoine Constants and Critical Pressures and Temperatures
Constant in Antoine Temperature
equation limits (°C) Critical conditions
Compo­ Pressure Temperature
nents A B C Min Max (kPa) (K)
Methane 15.2243 597.84 −7.16 −180 −153 4640.7 190.7
Ethane 15.6637 1511.42 −17.16 −143 −74 4883.9 305.4
Propane 15.726 1872.46 −25.16 −109 −24 4256.7 369.9
n-Butane 15.6782 2154.9 −34.42 −78 17 3796.6 425.2
i-Butane 15.5381 2032.73 −33.15 −86 7 3647.6 408.1
n-Pentane 15.8333 2477.07 −39.94 −53 57 3375.1 469.6
n-Hexane 15.8366 2697.55 −48.78 −28 97 3031.6 507.9
n-Heptane 15.8737 2911.32 −56.51 −3 127 2736.8 540.2
n-Octane 15.9426 3120.29 −63.63 19 152 2490 568.7
n-Nonane 15.9671 3291.45 −71.33 39 179 2290 594.6
n-Decane 16.0114 2456.8 −78.67 57 203 2110 617.7
Carbon 14.3686 530.22 −13.15 −210 −165 3499 132.9
monoxide
Carbon 22.5898 3103.39 −0.16 −119 −69 7370 304.1
dioxide
Hydrogen 16.1040 1768.69 −26.06 −83 −43 9007.8 373.6
sulfide
Nitrogen 14.9542 588.72 −6.6 −219 −183 3394.4 126.2
Oxygen 15.4075 734.55 −6.45 −210 −173 5043 154.6
Hydrogen 13.6333 164.9 3.19 −259 −248 1313 33.19
Water 18.3036 3816.44 −46.13 11 168 22,120 647.3

Vapor pressure calculation using EOSs


The vapor pressure of pure components can be calculated by estimating
the fugacity of the component. The general equation of fugacity for pure
components
SRK EOS

f A  Z + B
ln = Z − 1 − ln(Z − B) − ln   (2.30)
P B  Z 

PR EOS
f A Z + 2.414B
ln = Z − 1 − ln(Z − B) − ln (2.31)
P 2 2B Z − 0.414B

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 15

Vapor pressure is the equilibrium pressure, where

fL = fV (2.32)

where
f L = fugacity of the liquid phase
f V = fugacity of the vapor phase
P = pressure
Z = compressibility
B = parameter defined in Table 2.1

Example 2.3
Estimate the vapor pressure of n-hexane at 31.6°C (304.75 K).

SOLUTION
Use the Antoine equation
A = 15.8366
B = 2697.55
C = −48.78

2697.55
ln(P) = 15.8366 − = 5.29806
304.75 − 48.78

or
P = 199.95 mmHg = 26.66 kPa
Use PR EOS
Critical pressure = 3025 kPa
Critical temperature = 507.6 K
Acentric factor = 0.3047
Temperature = 304.75 K

Parameters are calculated as

(8.314 * 507.6)2
ac = 0.457235 = 2692.04
3025
mi = 0.37464 + 1.54226 * 0.33047 − 0.26992 * 0.3047 2 = 0.8195
Tri = 304.75/507.6 = 0.6

α = (1 + 0.8195 * (1 − 0.6 0.5 ))2 = 1.4031

a = ac * α = 3777.15
8.314 * 507.6
b = 0.077796 = 0.1085
3025

© 2010 Taylor & Francis Group, LLC


16 Process engineering and design using visual basic®

The vapor pressure will be the pressure at which the fugacity of


the liquid and vapor phases will be the same. This is calculated by
assuming an initial value and then modifying the value suitably. This
calculation converges very rapidly.
Assumption 1: Vapor pressure is 1 kPa

3777.15 * 1
A= = 0.0005884
(8.314 * 304.75) 2
0.1085 * 1
B= = 0.000043
304.75 * 8.314

Using the above values of A and B, the cubic equation will be

Z3 − 0.99996Z2 + 0.000503Z − 2.337 * 10−8 = 0

The above equation has three real roots; the highest value is the
compressibility of the vapor phase and the lowest one is the com-
pressibility of the liquid phase:

Compressibility of vapor phase = 0.99945


Compressibility of liquid phase = 0.000052

The fugacity can be calculated as

Liquid-phase fugacity = 26 kPa


Vapor-phase fugacity = 1 kPa

Since the values are not the same, the initial pressure is to be
modified and recalculated.
This calculation is repeated till the liquid and vapor phase fugac-
ity difference is <0.00001.
The estimated vapor pressure is 26.7 kPa (200.3 mmHg).
The calculated vapor pressure of hexane at 31.6°C:

Using the Antoine equation = 26.66 kPa (199.95 mmHg)


Using PR EOS = 26.7 kPa (200.3 mmHg)
Literature value [6] = 200 mmHg

Second law of thermodynamics


The first law of thermodynamics states that the energy is interchangeable,
but it did not provide any indication whether change will occur at all or to
what extent it will occur. The second law provides the essential conditions
to make a change possible.

• The change from heat to work is possible through a thermodynamic


engine, which works in a reversible cyclic process.

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 17

• The thermodynamic engine must work between two temperatures,


taking up heat from the higher-temperature source, converting a
portion into work, and giving up the rest of the heat to the lower-
temperature sink.

Carnot’s cycle
Carnot’s cycle (Figure 2.2) can be used to explain how and to what extent
work is obtained from heat. In this cycle, the engine starts at a point A and
comes back to the same point. Alternatively, the engine must operate in
a complete cycle. Also, maximum work can be obtained when every step
operates in a reversible fashion.
In the above cycle, the following operations can be analyzed.
Operation 1: Gas is allowed to expand, isothermally and reversibly,
from point A to point B (volume changes from V1 to V2). For an ideal gas,
the heat absorbed is equal to the work done.
V2 (2.33)
Q1 = RT1 ln
V1

Operation 2: The gas is then allowed to expand from V2 to V3 adiabati-


cally and reversibly till the temperature drops to the temperature of the
sink. Owing to the adiabatic process, the heat exchange is 0. The work
done (W1) by the gas can be calculated as

W1 = CV (T1 − T2) (2.34)

Operation 3: The gas is compressed isothermally and reversibly from V3


to V4. For an ideal gas, the heat given out is equal to the work done by the gas:
V4
Q2 = RT2 ln (2.35)
V3

A V1
T1
B V2

P
D
V4 C V3
T2

Figure 2.2 Carnot’s cycle.

© 2010 Taylor & Francis Group, LLC


18 Process engineering and design using visual basic®

Operation 4: The gas is compressed adiabatically and reversibly from


V4 to V1 and comes back to the initial state.

W2 = −CV (T1 − T2) (2.36)

The net work (W) done by the gas in the complete cycle

V2 V
W = RT1 ln + CV (T1 − T2 ) + RT2 ln 4 − CV (T1 − T2 ) (2.37)
V1 V3

or

V2 V
W = RT1 ln + RT2 ln 4 (2.38)
V1 V3

Now, from the first law

V2 V
= 3
V1 V4

Therefore, the net work done can be defined as

V2
W = R (T1 − T2 )ln (2.39)
V1

The efficiency (η) of the process is given as

W T
η= = 1− 2 (2.40)
Q1 T1

And the work is given as

 T 
W = Q1  1 − 2  (2.41)
 T1 

This relationship is the mathematical form of the second law.

Entropy
With some extension of the above analysis, it can be concluded that a ther-
modynamic change defined as dQ/T is independent of the path of the

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 19

transformation of the system. This function is called entropy and is nor-


mally denoted by S.
Mathematically, the change in entropy is measured by the ratio of
the heat change and temperature at which the heat change occurs and is
defined as

dQrev
dS = (2.42)
T

The term dQrev indicates that the heat change occurs through a revers-
ible process.

Sensible heat
Enthalpy is a function of temperature and pressure

H = f(T,P)

or

 ∂H   ∂H 
dH =  dT +  dP
 ∂ T  P  ∂ P  T

or

 ∂H 
dH = CP dT +  dP (2.43a)
 ∂ P  T

In the above equation, the second term is zero for the following
conditions:

a. When the pressure is constant


b. When enthalpy is independent of the pressure, for example, low-
pressure gas

Considering the above conditions, the change in enthalpy can be


defined as

dH = CP dT (2.43b)

where CP is the isobaric specific heat.

© 2010 Taylor & Francis Group, LLC


20 Process engineering and design using visual basic®

Thermodynamic properties
The following thermodynamic properties are extremely important in all
process engineering calculations. This section will discuss the method to
estimate these thermodynamic properties.

• Isobaric specific heat of hydrocarbon ideal gases


• Isobaric specific heat of hydrocarbon real gases
• Isobaric specific heat of hydrocarbon gas mixtures
• Isobaric specific heat of ideal liquids
• Isobaric specific heat of real liquids
• Enthalpy of gases
• Enthalpy of gas mixtures
• Entropy of ideal gases
• Entropy of real gases
• Entropy of hydrocarbon gas mixtures
• Viscosity of ideal liquids
• Viscosity of ideal hydrocarbon vapors
• Liquid viscosity of defined mixtures at low pressure
• Vapor viscosity of defined mixtures at low pressure
• Thermal conductivity of pure hydrocarbon liquids at low pressure
• Thermal conductivity of pure hydrocarbon vapors at low pressure

Isobaric specific heat of hydrocarbon ideal gases


Specific heat at a constant pressure is an important parameter for engi-
neering calculations. This value is largely influenced by the temperature
and the actual pressure of the fluid. The specific heat of pure components
for an ideal gas is calculated as [1]

CP/R = A + BT + CT2 + DT−2 (2.44)

where
CP = specific heat of ideal gas, kJ/(kmol⋅K)
R = universal gas constant, kJ/(kmol⋅K)
T = temperature, K
A,B,C,D = constants

Constants for the calculation of the specific heat of commonly used


ideal gases are presented in Table 2.4.

Example 2.4
Estimate the heat required to raise the temperature of 1 kmol meth-
ane from 100°C to 400°C.

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 21

Table 2.4 Constants for the Calculation of Specific Heat—Ideal Gases


Ideal Gases MW Tmax (K) A B * 103 C * 106 D * 10−5
Methane 16.043 1500 1.702 9.081 −2.164
Ethane 30.070 1500 1.131 19.225 −5.561
Propane 44.097 1500 1.213 28.785 −8.824
n-Butane 58.123 1500 1.935 36.915 −11.402
i-Butane 58.123 1500 1.677 37.853 −11.945
n-Pentane 72.150 1500 2.464 45.351 −14.111
n-Hexane 86.177 1500 3.025 53.722 −16.791
n-Heptane 100.204 1500 3.570 62.127 −19.486
n-Octane 114.231 1500 4.108 70.567 −22.208
Air 28.851 2000 3.355 0.575 −0.016
Nitrogen 28.014 2000 3.280 0.593 0.040
Oxygen 31.999 2000 3.639 0.506 −0.227
Hydrogen 2.016 3000 3.249 0.422 0.083
Hydrogen sulfide 34.082 2300 3.931 1.49 −0.232
Carbon monoxide 28.010 2500 3.376 0.557 −0.031
Carbon dioxide 44.01 2000 5.457 1.045 −1.157
Water 18.015 2000 3.47 1.45 0.121
Source: A
 dapted from Smith, J.M., Van Ness, H.C., and Abbott, M.M., Introduction to Chemical
Engineering Thermodynamics, 6th ed., McGraw-Hill, New York, 2001.
Note: Values for other components are available in the literature [1,5,7]. Tmax is the maxi-
mum temperature, K.

SOLUTION
The heat required can be calculated as

T2

Q = dH =
∫ C dT
T1
P

k
CP
=R
∫ R dT
1

 T2 T3 
= R  AT1 (k − 1) + B 1 (k 2 − 1) + C 1 (k 3 − 1)
 2 3 

where
T1 = initial temperature = 373.15 K
k = temperature ratio = 673.15/373.15 = 1.804
A,B,C = constants as per Table 2.4

© 2010 Taylor & Francis Group, LLC


22 Process engineering and design using visual basic®

Solving the above equation for methane

 373.152
Q = 8.314 1.702 * 373.15 * 0.804 + 9.801 * 10 −3 *
 2

373.153 
2.254 − 2.164 * 10 −6 * 4.871
3 
= 15515 kJ

Isobaric specific heat of hydrocarbon real gases


Isobaric specific heat is an important thermodynamic parameter and is
used in several calculations, including sensible heat effect, Joule–Thomson
cooling, and so on [4].
Isobaric specific heat is calculated as

 C 0 − CP 
CP = C P0 − R  P (2.45)
 R 

where
CP = isobaric specific heat of the real gas, kJ/(kmol·K)
C P0 = isobaric specific heat of the ideal gas, kJ/(kmol·K)
R = gas constant = 8.314 kJ/(kmol·K)
(C P0 − CP )/R = dimensionless correction factor

The dimensionless correction factor is calculated as

CP0 − CP  CP0 − CP  ω
0
 C 0 − C  h  C 0 − C  0 
=  + h  P P
− P P
 (2.46)
R  R  ω  R   R  

where
((C P0 − CP )/R)0 = effect of the pressure for simple fluid (use Equation
2.47 to calculate)
((C P0 − CP )/R)h = effect of the pressure for the heavy reference fluid
(n-octane) (use Equation 2.47 to calculate)

The pressure effect is calculated as

i i
 CP0 − CP  T (∂Pr /∂Tr )V2 r  ∆CV 
= 1+ r + (2.47)
 R   (∂Pr /∂Vr )Tr  R 

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 23

where

 ∂ Pr  1  b1 + b3 /Tr2 + 2b4 /Tr3 c1 − 2c3 /Tr3 d 2c


 ∂ T  = V 1 + + 2
+ 15 − 3 4 2
r Vr r  Vr Vr Vr Tr Vr

 γ   γ   
×  β + 2  exp  − 2    (2.48)
 Vr   Vr   

 ∂ Pr  Tr  2B 3C 6D c4    γ  γ 
 ∂ V  = − V 2 1 + V + V 2 + V 5 + T 3V 2  3β + 5 − 2β + 2   2 
 Vr   Vr 
r  r r  
r Tr
 r r r

 γ 
× exp  − 2   (2.49)
 Vr  


i
 ∆CV  2 (b3 + 3b4 /Tr ) 3c
  = − 2
+ 3 3 2 + 6E (2.50)
R Tr Vr Tr Vr

where
Pr = reduced pressure
Tr = reduced temperature
Vr = reduced volume = ZTr/Pr
Z = compressibility

b2 b b
B = b1 − − 32 − 43 (2.51a)
Tr Tr Tr

c2 c
C = c1 − + 33 (2.51b)
Tr Tr

d2
D = d1 + (2.51c)
Tr

c4   γ   γ 
E= 3 
β + 1 −  β + 1 + 2  exp  − 2   (2.51d)
2Tr γ   Vr   Vr  

Other constants used in the above equations for both simple and
heavy reference fluids are tabulated in Table 2.5.

© 2010 Taylor & Francis Group, LLC


24 Process engineering and design using visual basic®

Table 2.5 ​Values of Constants


Heavy reference
Constants Simple fluid fluid
b1 0.1181193 0.2026579
b2 0.265728 0.331511
b3 0.154790 0.027655
b4 0.030323 0.203488
c1 0.0236744 0.0313385
c2 0.0186984 0.0503618
c3 0 0.016901
c4 0.042724 0.041577
d1 * 104 0.155488 0. 48736
d2 * 104 0.623689 0.0740336
β 0.65392 1.226
γ 0.060167 0.03754
Source: Adapted from Technical Data Book—Petroleum
Refining, 4th ed., American Petroleum Institute,
Washington, D.C., 1982.

Isobaric specific heat of hydrocarbon gas mixtures


The above method can also be used to calculate the isobaric specific heat of
real hydrocarbon gas mixtures [4]. However, the pseudocritical properties
are to be used for the calculation. Pseudocritical properties are calculated as
n

Ppc = ∑x P
i =1
i ci (2.52)

Tpc = ∑xT
i =1
i ci (2.53)

ω= ∑x ω
i =1
i i (2.54)

CP = ∑w C i pi
(2.55)

where
Ppc = mixture’s pseudocritical pressure, kPa
Pci = critical pressure of component i, kPa
Tpc = mixture’s pseudocritical temperature, K
Tci = critical temperature of component i, K

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 25

n = number of components
xi = mole fraction of component i
ω = mixture’s acentric factor
ωi = acentric factor of component i
CP = mixture’s isobaric specific heat
CPi = isobaric specific heat of component i
wi = weight fraction of component i

Example 2.5
Estimate the isobaric specific heat for

i. Methane at 10,000 kPag and 20°C


ii. Ethane at 3000 kPag and 50°C
iii. Nitrogen at 8000 kPag and 30°C
iv. Mixed gas (nitrogen 10 mol%, methane 45 mol%, and eth-
ane 45 mol%, at 3000 kPag and 30°C) (ignore the interaction
parameters)

SOLUTION
i. Isobaric specific heat of ideal gas = 34.74 kJ/(kmol·K)
Compressibility = 0.81698

 ∂ Pr 
 ∂ T  = 2.3698
r Vr

 ∂ Pr 
 ∂ V  = −3.4043
r Tr

i
 ∆CV 
 R  = −0.2418
0
 C P0 − CP 
 = −1.77765
R 
 C P0 − CP 
 = −1.7572
R 

CP = 34.74 + 8.314 * 1.7572 = 49.35 kJ/(kmol·K)


(HYSYS® calculated value is 49.32 kJ/(kmol·K))
ii. Isobaric specific heat of ideal gas = 56.226 kJ/(kmol·K)
Compressibility = 0.77283
 C P0 − CP 
 = −1.6363
R 

CP = 69.83 kJ/(kmol·K)
(HYSYS calculated value is 69.98 kJ/(kmol·K))

© 2010 Taylor & Francis Group, LLC


26 Process engineering and design using visual basic®

iii. Isobaric specific heat of ideal gas = 29.13 kJ/(kmol·K)


Compressibility = 0.98869

 C P0 − CP 
 = − 0.3971
R 

CP = 32.43 kJ/(kmol·K)
(HYSYS calculated value is 32.99 kJ/(kmol·K))

iv. Pseudocritical pressure = 4625.48 kPa


Pseudocritical temperature = 235.88 K
Acentric factor = 0.05354
Compressibility factor = 0.87746 (Note-1)
Isobaric specific heat of methane at 30°C = 35.38 kJ/(kmol·K)
Isobaric specific heat of ethane at 30°C = 53.61 kJ/(kmol·K)
Isobaric specific heat of nitrogen at 30°C = 29.13 kJ/(kmol·K)
Weight fraction of methane = 0.3064
Weight fraction of ethane = 0.5743
Weight fraction of nitrogen = 0.1193
Isobaric specific heat of ideal mixtures = 45.11 kJ/(kmol·K)

 CP0 − CP 
 = − 0.7559
R 

CP = 51.4 kJ/(kmol·K)
(HYSYS calculated value is 49.64 kJ/(kmol·K), Note-1)


Note-1: The compressibility factor is calculated without con-
sidering the interaction parameters. As a result, both the com-
pressibility factor and the isobaric specific heat of real gas
mixtures will be different from the calculated value using the
interaction parameters.

Joule–Thomson coefficient
If we consider a case where volume V1 of a gas at pressure P1 is allowed to
pass to a lower pressure P2, through a semipermeable membrane slowly
and reversibly, the volume at the lower pressure side will increase to V2
(V2 > V1) as shown in Figure 2.3. If we assume that the piston is frictionless
and the system is thermally insulated and there is no heat change (dQ = 0),
then the work done can be defined as

Work done by the high-pressure side = P1V1


Work done by the low-pressure side = P2V2

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 27

V1 P1 V2 P2

Figure 2.3 Joule–Thomson effect.

Now, from the first law of thermodynamics

dU = −dW = P1V1 − P2V2

or

U1 + P1V1 = U2 + P2V2

or

H1 = H2

or

ΔH = 0

This indicates that an adiabatic expansion is also isenthalpic.


However, during this expansion, there will be a change in the temper-
ature, and this variation of temperature is called the Joule–Thomson effect.
The rate of change in temperature with pressure is called the Joule–
Thomson coefficient.

 dT 
µ= (2.56)
 dP  H

Generally, the value of μ is positive, meaning that with a drop in pres-


sure, the temperature will also drop. However, in some cases (hydrogen,
helium at room temperature), the value of μ is negative, meaning that
there will be an increase in temperature with a decrease in pressure.
Now, H = f(T,P)

∂T   ∂T   ∂H  1  ∂H 
  = −     = −  
∂P H ∂H P ∂P T CP  ∂ P  T

or

1  ∂H 
µ=−   (2.57)
CP  ∂ P  T

© 2010 Taylor & Francis Group, LLC


28 Process engineering and design using visual basic®

Again

 ∂H   ∂V  RT 2  ∂ Z 
  = V − T   = −  
∂P  T ∂T  P P  ∂T  P

where
Z = compressibility factor

The general equation of the Joule–Thomson coefficient can be


defined as [1]

RT 2  ∂ Z 
µ=   (2.58)
CP P  ∂ T  P

Example 2.6
Estimate the Joule–Thomson cooling temperature if methane at
10,000 kPag and 20°C is expanded to the atmospheric pressure.

SOLUTION
This can be calculated by reducing the pressure in steps and estimating
the temperature at the end of each step. The isobaric specific heat of a
real gas is calculated using the procedure described in Example 2.5.
The PR EOS is used for this calculation.
Let the number of steps be 50; therefore, the reduction in pressure
at the end of each step will be 200 kPa.
Constant parameters
Critical pressure = 4640.68 kPa
Critical temperature = 190.7 K
Acentric factor = 0.0115

Step 1 calculation
Calculated the value of mi (Equation 2.25i) = 0.3923
Calculated the value of aci (Equation 2.25g) = 247.67
Calculated the value of bi (Equation 2.25d) = 0.0266
Compressibility (Z) = 0.81792
Value of (∂Z/∂T)P = 0.00239
Isobaric heat capacity of a real gas = 49.35 kJ/(kmol·K)
Joule–Thomson coefficient (Equation 2.58) = 0.00342
Drop in temperature (Equation 2.56) = 0.68°C
Temperature after first step = 19.32°C

The above step is repeated 50 times to calculate the final


temperature.

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 29

Table 2.6 ​Joule–Thomson Temperature Calculation for Single Component


Final temperature
Pressure (kPag) (oC)
Initial
Component Initial Final temperature (oC) HYSYS Manual
Methane 10,000 0 20 −32.3 −32.0
Methane 8000 0 −7 −60.5 −61.3
Methane 8000 3000 −10 −39.9 −40.4
Ethane 3000 0 60 29.1 30.1
Propane 2000 0 100 78.6 78.8
i-Butane 1000 0 150 141.6 141.6
Carbon dioxide 5000 0 60 8.1 6.1
Nitrogen 8000 0 −7 −30.3 −30.6
Nitrogen 7000 0 10 −8.2 −8.4
Nitrogen 6000 2000 0 −10.6 −10.7

Calculated final temperature = −32.0°C (Note-1)


(HYSYS calculated temperature = −32.3°C)
Note-1: This calculation is not valid if the liquid phase is detected
at any step.
The results of a few typical calculations along with the HYSYS
calculated values are presented in Table 2.6.

Isobaric specific heat of ideal liquids


Similarly, specific heat at a constant pressure for liquids can be calculated as

CP/R = A + BT + CT2 (2.59)


Constants for the calculation of specific heat of commonly used liquids
are presented in Table 2.7.

Isobaric specific heat of real liquids


The calculation of the isobaric specific heat for a real liquid is identical
to the procedure used for a real gas [4]. The isobaric specific heat of real
hydrocarbon liquid mixtures is calculated as [4]

CP = ∑w Ci pi
(2.60)

where
CP = isobaric specific heat of mixtures
wi = weight fraction of component i
CPi = isobaric specific heat of component i

© 2010 Taylor & Francis Group, LLC


30 Process engineering and design using visual basic®

Table 2.7 Constants for the Calculation of Specific Heat—Liquids


Liquids A B * 103 C * 106
Ammonia 22.626 −100.75 192.71
Aniline 15.819 29.03 −15.80
Benzene −0.747 67.96 −37.78
1,3-Butadiene 22.711 −87.96 205.79
Carbon tetrachloride 21.155 −48.28 101.14
Chlorobenzene 11.278 32.86 −31.90
Chloroform 19.215 −42.89 83.01
Cyclohexane −9.048 141.38 −161.62
Ethanol 33.866 −172.60 349.17
Ethylene oxide 21.039 −86.41 172.28
Methanol 13.431 −51.28 131.13
n-Propanol 41.653 −210.32 427.20
Sulfur trioxide −2.930 137.08 −84.73
Toluene 15.133 6.79 16.35
Water 8.712 1.25 −0.18
Source: A
 dapted from Smith, J.M., Van Ness, H.C., and Abbott, M.M., Introduction to
Chemical Engineering Thermodynamics, 6th ed., McGraw-Hill, New York, 2001.

Enthalpy of gases
The enthalpy of a gas is estimated by estimating the enthalpy of an ideal
gas. The enthalpy of an ideal gas is calculated using the following equation:
T
R CP
0
H =H
T
0
25 +
M ∫
298.15
R
dT (2.61)

where
H T0 = ideal gas enthalpy of formation at temperature T, kJ/kg
0
H 25 = ideal gas enthalpy of formation at 25°C, kJ/kg
R = gas constant, kJ/(kmol·K)
M = molecular weight
CP = isobaric specific heat, kJ/(kg·°C)
T = temperature, K
The ideal gas enthalpy of formation at 25°C is presented in Table 2.8 [4].
The enthalpy of a real gas is estimated by using the following equa-
tion [1]:

HT = H T0 + H R (2.62)

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 31

Table 2.8 Ideal Gas Enthalpy of Formation at 25°C


Heat of formation
Component MW at 25°C (kJ/kg)
Methane 16.043 −4645.1
Ethane 30.070 −2787.5
Propane 44.097 −2373.9
n-Butane 58.123 −2164.2
i-Butane 58.123 −2308.5
n-Pentane 72.150 −2034.1
n-Hexane 86.177 −1937.2
n-Heptane 100.204 −1872.7
n-Octane 114.321 −1827.4
Source: Adapted from Technical Data Book—Petroleum Refining,
4th ed., American Petroleum Institute, Washington,
D.C., 1982.
Note: Values for other components are available in the litera-
ture [4].

where
HT = enthalpy of real gas, kJ/kg
HR = residual enthalpy, kJ/kg

Residual enthalpy is calculated as [1]

HR 1   d ln α(Tr )  
= Z − 1 +  − 1 qI  (2.63)
RT M   d ln(Tr )  

Different equations are used for different EOSs to calculate the value
of α(Tr) are indicated below [1].
For the PR EOS

α (Tr ) = [1 + (0.37464 + 1.54226ω − 0.26992ω 2 )(1 − Tr0.5 )]2 (2.64a)

For the SRK EOS

α (Tr ) = [1 + (0.480 + 1.574 ω − 0.176ω 2 )(1 − Tr0.5 )]2 (2.64b)

where
ω = acentric factor

© 2010 Taylor & Francis Group, LLC


32 Process engineering and design using visual basic®

The value of q is calculated using the following equation [1]:

For the PR EOS

0.457235α(Tr )
q= (2.65a)
0.077796Tr

For the SRK EOS

0.42747α (Tr )
q= (2.65b)
0.08664(Tr )

The value of I is calculated using the following equations [1]:

 Z + β
I = ln  (2.66)
 Z 

where
Z = compressibility

and for the PR EOS

Pr
β = 0.077796 (2.67a)
Tr

For the SRK EOS

Pr
β = 0.08664 (2.67b)
Tr

where
Pr = reduced pressure
Tr = reduced temperature

Enthalpy of gas mixtures


For hydrocarbon gas mixtures, a similar procedure is used to estimate
the enthalpy of gas mixtures with some modifications to the pressure and
temperature parameters [4].
The critical temperature is replaced by a pseudocritical temperature
using the following equation:
n

Tpc = ∑xT
i =1
i ci
(2.68)

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 33

The critical pressure is replaced by a pseudocritical pressure using


the following equation:
n

Ppc = ∑x P
i =1
i ci (2.69)

The mixture acentric factor is calculated as


n

ω= ∑xω
i =1
i i (2.70)

The ideal gas enthalpy of the mixture is calculated as

H0 = ∑x wi H i0 (2.71)

where
Tpc = pseudocritical temperature of the mixture, K
Tci = critical temperature of component i, K
xi = mole fraction of component i
Ppc = pseudocritical pressure of the mixture, kPa
Pci = critical pressure of component i, kPa
ω = mixture acentric factor
ωi = acentric factor of component i
H0 = ideal gas enthalpy of the mixture, kJ/kg
xwi = weight fraction of component i
H i0 = ideal gas enthalpy of component i
n = number of components

Example 2.7
Estimate the enthalpy of methane at 293.15 K and 10,101.3 kPa and
n-butane at 500 K and 5000 kPa. Use the PR EOS for the calculation.

SOLUTION
Enthalpy of methane
The enthalpy of methane at 25°C is –4645.1 kJ/kg.
The change in enthalpy for a temperature change from 298.15 to
293.15 K is calculated using the following equation:
T2

dH =
∫ C dT
T1
P

R  T12 2 T13 3 
=  AT1 (k − 1) + B (k − 1) + C (k − 1)
M 2 3 

© 2010 Taylor & Francis Group, LLC


34 Process engineering and design using visual basic®

where
R = gas constant, kJ/(kmol·K) = 8.314
T1 = initial temperature = 298.15
k = temperature ratio = 0.983
A = constant = 1.702
B = constant = 9.081 * 10−3
C = constant = −2.164 * 10−6
M = molecular weight = 16.043
Differential enthalpy = −10.9 kJ/kg
The enthalpy of ideal methane at 20°C is −4656 kJ/kg

Calculation of residual enthalpy


The compressibility of methane at 10,101.3 kPa and 293.5 K is 0.8179.
(The calculation of compressibility has been discussed before.)

Acentric factor = 0.011498


Critical pressure = 4640.7 kPa
Critical temperature = 190.7 K
Reduced pressure = 2.177
Reduced temperature = 1.573
Value of α(Tr) = 0.82065
Value of q = 3.1376
Value of I = 0.1263
Residual enthalpy = −120.2 kJ/kg
Enthalpy of real gas = −4776.2 kJ/kg
(HYSYS calculated enthalpy = −4795 kJ/kg)

Enthalpy of n-butane
The enthalpy of methane at 25°C is –2164.2 kJ/kg.
The change in enthalpy for a temperature change from 298.15 to
500 K is calculated using the following equation:

T2

dH =
∫ C dT
T1
P

R  T12 2 T13 3 
=  AT1 (k − 1) + B (k − 1) + C (k − 1)
M 2 3 

where
R = gas constant, kJ/(kmol·K) = 8.314
T1 = initial temperature = 298.15
k = temperature ratio = 1.6773
A = constant = 1.935
B = constant = 36.915*10−3
C = constant = −11.402*10−6
M = molecular weight = 58.123

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 35

Differential enthalpy = 427.7 kJ/kg


The enthalpy of ideal methane at 500 K = −1736.5 kJ/kg

Calculation of residual enthalpy


The compressibility of methane at 5000 kPa and 500 K is 0.6908.
(The calculation of compressibility has been discussed before.)

Acentric factor = 0.201


Critical pressure = 3796.6 kPa
Critical temperature = 425.2 K
Reduced pressure = 1.317
Reduced temperature = 1.176
Value of α(Tr) = 0.8895
Value of q = 4.446
Value of I = 0.1188
Residual enthalpy = −89.1 kJ/kg
Enthalpy of real gas = −1825.6 kJ/kg
(HYSYS calculated enthalpy = −1827 kJ/kg)

Entropy of ideal gases


The entropy of an ideal gas at 25°C can be calculated using the following
equation [4]:

0
S25 = 4.1867 * (6.2854B + 1.0734C + 0.43207 D + 0.0206E + 0.001037 F + G)
(2.72)

where
0
S25 = entropy of ideal gas at 25°C, kJ/(kg·K)
B,C,D,E,F,G = constants

The constants used in the above equation are presented in Table 2.9.
The ideal gas entropy at temperature T can be calculated using the
following equation [4]:

T
C P0
ST0 = S25
0
+

298.15
T
dT (2.73)

or

T
R  CT 2 DT −2 
0
S =S + 0
 A ln T + BT + − (2.74)
2  298.15
T 25
M 2

© 2010 Taylor & Francis Group, LLC


36 Process engineering and design using visual basic®

Table 2.9 Constants for the Calculation of Entropy—Ideal Gases


Ideal Gases B C D E F G
Methane 0.53829 −0.21141 0.33928 −1.16432 1.38961 −0.50287
Ethane 0.26461 −0.02457 0.29140 −1.28103 1.81348 0.08335
Propane 0.16030 0.12608 0.18143 −0.91891 1.35485 0.26090
n-Butane 0.09969 0.26655 0.05407 −0.42927 0.66958 0.34597
i-Butane 0.09907 0.23874 0.09159 −0.59405 0.90965 0.30764
n-Pentane 0.11183 0.22852 0.08633 −0.54465 0.81845 0.18319
n-Hexane 0.08971 0.26535 0.05778 −0.45221 0.70260 0.21241
n-Heptane 0.08978 0.26092 0.06345 −0.48471 0.75546 0.15776
n-Octane 0.07780 0.27936 0.05203 −0.46312 0.75074 0.17417
Nitrogen 0.25410 −0.01662 0.01530 −0.03100 0.01517 0.04868
Oxygen 0.22172 −0.02052 0.03064 −0.10861 0.13061 0.14841
Hydrogen 3.19962 0.39279 −0.29345 1.09007 −1.38787 −3.93825
Hydrogen sulfide 0.23745 −0.02323 0.03881 −0.11329 0.11484 −0.04064
Carbon monoxide 0.25284 −0.01540 0.01608 −0.03434 0.01757 0.10562
Carbon dioxide 0.15884 −0.03371 0.14811 −0.96620 2.07383 0.15115
Source: A
 dapted from Smith, J.M., Van Ness, H.C., and Abbott, M.M., Introduction to Chemical
Engineering Thermodynamics, 6th ed., McGraw-Hill, New York, 2001.
Note: Values for other components are available in the literature [4].

where
ST0 = entropy of ideal gas at temperature T, kJ/(kg·K)
0
S25 = entropy of ideal gas at 25°C, kJ/(kg·K)
C P0 = specific heat of ideal gas, kJ/(kg·K)
T = temperature, K
A,B,C,D = constants as per Table 2.4

Entropy of real gases


The entropy of a pure real gas can be calculated using the following equa-
tion [4]:

R  S0 − S 
S = ST0 − (2.75)
M  R 

where
S = entropy of real gas, kJ/(kg·K)
ST0 = entropy of ideal gas at temperature T, kJ/(kg·K)

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 37

R = gas constant, kJ/(kmol·K)


M = gas molecular weight
((S0 − S)/R) = dimensionless effect of pressure on entropy

The dimensionless effect of pressure on entropy can be calculated


as [4]

 S0 − S  R M  f  p 
 R  = − H RT + ln  p  + ln  6.8947  (2.76)
c

where
HR = residual enthalpy, kJ/kg; calculated using the previous method
f/p = fugacity correction
p = pressure, kPa
T = temperature, K
Tc = critical temperature, K
M = molecular weight

Fugacity correction
Fugacity correction can be calculated using the following equation [4]:

f  f ω
0
 f  h  f  0 
ln =  ln  +  ln  −  ln   (2.77)
p  p ωh  p   p 

where (ln(f/p))i can be calculated using the following equation:

i
 f B C D
 ln p  = Z − 1 − ln Z + V + 2V 2 + 5V 5 + E (2.78)
r r r

where
Z = compressibility

Other parameters are calculated using the method described under


specific heat calculation and constants in Table 2.5.

© 2010 Taylor & Francis Group, LLC


38 Process engineering and design using visual basic®

Entropy of hydrocarbon gas mixtures


The entropy of a defined hydrocarbon gas mixture can be calculated using
the following equation [4]:

∑ x 
0 0 R
S = S −
wi i ( xi ln xi ) (2.79)
i =1
M 

where
S0 = entropy of the gas mixture, kJ/(kg·K)
xwi = weight fraction of component i
R = gas constant, kJ/(kmol·K)
M = molecular of the gas mixture = ∑ i xi Mi
xi = mole fraction of component i
Mi = molecular weight of component i

Example 2.8
Estimate the entropy of the following pure components using the
PR EOS.

a. Methane at 10,000 kPag and 20°C


b. Ethane at 4800 kPag and 30°C

SOLUTION
a. Methane at 10,000 kPag and 20°C
Phase = vapor
Entropy at 25°C = 11.629 kJ/(kg·K)
Entropy at 20°C = 11.593 kJ/(kg·K)
Residual enthalpy calculated using the previous method =
−120.2 kJ/kg
Entropy pressure correction = 6.27
8.314
Entropy at 10,000 kPag, 20°C = 11.593 − * 6.27
16.04
= 8.343kJ/(kg·K)
(HYSYS calculated value is 8.733 kJ/(kg·K))
b. Ethane at 4800 kPag and 30°C
Phase = liquid
Entropy at 25°C = 7.626 kJ/(kg·K)
Entropy at 30°C = 7.656 kJ/(kg·K)
Residual enthalpy calculated using the previous method =
−300.8 kJ/kg
Entropy pressure correction = 9.803

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 39

8.314
Entropy at 4800 kPag, 30°C = 7.6558 − * 9.803
30.07

= 4.945 kJ/(kg⋅K )

(HYSYS calculated value is 4.664 kJ/(kg·K))

Viscosities of ideal liquids


The viscosity of pure components depends primarily on the temperature
and can be calculated using the following general equation [5]:

  1 1
µ = exp  A *  −   (2.80)
  T B 

Table 2.10 Constants for the Calculation of Liquid Viscosity—Pure


Components at Low Pressure
Ideal Components A B
Methane 114.14 57.60
Ethane 156.60 95.57
Propane 222.67 133.41
n-Butane 265.84 160.20
i-Butane 302.51 170.20
n-Pentane 313.66 182.48
n-Hexane 362.79 207.09
n-Heptane 436.73 232.53
n-Octane 473.70 251.71
Nitrogen 90.3 46.14
Oxygen 85.68 51.50
Hydrogen 13.82 5.39
Hydrogen sulfide 342.79 165.54
Carbon monoxide 94.06 48.90
Carbon dioxide 578.08 185.24
Methanol 555.30 260.64
Ethanol 686.64 300.88
Propanol 951.04 327.83
Benzene 545.64 265.34
Toluene 467.33 255.24
Water 658.25 283.16
Source: A
dapted from Coulson, J.M. and Richardson, J.F., Chemical
Engineering, Volume 6 (SI Unit), Pergamon Press, USA, 1986.
Note: Values for other components are available in the literature [5].

© 2010 Taylor & Francis Group, LLC


40 Process engineering and design using visual basic®

where
μ = viscosity, cP
A,B = constants as per Table 2.10
T = temperature, K

Viscosity of water
The viscosity of water at low pressure can also be calculated using the
­following equation. The following equation is valid for a temperature
range of 0–150°C.

 609.246 
µ = exp −3.827 +  (2.81)
 138.89 + t 

where
μ = viscosity, cP
t = temperature, °C

Viscosity of ideal hydrocarbon vapors


The viscosity of ideal vapors can be calculated using the following equa-
tion [4]:

1000 ATRB
µ= (2.82)
(1 + (C/TR ) + (D/TR2 ))

where
μ = viscosity, cP
TR = temperature, R
A,B,C,D = constants as per Table 2.11

Liquid viscosity of defined mixtures at low pressure


The liquid viscosities of defined mixtures at low temperature can be cal-
culated using the following equation [4]:
3
 n

µm = 

∑x µ
i =1
i
1/3
i 

(2.83)

where
μm = viscosity of the mixture, cP
μi = viscosity of component i, cP
n = number of components
xi = mole fraction of component i

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 41

Table 2.11 Constants for the Calculation of Vapor Viscosity—Pure


Components at Low Pressure
Ideal Components A B C D
Methane 3.715E−7 5.901E–1 190.3 0
Ethane 1.737E−7 6.799E–1 178.0 0
Propane 1.670E−7 6.861E–1 322.7 −2.67E4
n-Butane 1.528E−7 6.944E–1 409.9 −4.73E4
i-Butane 5.090E−7 5.214E–1 412.2 0
n-Pentane 3.853E−8 8.476E–1 75.10 0
n-Hexane 1.155E−7 7.074E–1 282.8 0
n-Heptane 4.100E–8 8.284E–1 154.4 0
n-Octane 1.806E–8 9.292E–1 99.16 0
Nitrogen 4.588E–7 6.081E–1 98.48 0
Oxygen 7.906E–7 5.634E–1 173.3 0
Hydrogen 1.201E–7 6.850E–1 −1.06 4.536E2
Hydrogen sulfide 3.223E–8 1.017 670.3 −2.08E5
Carbon monoxide 8.133E–7 5.338E–1 170.5 0
Carbon dioxide 1.639E–6 4.600E–1 522.0 0
Water 4.152E–7 6.778E–1 1525.0 −2.4E5
Source: Adapted from Technical Data Book—Petroleum Refining, 4th ed., American Petroleum
Institute, Washington, D.C., 1982.
Note: Values for other components are available in the literature [4].

Vapor viscosity of defined mixtures at low pressure


The viscosity of defined hydrocarbon mixtures at low pressure can be
­calculated using the following equation [4,8]:
n
µi
µm = ∑ n

∑φ
xj (2.84)
i =1
1+ ij
j =1
xi
j≠i

[1 + (µ i/µ j )0.5 ( M j /Mi )0.25 ]2


φ ij = (2.85)
8 [1 + ( Mi /M j )]0.5

where
μm = viscosity of the mixture, cP
μi = viscosity of component i, cP
ϕij = interaction parameter of component i with respect to j
xi = mole fraction of component i
xj = mole fraction of component j
Mi = molecular weight of component i
Mj = molecular weight of component j
n = number of components in the mixture

© 2010 Taylor & Francis Group, LLC


42 Process engineering and design using visual basic®

Example 2.9
Estimate the viscosity of a gas mixture at 0 kPag and 30°C.

Component Mole fraction


Methane 0.9
Ethane 0.02
Carbon monoxide 0.02
Carbon dioxide 0.03
Nitrogen 0.03

SOLUTION
The viscosity of individual components can be calculated as

Constants
Component A B C D Viscosity (cP)
Methane 3.715E−7 0.5901 190.3 0 0.0114
Ethane 1.737E−7 0.6799 178.0 0 0.0095
Carbon monoxide 8.133E−7 0.5338 170.5 0 0.0179
Carbon dioxide 1.639E−6 0.4600 522.0 0 0.0152
Nitrogen 4.588E−7 0.6081 98.48 0 0.0179

The interaction parameters can be calculated as

Interaction Mi Mj ϕij ϕij (xj/xi) Σϕij (xj/xi)


1-2 16.043 30.070 1.4824 0.03294
1-3 16.043 28.010 1.0340 0.02298
1-4 16.043 44.010 1.3500 0.04500
1-5 16.043 28.014 1.0332 0.03444 0.13536
2-1 30.070 16.043 0.6623 29.80284
2-3 30.070 28.010 0.7228 0.72275
2-4 30.070 44.010 0.9526 1.42885
2-5 30.070 28.014 0.7223 1.08341 33.03785
3-1 28.010 16.043 0.9344 42.04872
3-2 28.010 30.070 1.4619 1.46190
3-4 28.010 44.010 1.3561 2.03408
3-5 28.010 28.014 0.9992 1.49880 47.04350
4-1 44.010 16.043 0.6592 19.77659
4-2 44.010 30.070 1.0411 0.69409
4-3 44.010 28.010 0.7328 0.48850
4-5 44.010 28.014 0.7322 0.73224 21.69142
5-1 28.014 16.043 0.9352 28.05564
5-2 28.014 30.070 1.4633 0.97552
5-3 28.014 28.010 1.0008 0.66720
5-4 28.014 44.010 1.3573 1.35726 31.05562

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 43

Calculated viscosity = 0.0119 cP


(HYSYS calculated value is 0.0117 cP)

Thermal conductivity of pure hydrocarbon liquids at low pressure


The thermal conductivity of a pure hydrocarbon liquid varies linearly
with temperature. With known thermal conductivities at two different
temperatures, the value can be calculated at any temperature using linear
interpolation.
The thermal conductivity of common hydrocarbon liquids can be pre-
sented in Table 2.12.
The thermal conductivity of pure hydrocarbon liquid mixtures can
be calculated as

km = ∑ ∑ φφ k
i j
i j ij (2.86)

−1
1 1
k ij = 2  +  (2.87)
 ki k j 

Table 2.12 Thermal Conductivity of Pure Hydrocarbon Liquids


at Low Pressure
Temperature (oC) Thermal conductivity (W/(m.K))
At freezing At normal boiling
Component Freezing Normal boiling temperature temperature
Methane −182.5 −161.5 0.2246 0.1883
Propane −187.7 −42.0 0.2130 0.1289
n-Butane −138.3 −0.5 0.1869 0.1176
n-Pentane −129.7 36.1 0.1782 0.1086
n-Hexane −95.3 68.7 0.1622 0.1042
n-Heptane −90.6 98.4 0.1598 0.1025
n-Octane −56.8 125.7 0.1519 0.0981
Benzene 5.5 80.1 0.1493 0.1265
Toluene −95.0 110.6 0.1615 0.1116
o-Xylene −25.2 144.4 0.1430 0.1040
m-Xylene −47.9 139.1 0.1475 0.1035
p-Xylene 13.3 138.4 0.1326 0.1031
Source: Adapted from Technical Data Book—Petroleum Refining, 4th ed., American Petroleum
Institute, Washington, D.C., 1982.
Note: Values for other components are available in the literature [4].

© 2010 Taylor & Francis Group, LLC


44 Process engineering and design using visual basic®

xiVi
φi =
∑x V
j
j j
(2.88)

∑φ = 1
i
i (2.89)

where
km = thermal conductivity of the mixture, W/(m.K)
ϕi, ϕj = volume fraction of pure components i and j
ki, kj = thermal conductivity of pure components i and j, W/(m.K)
Vi, Vj = molar volume of pure components i and j, m3 per kg·mol
xi, xj = mole fraction of pure components i and j

Example 2.10
Calculate the thermal conductivity of the following liquid mixture at
0 kPag and 30°C.
n-Pentane = 40 vol%
n-Hexane = 30 vol%
n-Heptane = 30 vol%
The following data are available for the calculation:

Component Density (kg/m3) MW Molar volume (m3/kg·mol)


n-Pentane 615.6 72.15 0.1172
n-Hexane 652.4 86.18 0.1321
n-Heptane 673.8 100.2 0.1487

SOLUTION
Thermal conductivity of n-pentane at 30°C = 0.1112 W/(m.K)
Thermal conductivity of n-hexane at 30°C = 0.1179 W/(m.K)
Thermal conductivity of n-heptane at 30°C = 0.1232 W/(m.K)

k11 = k1 = 0.1112
k 22 = k 2 = 0.1179
k 33 = k 3 = 0.1232
k12 = k 21 = 0.1145
k13 = k 31 = 0.1169
k 23 = k 32 = 0.1205
φ 1 = 0.4, φ 2 = 0.3, φ 3 = 0.3

Thermal conductivity of the liquid mixture = 0.1167 W/(m.K)

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 45

Table 2.13 Constants for the Calculation of Hydrocarbon Vapor


Thermal Conductivity
Ideal components A × 103 B × 105 C × 108
Methane 16.77 4.358 1.335
Ethane 8.74 4.343 1.364
Propane 7.54 3.362 1.971
n-Butane 6.91 2.809 2.841
n-Pentane 6.76 2.337 2.778
n-Hexane 6.42 2.214 2.180
n-Heptane 4.95 2.444 1.685
n-Octane 3.59 2.710 1.175
Source: Adapted from Technical Data Book—Petroleum Refining, 4th ed., American
Petroleum Institute, Washington, D.C., 1982.
Note: Values for other components are available in the literature [4].

Thermal conductivity of pure hydrocarbon vapors at low pressure


The thermal conductivity of pure hydrocarbon gas at low pressure can be
calculated using the following equation [4]:

k = A + BT + CT2 (2.90)

where
k = thermal conductivity, Btu/(h.ft.°F)
A,B,C = constants (refer to Table 2.13)
T = temperature, °F

The thermal conductivity of pure hydrocarbon vapor mixtures can be


calculated as [4]
n

∑1
ki
km = n

∑A y
i =1 (2.91)
ij j
yi j =1

where
km = thermal conductivity of the mixture, Btu/(h.ft.°F)
ki = thermal conductivity of component i, Btu/(h.ft.°F)
n = number of components in the mixture
yi, yj = mole fraction of components i and j

0.5 2
  µ i  M j  0.75 (1 + (Si /T ))  
1  (1 + (Sij /T ))
Aij = 1 +      (2.92)
4  µ j  Mi  (1 + (Sj /T ))   1 + (Si /T )

© 2010 Taylor & Francis Group, LLC


46 Process engineering and design using visual basic®

Si, Sj = 1.5 Tb
Sij = SiSj
μi, μj = viscosities of components i and j, cP
Mi, Mj = molecular weight of component i and j
Tb = normal boiling point, R
T = temperature, R

Flash calculation
Flash calculation is probably the most important unit operation to solve
process engineering problems. Any mixture at a defined pressure and
temperature can exist either in a liquid phase or in a vapor phase, or in
two phases. Flash calculation is required to establish the state of the fluid
under a specific condition.

Vapor–liquid equilibrium
When a fluid exists in two phases, the mole fraction of any component in
the vapor and liquid phases differs depending on the vapor–liquid equi-
librium constant. The higher the value of the vapor–liquid equilibrium,
the higher will be the ratio of mole fraction between the vapor and liquid
phases. Mathematically

yi
Ki = (2.93)
xi

where
Ki = vapor–liquid equilibrium constant of component i
yi = mole fraction of component i in vapor phase
xi = mole fraction of component i in liquid phase
Once the value of the equilibrium constant is known, it is easy to do
a flash calculation and the bubble and dew points can be calculated using
the following equations:
Bubble point

∑y = ∑K x
i i i = 1.0 (2.94)

Dew point

∑x = ∑ K
yi
i = 1.0 (2.95)
i

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 47

It is clear from the above analysis that a flash calculation can proceed
only when an accurate equilibrium constant is available. Any flash calcu-
lation is initiated with the preliminary estimated values for equilibrium
constants. A large number of correlations and graphs are available in the
literature and a preliminary estimate can be made using the following
equation [9]:

Pci   T 
Ki = exp 5.37(1 + ω i )  1 − ci   (2.96)
P   T 

where
Ki = vapor–liquid equilibrium constant of component i
Pci = critical pressure of component i
Tci = critical temperature of component i
ωi = acentric factor of component i
P = operating pressure
T = operating temperature

The mole fraction of component i in the liquid and vapor phases can
be estimated as [9]

zi
xi = (2.97)
1 + V (K i − 1)

yi = x i K i (2.98)

An overall material balance can result:

N
zi (K i − 1)
∑ 1 + V(K − 1) = 0
i =1
i
(2.99)

where
zi = overall mole fraction of component i
V = vapor phase mole fraction

Other terms are as defined before.


Using the above equations, the compositions in the vapor and liq-
uid phases can be calculated using a set of equilibrium constants. The
adequacy of the calculation needs to be checked through the calculation
of the fugacity of each component. For the correct equilibrium condition,
the fugacity of each component in both the vapor and liquid phases will
be the same. If the fugacity is different, the equilibrium constants are

© 2010 Taylor & Francis Group, LLC


48 Process engineering and design using visual basic®

to be modified and recalculated. For the PR EOS, the fugacity of each


component in both the liquid and vapor phases is calculated using the
following equation [2]:

fk bk A 
2
∑x a i ik

bk 
ln = (Z − 1) − ln (Z − B) − 
i
− 
xk P b 2 2B  a b
 

 Z + 2.414B 
× ln  (2.100)
 Z − 0.414B 

where

a= ∑∑x x a
i j
i j ij (2.101)

b= ∑x b i i (2.102)

aij = (1 − δ ij ) ai0.5 a 0j .5 (2.103)

δij = interaction parameter, generally determined experimentally


f k = fugacity of component k
Other parameters are as defined in Table 2.1.
Equation 2.100 is solved for both the liquid and vapor phase param-
eters to calculate the fugacity in both phases.

Programming
Calculation of JT effect due to drop in pressure
This program has been developed to estimate the impact of the Joule–
Thomson effect when a gas is expanded through a pressure reduction
unit. The following basis has been used in this estimation:

• The calculation is based on the PR EOS.


• It is assumed that the expansion is adiabatic and not isentropic.
Generally, the temperature drop is larger in isentropic expansion in
comparison to adiabatic expansion.
• This calculation assumes only the vapor phase expansion and does
not perform any enthalpy balance due to a change in phase.

© 2010 Taylor & Francis Group, LLC


Chapter two: Thermodynamics 49

Figure 2.4 Solution of Example 2.6.

• If the liquid phase is detected at any step in the calculation, the


­program generates a note “Note-1: Liquid phase detected. Results may
not be accurate.”
• This calculation is performed using 50 steps and a downstream
­pressure–temperature relationship can be developed from the results.

Checking Example 2.6


The Visual Basic® solution of Example 2.6 is presented in Figure 2.4.

Nomenclature
a acceleration, m/s2
CP heat capacity at constant pressure, kJ/(kg·°C)
CV heat capacity at constant volume, kJ/(kg·°C)
EK kinetic energy
EP potential energy
F force, N
gc acceleration due to gravity, m/s2
H enthalpy, kJ
l displacement, m
K vapor–liquid equilibrium constant
m mass, kg
MW molecular weight

© 2010 Taylor & Francis Group, LLC


50 Process engineering and design using visual basic®

P pressure, kPa
Q heat, kJ
R universal gas constant, kJ/(kmol·K)
S entropy, kJ/(kmol·K)
T temperature, K
U internal energy, kJ
v velocity, m/s
V volume, m3
W work, kNm
z elevation, m
Z compressibility

Greek characters
γ ratio of specific heats
η efficiency
ω acentric factor
μ Joule–Thomson coefficient

References
1. Smith, J.M., Van Ness, H.C., and Abbott, M.M., Introduction to Chemical
Engineering Thermodynamics, 6th ed., McGraw-Hill, New York, 2001.
2. Peng, D.Y. and Robinson, D.B., A two constant equation of state, I.E.C.
Fundamentals, 15, 59–64, 1976.
3. Soave, G., Equilibrium constants from a modified Redlich-Kwong equation
of state, Chemical Engineering Science, 27(6), 1197, 1972.
4. Technical Data Book—Petroleum Refining, 4th ed., American Petroleum
Institute, Washington, D.C., 1982.
5. Coulson, J.M. and Richardson, J.F., Chemical Engineering, Volume 6 (SI Unit),
Pergamon Press, USA, 1986.
6. Perry, R.H. and Green, D., Perry’s Chemical Engineering Handbook, 6th ed.,
McGraw-Hill, Malaysia, 1984.
7. Moran, M.J. and Shapiro, H.N., Fundamentals of Engineering Thermodynamics,
5th ed., John Wiley, USA, 2004.
8. Bromley, A. and Wilke, C.R., Viscosity behavior of gases, Industrial and
Engineering Chemistry Chemical Engineering Science, 43(7), 1641, 1951.
9. Naji, H.S., Conventional and rapid flash calculations for the Soave-Redlich-
Kwong and Peng-Robinson equations of state, Emirates Journal for Engineering
Research, 13(3), 81–91, 2008.

© 2010 Taylor & Francis Group, LLC


References

1 Chapter 1 - Basic mathematics

1. Kreyszig, E., Advanced Engineering Mathematics, 7th ed.,


John Wiley and Sons, New York, 1993.

2. Grossman, S.I., Multivariable Calculus, Linear Algebra


and Differential Equations, 3rd ed., Sunders College
Publishing, 1994.

3. Jain, M.K., Iyengar, S.R.K., and Jain, R.K., Numerical


Methods for Scientific and Engineering Computation, Wiley
Eastern Limited, New Delhi, 1985.
2 Chapter 2 - Thermodynamics

1. Smith, J.M., Van Ness, H.C., and Abbott, M.M.,


Introduction to Chemical Engineering Thermodynamics, 6th
ed., McGraw-Hill, New York, 2001.

2. Peng, D.Y. and Robinson, D.B., A two constant equation


of state, I.E.C. Fundamentals, 15, 59–64, 1976.

3. Soave, G., Equilibrium constants from a modified


Redlich-Kwong equation of state, Chemical Engineering
Science, 27(6), 1197, 1972.

4. Technical Data Book—Petroleum Refining, 4th ed.,


American Petroleum Institute, Washington, D.C., 1982.

5. Coulson, J.M. and Richardson, J.F., Chemical


Engineering, Volume 6 (SI Unit), Pergamon Press, USA,
1986.

6. Perry, R.H. and Green, D., Perry’s Chemical Engineering


Handbook, 6th ed., McGraw-Hill, Malaysia, 1984.

7. Moran, M.J. and Shapiro, H.N., Fundamentals of


Engineering Thermodynamics, 5th ed., John Wiley, USA,
2004.

8. Bromley, A. and Wilke, C.R., Viscosity behavior of


gases, Industrial and Engineering Chemistry Chemical
Engineering Science, 43(7), 1641, 1951.

9. Naji, H.S., Conventional and rapid flash calculations


for the Soave-RedlichKwong and Peng-Robinson equations of
state, Emirates Journal for Engineering Research, 13(3),
81–91, 2008.
3 Chapter 3 - Fluid mechanics

1. American Society of Mechanical Engineers Standard,


Measurement of Fluid Flow in Pipes Using Orifice, Nozzle,
and Venturi.

2. Fluid Meters Their Theory and Application, 6th ed.,


Report of the American Society of Mechanical Engineers
Research Committee on Fluid Meters, 1971.

3. Crane Technical Paper No. 410, Flow of Fluids through


Valves, Fittings, and Pipe, Metric edition—SI Unit, 1995.

4. Miller, R.W., Flow Measurement Engineering Handbook, 2nd


ed., McGraw-Hill, USA, 1989.

5. Perry, R.H. and Green, D., Perry’s Chemical Engineers’


Handbook, 6th ed., McGraw-Hill, Malaysia, 1984.

6. Tuve, G.L. and Sprenkle, R.E., Instruments, 6, 201, 1933.

7. Coulson, J.M. and Richardson, J.F., Chemical


Engineering, 4th ed., Vol. 1, Pergamon Press, Great
Britain, 1990.

8. ISO 5167-2, Measurement of Fluid Flow by Means of


Pressure Differential Devices Inserted in Circular Cross
Section Conduits Running Full, Part 2, Orifice Plate,
International Standard, Switzerland, 2003.

9. ASME B31.3, Process Piping, ASME Code for Pressure


Piping, American Society of Mechanical Engineers, USA,
2002.

10. ASME B16.21, Nonmetallic Flat Gaskets for Pipe Flanges,


American Society of Mechanical Engineers, USA, 2005.

11. ASME B16.5, Pipe Flanges and Flanged Fittings, American


Society of Mechanical Engineers, USA, 2003.

12. McCabe, W.L. and Smith, J.C., Unit Operations of


Chemical Engineering, 3rd ed., McGraw-Hill, Tokyo, 1976.

13. Hooper, W.B., Calculated head loss caused by change in


pipe size, Chemical Engineering, November 7, 89–92, 1988.

14. Hooper, W.B., The two-K method predict head loss in


pipe fittings, Chemical Engineering, August 24, 96–100,
1981.
15. Zenz, F.A., Minimize manifold pressure drop,
Hydrocarbon Processing and Petroleum Refiner, 41(12),
125–130, 1962.

16. Fisher ED full port equal percentage case, Fisher


Catalog-10, USA, pp. 1–73.

17. API RP 14E, Recommended Practice for Design and


Installation of Offshore Production Platform Piping
Systems, 5th ed., American Petroleum Institute, 1991.

18. Massey, B.S., Mechanics of Fluids, 6th ed., Van


Nostrand Reinhold, chap. 12, London, 1989.

19. External Extruded High-Density Polyethylene Coating


System for Pipes, Australian/New Zealand Standard AS/NZS
1518:2002.

20. External Fusion-Bonded Epoxy Coating for Still Pipes,


Australian/New Zealand Standard AS/NZS 3862:2002.

21. Kern, D.Q., Process Heat Transfer, International


edition, McGraw-Hill, Singapore, 1988.

22. Hausen, H., Darstellung des Warmeuberganges in Rohren


durch verallgemeinerte Potenzbeziehungen, Zeitsche, V.D.I.
Beihefte Verfahrenstechnik, No. 4, 1943.

23. Carslaw, H.S. and Jaeger, J.C., Conduction of Heat in


Solids, Oxford University Press, Great Britain, 1959.

24. Parker, J.D., Boggs, J.H., and Blick, E.F.,


Introduction to Fluid Mechanics and Heat Transfer,
Addison-Wesley, Reading, MA, 1969.

25. Hilpert, R., Warmeabgabe von geheizen Drahten und


Rohren, Forsch Gebiete Iingenieurw, 4, 1933.

26. Beggs, H.D. and Brill, J.P., A study of two-phase flow


in inclined pipe, Journal of Petroleum Technology, May,
607–617, 1973.

27. Mukherjee, H. and Brill, J.P., Liquid holdup


correlations for inclined twophase flow, Journal of
Petroleum Technology, May, 1003–1008, 1983.

28. Mukherjee, H. and Brill, J.P., Pressure drop


correlations for inclined twophase flow, Journal of Energy
Resources Technology, 107, December, 549–554, 1985.
29. Gregory, G.A., Mandhane, J., and Aziz, K., Some design
consideration for two-phase flow in pipes, Journal of
Canadian Petroleum Technology, January– March, 65–71, 1975.

30. Bendiksen, K.H., Malnes, D., Moe, R., and Nuland, S.,
The dynamic twofluid model OLGA: Theory and application,
SPE Production Engineering, May, 171–180, 1991.

31. Baker, A., Nielsen, K., and Gabb, A., Pressure loss,
liquid-holdup calculations developed, Oil and Gas Journal,
March 14, 55–59, 1988.

32. Baker, A., Nielson, K., and Gabb, A., Holdup,


pressure-loss calculation confirmed, Oil and Gas Journal,
March 28, 44–49, 1988.

33. Mukherjee, H. and Brill, J.P., Empirical equations to


predict flow patterns in two-phase inclined flow,
International Journal of Multiphase Flow, 11(3), 299–315,
1985.

34. Waard, C. and Lotz, U., Corrosion 93, The NACE Annual
Conference and Corrosion Show, Paper No. 69.

35. CO 2 Corrosion Rate Calculation Model, Norsok


Standard, M-506, Rev2, June 2005.

36. Waard, C., Lotz, U., and Millams, D.E., Corrosion 91,
The NACE Annual Conference and Corrosion Show, Paper No.
577.

37. NACE Standard MR0175-2001, Item No. 21304.

38. Waard, C., Lotz, U., and Dugstad, A., Corrosion 95, The
NACE International Annual Conference and Corrosion Show,
Paper No. 128.
4 Chapter 4 - Heat transfer

1. Kern, D.Q., Process Heat Transfer, International ed.,


McGraw-Hill, Singapore, 1988.

2. Holman, J.P., Heat Transfer, 8th ed., McGraw-Hill, USA,


1997.

3. Rohsenow, W.M. and Hartnett, J.P., Handbook of Heat


Transfer, McGraw-Hill, New York, 1973.

4. Carslaw, H.S. and Jaeger, J.C., Conduction of Heat in


Solids, Oxford University Press, Great Britain, 1959.

5. Andrews, R.V., Solving conductive heat transfer problems


with electricalanalogue shape factors, Chemical Engineering
Progress, 51(2), 67, 1955.

6. Kreyszig, E., Advanced Engineering Mathematics, 7th ed.,


John Wiley and Sons, New York, 1993.

7. Gray, A. and Mathews, G.B., A Treatise on Bessel


Functions and Their Applications to Physics, Macmillan,
London, 1895.

8. Coulson, J.M. and Richardson, J.F., Chemical


Engineering, Vol. 1, 4th ed., Pergamon Press, Great
Britain, 1990.

9. Bird, R.B., Stewart, W.E., and Lightfoot, E.N.,


Transport Phenomenon, International ed., John Wiley and
Sons, USA, 1976.

10. McAdams, W.H., Heat Transmission, 3rd ed., McGraw-Hill,


New York, 1954.

11. Perry, R.H. and Green, D., Perry’s Chemical Engineers’


Handbook, 6th ed., McGraw-Hill, Malaysia, 1985.

12. Parker, J.D., Boggs, J.H., and Blick, E.F.,


Introduction to Fluid Mechanics and Heat Transfer,
Addison-Wesley, Reading, MA, 1969.

13. Holland, F.A., Moores, R.M., Watson, F.A., and


Wilkinson, J.K., Heat Transfer, Heinemann Educational
Books, London, 1970.

14. Chopey, N.P. (Editor), Handbook of Chemical Engineering


Calculations, 3rd ed., McGraw-Hill, New York, 2004.
15. Welty, J.R., Wicks, C.E., and Wilson, R.E.,
Fundamentals of Momentum, Heat and Mass Transfer, 3rd ed.,
John Wiley and Sons, USA, 1984.

16. Standards of the Tubular Exchanger Manufacturers


Association, 8th ed., TEMA Inc, New York, 1999.

17. Perrotin, T. and Clodic, D., Fin Efficiency Calculation


in Enhanced Fin-and-Tube Heat Exchangers in Dry
Conditions, International Congress of Refrigeration,
Washington, DC, 2003.

18. Siegel, R. and Howell, J.R., Thermal Radiation Heat


Transfer, McGraw-Hill, New York, 1981.
5 Chapter 5 - Distillation

1. Treybal, R.E., Mass Transfer Operation, 3rd ed.,


McGraw-Hill International Student Edition, Tokyo, 1980.

2. Coulson, J.M. and Richardson, J.F., Chemical


Engineering, Vol. 6, 6th ed., Pergamon Press, Great
Britain, 1986.

3. McCabe, W.L. and Smith, J.C., Unit Operations of


Chemical Engineering, 3rd ed., McGraw-Hill International
Student Edition, Tokyo, 1976.

4. Kurihara, K., Nakamichi, M., and Kojima, K., Isobaric


vapor-liquid equilibria for methanol + ethanol + water and
the three constituent binary systems, J. Chem. Eng. Data,
38, 446–449, 1993.

5. Smoker, E.H., Analytical determination of plates in


fractioning columns, Trans. Am. Inst. Chem. Eng., 34, 165,
1938.

6. Fair, J.R., How to predict sieve tray entrainment and


flooding, Petro./Chem. Eng., 33, 45, 1961.

7. Chopey, N.P., Handbook of Chemical Engineering


Calculation, 3rd ed., McGrawHill, New York, 2004.

8. Murphree, E.V., Rectifying column calculations with


particular reference to N component mixtures, Ind. Eng.
Chem., 17(7), 747, 1925.

9. Lewis, W.K., Rectification of binary mixtures, Ind. Eng.


Chem., 28, 399, 1936.

10. Couper, J.R. et al., Chemical Process


Equipment—Selection and Design, 3rd ed., Burlington, MA,
Oxford, UK, 2010.

11. Perry, R.H. and Green, D., Perry’s Chemical Engineers’


Handbook, 8th ed., McGraw-Hill, New York, 2008.

12. AIChE Research Committee, Bubble Tray Design Manual,


New York, 1958.

13. Gerster, J.A., Hill, A.B., Hochgraf, N.N., and


Robinson, D.G., Tray Efficiencies in Distillation Columns.
Final Report, University of Delaware, AIChE, 1958.

14. Smith, B.D., Design of Equilibrium Stage Processes,


McGraw-Hill, New York, 1963.

15. Fuller, E.N., Schettler, P.D., and Giddings, J.C., A


new method for the prediction of gas-phase diffusion
coefficients, Ind. Eng. Chem., 58(5), 19, 1966.

16. Wilke, C.R. and Chang, P., Correlation of diffusion


coefficients in dilute solutions, AIChE, 1955.

17. Lockett, M.J., Distillation Tray Fundamentals,


Cambridge University Press, England, 2009.

18. Kister, H.Z., Distillation Design, McGraw-Hill, USA,


1992.

19. Robbins, L.A., Chem. Eng. Prog., May, 87, 1991.

20. Lockett, M.J., Chem. Eng. Prog., 94(1), 60, 1998.

21. Zuiderweg, F.J., Sieve trays—A view on the state of


art, Chem. Eng. Sci., 37(10), 1441, 1982.

22. Lockett, M.J. and Banik, S., Weeping from Sieve Trays,
AIChE Meeting, November, San Francisco, 1984.
6 Chapter 6 - Separators

1. Gas Processors Suppliers Association, GPSA Engineering


Databook, 11th ed. GPSA, SI, Oklahoma, 1998.

2. Perry, R.H., Ed., Chemical Engineers’ Handbook, 5th ed.,


chap. 5, McGraw-Hill Book, Tokyo, 1973.

3. Fabian, P., Cusack, R., Hennessey, P., and Neuman, M.,


Demystifying the selection of mist eliminators, Part I,
Chemical Engineering, November, 148–156, 1993.

4. API Specification 12J, Specification for Oil and Gas


Separators, 7th ed., American Petroleum Institute,
Washington DC, 1989.

5. API Specification 11P, Specification for Packaged


Reciprocating Compressors for Oil and Gas Production
Services, 2nd ed., American Petroleum Institute,
Washington DC, 1989.

6. API RP 521, Guide for Pressure-Relieving and


Depressuring Systems, 4th ed., American Petroleum
Institute, Washington DC, 1997.

7. Design guide, Separations & Mass-transfer Products, ACS


Industries, LP, Houston, USA.

8. Campbell, J.M., Gas Conditioning and Processing, 8th


ed., John M. Campbell and Company, Vol. 2, Oklahoma, 2004.

9. Scott, S.L., Shoham, O., and Brill, J.P., Prediction of


slug length in horizontal, large-diameter pipes, SPE
Production Engineering, August, 335–340, 1989.

10. CO 2 Corrosion Rate Calculation Model, NORSOK M-506,


Revision 1, June, Norway, 1998.
7 Chapter 7 - Overpressure protection

1. API 520, Sizing, Selection, and Installation of


Pressure-Relieving Devices in Refineries, Part-1—Sizing
and Selection, 8th ed., American Petroleum Institute,
Washington, D.C., 2008.

2. API 520, Sizing, Selection, and Installation of


Pressure-Relieving Devices in Refineries,
Part-II—Installation, 4th ed., American Petroleum
Institute, Washington, D.C., 1994.

3. API 521, Pressure-Relieving and Depressuring Systems,


5th ed., American Petroleum Institute, Washington, D.C.,
2007.

4. ASME Section VIII, Rules for Construction of Pressure


Vessels, Division 1, American Society of Mechanical
Engineers, New York, 2003.

5. ASME B31.3, Process Piping, American Society of


Mechanical Engineers, New York, 2002.

6. AS 1271, Safety Valves, Other Valves, Liquid Level


Gauges and Other Fittings for Boiler and Unfired Pressure
Vessels, Australian Standard, Sydney, 1997.

7. API Std 598, Valve Inspection and Testing, 8th ed.,


American Petroleum Institute, Washington, D.C., 2004.

8. Yaws, C.L., Calculate thermal-expansion coefficients,


Chemical Engineering, August 1995.

9. Perry, R.H. and Green, D., Perry’s Chemical Engineers’


Handbook, 6th ed., McGraw-Hill, Malaysia, 1984.

10. Lapple, C.E., Isothermal and adiabatic flow of


compressible fluids, Transactions of AIChE, 39, 1943.

11. Mak, H.Y., New method speeds pressure relief manifold


design, Oil and Gas Journal, November 20, 1978.

12. API Std. 2000, Venting Atmospheric and Low-Pressure


Storage Tanks, 5th ed., American Petroleum Institute,
Washington, D.C., 1998.

13. AS 1940, The Storage and Handling of Flammable and


Combustible Liquids, Australian Standard, Sydney, 1993.

14. Fisher, H.G., DIERS research program on emergency


relief systems, CEP, August, 33–36, 1985.

15. Fauske, H.K., Emergency relief system (ERS) design,


CEP, August, 53–56, 1985.

16. Leung, J.C. and Grolmes, M.A., A generalized


correlation for flashing choked flow of initially
subcooled liquid, AIChE, April, 688–691, 1988.

17. Grolmes, M.A., Leung, J.C. and Fauske, H.K.,


Large-scale experiments of emergency relief systems, CEP,
57–62, 1985.

18. Fauske, H.K. and Leung, J.C., New experimental


technique for characterizing runaway chemical reactions,
CEP, August, 39–46, 1985.

19. Brzustowski, T.A. and Sommer, E.C., Jr., Predicting


radiant heating from flares, Proceeding—Division of
Refining, 53, 865–898, 1973.

20. BS 5345, Selection, Installation and Maintenance of


Electrical Apparatus for Use in Potentially Explosive
Atmospheres (Other than Mining Applications or Explosives
Processing and Manufacture) Part 1: General
Recommendations, 1989.

21. IEC 61508, Functional Safety of


Electrical/Electronics/Programmable Electronic
Safety-related Systems (Part 1 to Part 7).

22. IEC 61511, Functional Safety—Safety Instrumented


Systems for the Process Industry Sector (Part 1 to Part
3).

23. ANSI/ISA—S84.01, Application of Safety Instrumented


Systems for the Process Industries, 1996.
8 Chapter 8 - Glycol dehydration

1. API Specification 12GDU, Specification for Glycol-Type


Gas Dehydration Units, 1st ed., December 15, 1990.

2. Campbell, J.M., Gas Conditioning and Processing, John M.


Campbell and Company, 8th ed., Vol. 2, Oklahoma, 2004.

3. Gas Processors Suppliers Association, GPSA Engineering


Data Book—SI, GPSA, Oklahoma, 1998.

4. Glycol Pumps for the Next Generation, General Product


Information, Rotor-Tech.

5. Glycol Pumps and Accessories, Kimray Inc.

6. AS 3814—2005, Australian Standard, Industrial and


Commercial Gas-Fired Applications.

Figure 8.15 Message box.

You might also like