-
Notifications
You must be signed in to change notification settings - Fork 78
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
Test and benchmark pressure solver #159
base: master
Are you sure you want to change the base?
Conversation
circle!(pois); WaterLily.update!(pois) # update the Poisson solver | ||
MG ? solver!(pois;tol=100eps(T),itmx=32) : solver!(pois;tol=100eps(T),itmx=1e3) | ||
#@info "Iters $(pois.n), r⋅r=$(WaterLily.L₂(pois))" | ||
psolver!=GeomMultigridPoisson && @test WaterLily.L₂(pois) ≤ 100eps(T) # have we converged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is annoying; I cannot get it to work on this problem, probably because the tolerance is defined differently internally.
Benchmark case: # the classic...
function TGV(; pow=6, Re=1000, T=Float64, mem=Array)
# Taylor-Green-Vortex initial velocity field
function u_TGV(i,x,t,ν,κ)
i==1 && return sin(κ*x[1])*cos(κ*x[2])*exp(-2κ^2*ν*t) # u_x
return -cos(κ*x[1])*sin(κ*x[2])*exp(-2κ^2*ν*t) # u_y
end
# Define vortex size, velocity, viscosity
L = 2^pow; U = 1; ν = U*L/Re
# make the function
uλ(i,xy) = u_TGV(i,xy,0,ν,2π/L)
# Initialize simulation
return Simulation((L,L),(0,0),L;U,uλ,ν,T,mem,psolver=GeomMultigridPoisson)
end
WaterLily.solver!(p) = WaterLily.solver!(p;tol=1e-9,itmx=32) # strict convergence Benchmark results:
I am not sure why these are the same, some feel slower when I run them... |
That's odd. Side question, does Hyper work on GPU? |
We decided this should be a different repository, and so will not be merged here, correct? |
Yes correct, I will move this and close this PR. |
This pull request starts an effort to better benchmark and test the pressure solver in WaterLily.
The idea is to have a test that is strict enough to ensure that the pressure solver tolerances and implementation are efficient. For now, all the tests pass with
master
for bothFloat32
andFloat64
.I also implemented a wrapper to the
HYPRE.jl
solver suite that uses the highly optimised hypre library in the background. I think this will be useful to benchmark against (for now, we are slover with both the:Poisson
and:MultiLevelPoisson
). The caveat of the Hypre wrapper is that it only works for flows without immersed geometries and without periodic BCs. I am working on fixing the latter, but the first one requires a bit more thought and coding.I think also linking the pressure logging #135 will help here.
Things to do:
WaterLilyHYPREExt.jl
for periodic BCs (merely constructing the sparse matrix correctly)GeometricMultigrid.jl