home *** CD-ROM | disk | FTP | other *** search
- -----------------------------------------------------------------------------
- --VENTURI.UPL
- -- Venturi Nozzle Program
- -- User is prompted for the 1) entry diameter, 2) throat diameter,
- -- and 3) exit diameter.
- -- System will draw a sectional outline with the middle of the entry
- -- opening at the origin.
- -----------------------------------------------------------------------------
-
- PROC MAIN
-
- REAL NOZZLE_LENGTH --Length of venturi nozzle
- REAL OPEN_DIAM --The opening diameter of venturi
- REAL THROAT_DIAM --Throat diameter of venturi
- REAL OPEN_ANGLE --Exit diameter of venturi
- --These points are used for drawing the upper and lower profiles of the nozzle
- COORD POINT1, POINT2, POINT3 --upper profile data points
- COORD POINT4, POINT5, POINT6 --lower profile data points
-
- --start of executable code
-
- PRINT 'VENTURI NOZZLE PROGRAM. Enter the following values:'
-
- LOOP
- ACCEPT NOZZLE_LENGTH PROMPT(' Nozzle length: ') NEWLINE
- EXIT WHEN (NOZZLE_LENGTH => 0.0 AND NOZZLE_LENGTH <= 10.0)
- PRINT 'Nozzle length must be between 0.0 and 10.0'
- END LOOP
-
- LOOP
- ACCEPT OPEN_DIAM PROMPT(' Opening diameter: ') NEWLINE
- EXIT WHEN (OPEN_DIAM => 0.0 AND OPEN_DIAM <= 5.0)
- PRINT 'Opening diameter must be between 0.0 and 5.0'
- END LOOP
-
-
- LOOP
- ACCEPT THROAT_DIAM PROMPT(' Throat diameter: ') NEWLINE
- EXIT WHEN (THROAT_DIAM => 0.0 AND THROAT_DIAM <= 5.0)
- PRINT 'Throat diameter must be between 0.0 and 5.0'
- END LOOP
-
- LOOP
- ACCEPT OPEN_ANGLE PROMPT(' Opening angle: ') NEWLINE
- EXIT WHEN (OPEN_ANGLE => 0.0 AND OPEN_ANGLE <= 90.0)
- PRINT 'Opening angle must be between 0.0 and 90.0'
- END LOOP
-
- --Calculate points on the nozzle outline's upper profile
- POINT1.X = 0.0
- POINT1.Y = OPEN_DIAM/2.0
- POINT1.Z = 0.0
-
- POINT2.X = TAN(DEGRAD(OPEN_ANGLE))*((OPEN_DIAM-THROAT_DIAM)/2.0)
- POINT2.Y = THROAT_DIAM/2.0
- POINT2.Z = 0.0
-
- POINT3.X = NOZZLE_LENGTH
- POINT3.Y = OPEN_DIAM/2.0
- POINT3.Z = 0.0
-
- --Calculate points on the nozzle outline's upper profile
- --These are the mirror image about the x-axis so we negate
- --the y-component of each point.
- POINT4.X = POINT1.X
- POINT4.Y = -POINT1.Y
- POINT4.Z = POINT1.Z
-
- POINT5.X = POINT2.X
- POINT5.Y = -POINT2.Y
- POINT5.Z = POINT2.Z
-
- POINT6.X = POINT3.X
- POINT6.Y = -POINT3.Y
- POINT6.Z = POINT3.Z
-
- --Now draw the nozzle
-
- ECHO OFF
- SEND
- SEND 'INS LIN: ',DIGSTR(POINT1), ',', DIGSTR(POINT2), ',',
- SEND DIGSTR(POINT3), ',', DIGSTR(POINT1)
- SEND 'INS LIN: ',DIGSTR(POINT4), ',', DIGSTR(POINT5), ',',
- SEND DIGSTR(POINT6), ',', DIGSTR(POINT4)
- SEND 'SEL COLOR 15'
- SEND 'INS LIN FONT 3: X-1,IX',NOZZLE_LENGTH+2.0
- SEND 'REPA'
- SEND 'ZOOM ALL'
- SEND 'SEL COLOR 12'
- ECHO ON
-
- END PROC
-