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

Annotation of /trunk/doc/howto-dimeqns.lyx

Parent Directory Parent Directory | Revision Log Revision Log


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

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