Boundary conditions in cylindrical coordinates.
Demidov
11-10-2004, 10:06 AM
Hello Everybody!
I've got a question about the implementation of the boundary conditions for the multi-dimensional equations in cylindrical coordinates.
Can you explain which boundary condition should we use for the point where r=0?
For example, we know that in F(r, fi) = 0 while r = R (at the boundary).
But what should we write at another boundary of the grid: where r = 0 ?
Should we state that R(0, fi) = R(0, fi+dfi) (i.e. R is equal for all the fi at the point r=0)?
The question is for all who have ever used five-point Laplas approximation in cylindrical coordinates.
hernlund
11-18-2004, 01:27 PM
Yes, as r=0 is an actual point, it can only have a single value. As the coordinate lines phi=constant (phi is the angular coordinate) converge toward r=0, the derivative of the dependent variable u (say) with respect to phi must become zero, so that u(r=0,phi)=constant. If you are solving a simple equation with finite differences, you might simply take this value to be the average of all the surrounding points at r+dr over phi. But this doesn't always work. Another option is to discretize at half-steps, e.g. 0.5dr, 1.5dr, 2.5dr, etc, and have a ghost point at -0.5dr for each phi to enforce the boundary conditions. Then the boundary condition is simpler to obtain: the average of u(-0.5dr,phi) and u(0.5dr) is equal to u(r=0) (which is second order), and if this is a flux conservative problem then also the radial derivative vanishes, i.e. u(-0.5dr)=u(0.5dr) since you can't have flux through a surface that has no finite area.
Also note that terms like 1/r becomes large near r=0, and it is convenient to multiply the governing equations through by factors of r until all such terms are gone.
It is also a good idea to coarsen the discretization in phi as one nears r=0...but this is a bit more complicated.
Demidov
11-19-2004, 07:21 AM
hernlund , thank you very much for answer!
At the moment I'm trying to use slightly different scheme. What do you think of it?
I just state that near the poinr r=0 F(r,phi) is always equal F(r,phi + pi).
Actually this way is almost the same as your variant when you suggest to use ghost F(-.5dr, phi) point. Here I act the same way: my first node og the mesh is very close to zero, second node is r(first point) + dr of course, and my minus first node (I need it to write second derivative with respect to r) is -dr, so it is equal to the second node but for phi = phi+pi.
Of course first step from zero should be much smaller than regular step.
And another way of realization of your technique is to distribute the first node of the mesh at r=0+dr and then F(r-1,phi) which we again need for the second derivative is placed directly on r = 0 point. We dont need to calciulate it, but we state that it is equal to the average value of all phi-points of the first mesh node.
So, these are the two ways I'm going to try.
As for my equation it is (at the moment) quite simple: just Helmholz equation in cylindrical coordinates.
hernlund
11-19-2004, 03:40 PM
What you describe seems similar. You're right that there is a close correspondence in either case. As a rule, I usually use cell-centered discretizations when the coordinates contain a singularity, which avoids a lot of the problems associated with them.