<span class="Apple-style-span" style>Are you using the exact same matrix at each time-step or does the matrix change?</span><div><font class="Apple-style-span" color="#222222" face="arial, sans-serif"><br></font></div><div>
<font class="Apple-style-span" color="#222222" face="arial, sans-serif">Pressure lsys does not change over time. However, the diagonal of the velocity lsys's do change due to the variable time step. </font></div><div>
<font class="Apple-style-span" color="#222222" face="arial, sans-serif"><br></font></div><div><font class="Apple-style-span" color="#222222" face="arial, sans-serif">Best, </font></div><div><font class="Apple-style-span" color="#222222" face="arial, sans-serif">M</font></div>
<div><br><div class="gmail_quote">On Sun, Jan 8, 2012 at 10:11 PM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im"><br>
On Jan 8, 2012, at 9:33 PM, Mohamad M. Nasr-Azadani wrote:<br>
<br>
> How do you know it is diverging? Because it looks weird? You are comparing it to something?<br>
><br>
> While marching in time, it only takes 20-30 iterations to solve for pressure.<br>
> After a very long integrattion in time, all of a sudden the pressure lsys does not converge even in 10,000 iterations. So, that's why I am saying it is converging.<br>
<br>
</div> Are you using the exact same matrix at each time-step or does the matrix change?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> How accurately are you solving the linear system?<br>
> I tried rtol = 1e-10 and 1e-12.<br>
><br>
> What strange behavior? Is the right hand side for the pressure solution reasonable but the solution "strange"? How do you know you are not giving "bad stuff" to the pressure solve?<br>
> For my case, I get huge pressure gradients close to the solid boundaries. That, indeed, causes very small delta_t's when I keep integrating. That should not happen cause at this stage of my simulations, nothing is really happening in the flow field. Very small velocities and velocity gradients.<br>
> I am trying to find the problem, since I have only seen this for such big problem size, i.e. 100 million grid points. That makes it really hard to see if the I am feeding back rhs into the pressure linear system.<br>
><br>
> Best,<br>
> Mohamad<br>
><br>
><br>
><br>
><br>
><br>
><br>
> On Sun, Jan 8, 2012 at 6:47 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
><br>
> On Jan 8, 2012, at 5:13 PM, Mohamad M. Nasr-Azadani wrote:<br>
><br>
> > Thanks Barry and Matt,<br>
> ><br>
> > Barry,<br>
> > Also if you are really solving the Poisson problem you should use multigrid; if simple geometry then geometric multigrid if complicated geometry probably easier to use hypre BoomerAMG. No sane person solves Poisson problem with anything but a multigrid or FFT based solver.<br>
> ><br>
> > In my main code, I am actually doing what you suggested, i.e. GMRES + boomerAMG to solve for my Poisson equation. I have not used the KSPSetNullSpace() though.<br>
> > The problem is that my code (CFD, incompressible flow 3D) diverges after a long time integration<br>
><br>
> How do you know it is diverging? Because it looks weird? You are comparing it to something?<br>
><br>
><br>
> How accurately are you solving the linear system?<br>
><br>
><br>
> > and I am trying to find out why.<br>
> > The system that I have is a fairly big one, i.e. 100 million grid points and more.<br>
> > I see that pressure solution (which is obviously coupled to the velocity field) starts showing strange behavior.<br>
><br>
> What strange behavior? Is the right hand side for the pressure solution reasonable but the solution "strange"? How do you know you are not giving "bad stuff" to the pressure solve?<br>
><br>
> Barry<br>
><br>
><br>
> > That's why I tried to first double check my pressure solver.<br>
> ><br>
> > Based on your experience, do you think that not using a nullspace() for the pressure solver for that linear system size could have caused it to diverge?<br>
> ><br>
> ><br>
> > Matt,<br>
> > 1) Matlab could be doing a lot of things. I am betting that they scale the problem, so -pc_type jacobi.<br>
> ><br>
> > That could be right. The reason that I relied on the MATLAB's gmres solver to behave exactly similar to PETSc was just their "help" saying that<br>
> > ************<br>
> > X = GMRES(A,B,RESTART,TOL,MAXIT,M1,M2) use preconditioner M or M=M1*M2<br>
> > and effectively solve the system inv(M)*A*X = inv(M)*B for X. If M is<br>
> > [] then a preconditioner is not applied.<br>
> > ************<br>
> ><br>
> > Best,<br>
> > Mohamad<br>
> ><br>
> > On Sat, Jan 7, 2012 at 5:39 PM, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br>
> ><br>
> > On Jan 7, 2012, at 4:00 PM, Mohamad M. Nasr-Azadani wrote:<br>
> ><br>
> > > Hi guys,<br>
> > ><br>
> > > I am trying to narrow down an issue with my Poisson solver.<br>
> > > I have the following problem setup<br>
> > ><br>
> > > Laplace(f) = rhs(x,z,y)<br>
> > > 0 <= x,y,z <= (Lx,Ly,Lz)<br>
> > ><br>
> > > I solve the Poisson equation in three dimensions with the analytical function f(x,y,z) defined by<br>
> > ><br>
> > > f(x,z,y) = cos(2*pi*x/Lx)*cos(2*pi*y/Ly)*cos(2*pi*z/Lz) + K<br>
> > > where Lx = Ly =Lz = 1.0 and K is a constant I use to set f(Lx,Ly,Lz) = 0.0.<br>
> > ><br>
> > > Second order descritization is used for the Poisson equation.<br>
> > > Also, Neumann boundary condition is used everywhere, but I set the top-right-front node's value to zero to get rid of the Nullspaced matrix manually.<br>
> ><br>
> > Please don't do this. That results in a unnecessaryly huge condition number. Use KSPSetNullSpace.()<br>
> ><br>
> > Also if you are really solving the Poisson problem you should use multigrid; if simple geometry then geometric multigrid if complicated geometry probably easier to use hypre BoomerAMG. No sane person solves Poisson problem with anything but a multigrid or FFT based solver.<br>
> ><br>
> > Barry<br>
> ><br>
> > > I use 20 grid points in each direction.<br>
> > ><br>
> > > The problem is:<br>
> > > I use GMRES(20) without any preconditioners (rtol = 1e-12) to solve the linear system.<br>
> > > It takes 77,000 iterations to converge!!!!<br>
> > ><br>
> > > For the size of only 8,000 unknowns, even though the lsys is not preconditioned, I guess that is a LOT of iterations.<br>
> > > Next, I setup the exact same problem in MATLAB and use their GMRES solver function.<br>
> > > I set the same parameters and MATLAB tells me that it converges using only 3870 iterations.<br>
> > ><br>
> > > I know that there might be some internal differences between MATLAB and PETSc's implementations of this method, but given the fact that these two solvers are not preconditioned, I am wondering about this big difference?<br>
> > ><br>
> > > Any ideas?<br>
> > ><br>
> > > Best,<br>
> > > Mohamad<br>
> > ><br>
> ><br>
> ><br>
><br>
><br>
<br>
</div></div></blockquote></div><br></div>