Skip to content
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

MultiLevelPoisson solver tolerance not independent of domain size #96

Closed
marinlauber opened this issue Jan 9, 2024 · 1 comment · Fixed by #97
Closed

MultiLevelPoisson solver tolerance not independent of domain size #96

marinlauber opened this issue Jan 9, 2024 · 1 comment · Fixed by #97

Comments

@marinlauber
Copy link
Member

marinlauber commented Jan 9, 2024

I just realized (while looking at pressure forces) that the pressure field oscillates when the domain is large (384,256), see attached script.

I have managed to track the issue to the MultiLevelPoisson/solver! function.
This is linked to the V-cycle criterion that checks if the residual on the upper level (r₂) is below a certain tolerance (tol) before performing the Vcycle

while r₂>tol && nᵖ<itmx
      Vcycle!(ml)
      smooth!(p); r₂ = L₂(p)
      log && push!(res,r₂)
      nᵖ+=1
end

The issue is that (r₂) depends on the grid size through p.r as L₂(p::Poisson) = p.r ⋅ p.r, while tol does not. This means that in some cases, the solver! doesn't perform any V-cycle, which doesn't change the pressure field.

The proposed solution is to scale the tol by the grid size, compute it once and store in in the MultiLevelPoisson structure, see #97
TwoD_circle_pressure_check.zip

@weymouth
Copy link
Collaborator

weymouth commented Jan 9, 2024

Oops! This is what we do in the Fortran code. Not sure how we got away without doing it in WaterLily...

@b-fg b-fg linked a pull request Jan 10, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants