Commit a8fc113e authored by s.zitz's avatar s.zitz
Browse files

should simulate a sliding droplet

parent b637955f
Pipeline #22060 passed with stages
in 7 minutes and 38 seconds
Script to check if I can make a single droplet slide.
Hopefully everything works in well defined way.
What I want to see is that the droplet, deformes and then starts sliding.
using DrWatson
@quickactivate :JuThinFilm
using JuThinFilm, Plots
GR.inline("png") # Otherwise the animation will break...
palette(:tab10) # Hopefully the matplotlib colorscheme
# Some parameters to define the simulation
lx = 100
ly = 100
maxtime = 10000
θ₀ = 1/3
θₑ = 1/6
δ₀ = 4.0
h₀ = 25
T = Float64
center = (Int(lx/2), Int(ly/2))
mom = singledroplet(T, lx, ly, h₀, θ₀, center)
# Some parameter defining at the start
parameters = params{T}(lx=lx, ly=ly, mt=maxtime)
collisionparameters = collisionparams{T}(δ=δ₀, τ=1.0)
pressureparameters = pressurestats{T}(θ=θₑ)
dists = distributions{T}(para=parameters)
lat = lattice{T}()
Fpressure = default_force(T, lx, ly)
Fsum = default_force(T, lx, ly)
Fslip = default_force(T, lx, ly)
Fbody = default_force(T, lx, ly)
maxu = []
maxv = []
# Get the first equilibrium here
equilibrium!(dists, mom, lat, parameters, T)
# Now move to the time loop
anim = @animate for t in
if t%500 == 0
println("time step $t")
push!(maxu, maximum(mom.velocity.x))
push!(maxv, maximum(mom.velocity.y))
l = @layout [a b; c{0.2h}; d{0.2h}]
p1 = surface(mom.height, c=:viridis)
p2 = contourf!(mom.height, aspect_ratio=1, c=:viridis)
p3 = plot(maxu, xlabel = "Δt", ylabel = "u", lw=3, label="max(u)")
p4 = plot(maxv, xlabel = "Δt", ylabel = "v", lw=3, label="max(v)")
p = plot(p1, p2, p3, p4, layout = l)
plot!(p[1], zlims=(0, 14))
# Compute forces
JuThinFilm.kernel_pressure_2!(mom.pressure, mom.height, pressureparameters, T)
filmpressure!(Fpressure, mom, T)
slippage!(Fslip, mom, collisionparameters, T)
constantforce!(Fbody, mom, t, 1e-4, true, false, T)
sumforces!(Fsum, Fpressure, Fslip, Fbody)
# Get the equilibrium and then performe a collision.
equilibrium!(dists, mom, lat, parameters, T)
JuThinFilm.collidestreamBGK_periodicGUO!(dists, Fsum, lat, collisionparameters, T)
JuThinFilm.macroscopicmoments!(mom, dists, Fsum)
gif(anim, "animations/sliding_drop.gif", fps = 60)
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment