In this work, a methodology for the optimal design of flow in foundry casting rigging systems is discussed. The methodology is based on a novel, fully analytical design sensitivity formulation for transient, turbulent, free-surface flows. The filling stage of the casting process is modeled by solving the time-averaged form of the Navier-Stokes equations via a turbulent mixing-length model, in conjunction with the volume-of-fluid (VOF) method for modeling the free surface. The design of the runner and gating system of a simple block casting is presented as an example application for using sensitivity information in design. The analytical sensitivity routine is coupled to a numerical optimizer to yield an automated method for optimal design of the casting rigging system. The finite element model of the filling process is verified through physical experimentation. Solutions of glycerol and water are used to perform laminar and turbulent flow filling experiments, which are used to verify independently the VOF algorithm and the adequacy of the mixing-length model. The results show that the numerical model accurately reproduces the main features of the flow, and filling times agree with acceptable accuracy. Finally, the analytical techniques are used to obtain an optimal runner shape, which eliminates air entrainment, and the design is verified experimentally.