I wonder if my 1D integration code can be applied directly to 2D?

This is my 1D integration code

retention_solute = assemble(c*dx)    
retention_ct1 = assemble(ct1*dx)    
retention_ct2 = assemble(ct2*dx)   
retention_ct3 = assemble(ct3*dx)

Can I directly apply this 1D code to 2D ?

Yes, please test this on a simple problem before asking an incomplete question(not reproducible example).