diff --git a/.gitignore b/.gitignore index 86c03f9..3ee2607 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.jld2 *.nc *.vscode +*.mp4 /Manifest.toml /deps/deps.jl /docs/Manifest.toml diff --git a/examples/single_interface_periodic_linear_background.jl b/examples/single_interface_periodic_linear_background.jl new file mode 100644 index 0000000..cab3fa6 --- /dev/null +++ b/examples/single_interface_periodic_linear_background.jl @@ -0,0 +1,35 @@ +using StaircaseShenanigans + +architecture = CPU() # or GPU() +diffusivities = (ν = 1e-5, κ = (S = 1e-7, T = 1e-5)) +domain_extent = (Lx = 0.1, Ly = 0.1, Lz = -1.0) +resolution = (Nx = 5, Ny = 5, Nz = 50) +eos = CustomLinearEquationOfState(-0.5, 34.6) +model_setup = (;architecture, diffusivities, domain_extent, resolution, eos) + +## Initial conditions +depth_of_interface = -0.5 +salinity = [34.56, 34.70] +temperature = [-1.5, 0.5] +interface_ics = PeriodoicSingleInterfaceICs(eos, depth_of_interface, salinity, temperature, + BackgroundLinear()) +tracer_noise = TracerNoise(1e-6, 1e-6) + +## setup model +sdns = StaircaseDNS(model_setup, interface_ics, tracer_noise) + +## Build simulation +Δt = 1e-1 +stop_time = 4 * 60 * 60 # seconds +save_schedule = 30 # seconds +output_path = joinpath(@__DIR__, "output_linear_background") +simulation = SDNS_simulation_setup(sdns, stop_time, save_computed_output!, + save_vertical_velocities!; + Δt, save_schedule, + output_path, max_Δt = 5) +## Run +run!(simulation) + +## Compute density ratio +compute_R_ρ!(simulation.output_writers[:computed_output].filepath, + simulation.output_writers[:tracers].filepath, eos) diff --git a/examples/single_interface_periodic.jl b/examples/single_interface_periodic_tanh_background.jl similarity index 81% rename from examples/single_interface_periodic.jl rename to examples/single_interface_periodic_tanh_background.jl index fa0a51e..7af175e 100644 --- a/examples/single_interface_periodic.jl +++ b/examples/single_interface_periodic_tanh_background.jl @@ -9,9 +9,10 @@ model_setup = (;architecture, diffusivities, domain_extent, resolution, eos) ## Initial conditions depth_of_interface = -0.5 -salinity = [34.58, 34.70] +salinity = [34.56, 34.70] temperature = [-1.5, 0.5] -interface_ics = PeriodoicSingleInterfaceICs(eos, depth_of_interface, salinity, temperature, BackgroundTanh(tanh_background, 100, NamedTuple())) +interface_ics = PeriodoicSingleInterfaceICs(eos, depth_of_interface, salinity, temperature, + BackgroundTanh()) tracer_noise = TracerNoise(1e-6, 1e-6) ## setup model @@ -19,9 +20,9 @@ sdns = StaircaseDNS(model_setup, interface_ics, tracer_noise) ## Build simulation Δt = 1e-1 -stop_time = 200 * 60 # seconds -save_schedule = 10 # seconds -output_path = joinpath(@__DIR__, "output") +stop_time = 4 * 60 * 60 # seconds +save_schedule = 30 # seconds +output_path = joinpath(@__DIR__, "output_tanh_background") simulation = SDNS_simulation_setup(sdns, stop_time, save_computed_output!, save_vertical_velocities!; Δt, save_schedule,