Critical depth is an essential parameter for the design, operation, and maintenance of conduits. Circular, arched, and egg-shaped sections are often used in non-pressure conduits in hydraulic engineering, irrigation, and sewerage works. However, equations governing the critical depth in various sections are complicated implicit transcendental equations. The function model is established for the geometric features of multiple sections using the mathematical transform method and while considering non-dimensional parameters. Then, revised PSO algorithms are implemented in MATLAB, and the right solution’s formula for the critical depths in various non-pressure conduit sections is established through optimization. The error analysis results show that the established formula has broad applicability. The maximum relative errors of the formula for critical depths are less than 0.182%, 0.0629%, and 0.170% in circular, arched, and egg-shaped sections, respectively, which are more accurate than those of existing formulas; the form of the formula proposed in this work is also more compact than that of the existing formulas. The results of this research may be useful in design, operation, and maintenance in conduit engineering.