Closed suguanting closed 4 years ago
Hi @suguanting . This issue should not be due to hypre, and maybe you've already resolved it? I see we had another discussion about anchors in #177. I will close this, but let us know if you are still having the issue. Thanks! -Rob
Hi,
I aim to use HYPRE to solve Poisson equations on Cartesian grids, which I hope to function as a component of an in-house incompressible flow solver in the future. As a first step, I simply switched the former 2D Poisson solver to a test solver using HYPRE that was modified from the "ex3.c". Modifications include adjustment in the setting of the Struct Matrix for A and the Struct Vector for b and the implemented boundary conditions according to the set up of the flow problem.
I simulated the 2-D flow around a circular cylinder at Reynolds number of 25, which by definition is steady and is strictly axisymmetric to a certain cylidner axis. Therefore the corresponding Poisson problem is also axisymmetric. However, I noticed that at least at the first several time steps (i.e. the first several times of solving the Poisson equation), HYPRE produced solution with some considerable non-axisymmetry. Relative difference between the two sides could be about 0.1-1% of maximum value in the solution, which greatly exceed the used convergence tolerance (10^-6 as default). I further checked all input variables that were fed to the HYPRE SMG solver, i.e. A and b, using the "*GetBoxValues" functions. All coefficients were calculated as expected and defined a axisymmetric problem. The only non-axisymmetry introduced in A and b would be by the numerical anchor I set at one corner of the flow field for the Poisson problem as all boundary conditions were homogeneous Neumann conditions. I even try deleting the numerical anchor, but the non-axisymmetry of the same order of magnitude was still present and the solver rapidly diverged. Other than the numerical anchor, the same relative difference for other problem defining coefficients was ~10^-14, close to the machine error.
Based on my few experiences dealing with Poisson solvers, I suspect the non-axisymmetry is present because the SMG solver in HYPRE sweep in a same direction along each coordinate for every iteration. This would potentially cause an uneven accumulation of residuals, which in my case cause a considerable non-axisymmetry in the axisymmetrirc flow problem. Since I am incapable of modifying such feature in the HYPRE lib, a plausible solution would be alternating the distribution direction of A and b every iteration...
But before I do that, I just want to ask if this suspicion of mine might actually be correct... And is there a more subtle solution, like a HYPRE_StructSMG* function or some configuration option for this? Also, I am not limiting myself to the SMG solver and I am just starting from the simplest. So you are also welcome to recommend other types of solver that would inherently get rid of this issue.
Thanks in advance,
Guanting