Line (1996)

(june 1996 project, API functions only, BC++ 4.5)
This program was my early attempt to calculate PI levels and flows in the system composed of pipes and tanks using Newton-Raphsons method. Initial flow is calculated with velocity Vo=1 m/s and parameter w=1.85.

Program was developed using API functions so it is of no importance to describe it in details. The main idea was to ease the painful way of data-input in similar Fortran language-based programs. That input consisted of typing hundreds of coordinates in editor and then calling the DOS-based program.

 First dialog box is used for defining the 2D grid by giving distances between x-gridlines and y-gridlines.

After entering the grid we can adjust it with Grid Line Type, Grid Color and Hide/Show Grid options.

Next step is to adjust lines (pipes) that will be inserted between grid intersections, with Line Numbers (Show/Hide), Thickness and Line Color options.

Input mode is Line, while holding the left mouse button cursor will snap to nearest intersection and when the button is released the line will be drawn. If we press the right button nearest line will be marked so we can delete it by pressing the first button in the tool bar. Same can be done with undo button (second in the tool bar).

Mode is now Tank and single left click will place the tank at the nearest intersection.

After marking the first tank by right clicking near its left side and pressing Set button we can enter tank's Pi level.

Within the pipes dialog box we set diameter (using preset or other value) and roughness coefficient (same).

After pressing the system analysis button initial levels, flows, resistances and numbers of elements will be calculated.

When pressing the Qip button we can enter intersection number and its lost flow in lit/s. 

The entered value will be inserted.

By pressing Intr button program is calculating the single internal iteration ( changing Pi values).

After repeating the step above enough times and when Ep is small enough we press Extr button and calculate one external iteration (changing flows). 


Post a Comment

Cancel Reply