-
Notifications
You must be signed in to change notification settings - Fork 1
/
Lectures.tex
3386 lines (2665 loc) · 102 KB
/
Lectures.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% Created 2016-06-01 Wed 21:34
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[version=3]{mhchem}
\usepackage[numbers,super,sort&compress]{natbib}
\usepackage{natmove}
\usepackage{url}
\usepackage{minted}
\usepackage{underscore}
\usepackage[linktocpage,pdfstartview=FitH,colorlinks,
linkcolor=blue,anchorcolor=blue,
citecolor=blue,filecolor=blue,menucolor=blue,urlcolor=blue]{hyperref}
\usepackage{attachfile}
\usepackage{siunitx}
\usepackage[left=1in, right=1in, top=1in, bottom=1in, nohead]{geometry}
\geometry{margin=1.0in}
\usemintedstyle{emacs}
\newminted{python}{fontsize=\normalsize}
\usepackage{framed,color}
\definecolor{shadecolor}{rgb}{1.0,0.8,0.3}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0.5pt}
\lfoot{\today}
\cfoot{\copyright\ 2016 W.\ F.\ Schneider}
\rfoot{\thepage}
\author{William F. Schneider}
\date{\today}
\title{Lecture Notes for CBE 20255}
\begin{document}
\tableofcontents
\begin{options}
\end{options}
\section{Revised order}
\label{sec-1}
\begin{itemize}
\item variables
\item mass balances, single phase, mixtures, \ldots{}
\begin{itemize}
\item systems of linear equations
\end{itemize}
\item energy balances, single phase, mechanical, \ldots{}
\item single component, two-phase
\item two-component, two-phase, ideal
\item reactions
\item two-component, two-phase, non-ideal
\end{itemize}
\section{Intro to Chemical Engineering}
\label{sec-2}
\begin{enumerate}
\item Pop quiz
\begin{enumerate}
\item Which weighs more, the Earth or the moon?
\item Mix together 100 mL \ce{H2O} and 50 mL alcohol. What's the final volume?
\item Add 10 g Fe ball at 100 C to 10 g H2O at 20 C. What's the final temperature?
\item My pool holds 20,000 gal of \ce{H2O}. Pump circulates at 10 gpm. How
long does it take for all the \ce{H2O} to pass through the filter?
(Depends on whether it recirculates!)
\end{enumerate}
\item Instructor
\item Students
\item Syllabus
\item Assignment: Read Chapter 1
\end{enumerate}
\section{Introduction to Engineering Calculation}
\label{sec-3}
\subsection{Objectives}
\label{sec-3-1}
\begin{enumerate}
\item unit conversions
\item SI, cgs, English systems
\item sig figs
\item Is my answer reasonable?
\item Basic stats
\item Data fitting
\end{enumerate}
\subsection{Units and dimensions}
\label{sec-3-2}
\begin{itemize}
\item Engineering always deal with quantifiable, computable things.
\item Anything we can quantify has a \textbf{value} (number) and a \textbf{unit} (number of what? meters, bananas, bits, seconds)
\item A \textbf{dimension} is a property of a quantity, like \emph{length}, \emph{time}, \emph{speed} = \emph{length} / \emph{time}, \emph{density} = \emph{mass} / \emph{volume}. Most physical quantities have a dimension (other than pesky dimensionless quantities!).
\item Quantities of the \textbf{same dimension} can be added or subtracted. First they have to be put into the \textbf{same units}.
\end{itemize}
\[\boxed{\SI{3}{cm}+\SI{43}{mm} = \SI{30}{mm} + \SI{43}{mm} = \SI{73}{mm}} \]
\begin{itemize}
\item Quantities of different dimension can be multiplied or divided and carry the combined dimension
\end{itemize}
\[\boxed{ \SI{44}{m} / \SI{11}{s} = \SI[per-mode=symbol]{4}{\m\per\s}} \]
\begin{itemize}
\item Units \emph{not welcome} inside transcendental functions, sin, cos, ln, \ldots
\item Equations must be \emph{dimensionally homogeneous}: all additive terms on either side of an equality must have the same units
\item \textbf{ALWAYS} carry units in engineering computations
\end{itemize}
\subsection{Systems of units}
\label{sec-3-3}
\begin{itemize}
\item Base units
\end{itemize}
\begin{center}
\begin{tabular}{llll}
\hline
Dimension & SI & cgs & English\\
\hline
Length & m & cm & in, ft, mi\\
Mass & kg & g & lb$_{\text{m}}$\\
Time & s & s & s\\
Temperature & K & K & F\\
Current & A & A & \\
Light intensity & cd & cd & \\
\hline
\end{tabular}
\end{center}
\begin{itemize}
\item Multiplicative factors: T, G, M, k, c, d, m, $\mu$, n, f
\item Important chemical eng. derived units
\end{itemize}
\begin{center}
\begin{tabular}{llll}
\hline
Volume & liter & L & 1000 cm$^{\text{3}}$\\
Force & Newton & N & 1 kg m/s$^{\text{2}}$\\
& dyne & & 1 g cm/s$^{\text{2}}$\\
Energy/Work & Joule & J & 1 N m = 1 kg m$^{\text{2}}$/s$^{\text{2}}$\\
& erg & & 1 dyne cm = 1 g cm$^{\text{2}}$/s$^{\text{2}}$\\
& calorie & cal & 4.184 J\\
& Btu & & 1 Btu = 1055.05585 J\\
Power & Watt & W & 1 J/s\\
& Horsepower & hp & 1 hp = 745.7 W\\
Pressure & Pascal & Pa & 1 N/m$^{\text{2}}$ = 1 J/m$^{\text{3}}$\\
& bar & & 10$^{\text{5}}$ Pa\\
& atmosphere & atm & 1 atm = 1.01325 bar\\
& torr & torr & 1/760 atm\\
\hline
\end{tabular}
\end{center}
\begin{itemize}
\item Inside book cover has many useful conversions
\item Fun facts: 1 L of \ce{H2O} has a mass of 1 kg or about 2.2 lb$_{\text{m}}$. What about a liter of gasoline?
\item Fun facts: 1 Btu is amount of heat released in burning 1 4 in wood match, or heat needed to raise the temperature of 1 lb$_{\text{m}}$ water by 1$^{\^{}}$ F. ``Horsepower'' used by Watt to compare the power output of a draft horse to his steam engine. Definitions abound!
\item Pain in the neck to go between systems of units. Need conversion factors. E.g,. 1 lb$_{\text{m}}$ = 453.5932 g. 1 in = 2.54 cm. Unless \emph{forced} otherwise, use SI!
\end{itemize}
\subsection{Unit conversions}
\label{sec-3-4}
\begin{itemize}
\item Conversion factors are ratios
\end{itemize}
\[ \boxed{\SI[per-mode=fraction]{4}{\m\per\s} * \SI[per-mode=fraction]{100}{\cm\per\m} = \SI[per-mode=fraction]{400}{\cm\per\s}} \]
\begin{itemize}
\item Conversion factors can be ganged. Example: show that
\end{itemize}
\[ \boxed{\SI{1.00}{\cm\per\s\squared} = \SI{9.95e9}{\km\per year\squared}} \]
\subsection{Dimensional homogeneity}
\label{sec-3-5}
\begin{framed}
\noindent As you will learn in Thermodynamics, the internal energy \(U\) is related to other thermodynamic quantities by the relation
\begin{equation}
U = T S - P V + \mu N
\end{equation}
\noindent What are units on the entropy, \(S\)? Chemical potential, \(\mu\)? What does this say about the dimensionality of pressure?
\end{framed}
\begin{framed}
\noindent The Schr\"{o}dinger equation is the fundamental equation of quantum mechanics:
\begin{equation}
-\frac{\hbar^{2}}{2 m} \frac{\partial^{2}\psi}{\partial x^{2}} + V(x) \psi = E \psi
\end{equation}
\(E\) has units of energy and \(m\) units of mass. What are the units on \(V(x)\)? \(\hbar\)? \(\psi(x)\)?
\end{framed}
\subsection{Mass, force, weight}
\label{sec-3-6}
\begin{itemize}
\item \emph{mass} of an object is an intrinsic property, resistance to an applied force
\item Newton's 3rd Law
\end{itemize}
\[\boxed{F = m a } \]
\begin{itemize}
\item English force units messy
\end{itemize}
\[\boxed{\SI{1}{lb_{f}}=\SI{32.174}{lb_{m} ft\per\s\squared}} \]
\begin{itemize}
\item \emph{weight} is force exerted by a gravitational field on a mass
\end{itemize}
\[ \boxed{w = m g} \]
\begin{itemize}
\item \emph{g} depends on the planet you are standing on, as well as where you are standing
\end{itemize}
\begin{eqnarray*}
g &= & \SI{9.8066}{\m\per\s\squared}\\
& = & \SI{32.174}{ft\per\s\squared}
\end{eqnarray*}
\begin{framed}
\noindent Water has a density of \( \SI{62.4}{lb_{m}\per ft\cubed}\). How much does 2 ft$^{3}$ of water weigh on the earth? On the moon (\(g = \SI{1.62519}{\m\per\s\squared})?
\end{framed}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
earth = 2 * 62.4 * 32.174 * (1./32.174)
moon = earth * 1.62519/9.8066
print('earth:',earth,'lbf')
print('moon:',moon,'lbf')
\end{minted}
\begin{verbatim}
earth: 124.80000000000001 lbf
moon: 20.682368201007485 lbf
\end{verbatim}
\subsection{Numerical calculations}
\label{sec-3-7}
\subsubsection{Scientific notation, significant figures, precision}
\label{sec-3-7-1}
\begin{itemize}
\item Significant figures imply a precision
\item \emph{Always} report numbers with reasonable significant figures.
\item Examples of adding and multiplying with sig figs.
\item Round to even number: 1.35 to 1.45 all round to 1.4.
\end{itemize}
\subsubsection{Validating results}
\label{sec-3-7-2}
\begin{itemize}
\item Does the result make physical sense?
\item Do a ballpark estimate.
\item Back-substitute
\end{itemize}
\subsubsection{Sources of error}
\label{sec-3-7-3}
\begin{itemize}
\item Few, if anything, can be measured exactly. Processes have intrinsic variability
\item CSTR example: flow rate may fluctuate, temperature fluctuate, slightly inhomogeneous. So do measurements (thermocouple). Best we can do is estimate the ``truth.''
\begin{itemize}
\item random error
\item systematic error
\item Show random scatter, systematic drift, oscillation
\end{itemize}
\end{itemize}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
import numpy as np
import matplotlib.pyplot as plt
x = np.arange(40.)
sigma = 1.
T = 25. + sigma*np.random.randn(40)
T1 = 20. + .2 * x + sigma*np.random.randn(40)
T2 = 25. + 4. * np.sin(x/4.) + sigma*np.random.randn(40)
plt.subplot(311)
plt.scatter(x,T)
plt.ylim(15,35)
plt.xlim(0,40)
plt.ylabel('Temperature (C)')
plt.subplot(312)
plt.scatter(x,T1)
plt.ylim(15,35)
plt.xlim(0,40)
plt.ylabel('Temperature (C)')
plt.subplot(313)
plt.scatter(x,T2)
plt.ylim(15,35)
plt.xlim(0,40)
plt.xlabel('Sample (hour)')
plt.ylabel('Temperature (C)')
plt.savefig('./figs/random.png')
\end{minted}
\includegraphics[width=.9\linewidth]{./figs/random.png}
\subsubsection{Sample mean}
\label{sec-3-7-4}
\begin{itemize}
\item \emph{sample mean} to estimate truth
\end{itemize}
\[\boxed{\bar{X}=\sum_{1}^{n}X_{i}} \]
\subsubsection{Measures of scatter}
\label{sec-3-7-5}
\begin{itemize}
\item \emph{Range}
\item \emph{Sample variance}
\end{itemize}
\[\boxed{s_{X}^{2}=\frac{1}{N-1}\sum_{1}^{n}(X_{i}-\bar{X})^{2}}\]
\begin{itemize}
\item \emph{Standard deviation} has same units as \emph{X}
\end{itemize}
\[\boxed{s_{x}=\sqrt{s_{X}^{2}}} \]
\begin{itemize}
\item If a random variable is Gaussian, about 2/3 of measurements are within \(s_{x}\) of the mean, 95\% within \(2s_{x}\), 99\% within \(3s_{x}\).
\item Example 2.5.2
\end{itemize}
\begin{framed}
\noindent QA on pigment. Let \(Y\) be the number of batches that fail QA out of 500 in a week. If process is shutdown for maintenance if \(Y > \bar{Y} + 3 S_{Y}\), how many bad batches are required for a shutdown?
\end{framed}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
import numpy as np
import matplotlib.pyplot as plt
Week = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])
Y = np.array([17, 27, 18, 18, 23, 19, 18, 21, 20, 19, 21, 18 ])
plt.scatter(Week,Y)
plt.ylim(0,30)
plt.xlabel('Week')
plt.ylabel('Fails out of 500')
plt.savefig('./figs/QA.png')
N = Y.size
Sum = np.sum(Y)
Average = Sum/N
Variance = np.sum((Y - Average)**2)/(N-1)
StdDev = Variance**0.5
print('N Sum Average Variance Std. Dev')
print("{0:3d} {1:4d} {2:5.2f} {3:5.2f} {4:5.2f}".format(N,Sum,Average,Variance,StdDev))
Shutdown = Average + 3 * StdDev
print('Shutdown if Y > {0:5.2f}'.format(Shutdown))
\end{minted}
\begin{verbatim}
N Sum Average Variance Std. Dev
12 239 19.92 7.90 2.81
Shutdown if Y > 28.35
\end{verbatim}
\includegraphics[width=0.5\textwidth]{./figs/QA.png}
\subsection{Process data modeling}
\label{sec-3-8}
\begin{itemize}
\item Often interested in the relationship between two correlated variables. E.g. a correlation curve between a thermocouple resistance and a temperature. An optical density and a concentration.
\item \emph{Linear regression} to fit linear data (Appendix A); minimizes \emph{residuals} between data and a fit line
\item \(r^{2}\) measures fraction of variance in \emph{y} ``explained'' by variance in \emph{x}; 1 is best, 0 is worst
\end{itemize}
\[ r^{2} = 1. - \frac{\sum \text{res}_\text{lg}^{2}}{\sum \text{res}_\text{null}^{2}} \]
\begin{itemize}
\item Linearizing data (e.g. Arrhenius plot). (\emph{Danger}: Error can be scewed by linearizing. Non-linear regression a good alternative.)
\end{itemize}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
import numpy as np
import matplotlib.pyplot as plt
from scipy import stats
EHxy = [ 144,144, 132, 132, 116, 116, 190, 190, 173, 173, 111, 111, 91, 91, 207, 207, 199, 199, 110, 110, 83, 83]
RDxy = [152, 150, 141, 134, 117, 117, 204, 202, 184, 183, 123, 118, 94, 96, 225, 224, 213, 213, 114, 115, 89, 93]
m, b, r, p, e = stats.linregress(EHxy,RDxy)
print("Slope Intercept r**2")
print(m,b,r**2)
nu = np.linspace(80,230)
fit = m * nu + b
plt.scatter(EHxy,RDxy)
plt.plot(nu,fit)
plt.xlim((50,250))
plt.ylim((50,250))
plt.xlabel('Effective harmonic frequencies (cm$^{{-1}}$)')
plt.ylabel('Relaxed displacement frequencies (cm$^{{-1}}$)')
plt.savefig('./figs/freq.png')
\end{minted}
\begin{verbatim}
Slope Intercept r**2
1.08962211596 -4.08654658558 0.995318037198
\end{verbatim}
\includegraphics[width=0.5\textwidth]{./figs/freq.png}
\newpage
\section{Processes and process variables}
\label{sec-4}
\subsection{Learning objectives}
\label{sec-4-1}
\begin{itemize}
\item density
\item flow rates
\item composition
\item pressure
\end{itemize}
\subsection{Mass, volume, density}
\label{sec-4-2}
\begin{itemize}
\item mass, volume are \emph{extensive} quantities
\item \emph{density} ($\rho$) = mass / volume is \emph{intensive}, characteristic of a substance at some \emph{T} and \emph{P}
\item tabulated in common handbooks, allows us to convert between \emph{m} and \emph{V}
\item \emph{specific gravity} is density relative to some reference, commonly \ce{H2O} at \SI{4}{\celsius}
\end{itemize}
\begin{equation}
\rho_{\ce{H2O}}(\SI{4}{\celsius}) = \SI{1.00}{\gram\per\cm\cubed} = \SI{62.43}{lb_{m}\per ft\cubed}
\end{equation}
\begin{itemize}
\item mass is independent of \emph{T}, volume changes with \emph{T}, therefore so does $\rho$
\item can find tabulations of \(\rho(T)\), \(V(T)\), or \emph{coefficient of thermal expansion}
\end{itemize}
\begin{equation}
\alpha(T) = \frac{1}{V}\left ( \frac{\partial V}{\partial T} \right )_{P}
\end{equation}
\begin{itemize}
\item \textbf{Example 3.1.1}
\end{itemize}
\begin{quote}
Specific gravity of Hg at \SI{20}{\celsius} is 13.456. Density? Volume of 215 kg?
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
rho = 13.546 * 62.43
print('Density = ',rho,' lbm/ft^3')
print('Volume = mass/density')
volume = 215 * (1./0.454) / rho
print('Volume =',volume,'ft3')
\end{minted}
\begin{verbatim}
Density = 845.67678 lbm/ft^3
Volume = mass/density
Volume = 0.5599873298381516 ft3
\end{verbatim}
\hline
\begin{itemize}
\item \textbf{Example 3.1.2}
\end{itemize}
\begin{quote}
(a) What is volume of 215 kg Hg at \SI{100}{\celsius}?
(b) What is change in height between 20 and \SI{100}{\celsius} of a 0.25 in diameter Hg cylinder?
\end{quote}
\[ V_{Hg}(T) = V(0) [ 1 + 0.18182\times 10^{-3} T + 0.0078\times 10^{-6} T^{2} ] \]
\[ V(100) = V(20) * \frac{V(100)}{V(20)} \]
\[h = V/A\]
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
import numpy as np
def V(T):
# Volume relative to volume at 0 C
a = 0.18182e-3
b = 0.0078e-6
return 1. + T * (a + b*T)
def h(V):
area = np.pi * (0.25/12./2.)**2
return V/area
V20 = 0.560
h20 = h(V20)
V100 = V20 * V(100.)/V(20.)
h100 = h(V100)
print('Temperature Volume (ft3) Height (ft)')
print("{0:8.1f} {1:6.3f} {2:6.2f}".format(20,V20,h20))
print("{0:8.1f} {1:6.3f} {2:6.2f}".format(100,V100,h100))
deltah = h100-h20
print("Delta h = {0:6.2f} ft".format(deltah))
\end{minted}
\begin{verbatim}
Temperature Volume (ft3) Height (ft)
20.0 0.560 1642.78
100.0 0.568 1666.72
Delta h = 23.93 ft
\end{verbatim}
\hline
\subsection{Flow rate}
\label{sec-4-3}
\begin{itemize}
\item mass flow rate \(\dot{m}\): mass passing an area in a time
\item volume flow rate \(\dot{V}\): volume passing an area in a time
\end{itemize}
\[\rho =\frac{m}{V}=\frac{\dot{m}}{\dot{V}} \]
\begin{itemize}
\item Gas flows down a tapered cone. How does mass flow rate compare at entrance and exit?
\begin{itemize}
\item Same
\end{itemize}
\item If density is constant, how does volumetric flow rate compare?
\begin{itemize}
\item Same
\end{itemize}
\item How does linear velocity compare
\begin{itemize}
\item Goes up!
\end{itemize}
\item Molar flow rate, \(\dot{F}\)? Need to know MW!
\end{itemize}
\subsection{Chemical composition}
\label{sec-4-4}
\subsubsection{Moles and molecular weights}
\label{sec-4-4-1}
\begin{itemize}
\item atomic theory, we can count atoms and molecules. They are tiny, so need a big unit to count with!
\item molecular ``weight'' (\emph{MW}) is mass relative to \ce\{$^{\text{12}}$C\}, defined to have a mass of 12
\item Avogadro's number \(N_{A}=6.022\times 10^{23}\) number of \ce\{$^{\text{12}}$C\} to make 12 grams, called a \texttt{mole} or \texttt{gram-mole} (yech!)
\item \texttt{kmol} makes 12 kg, \texttt{lb-mole} makes 12 lbm
\item periodic table records masses of all elements relative to \ce{12C}
\end{itemize}
\includegraphics[width=.9\linewidth]{./figs/PeriodicTableMuted.png}
\begin{itemize}
\item \ce{CO2} = 44 g/g-mol = 44 kg/kg-mol = 44 lbm/lb-mol = 44 ton/ton-mol
\item calculate molar flow rate from mass flow rate
\end{itemize}
\begin{quote}
\textbf{EXAMPLE} What is molar flow rate of O in a stream of 4400 kg/hr \ce{CO2}?
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
F = 4400 * (1./44.) * 2
print("{0:6.2f} kmol O/hr".format(F))
\end{minted}
\begin{verbatim}
200.00 kmol/hr
\end{verbatim}
\subsection{Mixtures}
\label{sec-4-5}
\begin{itemize}
\item Always expressed as something/something
\item Generally faced with two types of problems: turn one concentration measure into another (intensive $\to$ intensive); or use in conversions of extensive $\to$ extensive
\end{itemize}
\subsubsection{Mass and mole fractions}
\label{sec-4-5-1}
\begin{itemize}
\item mass fraction A = mass A/total mass
\item mole fraction A = mol A/total mol
\item vol fraction A = vol A/total vol
\end{itemize}
\begin{quote}
\textbf{EXAMPLE} 35.0 \%(w/w) \ce{H2SO4} has a specific gravity of 1.2563. What volume of solution is needed to obtain 500 g-mol \ce{H2SO4}? (Extensive to extensive)
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
MW = 2.*(1.008) + 32.0 + 4 * 16.0 # g/g-mol
mass = 500 * MW # g
mass_soln = mass * (100./35.0) # g
rho = 1.2563 # g/mL
volume = mass_soln/rho/1000 # L
print("Volume={0:6.3f} L".format(volume))
\end{minted}
\begin{verbatim}
Volume=111.457 L
\end{verbatim}
\begin{quote}
\textbf{EXAMPLE} What is mole fraction \ce{H2SO4} in 35.0\%(w/w) solution? (intensive to intensive)
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
MWH2SO4 = 2*1.008 + 32.0 + 4 * 16.00
MWH2O = 2 *1.008 + 16.00
molH2SO4 = 35.0 / MWH2SO4 # mol H2SO4
molH2O = (100.-35.0)/ MWH2O # mol H2O
fracH2SO4 = molH2SO4/(molH2SO4+molH2O)
print("{0:6.3f}%(mol/mol) H2SO4".format(fracH2SO4*100))
\end{minted}
\begin{verbatim}
9.006%(mol/mol) H2SO4
\end{verbatim}
\begin{itemize}
\item trace species in a gas often expressed as ppm or ppb rather than \%
\item EPA ozone standard is 70 ppb, 70 ozone molecules/billion molecules of air
\item less frequently mass rather than mole basis
\end{itemize}
\subsubsection{Average molecular weight}
\label{sec-4-5-2}
\[ \bar{MW} = \sum_{i} y_{i} MW_{i} \]
\begin{quote}
\textbf{EXAMPLE} What is average molecular weight of air, which is 76.7\% \ce{N2} and 23.3\% \ce{O2} by mass?
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
# 100 g basis
MWN2 = 28.0
MWO2 = 32.0
molN2 = 76.7 / MWN2
molO2 = 23.3 / MWO2
moltot= molN2 + molO2
fracN2 = molN2/moltot
fracO2 = molO2/moltot
MWbar = fracN2*MWN2 + fracO2*MWO2
print("100 g basis")
print(" N2 O2")
print("MW: {0:4.2f} {1:4.2f}".format(MWN2,MWO2))
print("moles: {0:4.2f} {1:4.2f}".format(molN2,molO2))
print("mole frac: {0:4.2f} {1:4.2f}".format(fracN2,fracO2))
print("\nMWbar = {0:6.2f} g/mol".format(MWbar))
\end{minted}
\begin{verbatim}
100 g basis
N2 O2
MW: 28.00 32.00
moles: 2.74 0.73
mole frac: 0.79 0.21
MWbar = 28.84 g/mol
\end{verbatim}
\subsubsection{Concentrations}
\label{sec-4-5-3}
\begin{itemize}
\item ``concentration'' sometimes reserved for amount/volume
\item \texttt{molarity} = mol/volume; mass/volume less common
\end{itemize}
\begin{quote}
\textbf{EXAMPLE} 0.50 M \ce{H2SO4} flows into a process unit at \SI{1.25}{\meter\cubed\per\minute}. S.G. = 1.03. (a) Mass concentration? (b) mass flow rate of \ce{H2SO4}? (c) mass fraction \ce{H2SO4}?
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
Molarity = 0.50 # mol/L
MW = 2*1.0 + 32.0 + 4 * 16.0 # g/mol
flow = 1.25 # m3/min
density = 1.03 # kg/L
mass_conc = Molarity * (MW) * (1/1000) * (1000/1) # kg H2SO4/m3
H2SO4_mass_flow = mass_conc * flow * (1/60) # kg H2SO4/s
total_mass_flow = flow * (1/60) * (1000/1) * density # kg/s
mass_frac = H2SO4_mass_flow/total_mass_flow
print("{0:5.2f} kg H2SO3/m3 {1:5.2f} kg/s {2:5.4f} kg H2SO4/kg".format(mass_conc,H2SO4_mass_flow,mass_frac))
\end{minted}
\begin{verbatim}
49.00 kg H2SO3/m3 1.02 kg/s 0.0476 kg H2SO4/kg
\end{verbatim}
\subsection{Pressure}
\label{sec-4-6}
\subsubsection{Measures of pressure}
\label{sec-4-6-1}
\begin{itemize}
\item Pressure = Force/area required to resist motion of a frictional piston against a fluid
\item Internal fluid pressure arises from molecular motions and is present in any confined fluid
\item \emph{hydrostatic pressure} arises from gravitational force
\end{itemize}
\includegraphics[width=0.8\textwidth]{./figs/Pressure.png}
\begin{itemize}
\item \emph{air pressure} is hydrostatic pressure of the atmosphere (1 atm)
\item measured in standard pressure units (Pa, bar, atm)
\item \emph{or} measured in equivalent height of a fluid column in vacuum, most commonly mmHg, \(\rho_{\ce{Hg}} = \SI{13.6}{\gram\per\cm\cubed} = \SI{13594}{\kilogram\per\meter\cubed} (\SI{0}{\celsius}) \)
\end{itemize}
\begin{framed}
\[ h = P / \rho g \]
\end{framed}
\begin{quote}
\textbf{EXAMPLE} Express 1 atm in mmHg and mmH2O.
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
pressure = 1.01325e5 # Pa
density = 13594. # kg/m3
g = 9.807 # m/s2
heightHg = pressure /(density * g) # m
heightH2O = 13.6 * heightHg
print('{0:6.1f} mmHg {1:8.2f} mH2O'.format(heightHg*1000,heightH2O))
\end{minted}
\begin{verbatim}
760.0 mmHg 10.34 mH2O
\end{verbatim}
\begin{itemize}
\item open column of fluid (or solid) will have a total hydrostatic pressure at the base of atmospheric pressure plus column pressure
\end{itemize}
\[ P = P_{0} + \rho g h \]
\begin{quote}
\textbf{EXAMPLE} Hydrostatic pressure 30.0 m below the surface of a lake?
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
print('Easy way...40.3 m H2O!')
rho = 1000. # kg/m3
g = 9.807 # m/s2
h = 30.0 # m
P0 = 1.01325e5 # Pa
pressure = P0 + rho*g*h # Pa
pressureatm = pressure *( 1/P0)
pressurepsi = pressureatm * 14.696
print('Hard way...')
print('{0:5.2f} bar {1:5.2f} atm {2:5.2f} psi'.format(pressure/1e5,pressureatm,pressurepsi))
\end{minted}
\begin{verbatim}
Easy way...40.3 m H2O!
Hard way...
3.96 bar 3.90 atm 57.37 psi
\end{verbatim}
\subsubsection{Absolute vs.~gauge}
\label{sec-4-6-2}
\begin{itemize}
\item absolute pressure = pressure relative to a vacuum, always > 0
\item gauge pressure difference from atmosphere, can be positive or negative
\[ P_{gauge} = P_{abs} - P_{atm} \]
\end{itemize}
\subsubsection{Pressure gauges}
\label{sec-4-6-3}
\begin{itemize}
\item electronic devices (e.g. piezoelectric)
\item mechanical, based on a diaphragm or other deformable object
\item manometers: two-armed device. Pressures at equivalent heights within fluid must be the same.
\end{itemize}
\subsubsection{open-end manometer:}
\label{sec-4-6-4}
\includegraphics[width=.9\linewidth]{./figs/Manometer-open.png}
\begin{quote}
\textbf{EXAMPLE} Manometer fluid is Hg and \(h_{2} = -\SI{25}{\mm}\). What is gauge pressure? What is absolute pressure? In mmHg and in psi.
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
hatm = 760
hgauge = -25 # mmHg
habsolute = hgauge + hatm
print('Gauge = {0:5.1f} Abs = {1:5.1f} mmHg'.format(hgauge,habsolute))
g = 9.807 # m/s2
rhoHg = 13600 # kg/m3
pgauge = rhoHg * g * hgauge/1000. # Pa
pabsolute = rhoHg * g * habsolute/1000. # Pa
print('Gauge = {0:5.0f} Abs = {1:5.0f} Pa'.format(pgauge,pabsolute))
pgauge = pgauge * (14.696/ 1.01325e5) # lbf/in2
pabsolute = pabsolute * (14.696/ 1.01325e5) # lbf/in2
print('Gauge = {0:5.3} Abs = {1:5.3f} psi'.format(pgauge,pabsolute))
\end{minted}
\begin{verbatim}
Gauge = -25.0 Abs = 735.0 mmHg
Gauge = -3334 Abs = 98031 Pa
Gauge = -0.484 Abs = 14.218 psi
\end{verbatim}
\subsubsection{differential manometer}
\label{sec-4-6-5}
\includegraphics[width=.9\linewidth]{./figs/Manometer-diff.png}
\[ P_{2}- P_{1} = g(\rho_{f} - \rho_{m}) \Delta h \]
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
g = 980.7 # cm/s^2
Dh = 0.8 # cm
rhom = 1.05 # g/cm^3
rhof = 1.00 # g/cm^3
dP = g * Dh * (rhof - rhom) # dyne/cm2
print("\Delta P = {0:5.1f} dyne/cm2".format(dP))
\end{minted}
\begin{verbatim}
\Delta P = -39.2 dyne/cm2
\end{verbatim}
\subsubsection{Closed manometer}
\label{sec-4-6-6}
\subsection{Temperature}
\label{sec-4-7}
\subsubsection{Scales}
\label{sec-4-7-1}
\begin{itemize}
\item Kelvin: absolute scale, 0 $\to$ $\infty$
\item Celsius: \(T(^{\circ}C) = T(K) - 273.15)\)
\item Fahrenheit: \(T(^{\circ}F) = 1.8 T(^{\circ}C) + 32 )\)
\item Rankine: absolute scale, \(T(^{\circ}R) = T(^{\circ}F)+459.67\)
\item \textbf{Use care} in using in unit conversion calculations. Ratios work for converting temperature \emph{differences}, but not for converting absolute temperatures
\end{itemize}
\subsubsection{Measurement devices}
\label{sec-4-7-2}
\begin{itemize}
\item volume-based (thermometer)
\item radiation-based (pyrometer)
\item voltage-based (thermocouple) - change in potential between two dissimilar metals
\item resistance-based (thermistor)
\end{itemize}
\newpage
\section{Material balances on non-reactive systems}
\label{sec-5}
\subsection{Process types}
\label{sec-5-1}
\begin{itemize}
\item batch
\item continuous
\item semi-batch (filling a balloon)
\item steady-state vs. transient
\end{itemize}
\subsection{General balance equation}
\label{sec-5-2}
\begin{framed}
output = input + generation - consumption - accumulation
\end{framed}
\begin{quote}
\textbf{EXAMPLE} Every year 50,000 Leute move into a city, 75,000 move out, 22,000 are born, and 19,000 die. Write a differential balance on the population, i.e., what is change in population with time?
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
input = 50000; output=75000; generation=22000; consumption=19000;
accumulation =input + generation - output - consumption
print('accumulation = {0} people/year'.format(accumulation))
\end{minted}
\begin{verbatim}
accumulation = -22000 people/year
\end{verbatim}
\begin{itemize}
\item example of \emph{differential} balance, a change over time (or space)
\item \emph{integral} balance is sum of differential balance over some unit of time or space
\item batch: input = output = 0
\item continuous, steady-state, non-reactive: accumulation = generation = consumption = 0
\item Can balance \emph{total mass}: generation = consumption = 0
\item Can balance \emph{mass} or \emph{moles} of an element or molecular species
\end{itemize}
\begin{quote}
\textbf{EXAMPLE} Differential balance on a continuous, steady-state process
\SI{1000}{\kilogram\per\hour} mixture of 50\%(w/w) benzene and toluene is distilled into two streams, one containing \SI{450}{\kilogram\per\hour} benzene and other containing \SI{475}{\kilogram\per\hour} toluene. Solve for unknown flow rates.
\end{quote}
\includegraphics[width=.9\linewidth]{./figs/diff-balance1.png}
\subsection{Mass balance procedure}
\label{sec-5-3}
\begin{itemize}
\item Illustrates general procedure:
\end{itemize}
\hline
\begin{enumerate}
\item Create a flow chart
\item Label all known quantities along each stream
\begin{enumerate}
\item molar or mass flow rates
\item concentrations
\end{enumerate}
\item Label all \emph{unknown} quantities with symbols
\item Work in only mass or molar quantities
\end{enumerate}
\hline
\begin{itemize}
\item A flow sheet is \emph{balanced} if all material balances are closed
\item A balanced flow sheet can be \emph{scaled}; all flows multiplied by a constant value
\item Allows one to choose arbitrarily a \emph{basis}
\end{itemize}
\begin{quote}
\textbf{EXAMPLE} Air humidification example. Three inputs are fed into an evaporation chamber:
\begin{itemize}
\item Liquid \ce{H2O}, \SI{20}{\centimeter\cubed\per\minute}
\item Air
\item \ce{O2}, at a rate 1/5 of the air
\end{itemize}
The output contains 1.5\% \ce{H20}. What are the output compositions and other flow rates?
\end{quote}
\includegraphics[width=.9\linewidth]{./figs/Diff-balance3.png}
\includegraphics[width=.9\linewidth]{./figs/Diff-balance4.png}
\begin{itemize}
\item Number of equations = number of unknowns. Say \emph{degrees of freedom} = 0.
\end{itemize}
\begin{quote}
\textbf{EXAMPLE} DOF analysis. Humid air passes through a condenser that removes 95\% of \ce{H2O}. Condensate removed at 225 L/min. Calculate flow rate and composition of gas stream leaving condenser.
\end{quote}
\includegraphics[width=.9\linewidth]{./figs/DOF.png}
\begin{quote}
\textbf{EXAMPLE} 45.0\%(w/w) benzene and balance toluene are fed to a distillation column. The overhead product contains 95.0\%(mol/mol) benzene and accounts for 92\% of total fed benzene. The fed enters at 2000 L/h and has specific gravity 0.872. Determine mass flow rates of overhead and bottom streams and bottom composition.
\end{quote}
\begin{minted}[frame=lines,fontsize=\scriptsize,linenos]{python}
# Convert stream 2 to mass basis
MWb = 6 * 12.0 + 6 * 1.008
MWt = 7 * 12.0 +8 * 1.008
x2B = 0.95
x2T = 0.05
basis = 100.
m2B = basis * x2B * MWb
m2T = basis * x2T * MWt
m2tot = m2B + m2T
z2B = m2B/m2tot
z2T = m2T/m2tot
print('Z2Benzene = {0:5.3f} Z2Toluene = {1:5.3f} kg/kg'.format(z2B,z2T))
# total mass flow rate
SG = 0.872
v1 = 2000 # l/h
m1 = v1 * SG
# benzene flow rates
z1B = 0.45
m3B = 0.08 * m1 * z1B
m2B = 0.92 * m1 * z1B
print('Mdot1 = {0:6.1f} Mdot2B = {1:6.1f} Mdot3B = {2:6.1f} kg/hr'.format(m1,m2B,m3B))
# mass balances
m2 = m2B/z2B
m3 = m1 - m2
print('Mdot2 = {0:6.1f} Mdot3 = {1:6.1f} kg/hr'.format(m2,m3))
# last gasp
z3B = m3B/m3
print('Z3Benzene = {0:5.3f} Z3Toluene = {1:5.3f} kg/kg'.format(z3B,1-z3B))
\end{minted}
\begin{verbatim}
Z2Benzene = 0.942 Z2Toluene = 0.058 kg/kg
Mdot1 = 1744.0 Mdot2B = 722.0 Mdot3B = 62.8 kg/hr
Mdot2 = 766.8 Mdot3 = 977.2 kg/hr
Z3Benzene = 0.064 Z3Toluene = 0.936 kg/kg
\end{verbatim}
\includegraphics[width=0.8\textwidth]{./figs/Diff-balance5.png}
\includegraphics[width=0.8\textwidth]{./figs/Diff-balance6.png}