Anda di halaman 1dari 94

DGE/ 1549- 3 D i s t r i b u t i o n Category UC-66d

A COMPUTER PROGRAM FOR DETERMINING THE THERMODYNAMIC PROPERTIES OF LIGHT HYDROCARBONS

David H. Riemer

Harold R. Jacobs Robert F. Boeh Donald S. Cook

MECHANICAL ENGINEERING UNIVERSITY OF UTAH SALT LAKE CITY, UTAH 84112


D a t e Pub1 ished--July 1976
NOTICE

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

T h i s program was written t o be used as a subroutine.

The program

determines the thermodynamics of 1 i g h t hydrocarbons.

The following

1 i g h t hydrocarbons can be analyzed: Butane, Ethane , Ethyl ene , Heptane,

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.

NOMENCLATURE a constant i n SBWR equation constant i n SBWR equation b


BO
C cO
I1

I1

I1

I1

I1

I1

It

It

It

I1

I1

11

I1

I1

11

I1

hl h2

constant i n i d e a l gas enthalpy equation


I1

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

constant i n i d e a l gas entropy equation


I1 I1
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

constant i n SBWR equation


It
I1

I1

11

I1

I1

I1

I1

f h
P
S

f ugac it y enthalpy (BTU/l bmole) pressure ( p s i a ) entropy (BTU/l bmole)

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

...................... FUGAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Equation . . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol T.able . . . . . . . . . . . . . . . . . . . . Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . Computer L i s t i n g . . . . . . . . . . . . . . . . . . . . . .

Description . . . . . . . . . . . . Equations V a r i a b l e Symbol Table . . . . . . . Logic Diagram Computer L i s t i n g

.......................... ............. ........................

.............

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

Logic Diagram . . Computer L i s t i n g

......................

58 60 60 60 60 62 64 65 65 65 66 67

.......................... .................... ........................ ...................... VFIND . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Description . . . . . . . . . . . . . . . . . . . . . . . . . Equations . . . . . . . . . . . . . . . . . . . . . . . . . . V a r i a b l e Symbol Table . . . . . . . . . . . . . . . . . . . .


Equations V a r i a b l e Symbol Table Logic Diagram Computer Listing Logic Diagram . . Computer L i s t i n g REFERENCES

.............................. 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.

This r o u t i n e can be t r e a t e d as a black

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

2 3 4 2 (BoRT-Ao-Co/T +Do/T -Eo/T )p + (bRT-a-d/T)p3 + a ( a +d/T)p6

h =

@ (BoRT-2Ao-4Co/T 2

+ 5D0/T 3-6E0/T 4 )p+ @ / 2 (2bRT-3a-4d/T)p 2


2
)

+ar$/5(6a+7d/T)p5

+ C@/ (yT2) ( 3 - ( 3+yp2/2-y2p4),

s =

bRen (pRT) -@(BoR+2Co/T3-3D0/T 4 + 4E0/TS)p- @/2(bR + d/T)p2 a@dp5/(5T2) + 2 @C/(yT3)(1-(1 +yp2/2)eYP

2
+ CS1 + CS2T

Cs3T2 + CS4T3 + CsgT4 + Cs6T5

Rnf =

Rn (PRT) + 2/(RT) (BRT-Ao-Co/TZ + Do/T3 (bRT-a-d/T)p e-YP .)

E0/T4)p

+ 3/(2RT)

+ 6a/(5RT) (a-d/T) p 5 + C/(yRT3) (1 - ( 1-yp2/2-y2p4)

I!

yrs

Recall that a thermodynamic s t a t e requires t h a t two properties be known and

for saturation s t a t e s pressure and temperature are dependent.

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) ,

In order t o determine properties f o r these

processes, properties must be determined w i t h one of the following pairs of knowns: temperature and pressure, temperature and quality, pressure Since

and quality, pressure and enthalpy,and pressure and entropy.

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

and vapor densities.

The cases of pressure and entropy or enthalpy as

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.

i t e r a t i o n technique i s used f o r searches i n CARBON beccuse of i t s generally


r a p i d convergence.

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

of t h e program), second t h e program may be m o d i f i e d t o b e s t s u i t t h e users


needs ( t h e remaining t e x t contains a more complete d e s c r i p t i o n of each subroutine). Subroutines were used throughout t o a l l o w f o r each m o d i f i c a t i o n This r e p o r t c o n t a i n s

and as a means o f t r a c i n g any p o s s i b l e problems.

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

inf orma t ion :


1. The process f o r which p r o p e r t i e s a r e t o be determined (CYCLE) The a l l o w a b l e values o f CYCLE a r e t h e f o l l o w i n g p a i r s o f knowns: TP

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.

The value o f t h e f i r s t known s p e c i f i e d by t h e value o f CYCLE (FGIVEN)

3.

The value o f t h e second known s p e c i f i e d by t h e value o f CYCLE

( SGI VEN ).

4.

Light hydrocarbon type.

Acceptable values o f LFTYPE a r e ISOB,

ISOP, BUT, PENT, METH, ETH, ETHYL, PROP, HEX, HEPT, OCT and
PROPYL.

5.

Print s e l e c t o r

i f NPRIN = 0 , then do not print out r e s u l t s ,

otherwise p r i n t resul ts.


CARBON will return the following information:
1. 2.

Enthalpy (Btu/l bm) Entropy (BTU/l bmoR) Quality

3.

applies t o saturation s t a t e s ,

t e r than one

then superheated vapor region and i f l e s s than one then


compressed 1i q u i d region.
4.
5.

Specific volume (ft3/lbm) Temperature


(OF)

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.

A typical c a l l on CARBON would look like

CALL CARBON ( I TP ' , TEMP, PRESS,


HV,W,

' ISOB , H ,S ,V ,T ,P ,NPRIN ,SL ,HL ,VL ,SV ,


I

QUAL)

T h i s c a l l on CARBON eval uates properties f o r Isobutane given temperature,

(TEMP) and pressure (PRESS).

Subroutine CARBON was written so as t o be

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

absolute temperature difference between

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.

density (1 bmole/ft3) c r i t i c a l density ( 1 bmol e / f t 3 )


ah (P, W a p

DCRIT
DHDD

DH DT DL
DPDD
DPDT
DSDD

a h ( P ,TI/

a~
3

saturated 1 iquid density (1 bmo e / f t ' 1


ap( P S T ) / aP
a P ( P ,TI/ aT

as( P ,T I / a P

DSDT
DV

as(P ,TI a~
saturated vapor density (lbmole/ft 3 )

ETA

1-dimensional array containing the required coefficients f o r Ethane

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

CYCLE of TP, TX and TV and pressure for values o f CYCLE of PX,


PS and PH

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

accepted values are: BUT ETHYL

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

PH and entropy f o r CYCLE = PS

SL

saturated l i q u i d entropy (BTU/lbm OR) saturated vapor entropy (Btu/lbm0R) temperature


(OF)

sv
T TCRIT TR TTOLER V VL

c r i t i c a l temperature temperature (OR)

(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

1-dimensional array containing the required coefficients f o r isopentane

XMETH

1-dimensional array containing the required coefficients f o r methane

v > LL

n
IT >

10

c 2

'-

T= F t 1'I i N P = S S 1'; C Pi TR=T 4 i C S T

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)

2 + 5*D0/T 3-6*E0/T 4 ) P + 1/2

p2+a/5( 6*a+7*d/T) p5+c(y*T2) (3- ( 3 9 * P2/2-yZp4)

ah P T) = (CONVR/WM) ( BoR+8*Co/T3-1 5*D0/T4 + z ~ * E , / T ~ ) ~ 1/2 + (Z*b*R+4*d/T 2 )p 2

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) ) )

+ 3*Ch4*T 2+4*Chs*T 3+5*Ch6*T 4

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

/T2 + 5*Do/T3-6*Eo/T4+( 2*b*R*T


0

+ C/(y*T2) (5*y*p+59 2

p -2*y

3 5

p )

exp (-Y*P')) VARIABLE SYMBOL TABLE


C

1-dimensional a r r a y c o n t a i n i n g t h e c o e f f i c i e n t s t o t h e SBWR eqi of state

3 ti

CH

1-dimensional a r r a y c o n t a i n i n g t h e c o e f f i c i e n t s f o r t h e i d e a l gas enthalpy

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

intermediate value intermediate value


i ntermedi a t e Val ue

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

ENTR calculates the entropy and i t s derivatives w i t h respect t o

temperature and densi ty given density and temperature.

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)

(Bo*R + 2*CoT 3-3*D0/T 4+4*E0/T 5 ) p

-1/2 (b*R+d/T 2 )p 2+a*D*p5/(5*T2)+2*c/(y*T3) (1-(1+1/2*y*p2)

exP(-Y*P 2 )))+cs,

cs2 *T + Cs3*T 2 + Cs4*T 3 + Cs5*T4+Cs6*T5

aT

(COP.I.VR/WM) (-R/T- (-6*Co/T4+1 2*DoT5-20*Eo/T6)p+ d*p2/T3


-2*a* dp5/ ( 5*T3) -6*C/Cy*T4) ( 1 ( 1+1/2*y* p 2 ) exp ( -y*p2) ) )

+2*Cs3*T
cs2

+ 3 Cs4*T2 + 4*Cs5 *T 3+5*CS6*T4

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

+a*d*p 4/T 4 + 2*C/T3( p+y*p3)exp ( -y*p2) )

VARIABLE SYMBOL TABLE 1-dimensional array containing the coefficients t o the SBWR equation
o f state

CONV

2/ l bmft 3 conversion factor = 0.185037_-BtUurin

C S

1-dimensional array containing the coefficient f o r the ideal gas entropy

D
\

density (1 bmol e/ft3)

29

DSDT
T

temperature

(OR)

T E R M 1 intermediate Val ue
TERM2 TERM3

intermediate value intermediate value entropy ( B t u / l bmoR) molecular weight

s
WM

30

7
START

31

* * * * * ic * *
* * a w

i t * * * * * * *

* * * * * * * *

Y * * *

* * * * * * * * * Y * * * * * * * x * * Y * Y * * * * *
Y

Y *

* * *

* * * *

* * Y

* *

32

l u )

FUGAC

FUGAC c a l c u l a t e s t h e f u g a c i t y and i t s d e r i v a t i v e s w i t h respect t o

temperature and d e n s i t y given temperature and density.

The f u g a c i t y i s

computed using t h e Starling-Benedict-Webb-Rubin equation o f s t a t e . EQUATION !?,nf(p,T) = An (p*R*T) + 2/(R*T)(Bo*R*T-Ao-Co/T

2 +Do/T 3-Eo/T 4 > P

31(2*R*T) ( b*R*T-a-d/T)p2

+ 6 * 4 ( 5*R*T) ( a+d/T) p5+C (y*R*T3) ( 1 ( 1+y*p 2/Z-Y2 , P4)


exp (-Y*P2))

a f o aP

= f(p,T)*(l/d

+2 (R*T) (Bo*R*T-Ao-Co/T

+ Do/T -Eo/T )

+3/( R*T) (b*R*T-a-d/T)p

+ 6*a/ (R*T) (a+d/T)p4 +C/( R*T3)*y( 3*y*p+3*y2 **p3-Z Y 3*p 5 1- exP(-Y*P 2 1)

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

2 2 4 2 -6*a/ ( 5*R*T2) (a+Z*d/T) p5 -3*c/ (y*R*T4) (1 ( 1-y*p /2-y *p )exp( -y*p ) )

VARIABLE SYMBOL TABLE

1-dimensional a r r a y c o n t a i n i n g t h e c o e f f i c i e n t s t o t h e Star1 ingBenedict-Webb-Rubi n equation o f s t a t e

D
DFDD DFDT

d e n s i t y (1bmole/ft3)
%(PT) aP

f ugac it y 3 u n i v e r s a l gas constant = 10.7355 p s i a - f t /lbmole"R temperature TERM1


(OR)

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

intermediate value intermediate value

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

VARIABLE SYMBOL TABLE


C

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

F value of second equation 2 F value of t h i r d equation 3


index index index index

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

VARIABLE SYMBOL TABLE


BTOLER

lower tolerance on saturation and convergence t e s t s density (1 bmol e/ft')


ah (PJ)
aP

D
.

DHDD DH DT

ah (P T I aT

DLAST DPDD
DPDT

l a s t density calculated, to be used i n next i t e r a t i o n

.,P( P T I
aP

N P J )

aT

H
HCAL

known enthalpy (BTU/l bm)

cal cul a t e d enthalpy (BTU/l bm)

41

1
LIMIT
P

index

maximum number of i t e r a t i o n s allowed i n any one search


known pressure ( psia) cal cul ated pressure (psi a ) temperature
(OR)

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

((PC4L-P) M D T -(HCAL-H) DPDT)/XJACOB T=TLASST-((HCAL-H) oPDD-(PcAL-P)

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

temperature and density given the temperature and density.

The pressure

i s computed using the Starling-Benedict-Webb-Rubin equation of s t a t e .

EQUATIONS P ( p ,T) = p*R*T+( Bo*R*T-Ao-Co/T2+Do/T3-Eo/T +c*p 3/T 2 (l+yp21exp(-y*P2)

4 ) P2 +( 6*R*T-a-d/T)p 3+a(a+d/T) p 6

aP(p,T) 3 4 5 2 T= p*R+( Bo*R+2+Co/T-3*Do/T +4*E0/T )p +

2 3 6 2 (b*R+d/T )p -a*d*p /T

3 3 -2*c*p /T (1+r*p2) exp (-y*p2)

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)

VARIABLE SYMBOL TABLE


C

1-dimensional array containing the coefficients t o the SBWR equation of s t a t e

D DPDD

density (1 bmole/ft3)

P R T TERM 1
TERM 2

pressure ( p s i a ) universal gas constant = 10.7335 psia-ft 3/Ibmole"R temperature


(OR)

intermediate value intermediate value

46

TERM3
TE RM4

intermediate value intermediate value

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.

A t equilibrium the pressure and fugacity of the l i q u i d and

vapor phases m u s t be equal.


EQUATIONS
I

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

saturated 1 iquid density ( 1 bmo e / f t 3 )


l a s t l i q u d dens t y calculated

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

upper to1 erance on saturation and convergence t e s t s Jacobian

52

9
FUCiAC

PRESAT FAILE TD CONVERGC FP = PL FF = FL DFPDnV DFPDDL = DFFDD'J = OFFDOL = X JACOi3 *

-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

entropy ( B t u / l bmoR) s a t u r a t e d 1 i q u i d entropy ( B t u / l bmoR) saturated vapor entropy ( B t u / l bmoR) temperature


(OR)

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)

3/lbm) s a t u r a t e d vapor s p e c i f i c volume ( f t


-

57

+Lr' 6>
I
fiRRIt4
0

LFrYPE

SHV.HL SV.SL=

UAL > 0.0

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

maximum number of iterations t o be allowed i n any one search

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 DSDT DPDT M O D D = DLAST ((PCAL-P) DSDT-(SCAL5)' M'DT)/XJAtOB T-TLAST-((SCAL-5)'

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

TtilS SJLjnOQTrllE 3kTEKFiI:rJtS SATURATED *PhWtRTitS

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

PCRIT, DCRIT, WM and TCRIT are

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

index c r i t i c a l pressure ( p s i a ) c r i t i c a l temperature (OR)


mol ecul a r weight

PCRIT TRC I T

WM

The following arrays have the same format as GIVEN:


HEPT, HEX, OCT, PENT, PROP, PROPYL, XISOB, XISOP, XMETH.

BUT, ETH, ETHYL,

71

i3

PCRIT=GIVEN(24) TCRIT=CIVEN( 25)


DCRIT=CIVEl~(26)

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

F2 and F3 i n a Taylor series


LpL

+ aF1

APV +

aF1 3T

AT

-F3 - --ApL aF3 a PL

+ aF3

a%

APv +

aF3

AT

solving f o r ApL, ApV and AT and s u b s t i t u t i n g i n f o r F1, F2 and F3


-1
A PL

F1
F2

P V

AT

F3

a
74

BTOLER DCRIT DFLDDL

lower t o l e r a n c e on convergence and s a t u r a t i o n t e s t s c r i t i c a l density (lbmole/ft3) af(P,YT)


i

DFLDT
3T

DFVDDV DPVDT

DL DLLAST DPLDDL DPLDT

s a t u r a t e d 1i q u i d d e n s i t y ( 1 b m o l e / f t 3 ) l a s t l i q u i d d e n s i t y calculated, t o be used i n next i t e r a t i o n ap( PL YT)

DPVDDV

DPVDT

75

3 saturated vapor density (1 bmole/ft )

l a s t vapor density calculated, t o be used i n next i t e r a t i o n


ApL
APV

AT

F1
F2 F3 f(PLT)
d

f(P,

T)

index maxi mum number o f iterations allowed i n any one search


u n i t number o f printer

known pressure ( P s i 4
P(PL,T)

P( Pv S T )
saturation temperature
(OR)

l a s t temperature calculated, t o be used i n next i t e r a t i o n 2-dimensional array containing the Jacobian o f


pL,

pv

and T.

76

TCRITR = TCRIT ARST T 6.10.0 DV = DCRIT/ZO.O OL = DCRIT.2.5 TLAST * T OVLAST = DV DLLAST * OL

+
FRES( L I Q U I D )

PRES( VAPOR)

FUGAC( L I Q U I 0)

F U W ( VAPOR)

I I
I

YES 1 . 1 4 1 FAILED TO CONVERGE

fv fL F(3) XJACOE(l.1) = aP(oL.T)/ao XJACOB(1.2) = 0


XJACOB(1.3) XJACOE(Z.1)

* JP(oL,T)/aT

= 0 XJACOE(2.2) = aP(pv.T)/ap XJACOE(2.3) = P(py,T)/JT


XJAtOE(3.1) XJACOE(3.2) XJACOB( 3.3) -hf(pL.T)/Jo

* 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

VARIABLE SYMBOL TABLE BOTLER


D
DLAST
DPDD

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

maximum number of iterations allowed i n any one search


~

u n i t number of printer
known pressure (psia) calcul ated pressure (psi a )

P
PCAL

T
TTOLER

known temperature

(OR)

upper tolerance on saturation and convergence t e s t s

?
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

Anda mungkin juga menyukai