duct calculator programme

Upload: mohammed-hassan-mohiuddin-khan

Post on 14-Apr-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/30/2019 Duct calculator programme

    1/5

    DUCT CALCULATOR PROGRAMINTRODUCTION

    The DUCT CALC program (hereafter called DUCT) is a program for IBM-PC's andcompatibles that calculates the required size of ducts given the maximumvelocity and pressure drop allowed. It performs mathematical operationsusing reverse polish notation (RPN) similar to a Hewlett-Packardcalculator. This program was written in BASIC by Randall C. Wilkinson andcompiled into an .EXE file using Microsoft QuickBASIC.

    If you have a Microsoft mouse it will be automatically recognized and used.You can use the mouse to perform all DUCT functions. If the mouse isavailable, a number pad will appear to allow you to point to digits on thescreen when entering numbers.

    Many default operating parameters for DUCT can be changed to suit yourneeds (or desires). Some of the parameters that can be changed are: max.duct velocity, max. duct pressure drop, default rectangular duct height,screen colors, menu locations on screen and numeric accuracy displayed.

    RPN OPERATION

    As mentioned above, the program operates like an HP calculator. When you

    enter a number, it is assumed to be an air quantity flowing in CFM. It isput into the bottom of the stack and the size of a duct is calculatedaccording to the current sizing parameters. When you enter another number,the first number is pushed up to the second position the stack. The secondCFM is sized and now occupies the bottom position in the stack.

    If the two ducts combine together to form a single duct, you can add thetwo air quantities together by pressing the '+' key. The air quantitiesare added together and now the new total CFM occupies the bottom spot inthe stack. The new duct size is calculated and displayed.

    The program can perform addition, subtraction, multiplication and division.

    As you can see, this is a powerful tool for quickly sizing entire ductworksystems. Simply enter the air flowing from each branch in a system, theprogram sizes the branch duct, then that air can be added to the runningtotal in the trunk duct, and the trunk duct will be automatically re-sized.

    The RPN stack can contain up to 13 items and can be saved to, or recalledfrom a disk file.

    DUCT SIZING

    When calculating the required size of a duct, the program will iterateuntil it finds the smallest standard diameter duct that does not exceed themaximum velocity or maximum pressure drop allowed. Once the diameter is

    calculated, the program then calculates the rectangular duct width so thatthe rectangular duct has the same pressure losses.

    The method for calculating the pressure drop in a duct was taken from theCarrier System Design Manual, Part 2, page 31. The formula for convertingrectangular to round duct was taken from the same manual, page 34.

    Duct roughness factors used by DUCT are for new, clean, galvanized steel.Pressure drops displayed are per 100' of duct.

  • 7/30/2019 Duct calculator programme

    2/5

    When started, the program assumes you are sizing low pressure/velocityductwork. The pressure drop limit is initially set to 0.10 inchesH2O/100', and velocity limit is set to 1200 FPM.

    STARTING DUCT

    Starting the program can be done by typing DUCT. After an initial titlescreen, a blank screen will be displayed.The block near the center of the screen is the mouse pointer. At the topof the screen is a list of all valid operators or commands and the keysthat invoke them. At the right is a number pad that lets you point withthe mouse to enter numbers. At the bottom of the screen is the DUCT CFM orOPERATOR prompt. This is where new numbers are entered before going intothe stack. The open area in the center is where the stack will be.

    EXAMPLES

    Enter 500 then press ENTER. A duct is sized for 500 CFM. Enter 5000 thenpress ENTER. Another duct is sized, this time for 5000 CFM. Enter 50000then press ENTER. Press [UP ARROW] to increase rectangular duct height,until the HT field says 60. Notice that the duct width decreases as heightincreases. The screen now displays three sized ducts.

    A 110x60 duct carrying 50,000 CFM is limited by velocity. This isconfirmed by looking at the VEL field, it is near its limit of 1200 FPM.But the PDROP field says 0.016 in./100', this is well below the limit of0.1.

    A more realistic maximum velocity for such a large duct might be 2500 FPM.Press 'D' for Duct data, The stack momentarily disappears, and the programprompts for a new velocity limit. Enter 2500 then press ENTER. Then itprompts for a new pressure drop limit, press ENTER to keep the same 0.1.The program now prompts for a new default duct height, press enter to keepthe previous entry. The stack should re-appear.

    Changing the pressure drop and velocity limits will not effect ducts that

    have already been sized, pressing 'S' will force the duct at the bottom ofthe stack to be re-sized. The new diameter, velocity, and duct width willbe displayed.

    OPERATORS

    An operator is an action that is performed by the program. Some operatorsact on numbers in the stack, some perform program control functions. Alloperators are invoked by pressing the keystroke corresponding to thatoperator as indicated at the top of the screen.

    The following is a description of each operator, and how it is used:

    ADD (`+' key)

    Adds the CFM in position 1 of the stack to the CFM in position 2, thenerases both CFMs from the stack, and inserts the sum into position 1,pushing the remaining items up in the stack. The new CFM is sized as aduct.

    SUBT (`-' key)

  • 7/30/2019 Duct calculator programme

    3/5

    Subtracts the CFM in position 1 of the stack from the CFM in position 2,then erases both CFMs from the stack, and inserts the difference intoposition 1, pushing the remaining items up in the stack. The new CFM issized as a duct.

    MULT (`*' key)

    Multiplies the number in the CFM field in position 1 of the stack by theCFM in position 2, then erases both items from the stack, and inserts thenew CFM into position 1, pushing the remaining items up in the stack. Thenew CFM is sized as a duct.

    DIVIDE (`/' key)

    Divides the CFM in position 2 of the stack by the number in the CFM fieldin CFM in position 1, then erases both items from the stack, and insertsthe new CFM into position 1, pushing the remaining items up in the stack.The new CFM is sized as a duct.

    DROP (`X' key)

    Drops (discards) the item in position 1 of the stack (the bottom), andshifts the remaining items down 1 position.

    SWAP (`W' key)

    Exchanges the items in positions 1 and 2 with each other.

    DUP (`U' key)

    Moves all items in the stack up 1 position and duplicates the item now inposition 2 to position 1.

    SIZE (`S' key)

    Forces the program to re-size the duct in position 1 of the stack. The re-displays the new size

    MODES (`M' key)

    Not yet implemented. Eventually will allow summing pressures rather thanairflows, with the intention of being able to calculate total system

    pressure drop. Currently does nothing.

    DUCT DATA (`D' key)

    Prompts for velocity and pressure drop limits as well as defaultrectangular duct height to be used for subsequent duct sizing.

    MORE HT (`up arrow' key)

  • 7/30/2019 Duct calculator programme

    4/5

    Increases the rectangular duct height for the duct in position 1 of thestack. The duct width is re-calculated and adjusted on screen to beequivalent to the duct diameter already calculated.

    LESS HT (`dn arrow' key)

    Decreases the rectangular duct height for the duct in position 1 of thestack. The duct width is re-calculated and adjusted on screen to beequivalent to the duct diameter already calculated.

    LOAD (`L' key)

    Reads items into the stack from a file called RPN.STK as saved by the SAVEoperator.

    SAVE (`A' key)

    Writes all data in the stack to a file called RPN.STK in the current sub-directory. The file is stored as ASCII characters in a comma delimitedformat, with each line in the file corresponding to a stack position. The

    numbers are stored with full numeric accuracy, regardless of the displayaccuracy. This file could easily be read by LOTUS, dBASE, etc.

    CLEAR (`C' key)

    Destroys forever, all information in all positions of the stack.

    QUIT (`Q' key)

    Quits the program and returns to DOS.

    CUSTOMIZING

    When the DUCT program is started it looks in the current subdirectory for afile called DEFAULT.RPN. If that file exists, the program will readCUSTOMIZING parameters from it and use those parameters for the currentDUCT session.

    A DEFAULT.RPN file can be loaded from another subdirectory by specifyingthe full path and file name as a command line parameter to the DUCT commandfrom the DOS prompt. For example:

    C:\DOS>DUCT C:\MYDIR\MYSETUP.RPN

    An example DEFAULT.RPN file looks like this:

    FORMAT HEADER : cfmdiavelpdrophtwdthlenfrictCFM FORMAT :########_DIAM FORMAT :###_

  • 7/30/2019 Duct calculator programme

    5/5

    VELOCITY FORMAT :#####_PDROP FORMAT :##.###_HEIGHT FORMAT :###_WIDTH FORMAT :####_LENGTH FORMAT :#####_FRICTION FORMAT : #.##_STACK LINE :23PROMPT LINE :25OPERATORS LINE :5DEFAULT PDROP :.1DEFAULT VELOCITY :1200DEFAULT HEIGHT :18DEFAULT FRICTION :.9DEFAULT ROUNDING :2PAD LINE :20MAX LINES :23STACK FG :1STACK BG :3OPERATORS FG :3OPERATORS BG :1PAD FG :1PAD BG :2PROMPT FG :15PROMPT BG :0

    The program will read each line and look for the key words listed above.It will then skip up to and including the colon. All characters after thecolon are significant.

    The FORMAT HEADER item is printed as a string at the top of the stack.

    The FORMAT items specify the way numbers will look on screen, refer to theBASIC manual, under the PRINT USING statement, for the meaning of thesymbols used.

    The LINE items specify which screen line on the particular item will belocated. Mouse sensitivity will move with the location of the item. The

    number used will be the screen location of the lowest line of multi-lineitems.

    The DEFAULT items specify the numbers assumed when calculating duct sizes.

    The FG and BG items specify the foreground and background colors as used byBASIC's COLOR command.

    The program will use built-in defaults for any items that do not appear inyour custom DEFAULT.RPN file. Thus, you may leave out any items that donot concern you.