Skip to content

Commit

Permalink
add stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-silvestri committed Feb 3, 2025
1 parent 06a7c1b commit b9fccea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ previous_hydrostatic_tendency_fields(::Val{:SplitRungeKutta3}, args...) = nothin
function previous_hydrostatic_tendency_fields(::Val{:SplitRungeKutta3}, velocities, free_surface::SplitExplicitFreeSurface, args...)
U = similar(free_surface.barotropic_velocities.U)
V = similar(free_surface.barotropic_velocities.V)
return (; U=U, V=V)
η = similar(free_surface.η)
return (; U=U, V=V, η=η)
end
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ function rk3_average_free_surface!(free_surface::SplitExplicitFreeSurface, grid,

Uⁿ⁻¹ = timestepper.Ψ⁻.U
Vⁿ⁻¹ = timestepper.Ψ⁻.V
ηⁿ⁻¹ = timestepper.Ψ⁻.η
Uⁿ = free_surface.barotropic_velocities.U
Vⁿ = free_surface.barotropic_velocities.V
ηⁿ = free_surface.η

launch!(arch, grid, :xy, _rk3_average_free_surface!, Uⁿ, grid, Uⁿ⁻¹, γⁿ, ζⁿ)
launch!(arch, grid, :xy, _rk3_average_free_surface!, Vⁿ, grid, Vⁿ⁻¹, γⁿ, ζⁿ)
launch!(arch, grid, :xy, _rk3_average_free_surface!, ηⁿ, grid, ηⁿ⁻¹, γⁿ, ζⁿ)

return nothing
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ topo = (Bounded, Periodic, Bounded)

partition = Partition(x = Sizes(10, 13, 18, 39))

arch = Distributed(CPU(); partition)
arch = Distributed(CPU())

# Distribute problem irregularly
Nx = 80
Expand All @@ -46,6 +46,7 @@ coriolis = FPlane(f=1e-4)

model = HydrostaticFreeSurfaceModel(; grid,
coriolis,
timestepper = :SplitRungeKutta3,
free_surface = SplitExplicitFreeSurface(grid; substeps=10))

gaussian(x, L) = exp(-x^2 / 2L^2)
Expand Down

0 comments on commit b9fccea

Please sign in to comment.