home *** CD-ROM | disk | FTP | other *** search
/ Phoenix CD 2.0 / Phoenix_CD.cdr / 01e / libry31a.zip / LIBRY8.DOC < prev    next >
Text File  |  1987-01-21  |  14KB  |  402 lines

  1. .pa
  2.                         THERMODYNAMIC PROPERTIES
  3.  
  4. These  thermodynamic  property  procedures are all derrived from tabular
  5. data,  curve-fits,  or  first  principles.   All  of  the  thermodynamic
  6. properties  of  steam are consistent with Maxwell's relationships.  This
  7. is not the case with the work of some  other  programmers  that  I  have
  8. seen;    and  it  is  CRUCIAL  for  accurate,  consistent  thermodynamic
  9. analyses.
  10.  
  11. All  of  the  steam properties are based on the Tables of Keenan, Keyes,
  12. Hill, and Moore (published in 1969 by John Wyley and Sons).   These  are
  13. particularly  well  suited  to  computerizing (which is something that I
  14. can't say about other steam tables).  I also have  ASME  and  NBS  steam
  15. properties;   but  because  of  the  inconsiderate  way  in  which these
  16. regressions were done, these properties  are  slower  than  a  heard  of
  17. snails  crawling  up  Pike's  Peak  in a hailstorm and of insufficiently
  18. greater accuracy to be worth the price in CPU time (I've never heard  of
  19. a steam plant operating at 120,000 psia feedwater pressure).  All of the
  20. steam properties are accurate to five or so  figures  or  the  limit  of
  21. single precision which is as accurate as the tables.
  22.  
  23. All of the moist air properties are based on the ASHRAE tables  and  are
  24. at  least  as  accurate  as  the  tabulated  values  (in some cases like
  25. absolute humidity they are more accurate than the  tables).   Note  that
  26. wet-bulb  temperature  is  assumed  to  be  the  same  as  the adiabatic
  27. saturation temperature.
  28.  
  29. All  quantities  are  in standard, useful units (not to be confused with
  30. Silly Inane units).
  31. .pa
  32.                      QUICK LIST OF PLOT SUBROUTINES
  33.  
  34. CHNGP0: change air pressure
  35. CPFOFT: constant pressure specific heat of saturated liquid water
  36. CPGOFT: constant pressure specific heat of saturated vapor water
  37. DVFOFT: dynamic viscosity of saturated liquid water
  38. DVGOFT: dynamic viscosity of saturated vapor water
  39. FCPM:   constant pressure specific heat of moist air
  40. FDWA:   diffusion coefficient for water into air
  41. FHTWB:  enthalpy of moist air from wet-bulb
  42. FKM:    thermal conductivity of moist air
  43. FMUM:   dynamic viscosity of moist air
  44. FPSAT:  saturation pressure of steam
  45. FPVDWB: partial pres. of water vapor in moist air from dry- and wet-bulb
  46. FPWSAT: saturation partial pressure of water vapor in air
  47. FRHDWB: relative humidity from dry- and wet-bulb
  48. FRHOL:  density of liquid water at 1 atm.
  49. FRHOM:  density of moist air
  50. FSTW:   surface tension of water
  51. FTDBHW: dry-bulb from enthalpy and humidity
  52. FTDPDW: dew-point from dry- and wet-bulb
  53. FTDWBW: dry-bulb from wet-bulb and humidity
  54. FTDWRH: dry-bulb from wet-bulb and relative humidity
  55. FTSAT:  saturation temperature of steam
  56. FTWBH:  wet-bulb from enthalpy
  57. FTWDBP: wet-bulb from dry-bulb and dew-point
  58. FTWDRH: wet-bulb from dry-bulb and relative humidity
  59. FTWSAT: saturation temperature from partial pressure
  60. FWBDBW: wet-bulb from dry-bulb and humidity
  61. FWDBRH: wet-bulb from dry-bulb and relative humidity
  62. FWDWB:  humidity from dry- and wet-bulb
  63. FWSAT:  saturation humidity
  64. STATE:  2-character state indicator
  65. TKFOFT: thermal conductivity of saturated liquid water
  66. TKGOFT: thermal conductivity of saturated vapor water
  67. TOFPH:  temperature etc. from pressure and enthalpy
  68. TOFPS:  temperature etc. from pressure and entropy
  69. TV2PHS: pressure, enthalpy, and entropy from temperature and volume
  70. VOFTP:  volume from temperature and pressure
  71. .pa
  72. NAME:     CHNGP0 (note zero "0" not oh "O")
  73. PURPOSE:  change air pressure
  74. TYPE:     subroutine (far external)
  75. SYNTAX:   CALL CHNGP0(P)
  76. INPUT:    P (REAL*4) pressure in psia
  77. OUTPUT:   none
  78.  
  79.  
  80. NAME:     CPFOFT
  81. PURPOSE:  constant pressure specific heat of saturated liquid water
  82. TYPE:     REAL*4 function (far external)
  83. SYNTAX:   CP=CPFOFT(T)
  84. INPUT:    T (REAL*4) temperature [F]
  85. OUTPUT:   CP (REAL*4) constant pressure specific heat [Btu/lbm/F]
  86.  
  87.  
  88. NAME:     CPGOFT
  89. PURPOSE:  constant pressure specific heat of saturated vapor water
  90. TYPE:     REAL*4 function (far external)
  91. SYNTAX:   CP=CPFOFT(T)
  92. INPUT:    T (REAL*4) temperature [F]
  93. OUTPUT:   CP (REAL*4) constant pressure specific heat [Btu/lbm/F]
  94.  
  95.  
  96. NAME:     DVFOFT
  97. PURPOSE:  dynamic viscosity of saturated liquid water
  98. TYPE:     REAL*4 function (far external)
  99. SYNTAX:   DV=DVFOFT(T)
  100. INPUT:    T (REAL*4) temperature [F]
  101. OUTPUT:   DV (REAL*4) dynamic viscosity [lbm/ft/hr]
  102.  
  103.  
  104. NAME:     DVGOFT
  105. PURPOSE:  dynamic viscosity of saturated vapor water
  106. TYPE:     REAL*4 function (far external)
  107. SYNTAX:   DV=DVGOFT(T)
  108. INPUT:    T (REAL*4) temperature [F]
  109. OUTPUT:   DV (REAL*4) dynamic viscosity [lbm/ft/hr]
  110.  
  111.  
  112. NAME:     FCPM
  113. PURPOSE:  constant pressure specific heat of moist air
  114. TYPE:     REAL*4 function (far external)
  115. SYNTAX:   CP=FCPM(T,W)
  116. INPUT:    T (REAL*4) temperature [F]
  117.           W (REAL*4) absolute humidity []
  118. OUTPUT:   CP (REAL*4) constant pressure specific heat [Btu/lbm/F]
  119.  
  120.  
  121. NAME:     FDWA
  122. PURPOSE:  diffusion coefficient for water into air
  123. TYPE:     REAL*4 function (far external)
  124. SYNTAX:   D=FDWA(T)
  125. INPUT:    T (REAL*4) temperature [F]
  126. OUTPUT:   D (REAL*4) diffusion coefficient [sq.ft/hr]
  127.  
  128.  
  129. NAME:     FHTWB
  130. PURPOSE:  enthalpy of moist air from wet-bulb
  131. TYPE:     REAL*4 function (far external)
  132. SYNTAX:   H=FHTWB(TWB)
  133. INPUT:    TWB (REAL*4) wet-bulb temperature [F]
  134. OUTPUT:   H (REAL*4) enthalpy [Btu/lbm-dry-air]
  135.  
  136.  
  137. NAME:     FKM
  138. PURPOSE:  thermal conductivity of moist air
  139. TYPE:     REAL*4 function (far external)
  140. SYNTAX:   TK=FKM(T,W)
  141. INPUT:    T (REAL*4) temperature [F]
  142.           W (REAL*4) absolute humidity []
  143. OUTPUT:   TK (REAL*4) thermal conductivity [Btu/hr/ft]
  144.  
  145.  
  146. NAME:     FMUM
  147. PURPOSE:  dynamic viscosity of moist air
  148. TYPE:     REAL*4 function (far external)
  149. SYNTAX:   DV=FMUM(T,W)
  150. INPUT:    T (REAL*4) temperature [F]
  151.           W (REAL*4) absolute humidity []
  152. OUTPUT:   DV (REAL*4) dynamic viscosity [lbm/ft/hr]
  153.  
  154.  
  155. NAME:     FPSAT
  156. PURPOSE:  saturation pressure of steam
  157. TYPE:     REAL*4 function (far external)
  158. SYNTAX:   PSAT=FPSAT(TSAT)
  159. INPUT:    TSAT (REAL*4) saturation temperature [F]
  160. OUTPUT:   PSAT (REAL*4) saturation pressure [psia]
  161.  
  162.  
  163. NAME:     FPVDWB
  164. PURPOSE:  partial pres. of water vap in moist air from dry- and wet-bulb
  165. TYPE:     REAL*4 function (far external)
  166. SYNTAX:   PV=FPVDWB(TDB,TWB)
  167. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  168.           TWB (REAL*4) wet-bulb temperature [F]
  169. OUTPUT:   PV (REAL*4) partial pressure [psia]
  170.  
  171.  
  172. NAME:     FPWSAT
  173. PURPOSE:  saturation partial pressure of water vapor in air
  174. TYPE:     REAL*4 function (far external)
  175. SYNTAX:   PW=FPWSAT(T)
  176. INPUT:    T (REAL*4) temperature [F]
  177. OUTPUT:   PW (REAL*4) saturation partial pressure [psia]
  178.  
  179.  
  180. NAME:     FRHDWB
  181. PURPOSE:  relative humidity from dry- and wet-bulb
  182. TYPE:     REAL*4 function (far external)
  183. SYNTAX:   RH=FRHDWB(TDB,TWB)
  184. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  185.           TWB (REAL*4) wet-bulb temperature [F]
  186. OUTPUT:   RH (REAL*4) relative humidity [%]
  187.  
  188.  
  189. NAME:     FRHOL
  190. PURPOSE:  density of liquid water at 1 atm.
  191. TYPE:     REAL*4 function (far external)
  192. SYNTAX:   D=FRHOL(T)
  193. OUTPUT:   D (REAL*4) density [lbm/cu.ft]
  194.  
  195.  
  196. NAME:     FRHOM
  197. PURPOSE:  density of moist air
  198. TYPE:     REAL*4 function (far external)
  199. SYNTAX:   D=FRHOM(P,TDB,W)
  200. INPUT:    P (REAL*4) pressure [psia]
  201.           TDB (REAL*4) dry-bulb temperature [F]
  202.           W (REAL*4) absolute humidity []
  203. OUTPUT:   D (REAL*4) density [lbm/cu.ft]
  204.  
  205.  
  206. NAME:     FSTW
  207. PURPOSE:  surface tension of water
  208. TYPE:     REAL*4 function (far external)
  209. SYNTAX:   S=FSTW(T)
  210. INPUT:    T (REAL*4) temperature [F]
  211. OUTPUT:   S (REAL*4) surface tension [lbf/ft]
  212.  
  213.  
  214. NAME:     FTDBHW
  215. PURPOSE:  dry-bulb from enthalpy and humidity
  216. TYPE:     REAL*4 function (far external)
  217. SYNTAX:   TDB=FTDBHW(H,W)
  218.           W (REAL*4) absolute humidity []
  219. OUTPUT:   TDB (REAL*4) dry-bulb temperature [F]
  220.  
  221.  
  222. NAME:     FTDPDW
  223. PURPOSE:  dew-point from dry- and wet-bulb
  224. TYPE:     REAL*4 function (far external)
  225. SYNTAX:   TDP=FTDPDW(TDB,TWB)
  226. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  227.           TWB (REAL*4) wet-bulb temperature [F]
  228. OUTPUT:   TDP (REAL*4) dew-point temperature [F]
  229.  
  230.  
  231. NAME:     FTDWBW
  232. PURPOSE:  dry-bulb from wet-bulb and humidity
  233. TYPE:     REAL*4 function (far external)
  234. SYNTAX:   TDB=FTDWBW(TWB,W)
  235. INPUT:    TWB (REAL*4) wet-bulb temperature [F]
  236.           W (REAL*4) absolute humidity []
  237. OUTPUT:   TDB (REAL*4) dry-bulb temperature [F]
  238.  
  239.  
  240. NAME:     FTDWRH
  241. PURPOSE:  dry-bulb from wet-bulb and relative humidity
  242. TYPE:     REAL*4 function (far external)
  243. SYNTAX:   TDB=FTDWRH(TWB,RH)
  244. INPUT:    TWB (REAL*4) wet-bulb temperature [F]
  245.           RH (REAL*4) relative humidity [%]
  246. OUTPUT:   TDB (REAL*4) dry-bulb temperature [F]
  247.  
  248.  
  249. NAME:     FTSAT
  250. PURPOSE:  saturation temperature of steam
  251. TYPE:     REAL*4 function (far external)
  252. SYNTAX:   TSAT=FTSAT(PSAT)
  253. INPUT:    PSAT (REAL*4) saturation pressure [psia]
  254. OUTPUT:   TSAT (REAL*4) saturation temperature [F]
  255.  
  256.  
  257. NAME:     FTWBH
  258. PURPOSE:  wet-bulb from enthalpy
  259. TYPE:     REAL*4 function (far external)
  260. SYNTAX:   TWB=FTWBH(H)
  261. INPUT:    H (REAL*4) enthalpy [Btu/lbm-dry-air]
  262. OUTPUT:   TWB (REAL*4) wet-bulb temperature [F]
  263.  
  264.  
  265. NAME:     FTWDBP
  266. PURPOSE:  wet-bulb from dry-bulb and dew-point
  267. TYPE:     REAL*4 function (far external)
  268. SYNTAX:   TWB=FTWDBP(TDB,TDP)
  269. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  270.           TDP (REAL*4) dew-point temperature [F]
  271. OUTPUT:   TWB (REAL*4) wet-bulb temperature [F]
  272.  
  273.  
  274. NAME:     FTWDRH
  275. PURPOSE:  wet-bulb from dry-bulb and relative humidity
  276. TYPE:     REAL*4 function (far external)
  277. SYNTAX:   TWB=FTWDRH(TDB,RH)
  278. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  279.           RH (REAL*4) relative humidity [%]
  280. OUTPUT:   TWB (REAL*4) wet-bulb temperature [F]
  281.  
  282.  
  283. NAME:     FTWSAT
  284. PURPOSE:  saturation temperature from partial pressure
  285. TYPE:     REAL*4 function (far external)
  286. SYNTAX:   TWS=FTWSAT(PWS)
  287. INPUT:    PWS (REAL*4) saturation partial pressure [psia]
  288. OUTPUT:   TWS (REAL*4) saturation temperature [F]
  289.  
  290.  
  291. NAME:     FWBDBW
  292. PURPOSE:  wet-bulb from dry-bulb and humidity
  293. TYPE:     REAL*4 function (far external)
  294. SYNTAX:   TWB=FWBDBW(TDB,W)
  295. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  296.           W (REAL*4) absolute humidity []
  297. OUTPUT:   TWB (REAL*4) wet-bulb temperature [F]
  298.  
  299.  
  300. NAME:     FWBDBRH
  301. PURPOSE:  wet-bulb from dry-bulb and relative humidity
  302. TYPE:     REAL*4 function (far external)
  303. SYNTAX:   TWB=FWDBRH(TDB,RH)
  304. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  305.           RH (REAL*4) relative humidity [%]
  306. OUTPUT:   TWB (REAL*4) wet-bulb temperature [F]
  307.  
  308.  
  309. NAME:     FWDWB
  310. PURPOSE:  humidity from dry- and wet-bulb
  311. TYPE:     REAL*4 function (far external)
  312. SYNTAX:   W=FWDWB(TDB,TWB)
  313. INPUT:    TDB (REAL*4) dry-bulb temperature [F]
  314.           TWB (REAL*4) wet-bulb temperature [F]
  315. OUTPUT:   W (REAL*4) absolute humidity []
  316.  
  317.  
  318. NAME:     FWSAT
  319. PURPOSE:  saturation humidity
  320. TYPE:     REAL*4 function (far external)
  321. SYNTAX:   WSAT=FWSAT(T)
  322. INPUT:    T (REAL*4) temperature [F]
  323. OUTPUT:   WSAT (REAL*4) saturation absolute humidity []
  324.  
  325.  
  326. NAME:     STATE
  327. PURPOSE:  2-character state indicator
  328. TYPE:     CHARACTER*2 function (far external)
  329. SYNTAX:   ST=STATE(T,X)
  330. INPUT:    T (REAL*4) temperature [F]
  331.           X (REAL*4) quality []
  332. OUTPUT:   ST (CHARACTER*2) state (ie. CL,,SL, LV, SV, SH, SC)
  333.  
  334.  
  335. NAME:     TKFOFT
  336. PURPOSE:  thermal conductivity of saturated liquid water
  337. TYPE:     REAL*4 function (far external)
  338. SYNTAX:   TK=TKFOFT(T)
  339. INPUT:    T (REAL*4) temperature [F]
  340. OUTPUT:   TK (REAL*4) thermal conductivity [Btu/hr/ft]
  341.  
  342.  
  343. NAME:     TKGOFT
  344. PURPOSE:  thermal conductivity of saturated vapor water
  345. TYPE:     REAL*4 function (far external)
  346. SYNTAX:   TK=TKGOFT(T)
  347. INPUT:    T (REAL*4) temperature [F]
  348. OUTPUT:   TK (REAL*4) thermal conductivity [Btu/hr/ft]
  349.  
  350.  
  351. NAME:     TOFPH
  352. PURPOSE:  temperature etc. from pressure and enthalpy
  353. TYPE:     REAL*4 function (far external)
  354. SYNTAX:   CALL TOFPH(T,P,V,X,H,S)
  355. INPUT:    P (REAL*4) pressure [psia]
  356.           H (REAL*4) enthalpy [Btu/lbm]
  357. OUTPUT:   T (REAL*4) temperature [F]
  358.           V (REAL*4) specific volume [cu.ft/lbm]
  359.           X (REAL*4) quality []
  360.           S (REAL*4) entropy [Btu/lbm/R]
  361.  
  362.  
  363. NAME:     TOFPS
  364. PURPOSE:  temperature etc. from pressure and entropy
  365. TYPE:     REAL*4 function (far external)
  366. SYNTAX:   CALL TOFPS(T,P,V,X,H,S)
  367. INPUT:    P (REAL*4) pressure [psia]
  368.           S (REAL*4) entropy [Btu/lbm/R]
  369. OUTPUT:   T (REAL*4) temperature [F]
  370.           V (REAL*4) specific volume [cu.ft/lbm]
  371.           X (REAL*4) quality []
  372.           H (REAL*4) enthalpy [Btu/lbm]
  373.  
  374.  
  375. NAME:     TV2PHS
  376. PURPOSE:  pressure, enthalpy, and entropy from temperature and volume
  377. TYPE:     REAL*4 function (far external)
  378. SYNTAX:   CALL TV2PHS(T,V,P,H,S)
  379. INPUT:    T (REAL*4) temperature [F]
  380.           V (REAL*4) specific volume [cu.ft/lbm]
  381. OUTPUT:   P (REAL*4) pressure [psia]
  382.           H (REAL*4) enthalpy [Btu/lbm]
  383.           S (REAL*4) entropy [Btu/lbm/R]
  384.  
  385.  
  386. NAME:     VOFTP
  387. PURPOSE:  volume from temperature and pressure
  388. TYPE:     REAL*4 function (far external)
  389. SYNTAX:   CALL VOFTP(T,P,V,X,H,S,IOPT)
  390. INPUT:    T (REAL*4) temperature [F]
  391.           P (REAL*4) pressure [psia]
  392.           IOPT (INTEGER*2) option
  393.             IOPT=1  find saturated liquid properties
  394.             IOPT=2  find saturated vapor properties
  395.             IOPT=3  find properties outside vapor dome
  396.             IOPT=4  forces compressed liquid
  397.             IOPT=5  forces superheated vapor
  398. OUTPUT:   V (REAL*4) specific volume [cu.ft/lbm]
  399.           X (REAL*4) quality []
  400.           H (REAL*4) enthalpy [Btu/lbm]
  401.           S (REAL*4) entropy [Btu/lbm/R]
  402.