Skip to content

Instantly share code, notes, and snippets.

@chemicalfiend
Created May 3, 2023 11:01
Show Gist options
  • Save chemicalfiend/496a64ec4ad1091c53b3260ba5056c76 to your computer and use it in GitHub Desktop.
Save chemicalfiend/496a64ec4ad1091c53b3260ba5056c76 to your computer and use it in GitHub Desktop.
Simulation of a fluid against a moving wall.
#=
Simulation of a fluid mounted against a moving wall. Plots the velocity profile Vx(y) and showcases how it changes.
=#
using GLMakie
using Makie.Colors
using SpecialFunctions
ν = 1.0
v0 = 1.0
time = Observable(0.0)
ys = range(0, 7, length=40)
vx = @lift(v0 * erfc.(ys ./ sqrt(4 * ν * $time)))
fig = lines(ys, vx, color = :blue, linewidth = 4,
axis = (title = @lift("t = $(round($time, digits = 1))"),))
framerate = 30
timestamps = range(0, 10, step=1/framerate)
record(fig, "time_animation.mp4", timestamps;
framerate = framerate) do t
time[] = t
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment