// bga-7.fe

// Simple ball grid array joint.

// Circular, parallel, non-coaxial wetted pads. With gravity.
// Same as bga-3.fe, but with lateral movement of upper pad.

// Both pads represented with constraints.
// Liquid entirely bounded by facets.

evolver_version "2.11c"  // minimum Evolver version needed

// physical constants, in cgs units
parameter S_TENSION = 480    // liquid solder surface tension, erg/cm^2
parameter SOLDER_DENSITY = 9 // grams/cm^3
gravity_constant 980         // cm/sec^2

// configuration parameters
parameter height = 0.12    // height of upper pad, cm
parameter radius = 0.10    // radius of pads, cm
parameter offset = 0.03    // offset in x of upper pad, cm

// lower pad
constraint 1
formula: z = 0

// upper pad
constraint 2
formula: z = height

// rim of lower pad
constraint 3
formula: x^2 + y^2 = radius^2

// rim of upper pad
constraint 4
formula: (x-offset)^2 + y^2 = radius^2

vertices
// lower pad
1  radius*cos(0*pi/3) radius*sin(0*pi/3) 0   constraints 1,3 fixed
2  radius*cos(1*pi/3) radius*sin(1*pi/3) 0   constraints 1,3 fixed
3  radius*cos(2*pi/3) radius*sin(2*pi/3) 0   constraints 1,3 fixed
4  radius*cos(3*pi/3) radius*sin(3*pi/3) 0   constraints 1,3 fixed
5  radius*cos(4*pi/3) radius*sin(4*pi/3) 0   constraints 1,3 fixed
6  radius*cos(5*pi/3) radius*sin(5*pi/3) 0   constraints 1,3 fixed
// upper pad
7  radius*cos(0*pi/3) radius*sin(0*pi/3) height   constraints 2,4 fixed
8  radius*cos(1*pi/3) radius*sin(1*pi/3) height   constraints 2,4 fixed
9  radius*cos(2*pi/3) radius*sin(2*pi/3) height   constraints 2,4 fixed
10 radius*cos(3*pi/3) radius*sin(3*pi/3) height   constraints 2,4 fixed
11 radius*cos(4*pi/3) radius*sin(4*pi/3) height   constraints 2,4 fixed
12 radius*cos(5*pi/3) radius*sin(5*pi/3) height   constraints 2,4 fixed

edges  // defined by endpoints
// lower pad edges
1    1  2  constraints 1,3   fixed
2    2  3  constraints 1,3   fixed
3    3  4  constraints 1,3   fixed
4    4  5  constraints 1,3   fixed
5    5  6  constraints 1,3   fixed
6    6  1  constraints 1,3   fixed
// upper pad edges
7    7  8  constraints 2,4   fixed
8    8  9  constraints 2,4   fixed
9    9  10 constraints 2,4   fixed
10   10 11 constraints 2,4   fixed
11   11 12 constraints 2,4   fixed
12   12 7  constraints 2,4   fixed
// vertical edges
13   1  7
14   2  8
15   3  9
16   4  10
17   5  11
18   6  12

faces // defined by oriented edge loops to have outward normal
// lateral faces
1   1 14  -7 -13 tension S_TENSION
2   2 15  -8 -14 tension S_TENSION
3   3 16  -9 -15 tension S_TENSION
4   4 17 -10 -16 tension S_TENSION
5   5 18 -11 -17 tension S_TENSION
6   6 13 -12 -18 tension S_TENSION
// lower pad
7   -6 -5 -4 -3 -2 -1 fixed no_refine color red tension 0
// upper pad
8   7 8 9 10 11 12 fixed no_refine color green tension 0 constraint 2

bodies // defined by oriented face list
1   1 2 3 4 5 6 7 8   volume 1.3*pi*radius^2*height  density SOLDER_DENSITY

read

hessian_normal


// This has commands to move smoothly and calculate forces.
read "xzforce.cmd"

// Typical evolution
gogo := { u; g 3; r; g 5; r; g 5; hessian; hessian }