Pre-formed valleys use a diverter to prevent water from rushing under panels on the opposite side, instead channeling the water off the roof. Expanding foam closures are often used to ensure a good seal.