Ben, First make sure that the residual has actually gotten to the tolerance you want. PETSc KSP does NOT stop if the linear system has not converged; you should call KSPGetConvergedReason() after each solve to make sure it has converged (as a quick check you can run with -ksp_converged_reason.)
Next try decreasing the KSP tolerance factor a great deal. Does 1) the solution you get for your physics problem look the same for small time (after a few time-steps they will start to drift). 2) the residual blow up at the same time, or later? Barry On Thu, 7 Dec 2006, Ben Tay wrote: > Hi, > > I have been using a few different Krylov linear solver package such as > nspcg,sparsekit and now petsc to solve the linear eqns for my NS solver > momentum and poisson eqn. For moving bodies simulation, while solving the > poisson eqn, sometimes the result suddenly changes drastically, although the > iterations seems to have converged e.g. at the previous time step, > everything is fine, but at the next time step, the velocity suddenly > explodes from 2-3 to 20-30+. > > The strange thing is that this deviation happens at different time step for > different linear solver package ie for nspcg, it happens at time=20 but for > petsc, it happens at time=40. It seems "random" in this sense. Changing the > type of solver such as gmres or bcgs does not change the time of deviation. > > Does anyone know why this is happening? Is it a characteristic of krylov > solver to happen once in a while? It does not happen in the stationary body > simulation though. >
