GfsInitVorticity
From Gerris
GfsInitVorticity uses the given vorticity distribution to compute a two-dimensional stream-function and the corresponding velocity field. Due to limitations in the type of boundary conditions for the stream-function–vorticity equation, the vorticity field given as argument must vanish before reaching the boundaries of the domain.
The syntax in parameter files is:
[ GfsGenericInit ] [ GfsFunction ]
Examples
- Coalescence of a pair of Gaussian vortices (Gerris logo)
- Convergence for the three-way vortex merging problem
InitVorticity {} {
/* We use nested functions for simplicity (this will not work on MACOSX) */
double vortex (double xc, double yc, double r) {
double r2 = (x - xc)*(x - xc) + (y - yc)*(y - yc);
return 2.*M_PI*exp (- 2.*r2/(r*r));
}
double r = 0.01, theta = 30.*M_PI/180.;
return vortex (-r*sin(theta), r*cos(theta), 0.01) +
vortex (r*sin(theta), -r*cos(theta), 0.01);
}
InitVorticity {} {
double vortex (double xo, double yo, double s) {
double r = sqrt ((x - xo)*(x - xo) + (y - yo)*(y - yo));
return s*(1. + tanh (100.*(0.03 - r)))/2.;
}
return vortex (0., 0., -150.) +
vortex (0.09, 0., 50.) +
vortex (-0.045, 0.0779422863406, 50.) +
vortex (-0.045, -0.0779422863406, 50.);
}

