Thread Subject: Replacing SOR with poisson's solver

Subject: Replacing SOR with poisson's solver

From: Farhan Rahman

Date: 27 May, 2009 02:43:01

Message: 1 of 1

Hi everyone,

I'm in the process of trying to optimize a script used to calculate velocity of the laminar flow in a rectangular duct. I've vectorized certain parts of the code, and now it seems that the slowest section of the code is the successive over-relaxation calculation for the pressure correction. So far, this looks like:

        for i2=2:nhx-1
            for j2=2:nhy-1
                residual(i2,j2)= -1/(hx*hx)*(Pc(i2+1,j2)-2.*Pc(i2,j2)...
                                 +Pc(i2-1,j2))-1/(hy*hy)*(Pc(i2,j2+1)...
                                 -2.*Pc(i2,j2)+Pc(i2,j2-1))+1/dt*div(i2,j2);
            
                Pc(i2,j2)= (1/(-2/(hx*hx)-2/(hy*hy))*residual(i2,j2))...
                           *relx_pc+Pc(i2,j2);
            end
        end

I've been informed that it is possible to replace this by a much faster Poisson's solver and have heard of poisolv and poicalc, but am not sure how to implement either of these to replace the SOR method.

Is there a simple way to do this? Any help would be appreciated :)

Cheers

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
poicalc Farhan Rahman 26 May, 2009 22:44:04
sor Farhan Rahman 26 May, 2009 22:44:04
poisolv Farhan Rahman 26 May, 2009 22:44:04
poissons solver Farhan Rahman 26 May, 2009 22:44:03
rssFeed for this Thread

Contact us at files@mathworks.com