navidcy / TurbulentWords.jl

Make turbulence with words

Home Page:https://navidcy.github.io/TurbulentWords.jl/dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TurbulentWords.jl

stable docs latest docs GitHub tag (latest SemVer pre-release) ColPrac: Contributor's Guide on Collaborative Practices for Community Packages

Make turbulence with words.

demo-clima

Installation

To install from a Julia REPL:

julia> ]

pkg> add TurbulentWords

pkg> instantiate

TurbulentWords.jl requires Julia v1.6 or later but we encourage using Julia v1.10.

Usage

A turbulent word

using TurbulentWords
using CairoMakie

fig = Figure(size=(2400, 300))
ax = Axis(fig[1, 1])
word = word_to_array("Ναταλια")
heatmap!(ax, word)
fig
image

A turbulent flow

using TurbulentWords
using Oceananigans
using CairoMakie

u, v, ψ, ζ = word_to_flow("TEMPESTUOUS", vpad=50)

fig = Figure(size = (800, 800))

ax1 = Axis(fig[1, 1], title="Vorticity, ∂v/∂x - ∂u/∂y")
ax2 = Axis(fig[2, 1], title="Streamfunction, ψ")
ax3 = Axis(fig[3, 1], title="u = - ∂ψ/∂y")
ax4 = Axis(fig[4, 1], title="v = + ∂ψ/∂x")

[hidedecorations!(ax) for ax in (ax1, ax2, ax3, ax4)]

heatmap!(ax1, interior(ζ, :, :, 1), colormap=:balance, colorrange = (-1.2, 1.2))
heatmap!(ax2, interior(ψ, :, :, 1), colormap=:speed)
heatmap!(ax3, interior(u, :, :, 1), colormap=:balance)
heatmap!(ax4, interior(v, :, :, 1), colormap=:balance)

fig

image

A turbulent simulation

using TurbulentWords
using Oceananigans
using CairoMakie

simulation = word_to_simulation("STORMY")
simulation.stop_time = 5
run!(simulation)

model = simulation.model
u, v, w = model.velocities
ζ = Field(∂x(v) - ∂y(u)) |> compute!

fig = Figure()
ax = Axis(fig[1, 1])
hidedecorations!(ax)
heatmap!(ax, interior(ζ, :, :, 1), colormap=:balance)

fig

image

Another turbulent simulation

using TurbulentWords
using Oceananigans
using CairoMakie

simulation = word_to_simulation("ROILING", dynamics=:buoyancy_driven)
simulation.stop_time = 0.3
run!(simulation)

b = simulation.model.tracers.b

fig = Figure()
ax = Axis(fig[1, 1])
hidedecorations!(ax)
heatmap!(ax, interior(b, :, 1, :), colormap=:balance)

fig

image

It's too cool (hot?) to stop at just 0.3 though

simulation.stop_time = 0.5
run!(simulation)
heatmap!(ax, interior(b, :, 1, :), colormap=:balance)

fig

image

About

Make turbulence with words

https://navidcy.github.io/TurbulentWords.jl/dev

License:MIT License


Languages

Language:Julia 100.0%