tl;dr: yes, the potential energy increases. Surface effects (surface
tension leading to capillary action) provide the requisite
energy, but the water will eventually stop rising as the weight of the
water in the thread balances the surface tension.
Rather than discussing threads, I'm going to do as Lubos suggests and
consider a capillary tube---a very small tube up which water
will rise. This preserves the essential physics (contact between water
and a surface) while simplifying matters enough that
we can perform some explicit calculations.
Suppose, for the sake of concreteness, that the glass is a cylinder of
radius $r$ and that the water has an initial height (before you put
the capillary tube in) of $h$. Then the center of mass of the water is
at $h_{cm} = h/2$, and the initial gravitational potential
energy is
$$
U_{grav} = \rho V g h_{cm} = \frac{1}{2}\rho \pi r^2 h^2
$$
(where I've written the $\rho$ for the density of water and put the
zero of gravitational potential energy at the bottom of the glass).
If, then, you put a cylindrical capillary tube of radius $\delta r \ll
r$ into the glass of water, and the water rises to a level $l$ above
the new surface of the water in the glass, then we have a volume
$$
V_{tube}' = \pi \delta r^2 l
$$
of water in the tube, and
$$
V_{glass}' = \pi r^2 h - V_{tube}' = \pi r^2 h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right)
$$
in the glass proper. The surface of the water in the glass is now at
$$
h' = V_{glass}'/(\pi r^2) = h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right)
$$
so the center of mass of the water in the glass is at
$$
h_{cm}' = h'/2 = h_{cm}\left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right)
$$
and the gravitational potential energy of the water in the glass is
$$
U_{grav, glass}' = \rho gV_{glass}'h_{cm}' = \rho g\pi r^2 h^2/2 \left(1 - \frac{\delta r^2}{r^2}\frac{l}{h}\right)^2
$$
To next-to-leading order in $\delta r$ (since $\delta r \ll r$,
$\frac{\delta r^2}{r^2}$ is small and $\frac{\delta r^4}{r^4}$ is very
tiny indeed, so I can ignore it), this is
$$
U_{grav, glass}' \approx g\rho \pi r^2 h^2/2 \left(1 - 2\frac{\delta r^2}{r^2}\frac{l}{h}\right)
= U_{grav} - g\rho\pi r^2 h^2 \frac{\delta r^2 l}{r^2 h}
$$
The height of the center of mass of the water in the capillary tube is
$$
l/2 + h' = l/2 + h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right),
$$
so the potential energy of that water is
$$
U_{grav, tube}' = \rho V_{tube}' g (l/2 + h') = \rho g \pi \delta r^2l
\left[l/2 + h \left(1 - \frac{\delta r^2}{r^2} \frac{l}{h}\right)\right];
$$
to next-to-leading order in $\frac{\delta r}{r}$, this is
$$
U_{grav, tube}' \approx \rho V_{tube}' g (l/2 + h') = \rho g \pi\delta r^2l(l/2 + h).
$$
At last, we can write down the total gravitational potential energy of
all the water:
$$
U_{grav}' \approx U_{grav} + g\rho\pi \delta r^2l^2/2
$$
To answer the first part of your question, the gravitational
potential energy of the water does change. As you mentioned in your
reply to Lubos, the drop in the level of the water in the glass does
offset the increase in (gravitational) potential energy, but not
totally.
So far, so good: I've been able to make a reasonably straightforward
calculation of the gravitational potential energy of the two
configurations, and compare them. The concepts are from freshman
physics, and the techniques aren't hard to follow.
The thing is, the gravitational potential energy is not the only
energy in this situation, and that's where the question gets
complicated. There's also an energy associated with every
interface---every surface of contact between two different materials.
If you ponder a little while, that statement becomes pretty
obvious. Think about a kid blowing a soap-bubble: he has to do some
amount of work (call it $\delta W$) by blowing on that little thing
shaped like a Quidditch goal in order to increase the surface area
(inside and out) of the bubble. We define the surface tension $\gamma$
as
$$
\gamma = \frac{\delta W}{\delta A}
$$
(more or less---in actuality, we have to pass to the derivative:
consider very small $\delta W$ and $\delta A$. For a slightly less
intuitive example in which the surface tension comes out a bit more
nicely, without having to pass to a derivative, see
https://en.wikipedia.org/wiki/Surface_tension#Two_definitions). I
don't actually understand what causes surface tension; I assume it's
inter-molecular forces (e.g. van der Waals or polar forces), but I'd
like to see some calculations, or better yet experiments, bearing that
out. So that's one part of the answer: the surface tension, and
ultimately the forces between the water molecules, provide the work
required to draw the water up into the tube.
But that's not the whole story. Naively, even when we take surface
tension into account, the minimum energy condition would seem to be a
perfectly flat surface. Keeping the level of the water thus at $h$,
inside the tube or outside, would certainly minimize the surface area
of the water. Nor does saying ``surface tension!!one!'' really
constitute an explanation.
In order to come up with a satisfactory explanation, we have to shift
from thinking about energies to thinking about forces. One can think
of surface tension as a sort of analogue to pressure: it tells you how
much force is exerted across a line of given length drawn along an
interface between two substances. Surface tension is to the length of
a line along an interface as pressure is to the area of the
interface.
This has a surprising result: that at an ideal three-way interface,
for example at (an idealized version of) the edge of a droplet sitting
on a table or the place where the water meets the capillary tube, the
liquid makes a specific angle with the solid. In this case, there are
three relevant sets of interfaces, each with its own surface tension:
liquid-gas ($\gamma_{LG}$, water and air), liquid-solid
($\gamma_{LS}$, water and the glass of the capillary tube), and
gas-solid ($\gamma_{GS}$, air and glass).
If the whole situation is in equilibrium, we can do a force balance:
the horizontal component of the force due to the solid-gas surface
tension has to equal the sum of those due to solid-liquid and
liquid-gas surface tensions. Otherwise, the interface would be
moving. Writing $\theta_e$ for the contact angle, the angle
between the solid and the liquid measured through the liquid (that is
to say, on the liquid side of the interface), and dividing through by
the length of the three-way interface,
$$
\gamma_{GS} = \gamma_{LS} + \gamma_{LG} \cos\theta_e.
$$
This is Young's Equation
(https://en.wikipedia.org/wiki/Wetting#Simplification_to_planar_geometry.2C_Young.27s_relation);
solving for the contact $\theta_e$,
$$
\theta_e = \cos^{-1}\frac{\gamma_{GS} - \gamma_{LS}}{\gamma_{LG}}
$$
This immediately rules out the all-horizontal case, which would
require $\theta_e = 0$, or
$$
\frac{\gamma_{GS} - \gamma_{LS}}{\gamma_{LG}} = \frac{\pi}{2}
$$
which is not the case for water.
It also give us a clue as to how to proceed: the vertical component of
the force due to surface tension very near the three-way interface
between water, air, and tube is $\gamma (2\pi r) \cos \theta_e$; this
force must balance the weight of the water in the tube, which is $r
(\pi r^2) l \rho$ in the notation from the first part of this
answer. At last, we see that surface tension draws the water up to a
height
$$
l = \frac{2\cos\theta_e}{rg \rho}
$$
So: yes, the potential energy increases. Surface effects (surface
tension leading to capillary action) provide the requisite
energy, but the water will eventually stop rising as the weight of the
water in the thread balances the surface tension.
For more information:
There's Wikipedia, of course: look at the articles on surface tension, capillary action, and contact angle. I also used
- Landau, L.D. and E.M. Lifshitz. Fluid Mechanics. 2nd English
edition, revised. Trans. J.B. Sykes and W.H. Reid. Course of
Theoretical Physics Vol. 6. Oxford: Pergamon Press, 1986. \S 61,
pp. 238-244.
Note in particular problems 2 and 3.This book leaves a great deal for
the reader to figure out on his own. I'm coming to believe that that
is usual in the Course of Theoretical Physics.
Much more explicit is
- Kundu, Pijush K. and Ira M. Cohen. Fluid Mechanics. 2nd
edition. San Diego: Academic Press, 2002. pp. 9-12.
from which I drew (with modification) my calculation of the height to
which capillary action draws the water. Note in particular example
1. This appears to be an undergrad engineers' textbook.
For more information on wetting---how liquids interact with solid
surfaces in general---you might try Wikipedia, of course, but also
Though I've only read a little bit and can't vouch for its quality
myself, it appears to be frequently cited, so that's something.
Best Answer
This effect is called capillarity and is not that straightforward.
The contact between water and a solid surface is determined by the chemical bonds. It is macroscopically observed in the contact angle that the water/air surface makes with the solid surface. This angle depends on the strength of the bonds between the solid and the water molecules. You can see this when you pour water in a glass: the water at the edge of the glass is a bit higher than in the center; it makes an angle with the glass surface.
Now, if there is a lot of solid around the water, such as water in a tiny tube, there are a lot of contact points. Therefore, the water/air interface will be strongly curved. The curvature of this interface modifies the surface tension, which represents the energy contained in that surface. A good way to interpret the effect of curvature is that you surround a given portion of the interface by more (or less) water molecules as you curve the interface. The pressure on the interface is thus reduced or increased depending on the curvature.
In a small vertical tube, the curvature can be such that the pressure is higher than for a flat interface. Thus, it can counteract the gravity more easily.
In conclusion, the energy comes from the thermal (pressure) energy of the water molecules which push from the bottom.