CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Large pressure gradients from 3D pressure poisson equation

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   August 1, 2017, 14:50
Default Large pressure gradients from 3D pressure poisson equation
  #1
Senior Member
 
Selig
Join Date: Jul 2016
Posts: 213
Rep Power: 10
selig5576 is on a distinguished road
I have recently starting making my numerical solver 3D from 2D and I have ran into a problem when solving my PPE. For my 2D code, I have a convergent solution and pressure field never exceeds values of 1.2. For my 3D solver after 1 iteration I get pressure values of 12000.

I am almost certain it has to do with my pressure solver as my velocity components are not reaching values even near those of the pressure. The method in which I am solving the PPE is SOR. My relaxation factor I am using is 1.93 and my tolerance is 1e-6. Also my max iterations is 30,000.

Code:
for (int j=2; j < ny-2; j++)
        {
            for (int k=2; k < nz-2; k++)
            {
                R[ID(1,j,k)] = (rho/dt)*(idx*(ufs[ID(1,j,k)] - u[ID(0,j,k)]) + idy*(vfs[ID(1,j,k)] - vfs[ID(1,j-1,k)]) + idz*(wfs[ID(1,j,k)] - wfs[ID(1,j,k-1)]));
                P[ID(1,j,k)] = (1.0-omega)*P[ID(1,j,k)] + Aw*(idx2*P[ID(2,j,k)] + idy2*(P[ID(1,j+1,k)] + P[ID(1,j-1,k)]) + idz2*(P[ID(1,j,k+1)] + P[ID(1,j,k-1)]) - R[ID(1,j,k)]);

                R[ID(nx-2,j,k)] = (rho/dt)*(idx*(u[ID(nx-1,j,k)] - ufs[ID(nx-3,j,k)]) + idy*(vfs[ID(nx-2,j,k)] - vfs[ID(nx-2,j-1,k)]) + idz*(wfs[ID(nx-2,j,k)] - wfs[ID(nx-2,j,k-1)]));
                P[ID(nx-2,j,k)] = (1.0-omega)*P[ID(nx-2,j,k)] + Ae*(idx2*P[ID(nx-3,j,k)] + idy2*(P[ID(nx-2,j+1,k)] + P[ID(nx-2,j,j-1)]) + idz2*(P[ID(nx-2,j,k+1)] + P[ID(nx-2,j,k-1)]) - R[ID(nx-2,j,k)]);
            }
        }

        for (int i=2; i < nx-2; i++)
        {
            for (int k=2; k < nz-2; k++)
            {
                R[ID(i,1,k)] = (rho/dt)*(idx*(ufs[ID(i,1,k)] - ufs[ID(i-1,1,k)]) + idy*(vfs[ID(i,1,k)] - v[ID(i,0,k)]) + idz*(wfs[ID(i,1,k)] - wfs[ID(i,1,k-1)]));
                P[ID(i,1,k)] = (1.0-omega)*P[ID(i,1,k)] + An*(idx2*(P[ID(i+1,1,k)] + P[ID(i-1,1,k)]) + idy2*P[ID(i,2,k)] + idz2*(P[ID(i,1,k+1)] + P[ID(i,1,k-1)]) - R[ID(i,1,k)]);

                R[ID(i,ny-2,k)] = (rho/dt)*(idx*(ufs[ID(i,ny-2,k)] - ufs[ID(i-1,ny-2,k)]) + idy*(v[ID(i,ny-1,k)] - vfs[ID(i,ny-3,k)]) + idz*(wfs[ID(i,ny-2,k)] - wfs[ID(i,ny-2,k-1)]));
                P[ID(i,ny-2,k)] = (1.0-omega)*P[ID(i,ny-2,k)] + As*(idx2*(P[ID(i+1,ny-2,k)] + P[ID(i-1,ny-2,k)]) + idy2*P[ID(i,ny-3,k)] + idz2*(P[ID(i,ny-2,k+1)] + P[ID(i,ny-2,k-1)]) - R[ID(i,ny-2,k)]);
            }
        }

        for (int i=2; i < nx-2; i++)
        {
            for (int j=2; j < ny-2; j++)
            {
                R[ID(i,j,1)] = (rho/dt)*(idx*(ufs[ID(i,j,1)] - ufs[ID(i-1,j,1)]) + idy*(vfs[ID(i,j,1)] - vfs[ID(i,j-1,1)]) + idz*(wfs[ID(i,j,1)] - w[ID(i,j,0)]));
                P[ID(i,j,1)] = (1.0-omega)*P[ID(i,j,1)] + Ab*(idx2*(P[ID(i+1,j,1)] + P[ID(i-1,j,1)]) + idy2*(P[ID(i,j+1,1)] + P[ID(i,j-1,1)]) + idz2*P[ID(i,j,2)] - R[ID(i,j,1)]);

                R[ID(i,j,nz-2)] = (rho/dt)*(idx*(ufs[ID(i,j,nz-2)] - ufs[ID(i-1,j,nz-2)]) + idy*(vfs[ID(i,j,nz-2)] - vfs[ID(i,j-1,nz-2)]) + idz*(w[ID(i,j,nz-1)] - wfs[ID(i,j,nz-3)]));
                P[ID(i,j,nz-2)] = (1.0-omega)*P[ID(i,j,nz-2)] + At*(idx2*(P[ID(i+1,j,nz-2)] + P[ID(i-1,j,nz-2)]) + idy2*(P[ID(i,j+1,nz-2)] + P[ID(i,j-1,nz-2)]) + idz2*P[ID(i,j,nz-3)] - R[ID(i,j,nz-2)]);
            }
        }
selig5576 is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of the Governing Equations Mihail CFX 7 September 7, 2014 06:27
Problems with pressure equation in SIMPLER algorithm Corby Main CFD Forum 0 June 17, 2013 09:24
The correction on pressure equation of SIMPLE algorithm in MRFSimpleFOAM solver renyun0511 OpenFOAM Running, Solving & CFD 0 November 10, 2010 01:47
Neumann pressure BC and velocity field Antech Main CFD Forum 0 April 25, 2006 02:15
FEM pressure poisson equation (Implicit) cfd-beginner Main CFD Forum 0 August 9, 2005 13:32


All times are GMT -4. The time now is 21:48.