Here is some Mathematica code to numerically solve this using the 4th order Runge-Kutta method:

`(* runtime: 21 seconds, increase n for better resolution *)`

n = 23; tmax = 0.85; dt = tmax/100; rcore = 0.1; Klist = {1, -1, 1, -1}; zlist = {-1 - 0.5I, -1 + 0.5I, -0.5 - 0.5I, -0.5 + 0.5I}; m = Length[zlist];

v[K_, z_, z0_] := Module[{r2 = Abs[z - z0]^2}, I K(z0 - z)/r2(1 - Exp[-r2/rcore^2])];

Runge[z_] := Module[{}, k1 = dt vtot[z]; k2 = dt vtot[z + k1/2]; k3 = dt vtot[z + k2/2]; k4 = dt vtot[z + k3]; (k1 + 2 k2 + 2 k3 + k4)/6];

vtot[zlist_] := Table[Sum[If[i == j, 0, v[Klist[[j]], zlist[[i]], zlist[[j]]]], {j, 1, m}], {i, 1, m}]; zlists = Transpose[Table[zlist += Runge[zlist], {t, 0, tmax, dt}]];

vtot[z_] := Plus @@ v[Klist, z, zlists[[All, t]]]; image = Table[z = x + I y; Do[z -= Runge[z], {t, 100, 1, -1}]; z, {y, -1.125, 1.125, 2.25/n}, {x, -0.35, 1.9, 2.25/n}];

ListDensityPlot[Map[Sign[Im[#]]Arg[#] &, image, {2}], Mesh -> False, Frame -> False, AspectRatio -> Automatic]

Links

- My Educational Project – some basic potential flows using Matlab and Mathematica
- Vortex Movies – by Tee Tai Lim, I especially like the movies of leap-frogging and vortex ring collisions
- Bubble Ring Videos – blown by human, whale, dolphins. This is fun… try it some time!
- Leap-Frogging Bubble Rings – blown by scuba diver
- Bubble Rings – by David Whiteis
- Vortex rings blown out by Mt. Etna – same as a smoker puffing out an “O” ring
- Nuclear Bombs – mushroom clouds are giant vortex rings
- Birth of the Jellyfish – nice animation by Kerry Mitchell
- Smoke Ring – giant vortex ring at the Miramar Air Show
- Zero Blaster – fun toys that create fog vortex rings
- Ideal Flow Machine – Java applet by William Devenport
- Inviscid Flows – paper on incompressible, irrotational flows by Paul Hammerton

beautiful!

two questions: when I run the code in Mathematica it shows me a blurry image in blue tones. Did you apply post-processing to your images?

Can you point me to the steps for get the animatin on the side?

Thank you

The code that I have provided here produces a blocky grayscale image in Mathematica 4.2. Higher versions of Mathematica will produce a blurry image in blue tones. Using higher values of n will increase the resolution of the image. Using Mathematica for this is not very efficient. That is why my final animation was created in C++.

how about this?

http://2.bp.blogspot.com/_xHtRiPnJyTE/SRvehLbAewI/AAAAAAAAACE/XPsdUk8j578/s1600-h/New+Picture+(2).bmp

I’m developing from zero. this is a flow over body at Re550 using vortex method.

*I’m sorry, I’m writing my blog in Indonesian

One thing you could do to speed up the rendering is that you render only one (vertical) half of the image and then you copy, vertical flip and arrange it so the two parts form the whole image.

That is how I rendered the larger images, but the Mathematica code I gave was made to be as simple as possible, so that it would be easier for other people to understand. It is far from efficient. I recommend avoiding Mathematica entirely for large images.