Dynamics of osmotic flows