MULTIGRID 3D
Hi, i'm using FMG ( Full Multigrid Method ) from Numerical Recipes.
I will adapt this for a 3D stretched Poisson equation but for the moment I'm in trouble with the simple 2D regular Laplace equation: Laplacian[T(x,y)]=0. The problem is about the inhomogeneous boundary condition. In fact, I want to simulate the statiationnary problem of heated wall:[T(x=0,y)]=1 and :[T(x=1,y)]=0. As mentionned in the Num.Rec., I have introuduced the boundary condition in the source term (R.H.S.), but it doesn't work at all [T=0] everywhere. Any Ideas ???? |
Re: MULTIGRID 3D
Which language are you using for this code? I may help you.
|
Re: MULTIGRID 3D
Thanks I'm using Fortran 77 (or 90).
|
Re: MULTIGRID 3D
It is hard to see the code problem, would you send the file to me, I will take a look at it to find bugs.
|
Re: MULTIGRID 3D
parameter (n=65)
real*8 T dimension T(n,n) c c x: c ncycle=2 do 5 j=1,n do 5 i=1,n T(i,j)=0.d0 !=> temporal equilibrium qd t->infini 5 continue c do 7 i=1,n T(i,1)=-1.d0 !=> Boundary condition applied to the lower wall 7 continue ! The wall is heated at T(i,j=1)=1. Take a look at the Numerical Recipes again, and try below, do 7 i=1,n T(i,2)=-1.d0 |
Re: MULTIGRID 3D
Thanks, I've tried it... But there still problems I try to solve.
a) The solution doesn't correspond to boundary I fix: T=1. b) The solution depends on the Grid size !!! |
Re: MULTIGRID 3D
1) After you calculate the solution, you need to add T=1 at the boundary.
2) The problem itself is singular problem, why don't you try it with known solution to test the code. For example, T(x,y)=(x**2-x**4)(y**4-y**2) and set the source term as Laplacian of this T and solve the Poisson equation and compare with numerical solution and exact solution. |
Re: MULTIGRID 3D
Thank you. I've already fixed T=1 at the boundary but it doesn't appears in calculation so...
I have test the code with your exemple and it works well. So it was clearly a problem of singularity. A question arises : I'm trying to implement this Multigrid method to resolve a Pojection Pressure equation ( 2nd step of fractional Step Method in Navier Stokes ). But in wall bounded flow, it seems to discarded the boundary condition. I'm a little bit confused with the implicit 0 boundary condition. Thank you one more time |
Re: MULTIGRID 3D
If you use piecewise linear element in the pressure solver, and it turns out using 9 point finite difference scheme for Poisson solver, the zero boundary condition is obtained by zero Neumann boundary condition for the pressure field. The zero Neumann boundary condition for the pressure field implicitly given by using a test function, which is zero compact support in the boundary points.
|
All times are GMT -4. The time now is 15:20. |