:----NAME: "FLOWCOMP" ----------------------------------------------------- : :----***********************************************/ :---- Program computes mass flow through ASME nozzle -----------------------j :----***********************************************t # : ( "This program computes mass flow and volumetric flow of various - "gases thru ASME long-radius flow nozzles.0 2 "Required inputs are: D (duct diameter), dt (throat diameter),u 7 "P1 (upstream static pressure, in psia), delta-P (differential < "pressure, in inches of water), T1 (upstream static temperature, deg F)A "and type of gas (air, O2, N2, CO2, H2, CH4, CO, A(rgon))"F Program determines from input data whether flow is unchoked or choked 75 rem (critical) flow, and computes parameters accordingly.dPIIi "Duct diameter, inches, D ="; Dn "Throat diameter, inches, DT = "; DT%s "Upstream static pressure, psia, P1 = "; P1ix "Upstream static temperature, degrees Fahrenheit, T1 = "; T1} "name of gas (air,O2,N2,CO2,H2,CH4,CO,A) = ";GAS$ "DUCT DIAMETER, inches, D ="; D "THROAT DIAMETER, inches, DT ="; DT& "UPSTREAM STATIC PRESSURE, psia, P1 ="; P1e "UPSTREAM STATIC TEMPERATURE, deg. Fahrenheit, T1 ="; T1 "TYPE OF GAS =" GAS$ GAS$"air" M1!n :M2C { :M3 :GAz4 :R33U GAS$"O2" M1A~p :M2d*{ :M333C: GA333 :R33AF GAS$"N2" M1'p :M2_A{ :M333# :GA333 :R\ GAS$"CO2" M1_o:M2{:M3 :GAff& :Rff  GAS$"H2" M1o:M2 z:M3, :GAz4 :R GAS$"CH4" M1A~p:M2rz:M333K:GA' :R@J GAS$"CO" M1_o: M20{:M3( :GA333 :R\ GAS$"A" M1o:M2j<{ :M3X: GAU: R MU (M1T1 M2T1 M3) 7m Line 180 is second order fit to empirical viscosity data.$ "gas viscosity, lbm/sec-ft, MU = "; MU<ATHROAT PIDTY RHO1 P1R(T1) "RHO1, upstream gas density = ";RHO1BETADTD "BETA = ";BETA "GAMMA = ";GAS1(GA )GAS3 (GA )S4 S3((GA)(GA))S5 BETA"S7 S10S8 S3DS9 (GA )TS10 S9S5cS11 GA Parameters S1 thru S11 are used in equations below.^ RCRIT  : initial guess for (p2/p1 critical) h RNEW (S8 S9S5 RCRITS11)(S7)Dr (RNEW RCRIT)'p RCRIT RNEW: hY| RCRIT RNEW} "RCRIT, critical pressure ratio, p2/p1 = ";RCRIT Above is iteration to calculate critical pressure ratio p2/p1 crit# taken from "ASME Fluid Meters" Eq. I-5-110 on page 68.N "Delta-P, inches of water, = "; DLPh P2 P1ff&DLP  "Downstream static pressure, psia, P2 = "; P2  AR P2P1  "AR, pressure ratio, p2/p1 = ";AR  AR=actual pressure ratio, P2/P1 S2  ARS1* S6 S5AR(GA)_! ARRCRIT   :Unchoked flow situation.& :Choked flow calculation follows:0 P1P01  :Initial guess for P1/P01 = 11 P1P01 = P1/P01 8 Following equation taken from "ASME Fluid Meters" Eq. I-5-107, P.67B9 and solved iteratively.q: P1P01N (P1P01S11 S10S4)(GA(GA))D (P1P01 P1P01N)'p P1P01 P1P01N : :E "P1P01 = "; P1P01N P0 P1P1P01 :P0 = total pressure, in psiaO "P01 = "; P05X T0 (T1 ) (P1P01)S1cY "Total temperature, deg.R, T0 = "; T0b T2 T0(GA) :For choked flow only!c T2F T2  :Conversion from Rankine to Fahrenheit d "Downstream static temperature, deg.F, T2 = ";T2F2g MU(M1T2F M2T2F M3)7mlVCRIT (GART2) : VCRIT=sonic velocity at critical conditionsm "VCRIT = ";VCRITv MCRTH ATHROAT (GARS4)P0(T0)#w "MCR,th = "; MCRTH : theoretical mass flow at critical cond.ax Eqn for "MCRTH" taken from 4.17 on P.85, Shapiro Vol.I RHO2CR RHO1RCRIT(GA) :exit density at critical flow, lbm/ft3 "RHO2CR = ";RHO2CR RE MCRTH 0PIDTMU "Reynolds No., choked flow = ";REy YCH (RCRITS11S7(RCRITS1)(RCRIT)(S5)(S5RCRIT(GA))) :expansion factor cr. "Y,CH is expansion factor = ";YCH  MACTCD42MCRTH "M,actual (mass flow, lbm/sec) = "; MACT CFM MACT RHO1<U "actual cubic feet per minute, based on upstream, CFM = "; CFM} SCFMCH CFM(T1)P1"k "standard cubic feet per minute, scfm, choked = ";SCFMCH  :-----Unchoked flow calculation follows:M*V2TH ( P1RHO1S7S2(S6)) :theoretical exit velocity+ Taken from ASME "Fluid Meters", Equation I-5-22, page 52, as corrected, "theoretical exit velocity, V2th, ft/sec = "; V2TH/RHO2 RHO1AR(GA)@4Y (ARS11S7S2(AR)(S5)(S6)) :expansion factor, unchokeds>T2 (T1)ARS1 :T2 in degrees Rankine@ T2F T2  :Downstream static temp, deg. FHVS (GART2) :sonic velocity corresponding to actual T2, ft/min* JMACH2V2THVS :Mach No. at nozzle exitV K "Mach No. at nozzle exit = "; MACH2 S "Downstream static density, lbm/ft3, RHO2 = ";RHO2 WMU (M1T2F M2T2F M3)7m!X : Value of viscosity corresponding to exit (throat) static temperature$!\RE RHO2V2THDT MUM!] "Reynolds No.,RE, unchoked = ";RE!fMTH ATHROATY(RHO1ff&DLP(S5)) :theoretical mass flow!g "Mth, unchoked, lbm/sec, = "; MTH"h MTH is theoretical mass flow, unchoked. See I-5-8 and I-5-26, Fluid Met&"p :"zMACT MTHCD42"{ "Mact, lbm/sec = "; MACT :Mact = actual mass flow, unchoked"}MACTHMACT" "Mact, lbm/hr = "; MACTH :Macth = actual mass flow, lb/hr, unch."CFM MACTpRHO1@# "actual flow, cfm = "; CFM :cfm=actual cubic feet at p1 and T1p#SCFM MACTRHO1(T1)P1"k <# "scfm, unchoked = "; SCFM :SCFM = Standard cubic feet per minute$ The following is a computation for pressure recovery, taken from5$ Fig. II-III-18 on page 221 of "Fluid Meters."Y$L2LBETAEGBETAj$PR(L)DLP$ "Pressure recovery, in. H2O = ";PR$$ : This subroutine which follows computes discharge coefficient using"% : equation II-III-42 on page 220 of "Fluid Meters"C% RE| A : d% RE7 AL~ : % If 300000