I have performed cleaning validation studies on swabs taken from pharmaceutical manufacturing equipment, searching for trace levels of cleaning agents. I would use HPLC, of with a refractive index detector, or using ion chromatography. This process is expensive and tricky. What you're looking for is a way to generally determine if detergent remaining in a bulk fluid -- maybe you can determine it by conductivity? If the detergent is charged, you may be able to get a general idea by comparing the conductivity of a rinse sample before and after, since the rinse water likely has some conductivity of its own to start with.