CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Problem with SOR (https://www.cfd-online.com/Forums/main/9988-problem-sor.html)

Davoche October 1, 2005 04:26

Problem with SOR
 
hi everybody, I have a big problem with a SOR method applied to an elliptic equation.

In regular mesh, it works very well ( convergence and results ok ) , but as soon as I use an irregular mesh ( even if it is very smooth ), my convergence rate stops at a value and stay constant.

Is it a normal behaviour for a finite difference scheme ? I precise that I use periodic Boundary conditions in 2 directions and Neumann in another ( So I'm 3D )

Thanks

agg October 1, 2005 22:35

Re: Problem with SOR
 
It is possible that convergence rate drops. There are solutions however to that for example, preconditioning. There are several fast packages available for elliptic equations like FISHPACK and MUDPACK, if you do not have to stick to SOR methods

Davoche October 2, 2005 04:33

Re: Problem with SOR
 
Thanks but I want to use this SOR as the core of my Multigrid.

If it doesn't work ( not converge precisely )only with Sor, it shouldn't with Multigrid, isn't it ?

The result of SOR for irregular mesh is not wrong, but not enough accurate.I need a precision of 1.E-13 ( divergence free ) an I obtain only 10E-2

Davoche October 3, 2005 11:23

Re: Problem with SOR
 
Hi,

With Dirichlet Boundary Conditions, all is Ok ( on regular and irregular mesh ). But for Neumann, the result is not accurate especially where the mesh is the finest. ( I precise it is the same mesh than for Dirichlet test ).

So, I don't understand why the result is such affected with Neumann BC ?

agg October 3, 2005 12:01

Re: Problem with SOR
 
How did you implement Neumann BC in your code? Do you use a central differencing method or something else?

Davoche October 3, 2005 12:50

Re: Problem with SOR
 
Hi Agg, My Neumann is implemented with second order difference scheme with quantities at the cell center, for exemple in 1D regular mesh:

On boundary, T_{i=wall-1/2}=T_{i=wall+1/2} ( with T_{i=wall-1/2} is a ghost symetrical node ), with this I have a zero gradient on the wall.

In SOR : I replace it directly so

Sourceterm_{i=wall+1/2}=1/(dx^2).(T_{i=wall+3/2}-2.T_{i=wall+1/2}+T_{i=wall-1/2}) becomes

Sourceterm_{i=wall+1/2}=1/(dx^2).(T_{i=wall+3/2}-T_{i=wall+1/2}) only for the point near the boundary.


agg October 3, 2005 15:02

Re: Problem with SOR
 
Your implementation seems to be correct. So, here is another theory.

1) When you use a Neumann bc (at all boundaries), infinite solutions exist for the dependent variable. For example, a solution T1=10; T2=10; T3=10 will satisfy dt/dx=0 at node 2. Similarly T1=11; T2=11; T3=11 will also satisfy your bc. It is possoble that your SOR solver keeps bouncing between these infinite solutions.

However, when you have a dirichlet bc, the solution has to relax to the prescribed value at the boundary (say T=0) and the SOR solver behaves nicely, since only ONE solution will satisfy the bc.

What you can try is: Try a combination of Neumann and dirichlet bc and see how your solution behaves. If it behaves nicely, just like when you have dirichlet bc's at all boundaries, then the problem that i illustrated above might be the one holding up your SOR solver.

Just a theory! and i hope i haven't caused any confusion.

Davoche October 4, 2005 04:18

Re: Problem with SOR
 
Thanks for your suggestion Agg,

I've try it and it converge very very slowly now ( but the result is still the same ).

In fact, as my code works well in regular mesh ( even for different size of channel ) , I don't think it is due to a problem of bouncing between solutions.

It is clearly due to the staggered mesh... In fact, as soon as I use a staggered mesh, I see that the solution of my elliptic equation is the most diverging from the theoritical result at the location of the finest mesh of my grid ( I precise I am in Double precision ) .

But I don't know why...

agg October 4, 2005 11:33

Re: Problem with SOR
 
ok. Do you use under/over relaxation? Maybe you should play around with those parameters and see if that helps.

Davoche October 4, 2005 12:59

Re: Problem with SOR
 
Thank one more time, but I have already checked it.


All times are GMT -4. The time now is 11:59.