WaterLily-jl / WaterLily.jl

Fast and simple fluid simulator in Julia
Other
635 stars 78 forks source link

Simulations of wing-like structures always have detached flow #56

Closed tdunning closed 1 year ago

tdunning commented 1 year ago

In trying to simulate a crude wing in 2-D, I always seem to have flow that detaches from the top of the wing. This happens with low and high reynolds numbers and with low and high viscosities and very low angle of attack.

Could you help me build a simple example that does this correctly?

Here is an example:

image

weymouth commented 1 year ago

This depends sensitively on the foil shape and on the resolution of the flow. I suggest implementing a real foil shape and then reproducing some test cases from previous research papers. Here's one example, but there are lots and lots.

weymouth commented 1 year ago

Here's the preprint of the paper. https://eprints.soton.ac.uk/369635/1/Maertens2014%2520CMAME.pdf

weymouth commented 1 year ago

I added some code a few days ago to https://github.com/weymouth/WaterLily.jl/issues/53#issuecomment-1554818303 which can be immediately used to embed a parametric foil geometry, such as a NACA.

curve(t::T,thk) where T = SA[t^2,T(5thk*(0.2969t-0.126t^2-0.3516t^4+0.2843t^6-0.1036t^8))]
NACA_sdf(thk=0.12) = parametric_sdf(t->curve(t,thk))

function test()
    sdf(x,y) = NACA_sdf()(SA[x,y])
    x = range(-0.5, 2.5, length=100)
    y = range(0, 0.5, length=50)
    z = sdf.(x',y)
    contour(x,y,z,aspect_ratio=:equal, legend=false, border=:none)
    contour!(x,y,z,aspect_ratio=:equal, legend=false, border=:none,levels=[0],color=:green)
    savefig(".\\figures\\distance function.png")
end

Gives this figure: distance function

tdunning commented 1 year ago

This looks very promising

On Mon, May 22, 2023, 03:39 Gabriel Weymouth @.***> wrote:

I added some code a few days ago to #53 (comment) https://github.com/weymouth/WaterLily.jl/issues/53#issuecomment-1554818303 which can be immediately used to embed a parametric foil geometry, such as a NACA.

curve(t::T,thk) where T = SA[t^2,T(5thk*(0.2969t-0.126t^2-0.3516t^4+0.2843t^6-0.1036t^8))]NACA_sdf(thk=0.12) = parametric_sdf(t->curve(t,thk)) function test() sdf(x,y) = NACA_sdf()(SA[x,y]) x = range(-0.5, 2.5, length=100) y = range(0, 0.5, length=50) z = sdf.(x',y) contour(x,y,z,aspect_ratio=:equal, legend=false, border=:none) contour!(x,y,z,aspect_ratio=:equal, legend=false, border=:none,levels=[0],color=:green) savefig(".\figures\distance function.png")end

Gives this figure: [image: distance function] https://user-images.githubusercontent.com/468263/239883535-af035c41-e03e-4c75-9935-e05595b56c3d.png

— Reply to this email directly, view it on GitHub https://github.com/weymouth/WaterLily.jl/issues/56#issuecomment-1556983042, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5E6WJ5PKU5NBFLKLJX5DXHM67FANCNFSM6AAAAAAX75UVH4 . You are receiving this because you authored the thread.Message ID: @.***>

weymouth commented 1 year ago

Note that 2D simulations at low Re should give separated flow. image image

High Re flow is always 3D, if you don't run a 3D simulation at high Re, you will get something like this image

Attached, but weird.

Gabriel D Weymouth