                           *** PIPE ***  

             A program for HP48G to deteriment pipe size

                by sam chan (e-mail ce_css@stu.ust.hk)





   This program is designed for civil engineering students to 

deteriment the pipe diameter for a given flow rate and head loss.



  In order to deteriment the head loss along the pipe, the friction factor,

pipe diameter and flow rate must be given.  However, in many situation,

the pipe diameter is a unknown factor in order to satisfy a given flow

rate and allowable head loss.  As a result, in many situation we need to

assume a value of f in order to deteriment the diameter of the pipe, and 

then the check the f value to see if the assumption is corrected.  If 

the 'new' f value and 'old' f value are different, the 'new' f value will 

be use as a new guess to deteriment pipe diameter until the soultion 

become satisfy.



  This program solve the pipe diameter using this  procedures.  Here

  is the input format



  4: flow rate (in m3/s)

  3: head loss per unit length (dimensionless)

  2: kinematic viscosity (m2/s)

  1: roughness of the pipe (in m)



  After calculation, the pipe diameter will be on stack 1

  1: pipe diameter (in m)



  For example

  What size of new cast iron pipe, 1000m long will deliver 1.5m3/s of water 

  with a drop in the hydraulic grade of 5.4m?



  flow rate = 1.5m3/s

  head loss per unit length = 5.4m/1000m = 0.0054

  

  assume the fluid is wate at 20 deg C

  kinematic viscosity = 1.51e-6 m2/s (from table)



  assume the effective roughness of the pipe is 0.1mm

  roughness of the pipe = 0.1e-3m



  the input stacks are

  4:  1.5

  3: 0.0054

  2: 1.51e-6

  1: 0.1e-3



  the answer is 

  4:

  3:

  2:

  1:  0.8555  (The pipe diameter is 0.8555 m)





%%HP: T(3)A(R)F(.);

\<< .02

  DO 5 PICK SQ 2

PICK * 5 PICK /

.082627 * 5 XROOT

DUP DUP 8 PICK SWAP

/ 6 PICK / 4 * \pi /

SWAP 5 PICK SWAP /

SWAP DARCY DUP 4

ROLL %CH ABS SWAP 3

ROLLD

  UNTIL

    IF .1 > DUP        

    THEN SWAP DROP

    ELSE SWAP 7

ROLLD

    END NOT

  END 5 DROPN

\>>

