/[ascend]/trunk/doc/lyxFinal/howto-dimeqns.lyx
ViewVC logotype

Contents of /trunk/doc/lyxFinal/howto-dimeqns.lyx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 825 - (show annotations) (download) (as text)
Mon Aug 21 23:41:31 2006 UTC (18 years, 3 months ago) by johnpye
File MIME type: application/x-lyx
File size: 13635 byte(s)
Copying documentation into code tree
1 #LyX 1.4.1 created this file. For more info see http://www.lyx.org/
2 \lyxformat 245
3 \begin_document
4 \begin_header
5 \textclass book
6 \language english
7 \inputencoding auto
8 \fontscheme default
9 \graphics default
10 \paperfontsize default
11 \spacing single
12 \papersize a4paper
13 \use_geometry false
14 \use_amsmath 2
15 \cite_engine basic
16 \use_bibtopic false
17 \paperorientation portrait
18 \secnumdepth 3
19 \tocdepth 3
20 \paragraph_separation indent
21 \defskip medskip
22 \quotes_language english
23 \papercolumns 1
24 \papersides 2
25 \paperpagestyle default
26 \tracking_changes false
27 \output_changes true
28 \end_header
29
30 \begin_body
31
32 \begin_layout Chapter
33 Entering Dimensional Equations
34 \begin_inset LatexCommand \index{equation, dimensional}
35
36 \end_inset
37
38 from Handbooks
39 \begin_inset LatexCommand \label{cha:dimeqns}
40
41 \end_inset
42
43
44 \end_layout
45
46 \begin_layout Standard
47 Often in creating an ASCEND model one needs to enter a correlation
48 \begin_inset LatexCommand \index{correlation}
49
50 \end_inset
51
52 given in a handbook that is written in terms of variables expressed in
53 specific units.
54 In this chapter, we examine how to do this easily and correctly in a system
55 like ASCEND where all equations must be dimensionally correct.
56 \end_layout
57
58 \begin_layout Section
59 Example 1-- vapor pressure
60 \begin_inset LatexCommand \index{pressure, vapor}
61
62 \end_inset
63
64
65 \end_layout
66
67 \begin_layout Standard
68 Our first example is the equation to express vapor pressure using an Antoine
69 \begin_inset LatexCommand \index{Antoine}
70
71 \end_inset
72
73 -like equation of the form:
74 \end_layout
75
76 \begin_layout Standard
77 \begin_inset Formula \begin{equation}
78 \ln(P_{sat})=A-\frac{B}{T+C}\label{eqn:dimeqns.lnPsat}\end{equation}
79
80 \end_inset
81
82 where
83 \begin_inset Formula $P_{sat}$
84 \end_inset
85
86 is in {atm} and
87 \begin_inset Formula $T$
88 \end_inset
89
90 in {R}.
91 When one encounters this equation in a handbook, one then finds tabulated
92 values for
93 \begin_inset Formula $A$
94 \end_inset
95
96 ,
97 \begin_inset Formula $B$
98 \end_inset
99
100 and
101 \begin_inset Formula $C$
102 \end_inset
103
104 for different chemical species.
105 The question we are addressing is:
106 \end_layout
107
108 \begin_layout Quote
109 How should one enter this equation into ASCEND so one can then enter the
110 constants A, B, and C with the exact values given in the handbook?
111 \end_layout
112
113 \begin_layout Standard
114 ASCEND uses SI
115 \begin_inset LatexCommand \index{SI}
116
117 \end_inset
118
119 units internally.
120 Therefore, P would have the units {kg/m/s^2}, and T would have the units
121 {K}.
122 \end_layout
123
124 \begin_layout Standard
125 Eqn
126 \begin_inset LatexCommand \ref{eqn:dimeqns.lnPsat}
127
128 \end_inset
129
130
131 \noun off
132 is, in fact, dimensionally incorrect as written.
133 We know how to use this equation, but ASCEND does not as ASCEND requires
134 that we write dimensionally correct equations.
135 For one thing, we can legitimately take the natural log (ln) only of unitless
136 quantities.
137 Also, the handbook will tabulate the values for A, B and C without units.
138 If A is dimensionless, then B and C would require the dimensions of temperature.
139 \end_layout
140
141 \begin_layout Standard
142 The mindset we describe in this chapter is to enter such equations is to
143 make all quantities that must be expressed in particular units into dimensionle
144 ss quantities that have the correct numerical value.
145 \end_layout
146
147 \begin_layout Standard
148 We illustrate in the following subsections just how to do this conversion.
149 It proves to be very straight forward to do.
150 \end_layout
151
152 \begin_layout Subsection
153 Converting the ln term
154 \end_layout
155
156 \begin_layout Standard
157 Convert the quantity within the ln() term into a dimensionless number that
158 has the value of pressure when pressure is expressed in {atm}.
159 \end_layout
160
161 \begin_layout Standard
162 Very simply, we write
163 \end_layout
164
165 \begin_layout LyX-Code
166 P_atm = P/1{atm};
167 \end_layout
168
169 \begin_layout Standard
170 Note that P_atm has to be a dimensionless quantity here.
171 \end_layout
172
173 \begin_layout Standard
174 We then rewrite the LHS of Equation
175 \begin_inset LatexCommand \ref{eqn:dimeqns.lnPsat}
176
177 \end_inset
178
179
180 \noun off
181 as
182 \end_layout
183
184 \begin_layout LyX-Code
185 ln(P_atm)
186 \end_layout
187
188 \begin_layout Standard
189 Suppose P = 2 {atm}.
190 In SI units P= 202,650 {kg/m/s^2}.
191 In SI units, the dimensional constant 1{atm} is about 101,325 {kg/m/s^2}.
192 Using this definition, P_atm has the value 2 and is dimensionless.
193 ASCEND will not complain with P_atm as the argument of the ln
194 \begin_inset LatexCommand \index{ln}
195
196 \end_inset
197
198 () function, as it can take the natural log of the dimensionless
199 \begin_inset LatexCommand \index{dimensionless}
200
201 \end_inset
202
203 quantity 2 without any difficulty.
204 \end_layout
205
206 \begin_layout Subsection
207 Converting the RHS
208 \end_layout
209
210 \begin_layout Standard
211 We next convert the RHS of Equation
212 \begin_inset LatexCommand \ref{eqn:dimeqns.lnPsat}
213
214 \end_inset
215
216
217 \noun off
218 , and it is equally as simple.
219 Again, convert the temperature used in the RHS into:
220 \end_layout
221
222 \begin_layout LyX-Code
223 T_R = T/1{R};
224 \end_layout
225
226 \begin_layout Standard
227 ASCEND converts the dimensional constant 1{R} into 0.55555555...{K}.
228 Thus T_R is dimensionless but has the value that T would have if expressed
229 in {R}.
230 \end_layout
231
232 \begin_layout Subsection
233 In summary for example 1
234 \end_layout
235
236 \begin_layout Standard
237 We do not need to introduce the intermediate dimensionless variables.
238 Rather we can write:
239 \end_layout
240
241 \begin_layout LyX-Code
242 ln(P/1{atm}) = A - B/(T/1{R} + C);
243 \end_layout
244
245 \begin_layout Standard
246 as a correct form for the dimensional equation.
247 When we do it in this way, we can enter A, B and C as dimensionless quantities
248 with the values exactly as tabulated.
249 \end_layout
250
251 \begin_layout Section
252 Fahrenheit
253 \begin_inset LatexCommand \index{Fahrenheit}
254
255 \end_inset
256
257 -- variables with offset
258 \begin_inset LatexCommand \label{sec:dimeqns.Fahrenheit}
259
260 \end_inset
261
262
263 \end_layout
264
265 \begin_layout Standard
266 What if we write Equation
267 \begin_inset LatexCommand \ref{eqn:dimeqns.lnPsat}
268
269 \end_inset
270
271
272 \noun off
273 but the handbook says that T is in degrees Fahrenheit, i.e., in {F}? The
274 conversion from {K} to {F} is
275 \end_layout
276
277 \begin_layout LyX-Code
278 T{F} = T{K}*1.8 - 459.67
279 \end_layout
280
281 \begin_layout Standard
282 and the 459.67 is an offset.
283 ASCEND does not support an offset for units conversion.
284 We shall discuss the reasons for this apparent limitation in Section
285 \begin_inset LatexCommand \ref{ssec:dimeqns.handlingUnitConv}
286
287 \end_inset
288
289 .
290 \end_layout
291
292 \begin_layout Standard
293 You can readily handle temperatures in {F} if you again think as we did
294 above.
295 The rule, even for units requiring an offset for conversion, remains: convert
296 a dimensional variable into dimensionless one such that the dimensionless
297 one has the proper value.
298 \end_layout
299
300 \begin_layout Standard
301 Define a new variable
302 \end_layout
303
304 \begin_layout LyX-Code
305 T_degF = T/1{R} - 459.67;
306 \end_layout
307
308 \begin_layout Standard
309 Then code
310 \begin_inset LatexCommand \ref{eqn:dimeqns.lnPsat}
311
312 \end_inset
313
314
315 \noun on
316 Equation 7.1
317 \noun off
318 as
319 \end_layout
320
321 \begin_layout LyX-Code
322 ln(P/1{atm}) = A - B/(T_degF + C);
323 \end_layout
324
325 \begin_layout Standard
326 when entering it into ASCEND.
327 You will then enter constants A, B, and C as dimensionless quantities having
328 the values exactly as tabulated.
329 In this example we must create the intermediate variable T_degF.
330 \end_layout
331
332 \begin_layout Section
333 Example 3-- pressure drop
334 \begin_inset LatexCommand \label{ssec:dimeqns.pressure drop}
335
336 \end_inset
337
338
339 \end_layout
340
341 \begin_layout Standard
342 From the Chemical Engineering Handbook
343 \begin_inset LatexCommand \index{Chemical Engineering Handbook}
344
345 \end_inset
346
347 by Perry
348 \begin_inset LatexCommand \index{Perry}
349
350 \end_inset
351
352 and Chilton
353 \begin_inset LatexCommand \index{Chilton}
354
355 \end_inset
356
357 , Fifth Edition, McGraw-Hill, p10-33, we find the following correlation:
358 \end_layout
359
360 \begin_layout Standard
361 \begin_inset Formula \[
362 \Delta P_{a}^{\prime}=\frac{y(V_{g}-V_{l})G^{2}}{144g}\]
363
364 \end_inset
365
366 where the pressure drop on the LHS is in psi, y is the fraction vapor by
367 weight (i.e., dimensionless), Vg and Vl are the specific volumes of gas and
368 liquid respectively in ft3/lbm, G is the mass velocity in lbm/hr/ft2 and
369 g is the acceleration by gravity and equal to 4.18x108 ft/hr2.
370 \end_layout
371
372 \begin_layout Standard
373 We proceed by making each term dimensionless and with the right numerical
374 value for the units in which it is to be expressed.
375 The following is the result.
376 We do this by simply dividing each dimensional variable by the correct
377 unit conversion factor.
378 \end_layout
379
380 \begin_layout LyX-Code
381 delPa/1{psi} = y*(Vg-Vl)/1{ft^3/lbm}*
382 \end_layout
383
384 \begin_layout LyX-Code
385 (G/1{lbm/hr/ft^2})^2/(144*4.18e8);
386 \end_layout
387
388 \begin_layout Section
389 The difficulty of handling unit conversions defined with offset
390 \begin_inset LatexCommand \label{ssec:dimeqns.handlingUnitConv}
391
392 \end_inset
393
394
395 \end_layout
396
397 \begin_layout Standard
398 How do you convert temperature from Kelvin to centigrade? The ASCEND compiler
399 encounters the following ASCEND statement:
400 \end_layout
401
402 \begin_layout LyX-Code
403 d1T1 = d1T2 + a.Td[4];
404 \end_layout
405
406 \begin_layout Standard
407 and d1T1 is supposed to be reported in centigrade.
408 We know that ASCEND stores termperatures in Kelvin {K}.
409 We also know that one converts {K} to {C} with the following relationshipT{C}
410 = T{K} - 273.15.
411 \end_layout
412
413 \begin_layout Standard
414 Now suppose d1T2 has the value 173.15 {K} and a.Td{4} has the value 500 {K}.
415 What is d1T1 in {C}? It would appear to have the value 173.15+500-273.15
416 = 400 {C}.
417 But what if the three variables here are really temperature differences?
418 Then the conversion should be T{dC} = T{dK}, where we use the notation
419 {dC} to be the units for temperature difference in centigrade and {dK}
420 for differences in Kelvin.
421 Then the correct answer is 173.15+500=673.15 {dC}.
422
423 \end_layout
424
425 \begin_layout Standard
426 Suppose d1T1 is a temperature and d1T2 is a temperature difference (which
427 would indicate an unfortunate but allowable naming scheme by the creator
428 of this statement).
429 It turns out that a.Td[4] is then required to be a temperature and not a
430 temperature difference for this equation to make sense.
431 We discover that an equation written to have a right-hand-side of zero
432 and that involves the sums and differences of temperature and temperature
433 difference variables will have to have an equal number of positive and
434 negative temperatures in it to make sense, with the remaining having to
435 be temperature differences.
436 Of course if the equation is a correlation, such may not be the case, as
437 the person deriving the correlation is free to create an equation that
438 "fits" the data without requiring the equation to be dimensionally (and
439 physically) reasonable.
440 \end_layout
441
442 \begin_layout Standard
443 We could create the above discussion just as easily in terms of pressure
444 where we distinguish absolute from gauge pressures (e.g., {psia} vs.
445 {psig}).
446 We would find the need to introduce units {dpisa} and {dpsig} also.
447
448 \end_layout
449
450 \begin_layout Subsection
451 General offset
452 \begin_inset LatexCommand \index{offset}
453
454 \end_inset
455
456 and difference units
457 \begin_inset LatexCommand \index{difference units}
458
459 \end_inset
460
461
462 \end_layout
463
464 \begin_layout Standard
465 Unfortunately, we find we have to think much more generally than the above.
466 Any unit conversion can be introduced both with and without offset.
467 Suppose we have an equation which involves the sums and diffences of terms
468 t1 to t4:
469 \end_layout
470
471 \begin_layout Standard
472 \begin_inset Formula \begin{equation}
473 t_{1}+t_{2}-(t+t_{4})=0\label{eqn:t1+t2}\end{equation}
474
475 \end_inset
476
477 where the units for each term is some combination of basic units, e.g., {ft/s^2/R}.
478 Let us call this combination {X} and add it to our set of allowable units,
479 i.e., we define
480 \emph on
481 {X} = {ft/s^2/R}.
482
483 \emph default
484
485 \end_layout
486
487 \begin_layout Standard
488 Suppose we define units {Xoffset} to satisfy: {Xoffset} = {X} - 10 as another
489 set of units for our system.
490 We will also have to introduce the concept of {dX} and and should probably
491 introduce also {dXoffset} to our system, with these two obeying{dXoffset}
492 = {Xoffset}.
493
494 \end_layout
495
496 \begin_layout Standard
497 For what we might call a "well-posed" equation, we can argue that the coefficien
498 t of variables in units such as {Xoffset} have to add to zero with the remaining
499 being in units of {dX} and {dXoffset}.
500 Unfortunately, the authors of correlation equations are not forced to follow
501 any such rule, so you can find many published correlations that make the
502 most awful (and often unstated) assumptions about the units of the variables
503 being correlated.
504 \end_layout
505
506 \begin_layout Standard
507 Will the typical modeler get this right? We suspect not.
508 We would need a very large number of unit conversion combinations in both
509 absolute, offset and relative units to accomodate this approach.
510 \end_layout
511
512 \begin_layout Standard
513 We suggest that our approach to use only absolute units with no offset is
514 the least confusing for a user.
515 Units conversion is then just multiplication by a factor both for absolute
516 {X} and difference {dX} units-- we do not have to introduce difference
517 variables because we do not introduce offset units.
518
519 \end_layout
520
521 \begin_layout Standard
522 When users want offset units such as gauge pressure or Fahrenheit for temperatur
523 e, they can use the conversion to dimensionless variables having the right
524 value, using the style we introduced above, i.e., T_defF = T/1{R} - 459.67
525 and P_psig = P/1{psi} - 14.696 as needed.
526 \end_layout
527
528 \begin_layout Standard
529 Both approaches to handling offset introduce undesirable and desirable character
530 istics to a modeling system.
531 Neither allow the user to use units without thinking carefully.
532 We voted for this form because of its much lower complexity.
533 \end_layout
534
535 \end_body
536 \end_document

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22