Upload
jgarciablanco
View
216
Download
0
Embed Size (px)
Citation preview
8/14/2019 Program BWRS
1/94
DGE/ 1549- 3D i s t r i b u t i o n Category UC-66d
A COMPUTER PROGRAM FOR DETERMINING THETHERMODYNAMIC PROPERTIES OF LIGHT HYDROCARBONS
Dav id H. RiemerHarold R. JacobsRobert F B o e hDonald S. Cook
MECHANICAL ENGINEERINGUNIVERSITY OF UTAHSALT LAKE CITY, UT AH 84112D a t e Pub1 ished--July 1976NOTICE
sponsored by the United Ststea Government. Neitherthe United States nor the United Stat- EnergyResearch and Development Addnistmtion, nor any oftheir employees. nor m y of their mntnctorsSubconlnclon. or their employ- , mker anywarranty, expreu or implied. or anumes any Il iabaty 01 responsibility for the accuracy. cornpictenenor u rf u l n ea of m y informtion. apparatus. p r o d u a orpmcirr disclosed, r represents that its UIC would noti n f n n c privately owned right,.
?""si_.-PREPARED FOR T H E I >t p-ENERGY RESEARCH AND DEVELOPMENT ADMINISTRATIONUNDER GRA .IT E I 0-1 ) 1549
~~,~~~~DIVISION OF GEOTHERMAL ENERGY ~~~~~
8/14/2019 Program BWRS
2/94
DISCLAIMER
This report was prepared as an account of work sponsored by anagency of the United States Government. Neither the United StatesGovernment nor any agency Thereof, nor any of their employees,makes any warranty, express or implied, or assumes any legalliability or responsibility for the accuracy, completeness, orusefulness of any information, apparatus, product, or processdisclosed, or represents that its use would not infringe privatelyowned rights. Reference herein to any specific commercial product,process, or service by trade name, trademark, manufacturer, orotherwise does not necessarily constitute or imply its endorsement,recommendation, or favoring by the United States Government or anyagency thereof. The views and opinions of authors expressed hereindo not necessarily state or reflect those of the United StatesGovernment or any agency thereof.
8/14/2019 Program BWRS
3/94
DISCLAIMER
Portions of this document may be illegible inelectronic image products. Images are producedfrom the best available original document.
8/14/2019 Program BWRS
4/94
ACKNOWLEDGEMENTS
This computer routine was developed t o use in program DIRGE0desc r ibed in Ana lys is of D irect Contact Binary Cycles fo r GeothermalPoweP Generation, ERDA Report DGE/1549-5 (September 1 9 7 6 ) .
The suppor t o f E RDA i s a p p re c i at e d .
8/14/2019 Program BWRS
5/94
ABSTRACTT h i s program was written t o be used as a subrout ine. The program
determines the thermodynamics of 1i g h t hydrocarbons. The fol low ing1i g h t hydrocarbons can b e analyzed: Butane, Ethane , Ethyl ene , Heptane,Hexane, Isobutane, Isopentane, Methane, Octane, Pentane, Propane andPropylene.l ight hydrocarbons given any of the fo l lowing pa i r s o f s t a t e q u a n t i t i e s :pressure and qual i ty , pressure and enthalpy, pressure and entropy, tempera-ture and pressure, temperature and q&l i ty and temperature and s p e c i f i cvolume.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 .St ar 1 ing-Benedict-Webb-Rubin equ ation o f s t a t e was used. This re p or tcon ta ins a brief des c r i p t i on , f lowcha r t, l i s t i n g and r equ ir ed equa t ions foreach subrout ine.
The subroutine can evaluate a thermodynamic state for the
These s ix pa i r s o f knowns allow the user to analyze any thermo-The
8/14/2019 Program BWRS
6/94
NOMENCLATUREa
bBO
cO
C
hlh2h3h4h5h5h6cs 1cs2cs 3cs4cs5s6dDO
EOfhPS
c o n s t a n t i n SBWR e q u a t i o nc on s ta n t i n SBWR e q u a t i o n
I1 I 1 I 1 I 1
I 1 I t I t I t
I 1 I 1 I1 11
I 1 I 1 11 I 1
c o n s t a n t i n i d e a l gas e n t h a l p y e q u a t io nI1 I t 11 I 1 I 1 11
I1 I1 I1 I1 I 1 11
I1 I1 I1 I1 I 1 11
I1 I 1 I t 11 I1 11
I t I t I1 I t I1 11
I 1 I 1 I 1 I1 I 1 11
c on s t an t i n i d e a l gas en t r opy equa t ionI 1 I 1 I 1 I 1 I t 11
I1 I 1 I1 11 I1 11
I1 I t II I t I 1 11
I t I 1 I 1 I1 I 1 11
I1 I1 I 1 I t 11 11
c on s ta n t i n SBWR e q u a t i o nI t I1 I1 11
I1 I 1 I1 I1
f ugaci ye n t h a l p y ( B T U / l bmole)p r e s s u r e ( p s i a )en t ro py (BTU/l bmole)
8/14/2019 Program BWRS
7/94
TABLE OF CONTENTSABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . iACKNOWLEDGEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . iiNOMENCLATURE . . . . . . . . . . . . . . . . . . . . . . . . . . . v iINTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . 1DEVELOPMENT OF PROPERTIES . . . . . . . . . . . . . . . . . . . . 1PROGRAM DEVELOPMENT . . . . . . . . . . . . . . . . . . . . . . . . 2USE OF CARBON . . . . . . . . . . . . . . . . . . . . . . . . . . 3CARBON . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 5V ar ia b l e Symbol Tab l e . . . . . . . . . . . . . . . . . . . . 5Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 9C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 15 ENTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 24Equa t ions . . . . . . . . . . . . . . . . . . . . . . . . . . 24Va r ia b l e Symbol T ab le . . . . . . . . . . . . . . . . . . . . 24Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 26C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 27
ENTR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Description . . . . . . . . . . . . . . . . . . . . . . . . . 28Equa t ions . . . . . . . . . . . . . . . . . . . . . . . . . . 28Va r ia b l e Symbol T ab le . . . . . . . . . . . . . . . . . . . . 28Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 30C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 31
FUGAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 32E q u a t i o n . . . . . . . . . . . . . . . . . . . . . . . . . . . 32Var iable Symbol T.able . . . . . . . . . . . . . . . . . . . . 32Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 34 C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 35
8/14/2019 Program BWRS
8/94
INVERT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 6 D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 3 6 Va r i ab le Symbol Tab le . . . . . . . . . . . . . . . . . . . . 36Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 37 C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 39
PHKNOW . . . . . . . . . . . . . . . . . . . . . . . . . . . J . . . 40D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 40Equat ions . . . . . . . . . . . . . . . . . . . . . . . . . . 40Va r i ab le Symbol Tab le . . . . . . . . . . . . . . . . . . . . 40Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . 42C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 43
PRES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 45 V ar ia b l e Symbol Ta b le . . . . . . . . . . . . . . . . . . . . 45Equa t i ons . . . . . . . . . . . . . . . . . . . . . . . . . . 45Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 47C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 48
PRESAT . 49Descr i t on . . . . . . . . . . . . . . . . . . . . . . . . . 49Equa t i ons . . . . . . . . . . . . . . . . . . . . . . . . . . 49V ar ia b l e Symbol Tab le . . . . . . . . . . . . . . . . . . . . 49 Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 52C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 54
PRINTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 56Va r i ab le Symbol Ta b le . . . . . . . . . . . . . . . . . . . . 56 Logic D i a g r a m . . . . . . . . . . . . . . . . . . . . . . . . 57 C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 58
PSKNOW . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 60Equa t i ons . . . . . . . . . . . . . . . . . . . . . . . . . . 60Va r i ab le Symbol Tab le . . . . . . . . . . . . . . . . . . . . 60Log ic D iagram . . . . . . . . . . . . . . . . . . . . . . . . 62C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . . 64
SATC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65D e s c r i p t i o n . . . . . . . . . . . . . . . . . . . . . . . . . 65 Va r i ab l .e Symbol Table . . . . . . . . . . . . . . . . . . . .Logic Diagram . . . . . . . . . . . . . . . . . . . . . . . . 66C o m p u t e r L i s t i n g . . . . . . . . . . . . . . . . . . . . . . 6765
i v
8/14/2019 Program BWRS
9/94
8/14/2019 Program BWRS
10/94
8/14/2019 Program BWRS
11/94
I N T R O D U C T I O NTh is sub rou t i ne compu tes the thermodynami c p ro pe r t i e s o f 1i ht
hydrocarbons.a p p l i c a t i o n s s u c h t h a t i t may be used t o d e te rm in e t h e p r o p e r t i e s o f l i g h thydrocarbons i n any thermodynamic c y c le i c l u d i ng, as t h e au th ors deve l opedi t , e v a l u a t in g b i n a r y f l u i d cy c le s .b ox b y t h e u s e r w i t h a l i m i t e d b ac kg ro un d i n p r o g r a m i n g o r t h e p r og ra mmay be mod i f i e d t o meet th e users requ i rements . Th i s manual was w r i t t e nt o a s s i s t t h e u se r i n wh icheve r manner he i n tend s t o use th i s p rogram.DEVELOPMENT OF PROPERTIES
The s u b ro u t i n e was d e v e lo p ed t o a l l o w f o r a w id e ra n g e o f
T h i s r o u t i n e ca n b e t r e a t e d as a b l a c k
The b a s i c e q u a t i o n u se d i s t h e Starling-Benedict-Webb-Rubb e q u a t i o no f s t a t e , w hic h i s a p re s s ur e e x p l i c i t e q u a t i o n o f t h e f orm :
P =
h =
s =
Rn f =
2 3 4 2P R T + (BoRT-Ao-Co/T +Do/T -Eo/T )p + (bRT-a-d/T)p3 + a (a + d / T )p 6
@ (BoRT-2Ao-4Co/T 2 + 5D0/T 3 6E0/T 4 ) p + @ / 2 (2bRT-3a-4d/T)p 22+ar$/5(6a+7d/T)p5 + C@/ ( yT 2) (3 -( 3+yp2/2-y2p4),
bRen (pRT) -@(BoR+2Co/T3 3D0/T 4 + 4E0/TS)p- @/2(bR + d/T)p22YPa@dp5/(5T2) + 2 @C /(yT3 ) (1 - (1 +yp2 /2 )e - + CS1 + C S 2 T
+ Cs3T2 + CS4T3 + CsgT4 + Cs6T5
Rn (PRT) + 2/(RT) (BRT-Ao-Co/TZ + Do/T3 - E0/T4)p + 3/(2RT)2(bRT-a-d/T)p + 6a/ RT) (a- d/T ) p 5 + C/(yRT3) ( 1 ( 1 yp2/2-y2p4)
Ie-YP .)
8/14/2019 Program BWRS
12/94
2
Recal l tha t a thermodynamic s ta te requires t h a t two properties be known andfor s a t u r a t i o n s t a t e s p r e s s u r e and temperature are dependent.an ideal power cycle the fo l lowing processes are employed, constant entropy(turbine, compressor and pump), con stan t entha lpy (expansion val ve) ,consta nt pressu re (heat exchanger).proc esses, pr op er ti es must be determined w i t h one of the fo l lowing pa i r s
For eva lua t ing
In o rde r t o de te rmine p rop er t ie s fo r these
of knowns: temperature and pre ssu re, temperature and q u a li ty , pre ssu reand quality, pressure and enthalpy,and pressure and entropy. Sincepressure i s a func t ion o f de ns ity and temperature,when pre ssu re a nd tempera-ture are known a search technique must be used t o f i n d t h e d e n s i t y . Oncethe dens i ty i s k n o w n the remaining pr op er tie s may be ca lc ul at ed .s ta tes a re de f ined by the e q u a l i t y o f pressu re and fu gaci ty a t the sametemperature and both saturated 1 i q u i d and vapor densi t ies .
S a t u r a t i o n
When th es a tu r a t i o n p r e s s u r e i s known, a three variable search on temperature ands a tu r a t e d 1 i q u i d and vapor densi t ies i s requ i red . When the sa tu ra ti o ntemperature i s known a two var iab le sea rch i s required on t h e s a t u r a t e dl iq uid and vapor de ns i t ie s . Having completed e i t h e r o f t h e s e s e a r c h e s ,t h e r em a i n i n g p r o p e r t i e s may b e c o m p u te d b y u s i n g t h e s a t u r a t e d l i q u i dand vapor dens i t i e s . The cases of pressure and entropy or enthalpy asknowns re qu ire a two va ria bl e search sin ce both pres sur e and entropy oren tha lpy a re func t ions o f ' temperature and den si ty . This search i s usedonly i n the compressed l i q u i d or superheated regions .i t e r a t i o n t e c h n iq u e i s used for searches i n CARBON beccuse o f i t s genera l ly
The Newton-Raphson
r a p i d convergence.PROGRAM DE V E L0PME NT
Subrout ine CARBON was written i n FORTRAN V for t h e U N I V A C 1108 se r ie scomputer b u t should be easily adapted t o any s imi la r FORTRAN compiler.
8/14/2019 Program BWRS
13/94
The s u b r o u t i n e a l l o w s t h e u s e r t o u se t h e p r o gr am a t tw o l e v e l s , f i r s tas a " b l a c k b o x" ( t h e m a in t e x t d e s c r i b e s t h e u s e and g e n e ra l developmentof t h e p r og r am ) , s ec on d t h e p ro g ra m may be m o d i f i e d t o b e s t s u i t t h e u s e rsneeds ( t h e r e m a i n i n g t e x t c o n t a i n s a m ore c om p le t e d e s c r i p t i o n o f eachs u b r o u t i n e ) .and as a means o f t r a c in g any po ss i b l e p rob lems .v a r i a b l e d e s c r i p t i o n t a b l e s , f l o w ch a r t s , e q u a ti o ns and a b r i e f d e s c r i p t i o no f a l l s ub ro ut in es .U SE OF CARBON
S u b r o u t in e s were used t h r o u g h o u t t o a l l o w f o r e ac h m o d i f i c a t i o nT h i s r e p o r t c o n t a in s
I n o rd e r t o use CARBON t h e u s e r mu st su p p l y t o t h e p ro gr am t h e f o l l o w i n gi f ormati n :
1. The p rocess f o r wh i ch p r op er t i e s a re t o be de te rm ined (CYCLE)The a l l ow ab le va lues o f CYCLE a re th e f o l l o w in g p a i r s o f knowns:TP - temperature and pressureTX - t e mp e ra tu r e a nd q u a l i t yTV - t empera tu re and dens i t yPH - p r e s s u r e a n d e n t h a l p yPS - p r e s s u r e a n d e n t r o p yPX - p r e s s u r e a n d q u a l i t y
These a r e t h e o n l y a l l o w a b l e v a lu e s o f CYCLE an d t h e o r d e r i s i m p o r t a n t ,i.e., PT o r SP, e tc ., a r e i l l e g a l and w i l l genera te an e r r o r t e r m in a t io no f CARBON.
2. The v al ue o f t h e f i r s t known s p e c i f i e d b y t h e v a l ue o fCYCLE (FGIVEN) .The value o f th e second known sp e c i f ie d by th e va lue o f CYCLE.( SGI VEN ).
8/14/2019 Program BWRS
14/94
44. Light hydrocarbon type. Acceptable val ues o f L FT Y PE are ISOB,
ISOP, B U T , P EN T, METH, ETH, ETHYL, P R O P , H E X , H E P T , O C T andPROPYL.Print s e l e c t o r - i f NPRIN = 0 , then do not print o u t r e s u l t s ,. otherwise p r i n t r e s u l ts.
CARBON w i l l return the fo l lowing information:1. Enthalpy (Btu/l bm)2. Entropy (BTU/l bmoR)3. Qua l i ty - a p p l ie s t o s a t ur a t io n s t a t e s ,
4.5.6.7.8.9.
10.11.12.
te r than onethen superheated vapor region and i f less than one thencompressed 1 q u i d region.Specif ic volume (f t3 / lbm)Temperature ( O F )Pressure (psia )S a tu r a t e d 1 i q u i d enthalpy (Btu/lbm)S a tu r a t e d 1 q u i d entropy (Btu/ l brr; R)S a tu r a t e d 1 q u i d s p e c if ic vol ume ( f t /1 bm)Satura ted vapor enthalpy ( B t u / l bm)Satura ted vapor entropy (Btu/ l b m o R )Satura ted vapor specif ic volume ( f t /1 bm)
3
3A typ ica l ca l l on CARBON would l ook l ikeCALL CARBON ( I TP ' , TEMP, PRESS, ISOB I , H ,S V ,T ,P NPRIN ,SL ,HL ,VL ,SV ,HV,W, Q U A L )T h i s ca l l on CARBON eval ua tes p rop er t ie s f o r I sobu tane g i ven temperature ,
( T E M P ) and pressure (PRESS).independent of the ca l l in g program excep t f o r the passage of the aboveparamete rs , the re fo re , no e x te r n a l v a r i a b l e s need be placed i n common.
Subrout ine CARBON was w r i t t e n so as t o be
8/14/2019 Program BWRS
15/94
5
CARBONDes c r p t i on
CARBON i s the main ro uti ne fo r determining th e thermodynamic pr op er t ie sof 1 ight hydrocarbons. The r o u t i n e s e l e c t s t h e a p p r o p r i a t e c o e f f i c i e n t s f o rt h e p a r t i c u l a r l i g h t hydrocarbon to be evaluated. CARBON then determinesi f t he two s t a t e qu an t i t i e s spe c i f i ed accord ing t o t he va lue of C Y C L E a r el e g i t i m a t e q u a n t i t i e s .grea te r than one or l ess than zero for va lues of CYCLE equal t o TX o r PX.
A n example of an i l le g al qu an t i ty would be qu a l i t i e s
O n c e t h e s e t e s t s a r e s a t i s f i e d CARBON then determines the region t o whichthe poin t cor responds , i . e . , compressed l iqu id , sa tura t ed l iqu id-vaporequi 1 i br i um o r superheated vapor. Having determi ned th e reg ion , CARBONs e l e c t s the proper subrout ines t o determine the remaining thermodynamics t a t e p r o p e r t i e s .VARIABLE SYMBOL TABLEABST absolute temperature di fference between O F and OF = 459.6BTOLER lower tolerance on s a t u r a t i o n and convergence testsBUT 1-d imensiona l a r ray conta in ing the required coe f f i c i e n t s fo r
ButaneC
CH
CONVRcs
1-d imensiona l a r r ay conta in ing the coe f f i c i e n t s t o theSta r1 ing-Benedict-Webb-Rubin equ ation o f s t a t e f o r th el ight hydrocarbon to be evaluated1-dimensional a r r ay con t a i n i ng t he coe f f i c i en t s t o t he i dea l gasenthalpyconvers ion fac tor = 0.185057 B t u i n / l b - f t1 -d imensional a r ray conta in ing the co ef f i c i en t s t o the ideal gasentropy
2 3
8/14/2019 Program BWRS
16/94
6
I CYCLE
DDCRITDHDDDH DTDLDPDDDPDTDSDDDSDTD VETA
EHTYLF G I V E N
HHEPT
Type o f ca lcu la t ion to be made, C Y C L E has the fo l lowing poss ib lpairs of knowns:1 .2.3 .
temperature and pressure = T Ptemperature and qual i ty = TXtemperature and specific volume = TV
4.5.6 .d e n s i t y (1bmole/f t3)c r i t i c a l d e n s i t y ( 1bmol e / f t 3 )
p ressu re and qua l i ty = PXpressure and entropy = PSpressure and enthalpy = PH
a h ( P , W a pa h ( P , I / a~s a t u r a t e d 1iqu id dens i ty (1bmoap( P S T ) / aPa P ( P , T I / a Tas( P, I / a Pas(P , T I a~
3e / f t ' 1
3saturated vapor density ( lbmole/f t )1-d imens iona l a r ray con ta in ing the requi red coe f f i c ie n t s f o rEthane1-d imens iona l a r ray con ta in ing the requ ired c oe f f i c ie n ts fo r EthF i r s t k n o w n passed to C A R B O N , i .e . , temperature for values ofCYCLE o f TP, TX and TV and pressure for values o f CYCLE of PX,PS and PHenthalpy (BTU/l bm)1-dimens onal array containing the r e q u i r e d c o e f f i c i e n t s f o rHeptane
8/14/2019 Program BWRS
17/94
8/14/2019 Program BWRS
18/94
8
QUALRSS G I V E N
S LsvTT C R I TTRTTOLERVVLvvMUX ISOB
X I S O P
XMETH
qua l i t yuniversa l gas constant 10 .7335 psia-f t / lbmoleentropy (BTU/l bm oR)second known pas sed t o CARBON, i . e . , q u a l i t y for values o f CYCLEof TX and PX, p r e s s u r e f o r CYCLE = TP, sp ec i f ic volume f o rCYCLE = TV, e n th a lp y f o r CYCLE - PH and entropy for CYCLE = PSs a t u r a t e d l i q u i d entropy (BTU/lbm OR)saturated vapor entropy (Btu/lbm0R)temperature ( O F )c r i t i c a l t e m p e r a t u r e ( O F )temperature (OR)upper to lerance on sa tura t ion and convergence tes tsspecif ic volume ( f t /lbm)
3s a t u r a t e d l i q u i d s p e c i f i c voluw ( f t / l b m )sa tura ted vapor specif ic volume ( f t / l b m )mol ecul a r weigh t
3
3
3
1-d imens iona l a r ra y con ta in ing th e requ i red co ef f ic ien t fori sobutane1 -d ime ns io na l a r r a y c o n ta in in 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 risopentane1-dimensional ar ra y conta in ing the r e q u i r ed c o e f f i c i e n t s f o r methan e
8/14/2019 Program BWRS
19/94
vL>
I
n
8/14/2019 Program BWRS
20/94
10c 27-
t
I l I n?CSF.7I E I nA T C
P?I litUT-11
ERRO RQ3E T B R N
T= F t 1 I NP = S S 1; C PiT R = T 4 i C S T
I --A 1 > ' -
8/14/2019 Program BWRS
21/94
11
ITEHSAT
SATC1
COHPUfE11irfiR I N T C
8/14/2019 Program BWRS
22/94
12
PPINTC
RETUPN
8/14/2019 Program BWRS
23/94
1 3
TEMSAT
1 I
t
8/14/2019 Program BWRS
24/94
14
t
PRES
ttt1
ENTH
EIITR
PRINT:
RETURN
COMPUTE:QUALYLvvt iS
P R I N T C
8/14/2019 Program BWRS
25/94
CcCCcCCcCCCCCCCCCCC
8/14/2019 Program BWRS
26/94
8/14/2019 Program BWRS
27/94
t
8/14/2019 Program BWRS
28/94
8/14/2019 Program BWRS
29/94
C
c
b
C
c
C
k T tC2c r rX Ir C A.
xm Cz-L
.E
ooc
C
C
iT
z>
.r
a
..-2t
r
v
.uGI
r.
C
C
ir.r C.
.G
0
-
C
Cd
0
ccC
c C0 . 0 .
8/14/2019 Program BWRS
30/94
cC
GCA
w
c
aNC
acC
U rvC
L e
3 r r
8/14/2019 Program BWRS
31/94
c cc
c C w
cG
a
C
C
0
C
-
.-CcDr r
I -v
8/14/2019 Program BWRS
32/94
f2Cbc.- r.V r
8/14/2019 Program BWRS
33/94
c
8/14/2019 Program BWRS
34/94
24
ENTHDes c r i pti n
ENTH c a l c u l a t e s t h e e nt ha l py and i t s d e r i v a t i v e s w i t h r e sp e ct t odens i t y and t em per a t u r e g i ven t em per a t u r e and dens i t y .c a l c u l a t e d by c om p u ti ng t h e i d e a l gas en t ha lpy and t he en t ha lpy depa r t u r e
The en th al py i s
f r o m t h e i d e a l g a s e n t h a l p y b y u s i n g t h e Starling-Benedict-Webb-Rubinequa t ion o f s t a t e .EQUATIONS
h ( p ,T) = (CONVR/WM) ( ( Bo*R*T-2*Ao-4*Co/T 2 + 5*D0/T 3 6*E0/T 4 ) P + 1 2(2*b*R*T-3*a-4*d/T) p2+a/5( 6*a+7*d/T) p5+c(y*T2) (3- ( 3 9 * P 2 / 2 - y Z
ah P T) = (CONVR/WM) ( BoR+8*Co/T3-1 5*D0/T4 + z ~ * E , / T ~ ) ~ +/2 (Z*b*R+4*d/T 2 2paT -7*a*d*p5/5*T2-2*c/ (y*T3) (3- (3+1 2*y*p2) -y 2 4p ) exp( -y*p2) ) )+2*c *T + 3*Ch4*T 2+4*Chs*T 3+5*Ch6*T 4
'h2 h3ah( ,T = (CONVR/WM) ( Bo*R*T-2*Ao-4*C /T2 + 5*Do/T3-6*Eo/T4+( 2*b*R*TaP 0 2 3 3 5-3*a-4*d/T)p+c1(6*a+7*d/T)p4 + C/(y*T2) (5*y*p+59 p -2*y p )
exp (-Y*P'))VARIABLE SYMBOL TABLEC
CH
CONV R
1 -d im e ns io na l a r r a y c o n t a i n in g t h e c o e f f i c i e n t s t o t h e SBWR eqio f s t a t e1 -d im en sio na l a r r a y c o n ta 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 lgas en t ha lpyc o n v e r s i o n f a c t o r = 0.185057 B t u - i n / l b - f t 3
3 t i
8/14/2019 Program BWRS
35/94
25
DDHDDDHDTHTTE RM1TERM2TERM3TERM4
3d e n s i t y ( lbmol e / f t )W , T )aP
entha lpy B t u / l b m )temperature O R )in te rmedia te va lueinte rmedia te va luei ntermedi a t e Val ueinte rmedia te va lue
WM mol ecul a r weight
8/14/2019 Program BWRS
36/94
26
IC(4 *R 'T - 2 . 9 * C ( 2 ) - 4.0*:(6 /7"2 + 5 . 0 * C ( 8 ) /T"3 - 6 . O 'C ( 9 / T+ * 42 . f l*C(3 +R* l 3 . O* C( l ) - 4 . 0 * C ( 7 ) / Tt ( l J ) * ( G . O * C ( l 4 7.0*C(7)::)C ( 5 * ( 3 . 0 - ( 3 .0 + O . S ' C ( l l * D + * 2 - C ( l l ) + ' 2 * D * * 4 ) +E X P ( - C( l l ) * U * * ? ) ) / C ( 1 1 )TEHfII*D 4 TERll:*D**2/2.0 + T i R 1 4 3 * D * * 5 / 5 . 0 + TERE;'J/T W( 5 . 1 1 r C ( l l ) * D 4 5 . 0 * C ( l l ) * * ? * D * * 3 - 2 . 5 * C ( l l ) + + 3 *BlDD T E H r i l + TERX:+D 4 TERM3*D"d + C ( 5 / ( i ( l l ) ' T * * Z +J"5) +E XP( - C ( 1 1 'D+*Z)' E R f l l = ( C ( 4 j . R 4 3 . 0 f C ( 6 ) / T * + 3 - 1 5 . 0 * C ( b ) / T * + 4 + 24.0.C / 9 ) / T + * 5 ) 2' E R N = 0:5*(i?.O*C(3)*S + 4 .0*C( 7 ) :? **2 )*D*+2
~ : 4- z . v T E R ~ ~ ~ / T * * ~'ERI 3 = - C ( 1 0 * D 9 * 5 * 7 . 3 'C ( 7 ) / ( T * * 2 ' 5 . 0 )tI = H*CO lL'R/LIIl + C t l ( 1 ) + C H ( 2 ) T + C H ( 3 ) * T * * Z + C H ( 4 ) *1 * * 3 * U I ( S ) * T * * 4 + C H ( 6 * T * + 5+ 2 . O + C t l ( 3 ) * T 4 3 . 9 * C H ( 4 ) ' i g * 2 4 C i ( S ) * T " 3 * 4 . 04 5 . O * C H ( 6 ) * T * * 4
DH9D = DtiI)D*CO:IVR/'.JIlW5T = ( T E R l I + T E C l l P 4 TER M 3 + :ERY4)*CONVR/ W + C H 2 )
tR ETU R ' I
8/14/2019 Program BWRS
37/94
8/14/2019 Program BWRS
38/94
ENTRDESC RI PT I ON
ENTR c a l c u l a t e s the entropy and i t s d e r i v a t i v e s w i t h r e s p e c t t otemperature and densi ty g ive n densi ty and temperature .calculated by computing the ideal gas entropy and the en t ropy depar tu refrom the ideal gas entropy by using t h e S ta r1 ng-Benedict-Webb-Rubinequat ion o f s t a t e .
The en t ropy i s
EQUATIONSS ( 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 2p +a*D*p5/(5*T2)+2*c/(y*T3) (1-(1+1/2*y*p2)e x P ( - Y * P 2 ) ) ) + c s , + cs2*T + Cs3*T 2 + Cs4*T 3 + Cs5*T4+Cs6*T5
28
a T COP.I.VR/WM) ( - R / T - (-6*Co/T4+1 2*DoT5-20*Eo/T6)p+ d*p2/T3-2*a* d p 5 / ( 5*T3) -6*C/Cy*T4) ( 1- 1+1/2*y* p 2 ) exp (-y*p2) ) )
+2*Cs3*T + 3 Cs4*T2 + 4*Cs5 *T 3+5*CS6*T4cs2
aSP = C O N V R / W M ) ( -R/p-( Bo*R+2*Co/T3-3*Do/T4 + 4*D0/T5) - ( b*R+d/T2)p+a*d*p 4 4T + 2*C/T 3( p+y*p3)exp ( -y*p2) )
VARIABLE SYMBOL TABLEC 1-dimensional arr ay con ta in ing the c o e f f i c i e n t s t o the SBWR equat ion
o f s t a t e2 3CONV convers ion fac to r = 0.185037_-BtUurin / l bmft
CS 1-dim ensional a r ra y c o nt ai ni ng the c o e f f i c i e n t f o r the idea l gasentropy
D d e n s i t y ( 1bmol e/f t3)
8/14/2019 Program BWRS
39/94
29
DSDT
T temperature ( O R )TERM1 in te rm ed ia te Val ueTERM2 in termediate valueTERM3 in termediate values entropy ( B t u / l bmoR)WM molecular w eigh t
8/14/2019 Program BWRS
40/94
30
START7
8/14/2019 Program BWRS
41/94
8/14/2019 Program BWRS
42/94
32
FUGACFUGAC c a l c ul a te 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 r e s p ec t t o
t em per a t u r e and dens i t y g i ven t em per a t u r e and dens i t y . The f u g a c i t y i scomputed us ing the Starling-Benedict-Webb-Rubin e q u at io n o f s t a t e .E Q U A T I O N?,nf(p,T) = An (p*R*T) + 2/(R*T)(Bo*R*T-Ao-Co/T 2+Do/T 3 Eo/T 4 > P
+ 6 4 ( 5*R*T) ( a+d /T) p5+C (y*R*T3) ( 1- ( 1+y*p 2 Z Y2, P4)exp (-Y*P2))
+ 31 2*R*T) ( b*R*T-a-d/T)p2
2 3 4af o = f ( p , T ) * ( l / d +2 (R*T) (Bo*R*T-Ao-Co/T + Do/T - E o / T )aP+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 Y3 5p 1- exP(-Y*P 2 1)
af (p,T) = f(p,T) * ( 1/T+2/(R*T2)(Ao + 3*Co/T2-4*Do/T4)p + 3/(2*R*T2) (a+2*d/T)p2aT 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 TABLEC
DDFDDDFDT
TERM1TE RM2
1 -d im e ns io na l 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 S t a r 1 n g -Benedict-Webb-Rubi n e qu at i on o f s t a t ed e n s i t y (1b m o l e / f t 3 )% ( P T )aP
f ugaci yu n i v e r s a l g a s c o n s t a n t = 10.7355 p s i a - f t / lbmole"Rtempera ture ( O R )i n t e r m e d ia t e Val uei n t e r m e d i a t e v a l u e
3
8/14/2019 Program BWRS
43/94
33
TERM3 intermediate valueTERM4 intermediate value
8/14/2019 Program BWRS
44/94
34
S T A R T(7T E R M 2 = : {3 );R'T-C( 1 ) - C( 7 ) / TTERM 3 = C ( l ) + C ( ? ) / TTERM 4 = l . f l - ( l O - O. S* C ( 1 1 ) * 3 " 2 - C [ 1 1 ) * * 2 ' P * 4
C .CPf -3 1 1 ) ' @ ' * 5 1F = L O G ( U h R * T i+ 2 i O o ?f % l i O / t R * T ) + 3 . 0 * O * * 7 ~
F = E X I ' ( I )DFDD F + ( l . O / D t 2 . 0 * T E R K l / { R L T I - 3 . O * T E R V 2*3/
T E A 1 2/(2.fl*R*:)+C.O*C( 10). XRI 3 * Dc * 5 /(5.0aR+T)+C(5)* T E RM C / ( C ( l l ) * R * T * * 3 )
t R *T ) + G .O * C ( 1 0 ) * C + * 4 * T F R u 3 / ( 9 * T + C ( S ) /( R a t ( 1 1 * T ** 3 ) *( 3.G*C( 11:.*3+ .3*t( 11)**?*9* + 3- 2. 0' O t* 5* C ( 1 1 * * 3 ' * i P ( - C ( 11) D " 2 ) ,TERM 1 C( 2 ) +3.0*C( 6)/T"2-J. 0C 8) T* * 3 + 5 . 0 *
T E R I l 2 = C { l - 2 . 3 * C ( 7 / TC ( O ) / T * * 4OFDT = 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 22 ' D k ' 5 / ( S . D * R * T * * 2 ) - 3 . 0 * C ~ S ) ~ T E R M 4/C( 11)*R*T * *4 ) )
RETURN
8/14/2019 Program BWRS
45/94
-. . . . . .. . . -. ..-. . . - .. . . .
8/14/2019 Program BWRS
46/94
36
I N V E R TDESCR IPTI N
I N V E R T so l ves a sys tem of t h r e e e q u a t i o n s i n t h r e e unknowns b yG a us sia n 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 se arch i nVARIABLE SYMBOL TABLEC i n t e r m e d i a t e v a l u eDX(1)DX(2)
ApL to be so lved forApv t o b e s o l v e d for
D X ( 3 ) AT t o b e s o l v e d forF(1)F( 2)
F, v alu e of f i r s t e qu at io nF va lue o f second equat ionF v a lu e o f t h i r d e q u a ti o n
2F( 3) 3I i n d e x3 i n d e xK i n d e xL indexM indexN i n d e xW w o r k i n g 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 m a t r i x a n d t h e f u n c t i o n
v e c t o rXJACOB c o e f f i c i e n t m a t r i x
8/14/2019 Program BWRS
47/94
37
S T A R T
tY E S
YES
8/14/2019 Program BWRS
48/94
38
YES
1 m K = K + I
t
8/14/2019 Program BWRS
49/94
8/14/2019 Program BWRS
50/94
40
PH KNOWDESCRI PT I ON
PHKNOW uses a two va ria bl e Newton-Raphson i te r a t i o n technique t o f indthe dens i ty and temperature given pressure and enthalpy in the superheatedvapor or compressed l iquid regions.EQUATIONSP ( P T ) - 'knownh ( P T ) - known
= o= o
VARIABLE SYMBOL TABLEB T O L E R lower tolerance on saturat ion and convergence tes tsD dens i t y (1bmol e/ft')
a h ( P J )a Pa h ( P T I
a T
. DHDDDH DTDLASTDPDDDPDTH known enthalpy (BTU/l bm)HCAL
l a s t dens i t y ca l cu l a t ed , t o be used i n next i t e r a t i o n.,P( P T Ia PN P J )a T
ca l cul a t e d enthalpy (BTU/l bm)
8/14/2019 Program BWRS
51/94
41
1L IMITPPCALTTLASTTTOLERX JACOB
indexm a x i m u m number of i t e r a t i o n s a llo we d i n any one searchknown pressure ( p s i a )cal cul a ted pressure (psia )temperature O R )l a s t tempera ture ca lcu la t e d , t o be used i n n e x t i t e r a t i o nupper tolerance on saturat ion and convergence testsJacobian o f pressure and enthalpy
8/14/2019 Program BWRS
52/94
42
tPRFSUTUENTH
I f
1 . 1- I = I + lP H Y W : F4 I L O
DIDLAST - ( ( P C 4 L - P ) M D T -(HCAL-H)D P D T ) / X J A C O BT = T L A S S T - ( ( H C A L - H ) o P D D - ( P c A L - P ) RETURN
Y cstD = D L A S T / l O . ONo
f
T = T L A S T / l O . O
6
8/14/2019 Program BWRS
53/94
PRES
43
I
. _.
I
8/14/2019 Program BWRS
54/94
*4*i4*iYY**4Y***ini*ui*Y*Y*
49****i*YiY4*
x00uoWWaCwc
8/14/2019 Program BWRS
59/94
49
P RESATDESCRIPTION
PRESAT uses a two va ria ble Newton-Raphson i te r a t i o n technique t o f i n dt he sa tu ra t ion p ressu re and the sa tu ra t ed l i qu id and vapor dens i t i e s g iventemperature.vapor phases m u s t be equal .
A t equ i l ib r ium the pressure and fugaci ty of the l i q u i d and
EQUATIONSI
- m p T )aPJacobian = (
J iacobianL LVARIABLE SYMBOL TABLEBTOLER lower to le ran ce on sa tu ra t io n and convergence te s t sDFFDDL a f ( PL T 1
8/14/2019 Program BWRS
60/94
50
DFLDTDFPDDL
DFPDDV
DFVDDV
DLDL LASTDPLDDL
DPLDT
DPVDDV
DPWDT
D VDVLASTFFFLFPILIMITM2PPLPV
s a t u r a t e dl a s t l i q u
1 i qu id d e n s i t y ( 1bmod dens ty ca l cu la t ed
e / f t 3 )t o be used i n n e x t i t e r a t on
3saturated vapor densi ty ( l bmol e / f t )l a s t va por 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 nd i f f e r e n c e i n f u g a c i t i e s - f (pL ,T ) - f (pv,T)l i q u i d fu g a c i t y f (pL ,T )d i f f e r e n c e i n pressu res P(pL,T) - P(pv,T)indexmaximum number of i t e ra t ions a l lowed i n any one searchu n i t number fo r p r i n t e dp re s s u re (p s i a )1 i q u i d pressure P(PL,T) ( p s i a )vapor pressu re P(pv T) ( p s i a )
S
8/14/2019 Program BWRS
61/94
51
T temperature ( O R )TTOLER upper to1 erance on sa tu ra ti on and convergence t e s t sX JACOB Jacobian
8/14/2019 Program BWRS
62/94
r -
52
FUCiAC
FP = PL - PVF F = FL - FVDFPDnV -DPVDDVDFPDDL = D P L D D LDFFDD'J = - OFVDDVOFFDOL = D F L O D LX JACOi3 * DFP DDV'DFFDDL -DFPDDL DFFDDVD V = D'JLAST ( F P ' D F F D 3 L - F T ' D F P D D L ) iD i = DCLAST-( FF 'DFPDDV-FP*DFFDDV)/XJACOBXJACOR
P R E S A T F A I L ETD CONVERGC
tcETURN
8/14/2019 Program BWRS
63/94
53
D K A S T DV
YDV = OVL4ST/lO.O
bL , 0.0OL = 0 L L AST; I O . O
FUCACrFUGACr
23FTURN
8/14/2019 Program BWRS
64/94
*a
-
*c
x
Y
3Ul
x
Y
3Ul
inWE
*U3
*ak-
z
z
cow
i
Utl
*VI
LLF-
ia
E
*
au
*
i(
f
cn
H
*a
wo
*I
Y*
L
f
24.
*4.
Lf
Y
CO
*
3
*3