Skip to content

Volcanic eruption #1

@milankl

Description

@milankl

Script to simulate a volcanic eruption (add a mountain, add a passive tracer around it) @AnnaDSMS

using SpeedyWeather

# define some default model and simulate some days
spectral_grid = SpectralGrid(trunc=63, nlayers=8)
model = PrimitiveWetModel(spectral_grid)
simulation = initialize!(model)
run!(simulation, period=Day(10))

# now mimic a volcanic eruption by adding a mountain
H, λ₀, φ₀, w = 4000, 200, 20, 5         # height, lon, lat position, and width
set!(model, orography=(λ,φ) -> H*exp((--λ₀)^2 --φ₀)^2)/2w^2), add=true)

# and add a passive tracer called `:ash` and set it (=define its initial conditions)
add!(simulation, Tracer(:ash))
set!(simulation, ash = (λ, φ, σ) -> σ*exp((--λ₀)^2 --φ₀)^2)/2(3w)^2))

# now simulate another 5 days
run!(simulation, period=Day(5))

That tracer spread during those 5 days, e.g. in the upper atmosphere like this

ash = simulation.diagnostic_variables.grid.tracers_grid[:ash][:, 2]
heatmap(ash, title="Ash concentration")

Image

(I may have had a slightly different state when running this so the concentration may not be exactly reproducible ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions