Creating an Odd Pipe Transition

I am seeking an approach on how to create an odd shape. The attached file has a prototype to suuggest what I am trying to create. The starting point is the red shape. I have measured cross section curves that define that shape. The shape is supposed to flow into a pipe. I have the position and size of the pipe shown in purple. The top edge of the blue is the correct plan shape that the red should follow (but the vertical alignment is not correct here).

The question is how to get the red shape to wrap around to close the top (following the path of the top edge of the blue shape) and to merge the opening to the purple tube? What would be a good appoach to take? I have trimmed the purple at the last defined frame of the red. However, it can be cut back farther for the transition.

The starting point I have is the diameter and orientation of the purple cylinder and the frames that make up the red shape.

Problem Shape.3dm (3.3 MB)