# Example: Mound with gravity.

This example is a mound of liquid sitting on a tabletop with gravity acting on it. The contact angle between the drop surface and the tabletop is adjustable, to simulate the different degrees to which the liquid wets the table. This example illustrates macros, variables, constraints with energy, and omitting faces from body surfaces.

The drop starts as a cube with one face (face 6 of the cube example) on the tabletop (the z = 0 plane). The most straightforward way to specify a contact angle is to declare face 6 to be constrained to stay on the tabletop and give it a surface tension different than the default of 1. But this leads to problems described below. The way the contact angle is handled instead is to omit face 6 and give the edges around face 6 an energy integrand that results in the same energy we would get if we did include face 6. If we let the interface energy density for face 6 be T, then we want a vectorfield w such that

```
/             /
|  T k . dS = | w . dl
/ face 6      / bdry of face 6

```
So by Green's Theorem, all we need is curl w = Tk, and I will use w = -Tyi. Here i j k are the standard unit basis vectors.

I have chosen to parameterize the contact angle as the angle in degrees between the table and the surface on the interior of the drop. This angle can be adjusted with the A command at run time. I could have made T the parameter directly, but then I wouldn't have had an excuse to show a macro.

Here is the datafile mound.fe:

```// mound.fe
// Evolver data for drop of prescribed volume sitting on plane with gravity.
// Contact angle with plane can be varied.

PARAMETER angle = 90    // interior angle between plane and surface, degrees

#define WALLT  (-cos(angle*pi/180))  // virtual tension of facet on plane

constraint 1   /* the table top */
formula: x3 = 0
energy:  // for contact angle
e1: -(WALLT*y)
e2: 0
e3: 0

vertices
1   0.0  0.0 0.0  constraint 1  /* 4 vertices on plane */
2   1.0  0.0 0.0  constraint 1
3   1.0  1.0 0.0  constraint 1
4   0.0  1.0 0.0  constraint 1
5   0.0  0.0 1.0
6   1.0  0.0 1.0
7   1.0  1.0 1.0
8   0.0  1.0 1.0
9   2.0  2.0 0.0  fixed   /* for table top */
10  2.0 -1.0 0.0  fixed
11 -1.0 -1.0 0.0  fixed
12 -1.0  2.0 0.0  fixed

edges  /* given by endpoints and attribute */
1   1 2    constraint 1 /* 4 edges on plane */
2   2 3    constraint 1
3   3 4    constraint 1
4   4 1    constraint 1
5   5 6
6   6 7
7   7 8
8   8 5
9   1 5
10  2 6
11  3 7
12  4 8
13  9 10   fixed  /* for table top */
14 10 11   fixed
15 11 12   fixed
16 12  9   fixed

faces  /* given by oriented edge loop */
1   1 10 -5  -9
2   2 11 -6 -10
3   3 12 -7 -11
4   4  9 -8 -12
5   5  6  7   8
7  13 14 15  16  density 0 fixed /* table top for display */

bodies  /* one body, defined by its oriented faces */
1   1 2 3 4 5   volume 1  density 1