What happens to the potential energy when we connect 2 water tanks with different water levels? 
Imagine combining 2 water tanks (with equal cross section areas) with different water levels.
I'll call them A (tank with the higher water level) & B.
When water is flowing from A to B, what happens to its potential energy? Does it decrease? If so, what happens to that energy?
I would also like to know what happens to the center of gravity of this whole water volume? Does it also lower when water is flowing?
Edit:
I'll tell what I am thinking. In A, some amount of water is going down. Hence the potential energy decreases. And in B the same amount of water is pushed up the same hight. So the potential energy increases. So as the mass and the change of hight is equal the decrease and increase of potential energy is also equal. Doesn't that mean the net change of potential energy is zero?
I have seen so many explanations similar to the answers below. And that seems correct. But still I can't get my head off from the above explanation. Can anyone show me what is wrong in my explanation?
 A: Looking at the following image, it's pretty obvious that the centre of mass will be lower, because the final state will be, just taking a portion of water (blue rectangle) and lowering it.
And obviously, the potential energy also is reduced (lowering mass centre, lowers total potential), in an ideal world the water would just oscillate, going up and down in both tanks, but in reality, the kinetic energy of the water flowing will disperse very quick through friction and heat.

A: You have made two incorrect assumptions:

*

*You assumed that the height changes by the same amount in each tank. That is incorrect. It is only correct when the areas of the two tanks are equal. In general the volume of each tank changes by the same amount, not the height

*You assumed that equal changes in height lead to equal changes in potential energy. That is also incorrect.

The potential energy in a tank of water is proportional to the height of the water squared. That's because the height of the center of mass of the water is $h/2$ and the mass of the water is $\rho A h$, so the potential energy is $\frac{1}{2} \rho A g h^2$. Because the potential energy has this non-linear relationship, equal changes in height don't lead to equal changes in energy. Just calculate
$$(h_1 +\Delta h)^2 - h_1^2 = \Delta h^2+ 2\Delta h h_1$$
See how the change in the square of the height depends on the initial height $h_1$ as well as the change in height? That means the two tanks can change their potential energies by different amounts and hence the total change in potential energy can be non-zero.
