Formulas used in the Virtual World. For more theory 
General assumptions:

Calculations in FD_watersystems
 For each branch waterlevel (ylevel) and Energylevel (Hlevel) are calculated at the beginning and end of the branch.
 The Hlevel downstreams is transferred from the Hlevel upstreams branch downstreams. The ylevels are calculated with the dimensions from the branch. So it could be that ylevels between 2 branches are not the same? When drawing the yline, a transition between the 2 y levels has to be made.
 For connector you have different width and slope downstream and upstream!!
 CulvertRectangle: If downstreams waterdepth < Height culvert : Type is converted to Trapezium. Note: With high velocities, water level will rise and the type maybe should be concerted back to culvertrectangle. This can be solved by using several extra points.
 Water level at weir.
 In a branch (between 2 points) discharge is always the same.
 Normally HlevelWorld_m. x = HlevelWorld_m.y downstream branch. Except with a weir.
 At a point with InputDischarge, the waterlevel will drop because the increase of velocityhead. If this happens very suddenly is looks odd. Solution is to add 1 or more extra point downstream of a point with InputDischarge. So the full velocityhead is taken into account at the point downstream of the pint where InputDischarge occurs.
 2 special branches when calculating. First is the outflow: Discharge = 0. Value in InputDischarge.x is the velocity in the receiving water. Second is the weir : There is a jump in HlevelWorld compared to the downstream waterlevel.
 Weir is always assumed as free flow. And as a short crest. Waterlevel .x and .y are the same.
Workflow calculation
In the case of type = trapezium
 HlevelWorld_m.x = HlevelWorld.y previous branch
 yLevelWorld_m.x = yLevelWorld.y previous branch
 Get Discharge from point upstreams
 Calculate Depth_m.x ,WettedArea.x, WetterPerimeter.x, HydraulicRadius.x, Velocity.x
 Calculate Hslope, dH, Time
 HlevelWorld_m.y = HlevelWord_m.x + dH
ylevelWorld_m.y = yLevelWorld,x + dH  Calculate Depth_m.y ,WettedArea.y, Velocity.y, VelocityHead
ylevelWorld_m.y= HLevelWorld_m.y – VelocityHead
 Outflow downstreams is calculated separate
 Check if branch is weir. If weir calculate H above weir, convert to HlevelWorld_m.x = HlevelWorld.y. yLevelWorld_m = CrestlevelLevelWorld_m + 2/3 * H.
 If branch is not weir
 If branch = connector; calculate average width and average slope
 Calculate Depth_m.x ,WettedArea.x, WetterPerimeter.x, HydraulicRadius.x, Velocity.x
 Calculate Hslope, dH, Time
 HlevelWorld_m.y = HlevelWord_m.x + dH
 ylevelWorld_m.y = yLevelWorld,x + dH
 Calculate Depth_m.y ,WettedArea.y, Velocity.y, VelocityHead
 ylevelWorld_m.y= HLevelWorld_m.y – VelocityHead