(1) 
Using a general function , we may calculate the divergence in this case, which of course in a DF method must be imposed to be 0.
(2) 
where
(3) 
The final function is: . This is basically a cubic function that, when used, simplifies with the denominator in equation (1), leaving the ith velocity component independent from the ith axis (u independent of x, v independent of y and w independent of z).
Further investigation showed that the system (3) is not the only solution of our problem. In fact basically in equation (2) may be grouped in a different way and lead us to a different system of solving equations. Anyway, in the Matlab provided at the bottom of the page, I tried (using a symbolic calculator) to manage a general function, and for each function depending only on the distance leads us to a divergence free velocity field [see matlab script].

After all these considerations I wanted to check everything in the DFSEM. I calculate then the divergence in any simulations and I plotted the results in fig. 2.I calculate the derivative with a central difference 2nd order scheme. This picture shows that the method is divergence free everywhere but near the eddy edge.

After all these considerations I wanted to check everything in the DFSEM. I calculate then the divergence in any simulations and I plotted the results in fig. 2.
(4) 
(5) 
I  Attachment  Action  Size  Date  Who  Comment 

m  symcal2cart.m  manage  1.2 K  20100407  12:42  RuggeroPoletto 