-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spherical benchmarks: mismatch between analytical and computed pressure values #199
Comments
Okay, the first thing to do is see if we are converging. If we converge, but the solution is wrong, then something is wrong in the residual definition. If we are not converging, something is wrong in the solver. So please |
stokes.petsc_options["ksp_monitor_true_residual"] = None
stokes.petsc_options["snes_monitor"] = None
stokes.snes.getConvergedReason()
stokes.snes.ksp.getConvergedReason()
Note: @knepley, only the pressure values do not match. The velocity values look fine. |
Okay, the SNES residual is small, so there is a definition problem. Pressure has an arbitrary zero. How are you setting the 0 of pressure, and how does your analytic solution do it? |
This is what paper says: "The analytical velocity solution is prescribed on both internal (r = R1) and external (r = R2) boundaries. Given these boundary conditions, the pressure is determined up to a constant. Both codes allow for a surface normalisation (the average pressure along the surface has a prescribed value - in this case zero), and a volume normalisation (the average pressure over the whole volume has a prescribed zero value). Since I have shown here above that both are identically nul for the pressure field, the choice of pressure normalisation does not matter. Also, the boundary conditions preclude the presence of a pure rotational mode of numerical origin (Zhong et al., 2008)." Currently, I am not setting the 0 of the pressure. I am not sure how to set it. At the moment, Underworld only supports setting boundary conditions on velocity field. In the case of the Annulus, I generated the density field (i.e., from analytical equation) for the Stokes system and applied velocity conditions at the inner and outer radii. This approach resulted in numerical results consistent with the analytical ones, falling within the expected error range. However, when applying the same method to the spherical case, the outcomes appear anomalous. |
@gthyagi, You have a very accurate velocity solution, so the first thing we need to understand is whether there is some null space in the pressure that does not appear in the numerical residual but does cause you problems. The pressure null-space is any pressure field that does not excite a flow. As the benchmark paper points out, the surface average values are both indeterminate and they remove them. This implies subtracting a hydrostatic pressure gradient which is also in the null space (hence the name). The way we set things up, the pressure null space does not cause numerical convergence problems, but you do need to deal with it after the fact in the same way as the analytic solutions do. I am a little bit puzzled by what I am seeing here. |
Oh, my bad: I misunderstood the issue. I thought the velocity solution was well behaved. |
@lmoresi Here is the benchmark script. Please go through it to help diagnose the pressure null space issue. |
Hi @knepley,
I am running spherical benchmarks from the following papers:
I successfully reproduced the benchmark results from the first paper, but I'm encountering difficulties with the second. The numerical pressure values deviate significantly from the analytical ones. The primary difference between the benchmarks in these two papers lies in the initial conditions, specifically the magnitude of the velocity on the outer surface and the magnitude of the density difference.
For both benchmarks, I am using identical solver settings.
Analytical (left) and numerical (right) pressure solution:
Analytical (left) and numerical (right) velocity solution:
Here are the scripts I am using:
Paper 1: Benchmark script
Paper 2: Benchmark script
The text was updated successfully, but these errors were encountered: