syou83syou83 / hello-world

Learn how to use github; the first repository.
0 stars 0 forks source link

test expandable-not an issue #2

Open syou83syou83 opened 2 years ago

syou83syou83 commented 2 years ago

Follow this post: https://gist.github.com/scmx/eca72d44afee0113ceb0349dd54a84a2#code

Minimum Working Example ``` using Random using Printf using Plots using Oceananigans using Oceananigans.Units: minute, minutes, hour Nz = 24 # number of points in the vertical direction Lz = 32 # (m) domain depth refinement = 1.2 # controls spacing near surface (higher means finer spaced) stretching = 12 # controls rate of stretching at bottom h(k) = (k - 1) / Nz ζ₀(k) = 1 + (h(k) - 1) / refinement Σ(k) = (1 - exp(-stretching * h(k))) / (1 - exp(-stretching)) z_faces(k) = Lz * (ζ₀(k) * Σ(k) - 1) grid = RectilinearGrid(size = (32, 32, Nz), x = (0, 64), y = (0, 64), #z = (-Lz, 0)) # Errors are gone for uniform grid z = z_faces) ############################ Lagrangian Particles n_particles = 10; x₀ = 60*rand(n_particles); y₀ = 60*rand(n_particles); z₀ = -Lz*0.5*rand(n_particles); lagrangian_particles = LagrangianParticles(x=x₀, y=y₀, z=z₀, restitution=0) ############################ b_bcs = FieldBoundaryConditions(top=FluxBoundaryCondition(1e-8)) model = NonhydrostaticModel(advection = UpwindBiasedFifthOrder(), timestepper = :RungeKutta3, grid = grid, tracers = (:b,), coriolis = FPlane(f=1e-4), buoyancy = BuoyancyTracer(), closure = AnisotropicMinimumDissipation(), boundary_conditions = (b=b_bcs,), particles=lagrangian_particles) ############################ Lagrangian Particles bᵢ(x, y, z) = 1e-5 * z + 1e-9 * rand() set!(model, b=bᵢ) simulation = Simulation(model, Δt=10.0, stop_time=20minutes) wizard = TimeStepWizard(cfl=1.0, max_change=1.1, max_Δt=1minute) simulation.callbacks[:wizard] = Callback(wizard, IterationInterval(10)) run!(simulation) ```

Thank you!

syou83syou83 commented 2 years ago

Minimum Working Example this is a quote