ebook img

Chemical engineering computation with matlab PDF

629 Pages·2017·18.18 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Chemical engineering computation with matlab

Chemical Engineering Computation with MATLAB® Chemical Engineering Computation with MATLAB® Yeong Koo Yeo MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® software or related products does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular use of the MATLAB® software. CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Taylor & Francis Group Boca Raton, FL 33487-2742 © 2018 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 Printed on acid-free paper International Standard Book Number-13: 978-1-138-03989-6 (Hardback) 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, transmitted, 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. Library of Congress Cataloging-in-Publication Data Names: Yeo, Yeong Koo, author. Title: Chemical engineering computation with MATLAB / Yeong Koo Yeo. Description: Boca Raton : Taylor & Francis, CRC Press, 2017. | Includes bibliographical references. Identifiers: LCCN 2017011618| ISBN 9781138039896 (hardback : acid-free paper) | ISBN 9781315114880 (ebook) Subjects: LCSH: Chemical engineering--Data processing. | MATLAB. Classification: LCC TP184 .Y46 2017 | DDC 660.0285--dc23 LC record available at https://lccn.loc.gov/2017011618 Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Contents Preface ..............................................................................................................................................xv Acknowledgments ..........................................................................................................................xvii Author .............................................................................................................................................xix Chapter 1 Introduction to MATLAB® ...........................................................................................1 1.1 Starting MATLAB® ...........................................................................................1 1.1.1 Entering Commands in the Command Window ...................................1 1.1.2 Help Command ....................................................................................3 1.1.3 Exit from MATLAB® ...........................................................................4 1.2 Operations and Assignment of Variables ...........................................................4 1.2.1 Errors in Input ......................................................................................5 1.2.2 Aborting Calculations ..........................................................................6 1.3 Vectors and Matrices .........................................................................................6 1.3.1 Vectors ..................................................................................................6 1.3.2 Matrices ................................................................................................9 1.3.3 Complex Number ...............................................................................13 1.3.4 Suppression of Screen Output ............................................................14 1.4 Numerical Expressions ....................................................................................14 1.5 Managing Variables .........................................................................................16 1.5.1 clear Command ..............................................................................16 1.5.2 Computational Limitations and Constants .........................................16 1.5.3 whos Command .................................................................................17 1.6 Symbolic Operations .......................................................................................17 1.6.1 Substitution in Symbolic Equations ...................................................18 1.7 M-Files ............................................................................................................19 1.7.1 Script M-Files .....................................................................................19 1.7.2 Adding Comments ..............................................................................20 1.7.3 Function M-Files ................................................................................21 1.8 Functions .........................................................................................................22 1.8.1 Built-In Functions ..............................................................................22 1.8.2 User-Defined Functions ......................................................................23 1.9 Loops ...............................................................................................................24 1.9.1 if Statement ......................................................................................24 1.9.2 for Loop ...........................................................................................25 1.10 Graphics ...........................................................................................................25 1.10.1 Plotting with ezplot ........................................................................25 1.10.2 Modifying Graphs ..............................................................................25 1.10.3 Graphing with plot ..........................................................................27 1.10.4 Plotting Multiple Curves ....................................................................28 1.10.5 Three-Dimensional Plots ....................................................................29 1.11 Ordinary Differential Equations ......................................................................30 1.12 Examples .........................................................................................................31 1.12.1 Population Growth Model ..................................................................31 1.12.2 Random Fibonacci Sequence .............................................................32 1.12.3 Generation of a 3D Object..................................................................33 Bibliography ...............................................................................................................34 v vi Contents Chapter 2 Numerical Methods with MATLAB® .........................................................................35 2.1 Linear Systems ................................................................................................35 2.2 Nonlinear Equations ........................................................................................40 2.2.1 Polynomial Equations ........................................................................40 2.2.2 Zeros of Nonlinear Equations.............................................................41 2.2.2.1 Bisection Method ................................................................41 2.2.2.2 False Position Method ........................................................41 2.2.2.3 Newton’s Method ................................................................41 2.2.2.4 Secant Method ....................................................................41 2.2.2.5 Muller’s Method .................................................................41 2.2.2.6 Newton’s Method for Nonlinear Systems ...........................42 2.2.2.7 Fixed-Point Iteration Method for Nonlinear Systems.........42 2.3 Regression Analysis .........................................................................................47 2.3.1 Introduction to Statistics .....................................................................47 2.3.2 Generation of Random Numbers ........................................................50 2.3.3 Linear Regression Analysis ................................................................50 2.3.4 Polynomial Regression Analysis ........................................................52 2.3.5 Transformation of Nonlinear Functions to Linear Functions .............53 2.4 Interpolation ....................................................................................................60 2.4.1 Polynomial Interpolation ....................................................................60 2.4.2 Use of the Function polyfit .................................................................62 2.4.3 Cubic Spline Interpolation .................................................................64 2.4.4 Interpolation in One Dimension .........................................................65 2.4.5 Interpolation in Multidimension .........................................................67 2.5 Optimization ....................................................................................................69 2.6 Differentiation and Integration ........................................................................70 2.6.1 Differentiation ....................................................................................70 2.6.2 Integration ..........................................................................................72 2.6.2.1 Definite Integral ..................................................................72 2.6.2.2 Multiple Integrals ................................................................74 2.7 Ordinary Differential Equations ......................................................................75 2.7.1 Initial-Value Problems ........................................................................75 2.7.2 Stiff System ........................................................................................77 2.7.3 Boundary-Value Problems ..................................................................84 2.8 Partial Differential Equations ..........................................................................87 2.8.1 Classification of Partial Differential Equations ..................................87 2.8.1.1 Classification by Order .......................................................87 2.8.1.2 Classification by Linearity ..................................................87 2.8.1.3 Classification of Linear 2nd-Order Partial Differential Equations ............................................................................88 2.8.1.4 Classification by Initial and Boundary Conditions .............88 2.8.2 Solution of 1st-Order Parabolic/Elliptic Partial Differential Equations Using pdepe .......................................................................88 2.9 Historical Development of Process Engineering Software .............................91 Problems .....................................................................................................................93 References ................................................................................................................101 Chapter 3 Physical Properties ...................................................................................................103 3.1 Water and Steam ............................................................................................103 3.1.1 Division of Pressure–Temperature Range ........................................103 Contents vii 3.1.2 Property Equations ...........................................................................104 3.1.2.1 Parameters and Auxiliary Equations .................................104 3.1.2.2 Basic Equations for Region 1 ...........................................104 3.1.2.3 Basic Equations for Region 2 ...........................................105 3.1.2.4 Basic Equations for Region 3 ...........................................105 3.1.2.5 Basic Equations for Region 4 ...........................................105 3.1.2.6 Basic Equations for Region 5 ...........................................106 3.1.3 Properties of Saturated Steam ..........................................................110 3.2 Humidity ........................................................................................................113 3.2.1 Relative Humidity ............................................................................113 3.2.2 Absolute Humidity ...........................................................................114 3.3 Density of Saturated Liquids .........................................................................115 3.3.1 COSTALD Method ..........................................................................117 3.4 Viscosity ........................................................................................................118 3.4.1 Viscosity of Liquids..........................................................................118 3.4.2 Viscosity of Gases ............................................................................120 3.5 Heat Capacity ................................................................................................121 3.5.1 Heat Capacity of Liquids ..................................................................121 3.5.1.1 Polynomial Correlation .....................................................121 3.5.1.2 Rowlinson/Bondi Method .................................................123 3.5.2 Heat Capacities of Gases ..................................................................123 3.6 Thermal Conductivity ....................................................................................125 3.6.1 Thermal Conductivities of Liquids ...................................................125 3.6.2 Thermal Conductivities of Gases .....................................................126 3.7 Surface Tension .............................................................................................128 3.8 Vapor Pressure ...............................................................................................132 3.8.1 Antoine Equation ..............................................................................132 3.8.1.1 Extended Antoine Equation ..............................................132 3.8.2 Wagner Equation ..............................................................................134 3.8.3 Hoffmann–Florin Equation ..............................................................135 3.8.4 Rarey/Moller Equation .....................................................................135 3.9 Enthalpy of Vaporization ...............................................................................137 3.9.1 Watson Equation ...............................................................................137 3.9.2 Pitzer Correlation .............................................................................138 3.9.3 Clausius–Clapeyron Equation ..........................................................139 3.10 Heat of Formation for Ideal Gases ................................................................140 3.11 Gibbs Free Energy .........................................................................................142 3.12 Diffusion Coefficients ....................................................................................143 3.12.1 Liquid-Phase Diffusion Coefficients ................................................143 3.12.2 Gas-Phase Diffusion Coefficients .....................................................144 3.13 Compressibility Factor of Natural Gases .......................................................145 Problems ...................................................................................................................147 References ................................................................................................................148 Chapter 4 Thermodynamics ......................................................................................................151 4.1 Equation of State ...........................................................................................151 4.1.1 Virial State Equation ........................................................................151 4.1.2 Lee–Kesler Equation ........................................................................153 4.1.3 Cubic Equations of State ..................................................................155 viii Contents 4.2 Thermodynamic Properties of Fluids ............................................................158 4.2.1 Enthalpy Change ..............................................................................158 4.2.2 Departure Function ...........................................................................158 4.2.2.1 Departure Function from the Virial Equation of State ......159 4.2.2.2 Departure Function from the VDW (van der Waals) Equation of State ...............................................................159 4.2.2.3 Departure Function from the RK (Redlich–Kwong) Equation of State ...............................................................159 4.2.2.4 Departure Function from the SRK (Soave–Redlich– Kwong) Equation of State ................................................160 4.2.2.5 Departure Function from the PR (Peng–Robinson) Equation of State ...............................................................160 4.2.3 Enthalpy of Mixture .........................................................................164 4.3 Fugacity Coefficient ......................................................................................168 4.3.1 Fugacity Coefficients of Pure Species ..............................................168 4.3.1.1 Fugacity Coefficient from the Virial Equation of State ....168 4.3.1.2 Fugacity Coefficient from the van der Waals Equation of State ..............................................................................168 4.3.1.3 Fugacity Coefficient from the Redlich–Kwong Equation of State ...............................................................168 4.3.1.4 Fugacity Coefficient from the Soave–Redlich–Kwong and Peng–Robinson Equations of State ............................168 4.3.1.5 Fugacity Coefficient from Experimental Data ..................169 4.3.2 Fugacity Coefficient of a Species in a Mixture ................................171 4.3.2.1 Fugacity Coefficient from the Virial Equation of State ......................................................................171 4.3.2.2 Fugacity Coefficient from the Cubic Equations of State .........................................................................171 4.3.2.3 Fugacity Coefficient from the van der Waals Equation of State ..............................................................................171 4.4 Vapor Pressure ...............................................................................................173 4.4.1 Antoine Equation ..............................................................................173 4.4.2 Riedel Equation ................................................................................174 4.4.3 Harlecher–Braun Equation ...............................................................174 4.5 Activity Coefficient .......................................................................................176 4.5.1 Activity Coefficient Models .............................................................179 4.5.1.1 Wilson Equation................................................................179 4.5.2 van Laar Equation ............................................................................179 4.5.3 Activity Coefficients by the Group Contribution Method ................180 4.5.3.1 UNIQUAC Method ...........................................................180 4.5.3.2 UNIFAC Method ..............................................................181 4.6 Vapor–Liquid Equilibrium .............................................................................185 4.6.1 Vapor–Liquid Equilibrium by Raoult’s Law ....................................185 4.6.2 Vapor–Liquid Equilibrium by Modified Raoult’s Law ....................188 4.6.2.1 Flash Calculations .............................................................192 4.6.3 Vapor–Liquid Equilibrium Using Ratio of Fugacity Coefficients .............................................................................195 4.6.3.1 Dew-Point and Bubble-Point Calculations .......................195 4.6.3.2 Flash Calculations .............................................................199 4.7 Vapor–Liquid–Liquid Equilibrium ................................................................203 4.7.1 Bubble-Point Calculations ................................................................204 Contents ix 4.7.2 Dew-Point Calculations ....................................................................204 4.7.3 Isothermal Flash Calculations in the Two-Phase Region .................205 Problems ...................................................................................................................207 References ................................................................................................................210 Chapter 5 Fluid Mechanics .......................................................................................................213 5.1 Laminar Flow ................................................................................................213 5.1.1 Reynolds Number .............................................................................213 5.1.2 Flow in a Horizontal Pipe .................................................................214 5.1.3 Laminar Flow in a Horizontal Annulus ............................................215 5.1.4 Vertical Laminar Flow of a Falling Film ..........................................217 5.1.5 Falling Particles ................................................................................219 5.2 Friction Factor ...............................................................................................221 5.3 Flow of Fluids in Pipes ..................................................................................225 5.3.1 Friction Loss .....................................................................................225 5.3.2 Equivalent Length of Various Fittings and Valves ............................231 5.3.3 Excess Head Loss .............................................................................231 5.3.4 Pipe Reduction and Enlargement .....................................................232 5.3.5 Overall Pressure Drop ......................................................................234 5.3.6 Pipeline Network ..............................................................................237 5.4 Flow through Tank .........................................................................................242 5.4.1 Open Tank ........................................................................................242 5.4.2 Enclosed Tank ..................................................................................243 5.5 Flow of Non-Newtonian Fluid .......................................................................245 5.5.1 Velocity Profile .................................................................................245 5.5.2 Reynolds Number .............................................................................247 5.5.3 Friction Factor ..................................................................................248 5.6 Compressible Fluid Flow in Pipes .................................................................250 5.6.1 Critical Flow and the Mach Number ................................................250 5.6.2 Compressible Isothermal Flow .........................................................250 5.7 Two-Phase Flow in Pipes ...............................................................................254 5.7.1 Flow Patterns ....................................................................................254 5.7.2 Pressure Drop ...................................................................................255 5.7.3 Corrosion and Erosion ......................................................................257 5.7.4 Vapor–Liquid Two-Phase Vertical Downflow ..................................260 5.7.5 Pressure Drop in Flashing Steam Condensate Flow ........................260 5.8 Flow through Packed Beds ............................................................................261 Problems ...................................................................................................................263 References ................................................................................................................265 Chapter 6 Chemical Reaction Engineering ...............................................................................269 6.1 Reaction Rates ...............................................................................................269 6.1.1 Reaction Rate Constant ....................................................................269 6.1.1.1 Estimation of Reaction Order and Rate Constant Using Experimental Data ..................................................270 6.1.2 Reaction Equilibrium .......................................................................272 6.1.3 Reaction Conversion ........................................................................273 6.1.3.1 Estimation of Reaction Rate Parameters Using Conversion ........................................................................274 6.1.4 Series Reactions ...............................................................................275

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.