Created
May 3, 2023 11:01
-
-
Save chemicalfiend/496a64ec4ad1091c53b3260ba5056c76 to your computer and use it in GitHub Desktop.
Simulation of a fluid against a moving wall.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#= | |
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