Calculates the convection coefficient for fluid flow through a circular pipe.
Source Code
10 REM "HT" 20 PRINT "THIS PROGRAM CALCULATES THE CONVECTION COEFFICIENT FOR FLUID FLOW THROUGH A CIRCULAR PIPE" 30 PRINT 40 PRINT "IS THE PIPE CIRCULAR? (1 YES 2 NO)" 50 INPUT A 60 IF A<>1 AND A<>2 THEN GOTO 40 70 IF A=2 THEN GOTO 1650 80 PRINT "ENTER PIPE LENGTH (M)" 90 INPUT L 95 PRINT "PIPE LENGTH=";L;"M" 100 PRINT "IS AN AVERAGE (1) OR SPECIFIC (2) VALUE OF H REQUESTED?" 120 INPUT B 130 IF B<>1 AND B<>2 THEN GOTO 100 140 IF B=2 THEN GOTO 230 150 REM B=1 AVE H 160 PRINT "BASED ON THE DATA YOU HAVE, DECIDE ON A MEAN TEMP. FOR THE FLUID CONSIDERING THE ENTIRE PIPE" 190 PRINT "ENTER MEAN TEMP (K)" 200 INPUT C 210 PRINT "MEAN TEMP=";C;"K" 220 GOTO 270 230 REM B=2 SPEC H 240 PRINT "INPUT TEMP. AT DESIRED LOCATION (K)" 250 PRINT "IF NOT KNOWN EXACTLY, ENTER AN APPROX. VALUE" 255 INPUT T 260 PRINT "T=";T;"K" 270 REM CALC RE 280 PRINT "ENTER VISCOSITY AT TEMP. ABOVE (KG/(S*M))" 290 INPUT MU 300 PRINT "MU=";MU;" KG/(S*M)" 310 PRINT "ENTER FLOW RATE (KG/S)" 320 INPUT M 330 PRINT "M=";M;" KG/S" 340 PRINT "ENTER PIPE DIAMETER (M)" 350 INPUT D 360 PRINT "DIAMETER=";D;" M" 370 LET RE=(4*M)/(PI*D*MU) 380 PRINT "REYNOLDS NUMBER=";RE;" (EQ. 8.6)" 390 IF RE>=2300 THEN GOTO 1070 400 PRINT "FLOW IS LAMINAR" 410 LET XFD=.05*RE*D 420 PRINT "ENTRY LENGTH APPROX.=";XFD;" M" 430 IF B=1 THEN GOTO 470 440 PRINT "ENTER POINT OF INTEREST AS DISTANCE FROM INLET IN M" 450 INPUT X 460 GOTO 550 470 REM B=1 AVG VALUE 480 LET I=XFD/L 490 IF I>.05 THEN GOTO 530 500 PRINT "ENTRY REGION NOT SIGNIFICANT" 510 PRINT "USE AVERAGE VALUES FOR VARIABLES" 520 GOTO 560 530 PRINT "ENTRY REGION SIGNIFICANT" 540 GOTO 740 550 IF X<XFD THEN GOTO 740 560 PRINT "FLOW FULLY DEVELOPED" 570 PRINT "IS THERE UNIFORM HEAT FLUX? (1 YES 2 NO)" 580 INPUT E 590 IF E<>1 AND E<>2 THEN GOTO 570 600 IF E=2 THEN GOTO 660 610 LET NU=4.36 620 PRINT "EQ. 8.51 NUSSELT NO.=";NU 630 PRINT "ENTER VALUE OF K (W/(M*K)) AT MEAN TEMP" 640 INPUT K 645 PRINT "K=";K;"W/(M*K)" 650 GOTO 1620 660 REM E=2 670 PRINT "IS THE SURFACE TEMP. CONSTANT? (1 YES 2 NO)" 680 INPUT F 690 IF F<>1 AND F<>2 THEN GOTO 670 700 IF F=2 THEN GOTO 1650 710 LET NU=3.66 720 PRINT "EQ. 8.53 NUSSELT NO.=";NU 730 GOTO 630 740 PRINT "ENTRY REGION" 750 IF B=1 THEN GOTO 860 760 REM B=2 SPEC VALUE 770 PRINT "ENTER PRANDTL NO. AT POINT IN QUESTION" 780 INPUT PR 790 LET G=(X/D)/(RE*PR) 800 PRINT "REFER TO FIG. 8.8 TO DETERMINE NUSSELT NO. FOR (X/D)/(RE*PR)=";G 810 PRINT "ENTER NUSSELT NO." 820 INPUT NU 830 PRINT "ENTER K (W/(M*K)) AT POINT IN QUESTION" 840 INPUT K 845 PRINT "K=";K;"W/(M*K)" 850 GOTO 1610 860 REM B=1 AVG VALUE 870 PRINT "IS SURFACE TEMP. CONSTANT? (1 YES 2 NO)" 880 INPUT J 890 IF J<>1 AND J<>2 THEN GOTO 870 900 IF J=1 THEN GOTO 920 910 GOTO 1650 920 PRINT "ENTER ALL VALUES AT AVERAGE MEAN TEMP. (MEAN TEMP. IN+MEAN TEMP. OUT)/2" 925 PRINT "HAUSEN EQ. 8.54" 926 PRINT "ENTER AVG. VISCOSITY" 927 INPUT MU 928 LET RE=(4*M)/(PI*D*MU) 929 PRINT "NEW REYNOLDS NO.=";RE 930 PRINT "ENTER PRANDTL NO." 940 INPUT PR 950 LET NU=3.66+(.0668*D*RE*PR/L)/(1+.04*(D*RE*PR/L)**(2/3)) 960 PRINT "NUSSELT NO.=";NU 970 PRINT "FOR IMPROVED ACCURACY: SIEDER-TATE EQ. 8.55" 980 IF PR<.48 OR PR>16700 THEN GOTO 1650 990 PRINT "ENTER VISCOSITY AT SURFACE TEMP" 1000 INPUT MUS 1010 PRINT "SURFACE VISCOSITY=";MUS;"KG/(S*M)" 1020 IF MU/MUS<.0044 OR MU/MUS>9.75 THEN GOTO 1650 1030 LET NU=1.86*(RE*PR/(L/D))**(1/3)*(MU/MUS)**.14 1040 PRINT "ENTER K (W/(M*K)) AT MEAN TEMP" 1050 INPUT K 1055 PRINT "K=";K;"W/(M*K)" 1060 GOTO 1610 1070 PRINT "FLOW IS TURBULENT" 1080 PRINT "IN THE ENTRY REGION THE RESULTS GIVEN WILL BE CRUDE APPROXIMATIONS" 1082 IF B=1 THEN PRINT "ENTER ALL VALUES AT AVG. MEAN TEMP." 1084 IF B=2 THEN GOTO 1090 1085 PRINT "ENTER AVG. VISCOSITY" 1086 INPUT MU 1087 LET RE=(4*M)/(PI*D*MU) 1088 PRINT "NEW REYNOLDS NO.=";RE 1090 PRINT "ENTER PRANDTL NO." 1100 INPUT PR 1105 PRINT "PR=";PR 1110 LET PE=RE*PR 1115 PRINT "PECLET NO. (PE)=";PE 1118 IF PR>=3E-3 AND PR<=5E-2 THEN GOTO 1450 1120 IF PR<.7 OR PR>160 THEN GOTO 1650 1130 IF RE<10000 THEN GOTO 1650 1140 IF (L/D)<60 THEN GOTO 1650 1200 PRINT "IS THE TEMP. DIFF. (SURFACE TEMP.-MEAN TEMP.) SMALL? (1 YES 2 NO)" 1210 INPUT J 1220 IF J<>1 AND J<>2 THEN GOTO 1200 1230 IF J=2 THEN GOTO 1360 1240 REM TEMP DIFF SMALL 1250 PRINT "COBURN EQ. 8.57" 1260 LET NU=.023*RE**.8*PR**(1/3) 1270 PRINT "NUSSELT NO.=";NU 1280 PRINT "PREFERRED: DITTUS-BOELTER EQ. 8.58" 1290 PRINT "IS HEATING (1) OR COOLING (2) TAKING PLACE?" 1300 INPUT L 1310 IF L<>1 AND L<>2 THEN GOTO 1290 1320 IF L=1 THEN LET N=.4 1330 IF L=2 THEN LET N=.3 1340 LET NU=.023*RE**.8*PR**N 1342 PRINT "NUSSELT NO.=";NU 1345 PRINT "ENTER K (W/(M*K))" 1347 INPUT K 1350 GOTO 1620 1360 REM J=1 TEMP DIFF LARGE 1370 IF PR<.7 OR PR>16700 THEN GOTO 1650 1380 IF RE<10000 OR (L/D)<60 THEN GOTO 1650 1400 PRINT "SIEDER/TATE EQ. 8.59" 1410 PRINT "ENTER SURFACE VISCOSITY (KG/(S*M))" 1420 INPUT MUS 1430 LET NU=.027*RE**.8*PR**(1/3)*(MU/MUS)**.14 1440 GOTO 1342 1460 PRINT "LIQUID METAL" 1480 PRINT "IS THE SURFACE HEAT FLUX CONSTANT (1), THE SURFACE TEMP. CONSTANT (2), OR NONE OF THE ABOVE?" 1490 INPUT Q 1500 IF Q<>1 AND Q<>2 AND Q<>3 THEN GOTO 1480 1510 IF Q=2 OR Q=3 THEN GOTO 1570 1520 REM HEAT FLUX CONST 1530 IF RE<3.6E3 OR RE>9.05E5 THEN GOTO 1650 1540 IF PE<100 OR PE>10000 THEN GOTO 1650 1550 PRINT "EQ. 8.60" 1560 LET NU=4.82+.0185*PE**.827 1565 GOTO 1345 1570 IF Q=3 THEN GOTO 1650 1580 REM Q=2 SURF TEMP CONST 1590 IF PE<=100 THEN GOTO 1650 1600 LET NU=5+.025*PE**.8 1605 GOTO 1345 1610 PRINT "NUSSELT NO.=";NU 1620 LET H=(K*NU)/D 1630 PRINT "HEAT TRANSFER COEFFICIENT=";H;"W/(M**2*K)" 1640 STOP 1650 PRINT "OUT OF RANGE OF PROGRAM, CONSULT LITERATURE" 1 REM "A" 2 LET Z=.4342944819 5 FAST 10 FOR J=1 TO 3 20 IF J=2 OR J=3 THEN GOTO 30 22 LET A=1 24 LET B=.1 26 GOTO 50 30 IF J=3 THEN GOTO 40 32 LET A=10 34 LET B=1 36 GOTO 50 40 LET A=100 42 LET B=10 50 FOR W=0 TO A STEP B 60 LET X=Z*10*LN (.25*W**2+1) 70 PRINT W,X 80 NEXT W 85 NEXT J 90 SLOW