An application for calculating critical depth in open channels flow