What size supply pipe must be used from a 5000 litre water tank to supply 4 bars of pressure to a house that is 20m below and 300m away from the tank?
It's a trick question, you can never get 4 bar of pressure with only a 20 m head.
The pressure due to a vertical column of liquid is equal to the density x height of the column x the acceleration due to gravity (little g = 9.8 m/s2).
Your height is 20m
Density of water is 1000 kg/m3
g = 9.8
So, pressure is 196,000 Pascals
100,000 Pascal per bar, so you have 1.96 bar as the max pressure you could get, independent of flow rate or pipe size.
Pressure of the gravity fed water delivered from the overhead tank will have nothing to do with the pipe size used. The pressure is dependent only on the vertical distance between the top of the water in the tank and the delivery point.
Where pipe size does come into play is in the flow rate that is needed at the delivery point. If you only have one delivery point being used at a time you can get by with a pipe size that can deliver the desired flow rate all the way back to the tank.
If you have multiple delivery points in use at one time then the branch lines from those delivery points will have to merge into a larger pipe at some point and then this larger pipe goes the rest of the way back to the tank. You roughly work out the size of this larger pipe needing to have a cross sectional area that is the sum of the cross sectional areas of the multiple use delivery point pipes.
Given that 20 meters of head only equates to 1.96 Bar (1m elevation = 0.0980413943 Bar), no pipe alone will do this - you'll need a pump, or you'll need to accept less than 2 Bar as all the pressure you have available.
Then you need to determine the flow rate you wish to operate at for sizing the pipe - you'll get 1.96 bar with any size pipe and no flow (static head) but as you actually use water the pressure will drop (dynamic head) in relation to to pipe size and rate of flow. That is essentially friction in the pipe resisting flow and reducing the effective head. Calculators are available and the formulas for that are adequately complex that using one is suggested. Aside from size of pipe and flow rate, pipe material enters into it as some types are smoother inside and thus have less friction for a given size of pipe than other types.
For example, if you were sizing for 12 l/min, 25mm plastic pipe would have about 2.7 m dynamic head, leaving you with 17.3m head pressure (delivery pressure = 1.7 Bar), and 50 mm pipe would only lose 0.0925m at that flow rate (delivery pressure = 1.9 Bar).
Bump the flow up to 120 l/min and the 50 mm pipe costs 6.55m head (delivery pressure = 1.3 Bar) - but the 25mm pipe cannot provide that flow rate at all with 20m head - it tops out at about 35 l/min with no pressure at the house end (20 m static head - 20m dynamic head; delivery pressure = 0 Bar)