In engineering, fluid flow and programming is a big deal. A thorough understanding of fluid flow fundamentals is a requirement for any mechanical engineer. Whether you are sizing a pump for a pipeline, designing a heat exchanger, or trying to alleviate bottlenecks in pipeline gathering systems, fluid flow shows up in many cases in our profession. I want to demonstrate a step-by-step procedure to calculate frictional pressure losses in a pipeline for single-phase incompressible flow using a hand calculation. Then I will demonstrate how to code this in excel VBA so the process is repeatable for different cases.
The sample code is presented below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|