Division into subnets

Calculation of flows

Calculation of pressure losses

Error indication

For example, the following scheme will be used:

You can download example stks-file, open it in Stokes and change different parameters there. There are 25 objects in the file – the free version of Stokes is enough.

If there are pumps or reductors in the scheme, then the network is divided into separate subnets, which are calculated separately. In the example above, there are two subnets:

- nodes 1, 2, 3, 4, 5, 6, 7, 8, 9 and 24 – reductor 5 for this subnet is a consumer with a flow rate of 20 m
^{3}/h; - 5, 10, 11, 12 – reductor 5 is a source of this subnet.

In Stokes, pipes of different subnets are tinted with shadows of different colors. In this case, it is blue for the first subnet and light green for the second.

Flows are set as input data in properties of consumers (the **Q** parameter). For other objects, the initial value of the flow through them is 0.

Before starting hydraulic calculations, it is necessary to put the flow values through all nodes and pipes. To do this, the program passes from each consumer in turn to the source of the corresponding subnet and adds the consumption value of this consumer to them.

This algorithm does not try to figure out whether the diameter of pipe is enough to pump such an amount of gas/liquid through it. It's just supposed to be enough :)

When all the flows are determined, there is a passage in the opposite direction – from the source towards the consumers. In this passage, the pressure losses in the pipes is calculated:

P_{2} = P_{1} - ∆P_{L} - ∆P_{h}

где

P_{2} – pressure at the end of pipe;

P_{1} – pressure at the start of pipe;

∆P_{L} – pressure loss along length;

∆P_{h} – pressure change due to the altitude difference of the beginning and end of pipe.

Equations for calculation ∆P_{L} and ∆P_{h} can be found in the article about formulas.

If P_{1} - ∆P_{L} - ∆P_{h} < -101325 Pa (which corresponds to zero absolute pressure – vacuum), then P_{2} is set to -101325 Pa. All subsequent pipes and nodes will also have pressure of -101325 Pa.

If you see such pressure values, it means that the pipe capacity was not enough for the specified flow rate. It is necessary to increase the diameters of some pipes, or reduce consumptions of consumers, or increase the source pressure.

When the flows and pressures are calculated, Stokes checks whether the calculated parameters do not exceed the permissible values. The limits of acceptable values are set in the object parameters, these are:

**Max. allowable speed**speed of fluid flow in pipes;**Min. and max. allowable pressure**at the inlet to consumers, pumps and reductors;**Max. consumption/flow**of gas/liquid for sources, pumps and reductors.

If some parameters go beyond the allowed limits, the object is highlighted in red. It looks like this: