Escolar Documentos
Profissional Documentos
Cultura Documentos
David H. Riemer
1 Research the
sponsored by the United Ststea Government. Neither United States nor the United Stat- Energy and Development Addnistmtion, nor any of their employees. nor m y of their mntnctors, Subconlnclon. or their employ-, m k e r any warranty, expreu or implied. or anumes any I + liabaty 01 responsibility for the accuracy. cornpictenen or urfulnea of m y informtion. apparatus. produa or pmcirr disclosed, o r represents that its UIC would not infnnc privately owned right,.
PREPARED FOR THE ENERGY RESEARCH AND DEVELOPMENT ADMINISTRATION DIVISION OF GEOTHERMAL ENERGY UNDER GRA!.IT E ( I 0-1 ) 1549
p \ ; ~~,~~~~~
I->It
~~~~~
?""si ,_.-
DISCLAIMER This report was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor any agency Thereof, nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark, manufacturer, or otherwise does not necessarily constitute or imply its endorsement, recommendation, or favoring by the United States Government or any agency thereof. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or any agency thereof.
DISCLAIMER Portions of this document may be illegible in electronic image products. Images are produced from the best available original document.
Ls
ACKNOWLEDGEMENTS
This computer routine was developed t o use in program DIRGE0 described in "Analysis of Direct Contact Binary Cycles f o r Geothermal PoweP Generation," ERDA Report DGE/1549-5 (September 1976).
The support of ERDA i s appreciated.
ABSTRACT
The program
The following
Hexane, Isobutane, Isopentane, Methane, Octane, Pentane, Propane and Propylene. The subroutine can evaluate a thermodynamic s t a t e for the
l i g h t hydrocarbons given any of the following pairs o f s t a t e quantities: pressure and quality, pressure and enthalpy, pressure and entropy, temperature and pressure, temperature and q&l"ity and temperature and specific volume. These s i x pairs o f knowns allow the user to analyze any thermoThe
dynamic cycle u t i l i z i n g a l i g h t hydrocarbon as the working f l u i d . Star1 ing-Benedict-Webb-Rubin equation o f s t a t e was used.
This report
contains a brief description, flowchart, l i s t i n g and required equations for each subroutine.
I1
I1
I1
I1
I1
It
It
It
I1
I1
11
I1
I1
11
I1
hl h2
It
11
I1
I1
11
I1
I1
I1
I 1
I1
11
h3
I1
I1
I1
I1
I1
11
h4
I1 I1 It 11 I1
11
h5
It It I1
It
I1
11
h5
I1
I1
I1
I1
I1
11
h6 cs 1 cs2
I1
I1
It
11
I1
11
I 1
11
cs 3
I1
It
II It I1
11
cs4
It
I1
I1
I1
I1
11
cs 5
I1
I1
I1
It
11
11
s6
d
DO
EO
I1
11
I1
I1
I1
I1
f h
P
S
TABLE OF CONTENTS
............................. .......................... ........................... INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . DEVELOPMENT OF PROPERTIES . . . . . . . . . . . . . . . . . . . . PROGRAM DEVELOPMENT . . . . . . . . . . . . . . . . . . . . . . . . USE OF CARBON . . . . . . . . . . . . . . . . . . . . . . . . . . CARBON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . ENTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Equations . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . ENTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ABSTRACT ACKNOWLEDGEMENTS NOMENCLATURE
i ii vi
1
2 3
5 5 5 9 15
24 24 24 24 26 27 28
28
.............
28
28
30 31 32 32 32 32 34 35
.............................. Description . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . ... PHKNOW . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Equations . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . PRES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Equations . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . PRESAT . Descr ip t i on . . . . . . . . . . . . . . . . . . . . . . . . . Equations . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . PRINTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . .
INVERT
J
36
36 36 37 39 40 40 40 40 42 43 45 45 45 45 47 48 49 49 49 49 52 54 56 56 56
57
...................... PSKNOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Equations . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . . SATC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Variabl.e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . .
iv
......................
58 60 60 60 60 62 64 65 65 65 66 67
.............................. Description . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . . ... TEMSAT . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . .
SETUP
1
68 68 68 71 72 73
73 73 74 76 79
81 81 81 81 82 83 84
T
c1
temperature
(OR)
constant i n SBWR equation constant i n SBWR equation conversion factor = 0.185057 density (lbmole/ft 3 )
Y 4)
P
vii
INTRODUCTION This subroutine computes t h e thermodynami c p r o p e r t i e s o f 1igh t hydrocarbons. The subroutine was developed t o a l l o w f o r a wide range o f
a p p l i c a t i o n s such t h a t i t may be used t o determine t h e p r o p e r t i e s o f l i g h t hydrocarbons i n any thermodynamic c y c l e in c l u d i ng, as t h e authors devel oped
i t , e v a l u a t i n g b i n a r y f l u i d cycles.
box by t h e user w i t h a l i m i t e d background i n p r o g r a m i n g o r t h e program may be m o d i f i e d t o meet t h e users requirements. This manual was w r i t t e n
t o a s s i s t t h e user i n whichever manner he intends t o use t h i s program. DEVELOPMENT OF PROPERTIES The b a s i c equation used i s t h e Starling-Benedict-Webb-Rubb equation of s t a t e , which i s a pressure e x p l i c i t equation o f t h e form:
P = PRT
h =
@ (BoRT-2Ao-4Co/T 2
+ar$/5(6a+7d/T)p5
s =
2
+ CS1 + CS2T
Rnf =
E0/T4)p
+ 3/(2RT)
I!
yrs
For evaluating
an ideal power cycle the following processes are employed, constant entropy
(turbine, compressor and pump), constant enthalpy constant pressure (heat exchanger). (expansion val ve) ,
processes, properties must be determined w i t h one of the following pairs of knowns: temperature and pressure, temperature and quality, pressure Since
pressure i s a function o f density and temperature,when pressure and temperature are known a search technique must be used t o f i n d the density. the density i s known the remaining properties may be calculated.
Once
Saturation
s t a t e s are defined by the equality o f pressure and fugacity a t the same temperature and both saturated 1 i q u i d and vapor densities. When the
saturation pressure i s known, a three variable search on temperature and saturated 1 i q u i d and vapor densities i s required. When the saturation
temperature i s known a two variable search i s required on the saturated liquid and vapor densities. Having completed e i t h e r o f these searches,
t h e r e m a i n i n g p r o p e r t i e s may b e computed by u s i n g t h e s a t u r a t e d l i q u i d
knowns require
a two variable search since both pressure and entropy or This search i s used The Newton-Raphson
enthalpy are functions o f ' temperature and density. only i n the compressed l i q u i d or superheated regions.
PROGRAM DE V E L0PME NT
Subroutine CARBON was written i n FORTRAN V for the UNIVAC 1108 series computer b u t should be easily adapted t o any similar FORTRAN compiler.
The subroutine a l l o w s t h e user t o use t h e program a t two l e v e l s , f i r s t as a "black box" ( t h e main t e x t describes t h e use and general development
v a r i a b l e d e s c r i p t i o n tables, flowcharts, equations and a b r i e f d e s c r i p t i o n o f a l l subroutines. USE OF CARBON I n o r d e r t o use CARBON t h e user must supply t o t h e program t h e f o l l o w i n g
temperature and pressure temperature and q u a l i t y temperature and d e n s i t y pressure and enthalpy pressure and entropy pressure and q u a l i t y
TX
TV
PH
PS
PX
These are t h e o n l y a l l o w a b l e values o f CYCLE and t h e o r d e r i s important, i.e., PT o r SP, etc., a r e i l l e g a l and w i l l generate an e r r o r t e r m i n a t i o n
o f CARBON.
2.
3.
( SGI VEN ).
4.
ISOP, BUT, PENT, METH, ETH, ETHYL, PROP, HEX, HEPT, OCT and
PROPYL.
5.
Print s e l e c t o r
3.
applies t o saturation s t a t e s ,
t e r than one
6. Pressure (psi a )
7.
8. 9.
10.
Saturated 1 i q u i d enthalpy (Btu/lbm) Saturated 1i q u i d entropy (Btu/l brr;"R) 3 Saturated 1i q u i d s p e c i f i c vol ume ( f t /1 bm) Saturated vapor enthalpy ( B t u / l bm) Saturated vapor entropy (Btu/l bmoR)
3 Saturated vapor specific volume ( f t /1 bm)
11. 12.
QUAL)
I $
independent of the c a l l i n g program except f o r the passage of the above parameters, therefore, no external variables need be placed i n common.
CARBON
Des c r i p ti on
CARBON i s the main routine for determining the thermodynamic properties
of 1 ight hydrocarbons. The routine s e l e c t s the appropriate coefficients f o r the particular l i g h t hydrocarbon to be evaluated. CARBON then determines i f the two s t a t e quantities specified according to the value of CYCLE are legitimate quantities. An example of an illegal quantity would be q u a l i t i e s
greater than one o r l e s s than zero f o r values of CYCLE equal to TX o r PX. Once these t e s t s are s a t i s f i e d CARBON then determines the region t o which the point corresponds, i .e., compressed liquid, saturated liquid-vapor equi 1 i bri um o r superheated vapor.
Having determi ned the region, CARBON
selects the proper subroutines t o determine the remaining thermodynamic s t a t e properties. VARIABLE SYMBOL TABLE
AB ST BTOLER BUT
OF
and
OF!
= 459.6
lower tolerance on saturation and convergence t e s t s 1-dimensional array containing the required coefficients f o r Butane
1-dimensional array containing the coefficients t o the Star1 ing-Benedict-Webb-Rubin equation of s t a t e for the l i g h t hydrocarbon to be evaluated
CH
1-dimensional array containing the coefficients to the ideal gas enthalpy conversion factor = 0.185057 B t u i n 2/ l b - f t 3 1-dimensional array containing the coefficients t o the ideal gas entropy
CONVR
cs
CYCLE
Type of calculation t o be made, CYCLE has the following possible pairs of knowns:
1.
2.
3.
temperature and pressure = TP temperature and quality = TX temperature and specific volume = TV pressure and quality = PX pressure and entropy = PS pressure and enthalpy = PH
4. 5.
6.
DCRIT
DHDD
DH DT DL
DPDD
DPDT
DSDD
a h ( P ,TI/
a~
3
as( P ,T I / a P
DSDT
DV
as(P ,TI a~
saturated vapor density (lbmole/ft 3 )
ETA
EHTY L
FGIVEN
1-dimensional array containing the required coefficients f o r Ethylene F i r s t known passed to CARBON, i .e.
, temperature f o r values of
enthalpy (BTU/l bm) 1-dimens onal array containing the required coefficients f o r Heptane
HEPT
u
HEX
HL 1-dimensional a r r a y c o n t a i n i n g t h e r e q u i r e d c o e f f i c i e n t s f o r Hexane s a t u r a t e d l i q u i d enthalpy (Btu/lbm) s a t u r a t e d vapor enthalpy ( B t u / l bm) t h e l i g h t hydrocarbon t o be evaluated
HV
LFTY PE
HEPT
HEX ISOB ISOP
Butane Ethylene Heptane Hexane Isobutane Isopentane Methane Octane Pentane Propane
METH
OCT PENT
PROP
PROPYL- Propylene LIMIT maximum number o f i t e r a t i o n s allowed i n any one search u n i t number f o r p r i n t e r p r i n t selector
M2
NPPIN
OCT
no p r i n t o u t i f NPRIN = 0 e l s e p r i n t o u t i s generated
1-dimensional a r r a y c o n t a i n i n g t h e r e q u i r e d c o e f f i c i e n t s f o r Octane pressure ( p s i a ) c r i t i c a l pressure ( p s i a ) 1-dimensional a r r a y c o n t a i n i n g t h e r e q u i r e d c o e f f i c i e n t s f o r Pentane 1-dimensional a r r a y c o n t a i n i n g t h e r e q u i r e d c o e f f i c i e n t s f o r Propane 1-dimensional a r r a y c o n t a i n i n g t h e r e q u i r e d c o e f f i c i e n t s f o r Propylene s a t u r a t i o n pressure ( p s i a )
P
PCRIT
PENT
PROP PROPYL PSAT
W J I l i
QUAL R
S
qual i t y
universal gas constant 10.7335 psia-ft /lbmole entropy (BTU/l bmoR) second known passed t o CARBON, i . e . , quality for values of CYCLE of TX and PX, pressure for CYCLE = TP, specific volume f o r
CYCLE = TV, enthalpy f o r CYCLE
SGIVEN
SL
sv
T TCRIT TR TTOLER V VL
(OF)
upper tolerance on saturation and convergence t e s t s 3 specific volume ( f t /lbm) saturated liquid specific voluw ( f t3/ l b m ) saturated vapor specific volume ( f t3/lbm) mol ecul a r weight 1-dimensional array containing the required coefficient for
i sobutane
vv
MU
X ISOB
XISOP
XMETH
v > LL
n
IT >
10
c 2
'-
IlIn
P?CSF.7
IEIn
SATC
Q c3 AERROR
RETBRN
SA1
>"'
UT-11
P?I flit
11
TEHSAT
1
SATC
1
COHPUfE
irfi
PRINTC
12
;u
PPINTC
RETUPN
13
TEMSAT
l i
14
PRES
ENTH
EIITR
t I t I t
COMPUTE: QUAL YL
vv
ti
PRINTC
PRINT:
1
RETURN
c
C
c
C
c
C
C
C
c
C C C C C C C C
C C C
18
0
4
hl
0
0
c
C C
k
c:
T
c
b-
X I r *
x m
i
t C
x C
I
A '
r
0
2L'
z -
...-E
ooc
iT
2
a
u l
C z> r
C irl
0
0
r
0
Y
. .
t
v
. r .
r
GI
. .
0
0
I C
0
C d
c .
C
c
0
. .
C
0
-r
T 1
4
-@
%
w
a 3
.
Y
61
c
c
C C
c
G ' C A
c
N
C
a
c .
a.
rv
3'
( r ,
LT
z
A
01
c-.
c1
C
c c
0
G
c
0
C C
0
0 '
C
-.
Y
.D r
4
C;
r
I :
vi
Y
f2
. -r
.
r
VI
I u
24
ENTH Des c r i p t ion ENTH c a l c u l a t e s t h e enthalpy and i t s d e r i v a t i v e s w i t h respect t o d e n s i t y and temperature given temperature and density. The enthal py i s
c a l c u l a t e d by computing t h e i d e a l gas enthalpy and t h e enthalpy departure from t h e i d e a l gas enthalpy by using t h e Starling-Benedict-Webb-Rubin equation o f state. EQUATIONS h (p ,T) = (CONVR/WM) ( ( Bo*R*T-2*Ao-4*Co/T (2*b*R*T-3*a-4*d/T)
aT
-7*a*d*p5/5*T2-2*c/ 'h2 +2*c *T h3 (y*T3) (3- (3+1 /2*y*p2)
-y 2*p 4 ) exp( -y*p2) ) )
ah( ,T
aP
(CONVR/WM) ( Bo*R*T-2*Ao-4*C
-3*a-4*d/T)p+c1(6*a+7*d/T)p4
+ C/(y*T2) (5*y*p+59 2
p -2*y
3 5
p )
3 ti
CH
CONV R
2 3 conversion f a c t o r = 0.185057 B t u - i n / l b - f t
25
D DHDD
3 density (lbmol e / f t )
W , T )
aP
DH DT
H
enthalpy B t u / l b m ) temperature
(OR)
T TE RM1
TERM2
TE RM3
TERM4
intermediate value
mol ecul a r weight
WM
26
C(4!*R'T 2.9*C(2) 4.0*:(6!/7"2 + 5.0*C(8)/ 6.O'C(9!/T+*4 T"3 3.O*C(l) 4.0*C(7)/T 2.fl*C(3!+R*l 4 7.0*C(7)::) t(lJ)*(G.O*C(l! C(5!*(3.0 (3.0 + O.S'C(ll!*D+*2 C(ll)+'2*D**4)+ EXP( -C( l l ) * U * * ? ) ) / C ( 1 1 ) TEHfII*D 4 TERll:*D**2/2.0 + TiR143*D**5/5.0 + TERE;'J/
BlDD
'ERfll 'ERN 'ERI!3
~ : tI
T W
T E H r i l + TERX:+D 4 TERM3*D"d + C(5!/(i(ll)'T**Z!+ (5.11rC(ll)*D 4 5.0*C(ll)**?*D**3 2.5*C(ll)++3* J"5) +E XP( -C( 1 1 ) 'D+*Z) = (C(4j.R 4 3.0fC(6)/T*+3 1 5 . 0 * C ( b ) / T * + 4 + 24.0. C / 9 ) / T + * 5 ) '2 = 0:5*(i?.O*C(3)*S + 4.0*C( 7):?**2)*D*+2 = -C( 10!*D9*5*7.3'C( 7)/(T**2'5.0) 4 -z.vTER~~~/T**~ = H*CO!lL'R/LIIl + C t l ( 1 ) + CH(2)'T + CH(3)*T**Z + C H ( 4 ) * 1 * * 3 * U I ( S ) * T * * 4 + CH(6!*T*+5 = DtiI)D*CO:IVR/'.JIl = (TER!lI + TECllP 4 TERM3 + :ERY4)*CONVR/!W + CH(2) + 2.O+Ctl(3)*T 4 3.9*CH(4)'ig*2 4 C!i(S)*T"3*4.0 4 5.O*CH(6)*T**4
DH9D
W5T
t
RETUR'I
28
ENTR
DESC RI PT I ON
The entropy i s
calculated by computing the ideal gas entropy and the entropy departure from the ideal gas entropy by using the Star1 ing-Benedict-Webb-Rubin equation o f s t a t e . EQUATIONS S ( p,T) = (CONVR/WM) (-RRn (p*R*T)
exP(-Y*P 2 )))+cs,
aT
+2*Cs3*T
cs2
a aP S O
C
= (CONVR/WM)
(-R/p-( Bo*R+2*Co/T3-3*Do/T4
+ 4*D0/T5)
( b*R+d/T2)p
VARIABLE SYMBOL TABLE 1-dimensional array containing the coefficients t o the SBWR equation
o f state
CONV
C S
D
\
29
DSDT
T
temperature
(OR)
T E R M 1 intermediate Val ue
TERM2 TERM3
s
WM
30
7
START
31
* * * * * ic * *
* * a w
i t * * * * * * *
* * * * * * * *
Y * * *
* * * * * * * * * Y * * * * * * * x * * Y * Y * * * * *
Y
Y *
* * *
* * * *
* * Y
* *
32
l u )
FUGAC
The f u g a c i t y i s
31(2*R*T) ( b*R*T-a-d/T)p2
a f o aP
= f(p,T)*(l/d
+2 (R*T) (Bo*R*T-Ao-Co/T
+ Do/T -Eo/T )
af(p,T) aT
= f(p,T)
* ( 1/T+2/(R*T2)(Ao +
3*Co/T2-4*Do/T4)p
+ 3/(2*R*T2) (a+2*d/T)p2
D
DFDD DFDT
d e n s i t y (1bmole/ft3)
%(PT) aP
i n t e r m e d i a t e Val ue i n t e r m e d i a t e value
Irs
TE RM2
33
TERM3
TERM4
34
(7
START TERM 2 = :{3);R'T-C( 1)-C( 7 ) / T TERM 3 = C ( l ) + C ( ? ) / T TERM 4 = l.fl-(l.O-O.S*C( 11)*3"2-C[ 11)**2'P*4! 'C .CPf-3( 11)'@'*51 F = LOG(UhR*Ti+2iOo?f!% liO/tR*T)+3.0*O**7~ T E A 1 2/(2.fl*R*:)+C.O*C( 10). XRI! 3*Dc*5/ (5.0aR+T)+C(5)* TERM C / ( C ( l l ) * R * T * * 3 ) F = EXI'(I) DFDD F+(l.O/Dt2.0* TERK l / { R L T I - 3 . O * TERV 2*3/ tR*T)+G.O*C( 1 0 ) * C + * 4 * TFRu 3 / ( 9 * T ! + C ( S ) / ( R a t ( 11!*T**3) *( 3.G*C( 11:. *3+!.3*t( 11)**?*9 *+3-2.0'Ot*5*C( 11!**3'*iP(-C( 11) 'D"2), TERM 1 8 C( 2 ) +3.0*C( 6)/T"2-J. 0.C: 8) /T**3+5.0* C( O)/T**4 TERIl 2 = C{l!-2.3*C(7!/T OFDT = F*( 1.O/T+2.0* T E Y 4 1 *D/(T**Z*R)+3.0* T f R l l 2'D0*2/(2.O*~'T"2)-6.3.C( 13). T E W I 2 2'Dk'5/(S.D*R*T**2)-3.0*C~S)~ TERM 4/C( 11) *R*T **4 ) )
I
RETURN
-.
. .
..
..
. -.
..-.
. .
..
. .
w cn
36
INVERT
DESCR I PT I ON
INVERT solves a system of three equations i n t h r e e unknowns by
Gaussian e l i m i n a t i o n . TEMSAT INVERT is used i n t h e t h r e e v a r i a b l e search i n
.
intermediate value ApL t o be solved for
Apv t o be solved
DX(1) DX(2)
for
DX(3)
AT t o be solved for
F(1)
F( 2)
F,
value of f i r s t equation
F( 3)
I
3
K
L
M
index
index working a r r a y containing the c o e f f i c i e n t m a t r i x and t h e f u n c t i o n vector
N
W
XJACOB
coefficient matrix
37
0
START
YES
YES
38
YES
m -
K = K + I
39
40
PH KNOW
DESCRI PT I ON
PHKNOW uses a two variable Newton-Raphson i t e r a t i o n technique t o find
the density and temperature given pressure and enthalpy in the superheated vapor or compressed liquid regions. EQUATIONS
P(PT)
'known known
=o
h(PT)
=o
D
.
DHDD DH DT
ah (P T I aT
DLAST DPDD
DPDT
.,P( P T I
aP
N P J )
aT
H
HCAL
41
1
LIMIT
P
index
PCAL
T TLAST TTOLER
l a s t temperature calculated, to be used i n next i t e r a t i o n upper tolerance on saturation and convergence t e s t s Jacobian o f pressure and enthalpy
X JACOB
42
UTU
PRFS
I
ENTH
If
DIDLAST
1 . 1
I = I + l
PHYW:! F 4 I L EO
RETURN
Y cs
t
No
D=DLAST/lO.O
1
T=TLAST/lO.O
43
PRES
I
I!
. .
_.
44
Y * Y * Y * * * *
* * * * * Y *
Y
Y * Y
* * * it * * *
if
it * *
* * * * * * * * * * * * * * * * *
u o
X Y \ \
A -
46
46
* * it * Y Y * *
Y-3
it 4-
*
00
* *
it
Y
4 t *
46
it * * * * Y *
* * * * * *
x
<u
I-0
96
ao a x
3 .a * +
A A
* * * * * * * *
cc
0
I
!3
i +
* * it * * *
J
n.
-r
3 _-+
t-33 31i:1
51 I * .- a
a 'd
. f
x a-
Y,
+a
a * L3
1I
u'rl * '3 * II 11 c 3 * . n
! L
c
* * * * *
* * * i t * * *
* * Y * *
Y
it
20
.J0
3
0c It II
L
ia
* * *
2
v :L
I E'
b -
J
CO
L, (3
t ; n *
4
'2: 3
L
J3 t- u
3 0 3 4
I 3 w .r .AJ
3 3 3\
45
u
PRES
DESCRI PT I ON
PRES calculates the pressure and i t s derivatives w i t h respect t o
The pressure
4 ) P2 +( 6*R*T-a-d/T)p 3+a(a+d/T) p 6
2 3 6 2 (b*R+d/T )p -a*d*p /T
aP(p,T)
ap
3-Eo/T 4 )p + 3( b*R*T*-a-d/T)p 2 R*T+2( Bo*R*T-Ao-Co/T2+Do/T +6*a( a+d/T)p5 + 3*C*p 2/ T 2 ( l+y*p2) exp (-y*p2) -2*y2*p6*C/T2exp(-y*p2)
D DPDD
density (1 bmole/ft3)
P R T TERM 1
TERM 2
46
TERM3
TE RM4
47
t I
T E N 1 = C(n)*R*T-C(Z)-C(6)/T**Z+C(8)/T**3-C(9) iv*d TEHfl 2 = k ( 3 ! * R * T - C ( 1 ) - C ( 7 ) / T TERM 3 = C ( l ) + C ( 7 ) / T TERM 4 = I . f l + C ( l I ) * D * V P = DgRT+TER:I1*D*+2~TE?M Z*D**3+C( 10). TERM 3 *U**6+C(S)D**3* T t K I 4EXF(-C( 1l)DZ)
CrJ
START
/T**z
DPDD = R*T+2.0* TERM l * W 3 . J * TERM 2*D**2+6.0* C ( l 0 ) TERK 3*D**S~3.OOC(S)*D**Z* TCRM 4 EXP(-C( 1 1 ) 0 * * 2 ) / T + * ~ - 2 . D * C ( 1 1 ) **,?*D**6* C( 5 ) LXP( -C( 1 1 ) * C * Z ! /T+2 DPPT = D*R+D**Z+( C(4!*R+~.OC(61/1*3-3.nC(8)/ T**4+4.WC( 9)/7**5)+?**3*( C( 3 ) *RIG( 7 ) / T **Z)-D**6*C( 1O)*C( 7)/T**Z-Z.OC( 5 ) *D**3* TERM 4*EXP(-C( 111+9**7)1T**3
48
* * * * * * * * * * * * * * * + * *
Y
* * * * it * *
>
W
u * * * * * * * * * * * * * * *
*
=t
L -
u
~
* ** * *** ** * L
Y E
*
A
*
m!Y * w
5 -a
r3
-7
W
( r
* * * *
* * * Y
It
4t
* * * * **
C
+
a
c
#
?-
49
P RESAT
DESCRIPTION
PRESAT uses a two variable Newton-Raphson i t e r a t i o n technique t o f i n d
the saturation pressure and the saturated liquid and vapor densities given temperature.
Jacobian = (
-mp"
T)
aP
L'
Jacobian
Ji
VARIABLE SYMBOL TABLE BTOLER DFFDDL lower tolerance on saturation and convergence t e s t s
a f ( PL ,T 1
50
DFLDT DFPDDL
DFPDDV
DFVDDV
DL DLLAST DPLDDL
t o be used i n next i t e r a t on
DPLDT
DPVDDV
DPWDT
DV
s a t u r a t e d vapor density ( l b m o l e / f t 3 )
DVLAST FF FL FP
l a s t vapor density calculated, t o be used i n next i t e r a t i o n difference i n fugacities liquid fugacity f(pL,T) difference i n pressures P(pL,T) index maximum number of iterations allowed i n any one search
f(pL,T)
f(pv,T)
P(pv,T)
I
LIMIT
M2
P
PL
u n i t number f o r printed
pressure (psia)
1 i q u i d pressure P(PL,T)
(psia) (psia)
PV
vapor pressure
P(pv T)
S
51
temperature
(OR)
TTOLER
X JACOB
52
9
FUCiAC
-DPVDDV DPLDDL OFVDDV DFLODL DFP DDV'DFFDDL DFPDDL'DFFDDV D V = D'JLAST (FP'DFFD3L-FT'DFPDDL)i XJACOB D i = DCLAST-( FF'DFPDDV-FP*DFFDDV)/ XJACOR
- PV - FV -
c3
RETURN
53
Y
DV = OVL4ST/lO.O
bL ? , 0.0
OL = 0LLAST;IO.O
"r" "r"
FUCAC
FUGAC
DKAST
DV
-23
RFTURN
54
u
i t * * + * *
*
*
O
** it
* - I ii3
-
U * * * * * * *
W
Y
it
OZ
2
v1
*
oc * a r
*
Y
c a
* i *
*
k -
* *
VI
7
* * * * * it it *
ak-
* * it * * * * *
5?
e -
it
a
-
x
U l
w
*
* * a
* * I * V *
*
I D
inW U 3
W E
c a
U t l
z zcr o w
CE
LLF-
au
* * Y
a .
I
i(
f Y
cn5 H w o
* *. * * * Y * * * * * & * * * *
Li W f l
'4 ' 4 .L
C O
3%
3 <
3
Y z
9 m '2 , U
N
\
A
t 413
i-
1 3 II
P
' I
a
.n a
I-3
* * *
-4
Y Y
11 3
lL
II J
* * w + *
* m ua
l L L3
55
LUJ
z
0
-J
W
-.z
a
n z
U
e
! J -J
a
0
n w >
W ' 3
0 t0
56
Lj
PRINTC
DESCRIPTION PRINTC p r i n t s t h e r e s u l t s o f CARBON i , f NPRIN does n o t equal zero.
VARIABLE SYMBOL TABLE ABST absolute temperature d i f f e r e n c e enthalpy (BTU/l bm) saturated 1i q u i d enthalpy (BTU/lbm) s a t u r a t e d vapor enthalpy (BTU/l bm) t h e type o f l i g h t hydrocarbon t o be evaluated u n i t number f o r p r i n t e r p r i n t s e l e c t o r i f NPRIN = 0 then no p r i n t e l s e p r i n t o u t r e s u l t s o f CARBON
P
O F
to
OR
= 459.6
H
HL
HV
LFTYPE M2 NPRIN
pressure ( p s i a )
ty qual i
QUAL
S
SL
sv
T V
VL
VV
.- .
3 s p e c i f i c volume ( f t /lbm)
saturated 1i q u i d s p e c i f i c volume ( f t /1 bm)
57
+Lr' 6>
I
fiRRIt4
0
LFrYPE
SHV.HL SV.SL=
vv.v
( )
RETURY
COMPRESSED RETURN
-c
59
60
PSKNOW DESCRIPTION PSKNOW u es a two v a r i a b l e Newton-Raphson i t e r a t i o n technique t o f i n d t h e d e n s i t y and temperature given pressure and entropy i n t h e superheated vapor o r compressed l i q u i d region. EQUATIONS
P(PT)
S(PT)
dr)
Pknown Sknown
=o =o
VARIABLE SYMBOL TABLE BTOLER lower t o l e r a n c e on s a t u r a t i o n and convergence t e s t s density (lbmole/ft3) l a s t d e n s i t y c a l c u l a t e d t o be used i n n e x t i t e r a t i o n
aP(PT)
aP
D
DLAST
DPDD
DPDT
DSDD
aP(PT) aT aS(PT)
aP
DSDT
as( P T I
aT
index
I
\
61
LIMIT
M2
P PCAL
u n i t number f o r printer
known pressure (psi a ) calculated pressure (psia) known entropy (Btu/l bmoR) calculated entropy (Btu/l bmoR) temperature
(OR)
s
SCAL T TLAST TTOLER XJACOB
l a s t temperature calculated t o be used i n next i t e r a t i o n upper tolerance on saturation and convergence t e s t s Jacobian of pressure and entropy
62
"r"
PRES YES PSrC*lOW F A I L E TO CONVERGE
1
XJACOB
DPDD-(PCAL-P)
DSDD)/XJACOB
t
T
c
0.0
T=TLAST/lO.O
5
D=DLAST/ 10.0
63
Ls
0-l
65
SATC
DESC R I PTION SATC c a l l s ENTH and ENTR t o compute t h e s a t u r a t e d l i q u i d and vapor
p r o p e r t i e s given temperature and t h e s a t u r a t e d 1i q u i d and vapor d e n s i t i e s
VARIABLE SYMBOL
DHLDD DHLDT DHVDD DHVDT DL DSLDD DSLDT saturated l i q u i d density (lbmole/ft3)
DSVDD
ash, T)
aP
DSVDT
DV
as(,pv T)
aT'
s a t u r a t e d vapor d e n s i t y ( 1 b m o l e / f t 3 ) s a t u r a t e d 1i q u i d enthalpy ( B t u / l bm) s a t u r a t e d vapor enthal py ( B t u / l bm) s a t u r a t e d l i q u i d entropy (Btu/lbm"R) s a t u r a t e d vapor entropy ( B t u / l bmoR) temperature
(OR)
HL HV
SL
sv
T
66
i +
START
ENTH(L IQU I D )
ENTR(LIQU1D)
ENTH(VAP0R)
t
****************************************************4*********
* *
* *
S A T C
LIQUID
AFJD V A P W
* ******************************************************************
S U ~ ~ U C I T I IS ~kE T C ( I r Lit- r U J I t l L , SL I tfv r SV 1CALL t i J T r i ( T r irL t i IL r O i L a T r bhLOL 1 CALL t I J T t { ( T r UL r LL e u ! ; ~ i TI LSLDL CALL tfJ I t 1 ( I b V r t i d r ZtibDT tUt1VDi)) CALL Erir r( t i I i)v I s v U:,JI,T L S V D 1~ RETUriN END
* * * * * *
r n
U
68
cos
SETUP
DESCRIPTION
SETUP stores the values f o r the 1 ight hydrocarbon to be eval uated i n
the coefficient arrays, C, CS and CH. a1 so assigned t h e i r Val ues. VARIABLE SYMBOL TABLE
C
1-dimensional array containing the coefficients f o r the Star1 ingBenedict-Webb-Rubin equation of s t a t e c(1)
c(2) c(3)
(34) c( 5)
b
BO
C
cO
C(6) (37)
C(8)
d
DO
c(9)
Eo
ct
C(1W
C(11)
cs
CH
1-dimensional array containing the coefficients f o r the ideal gas entropy 1-dimensional array containing the coefficients for the ideal gas enthalpy c r i t i c a l density (lbmole/ft 3 ) 1-dimensional array containing the coefficients f o r the hydrocarbon t o be evaluated
DCRIT GIVEN
69
GIVEN (1) GIVEN (2) GIVEN (3) GIVEN (4) GIVEN (5) GIVEN ( 6 ) GIVEN ( 7 ) GIVEN (8) GIVEN ( 9 ) GIVEN ( 1 0 ) GIVEN (11) GIVEN (12) GIVEN (13) GIVEN (14) GIVEN (15) GIVEN (16) GIVEN (17) GIVEN (18) GIVEN (19) GIVEN (20) GIVEN (21) GIVEN ( 2 2 ) GIVEN (23) GIVEN ( 2 4 ) GIVEN (25) GIVEN (26) GIVEN ( 2 7 )
i
70
PCRIT TRC I T
WM
71
i3
MI-GIVEN(27)
A
RETURN
72
* ******** *
c T
'Ll J
I -
Y
i+
0 Y
Y
it
* * * Y * * it
Y
* A I
*
e
'0
* *
* - I
* * *
r
e o
LL
V I
i -
Y * *
W
n
* e * * + -
* * * * *
w
i Y t e
it
u
* a
* *
* I -
a a
* I -
* * * * *
w
IN
WLA!
a
*;LE
*uz *e
u l
* * Y
Y * * * * * * * * * * * * * * it * Y *
46
* Y
* i t * *
x U L
3
73
TEMSAT
DESCRI PT I O N
TEMSAT uses a three variable Newton-Raphson i t e r a t i o n technique t o find
the saturation temperature and the saturated liquid and vapor densities
gi ven pressure. The conditions a t equi 1 i b r i um are, the pressure cal cul ated
w i t h e i t h e r the liquid o r vapor density must equal the known pressure and t h e
fugacities of both the liquid and vapor phases must also be equal.
known = F2
-F1 =
SL
+ aF1
APV +
aF1 3T
AT
+ aF3
a%
APv +
aF3
AT
F1
F2
P V
AT
F3
a
74
DFLDT
3T
DFVDDV DPVDT
DPVDDV
DPVDT
75
AT
F1
F2 F3 f(PLT)
d
f(P,
T)
known pressure ( P s i 4
P(PL,T)
P( Pv S T )
saturation temperature
(OR)
pv
and T.
76
+
FRES( L I Q U I D )
PRES( VAPOR)
FUGAC( L I Q U I 0)
F U W ( VAPOR)
I I
I
* JP(oL,T)/aT
* af(ov,T)/ao
Jf( pV,T)/ JT
Jf(DL.f)/Jf
77
r
t
78
PRES(VAP0R)
FUGAC( L IQUI 0)
No4
TOLERANCE
79
* *
+ * * * *
.c
* * * * * *
* ****** * * * * * * * * 0 * Z * * * Y * Y * * * * * *
* C Y * 'JJ * - I
a
**
* *
*
* o * I * a
'E
' L J
* - I
* * * * * *
I -
113
* * * * * * * * *
Y, :3
J
3
* * * * * *
n
.J
L-c
-J
-3
L
3
F3
II
-3 II
na
3 1
II It
1
v
V Q
3 ' d
.a
>
II
it
Y *
J J 3
a c e
4
G O
r c o
c
C I -
u l
iC
t
-4 II II
z
-4
k
II c r
cc r <rc
t t
II
C?
s m
3 4
cir?
X-i
\ -
I-c
0
c D r
t
0 0
r
Y
Frl
h
3 -
v;
C
L.
08
t
81
VFIND DESCRIPTION VFIND uses a Newton-Raphson i t e r a t i o n technique to f i n d the density given pressure and temperature f o r the compressed 1i q u i d o r superheated vapor regions EQUATIONS
P(p,T)
Pknown
=o
lower tolerance on saturation and convergence t e s t s density (1bmol e/ft) l a s t density calculated, t o be used i n next i t e r a t i o n aP(P,T)
aP
DPDT I LIMIT
M2
u n i t number of printer
known pressure (psia) calcul ated pressure (psi a )
P
PCAL
T
TTOLER
known temperature
(OR)
?
82
+
PRES
t
DZDLAST- (FCAL-P)/DPDD
I
I 1 0
DLAST=D
I
RETURN
t
D=DLAS:/lO.O
it*
* *
it
* * *
it
Y *
* * *
U
* * it .+ * * * *
4t
it
ik
* * * * *
46
*
i
it
* Y * * *
it + *
* * * it * it
C '
X
L
it
G 4
zc
b
* * * * * * * * * *
m
i
H
it
4
it
u l
X I?
* * it
0
L.
* * * * * * * * * * * * *
L n
Y
.y
* * * *
it
18
m z
* * *
Y * it
it Y
it*
* * **** * *
r3
84
Refe rences
1. Mechtly, E. A., The International System of Units, Physical Constants and Conversion Factors, 2nd Revision, NASA, Washington, D. C., 1973
2. Starling, Kenneth E., Fluid Thermodynamic Properties for Light Petroleum Systems, Gulf Publishing Company, Houston, 1973
t?
3. Starling, K. E., Fish, L. W., and Yieh, D., HSGC, A Mixture University Thermodynamic Properties Computer Program, 0R0-4944-2, of Oklahoma, 1975