CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   Diffusion Using Gauss-seidel Method (https://www.cfd-online.com/Forums/main/143853-diffusion-using-gauss-seidel-method.html)

J.Y.Won November 4, 2014 07:21

Diffusion Using Gauss-seidel Method
 
2 Attachment(s)
Hello all,
I'm making a C++ code solving diffusion equation gauss-seidel method.
It's just 2D problem and domain has length of 1 in x, y direction.

Solving this problem, I found something strange.

As my cell numbers gets larger(16x16, 32x32, 64x64 ... 1024x1024), the error between exact solution and my code goes down and up again.
I mean, error gets smaller until 128x128 and after that, error gets bigger...

So, until now I tried to find something wrong in my code.
And when I just translate my C++ code into matlab code, Error gets smaller without increasing again.....

I can't understand why this happen... can someone help me?
I attached my C++ code and matlab script.
:o
Thanks,:)

J.Y.Won November 5, 2014 00:59

problem solved...
It was because of the tolerance..:p


All times are GMT -4. The time now is 13:36.