Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add background zonal flow U or U(y) in the SingleLayerQG module #360

Merged
merged 39 commits into from
Jul 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
16bd801
Update singlelayerqg.jl to include background flow
mncrowe Jun 17, 2024
30178e1
Fixed typo in previous change
mncrowe Jun 17, 2024
4362a87
added background flow test
mncrowe Jun 27, 2024
76f1643
corrected typo
mncrowe Jun 27, 2024
4781b8d
Added some spaces to cheer up Greg
mncrowe Jun 27, 2024
eada586
more spaces
mncrowe Jun 27, 2024
cc1b78a
added variable U functionality
mncrowe Jul 22, 2024
e756aa1
Merge branch 'main' into main
mncrowe Jul 22, 2024
3ce3abd
reduced memory of Uy assignment and updated function descriptions
mncrowe Jul 22, 2024
8641abe
Merge branch 'main' of https://github.com/mncrowe/GeophysicalFlows.jl
mncrowe Jul 22, 2024
9bd7576
update function descriptions
mncrowe Jul 22, 2024
f0baf3f
T(U) -> convert(T, U)
mncrowe Jul 22, 2024
deea626
clarify U array formulation
mncrowe Jul 22, 2024
f351da2
fix bug with previous push
mncrowe Jul 22, 2024
8c1859f
add additional test function for U as an Array and include tests in
mncrowe Jul 23, 2024
dd93d22
simplify background U and use Rossby wave test for U that does not va…
navidcy Jul 27, 2024
122b713
homogenize notation/docs
navidcy Jul 27, 2024
ab0fe02
bump patch release
navidcy Jul 27, 2024
dd3c1ad
Merge remote-tracking branch 'upstream/main'
navidcy Jul 27, 2024
85d4393
fix test for gpu
navidcy Jul 27, 2024
619f398
== -> ===
navidcy Jul 27, 2024
ace06eb
use different calcN_advection! methods for U const and y-varying
navidcy Jul 27, 2024
2fcccc7
minor tweaks
navidcy Jul 27, 2024
20a361b
update singlelayergq module in docs
navidcy Jul 27, 2024
346f914
homogenize notation/wording
navidcy Jul 27, 2024
e6e7707
add empty line
navidcy Jul 28, 2024
73399f0
code alignment
navidcy Jul 28, 2024
99eb5ff
add Qx and Qy in params; refactor calcN_advection
navidcy Jul 28, 2024
6604120
clarify when U=const
navidcy Jul 28, 2024
f387333
some fixes + cleanup
navidcy Jul 28, 2024
40cc4db
add nonlinear advection test for finite deformation + topo
navidcy Jul 28, 2024
63a7a8c
fixes nonlinear advection w U(y) + add tests
navidcy Jul 28, 2024
6430e59
add comment for β term
navidcy Jul 28, 2024
48f2f1b
remove debug statements + fix test for julia 1.6
navidcy Jul 28, 2024
42d9003
more tests for the nonlinear terms
navidcy Jul 28, 2024
22e3bde
fix test_1layerqg_nonlinearadvection on gpu
navidcy Jul 28, 2024
c6cf36a
fix test_1layerqg_nonlinearadvection on gpu
navidcy Jul 28, 2024
5c9eb93
improve docs
navidcy Jul 28, 2024
1d2509f
drop GeophysicalFlows from docs/Project.toml
navidcy Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion test/test_singlelayerqg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -435,4 +435,28 @@ function test_1layerqg_enstrophy_drag(dev; deformation_radius=2.23)
prob = SingleLayerQG.Problem(dev; nx=16, deformation_radius=deformation_radius)
SingleLayerQG.enstrophy_drag(prob)
return nothing
end
end

"""
test_1layerqg_background_flow(dev; n, L, dt)

Evolves a lamb vortex with a background flow such that the vortex remains stationary.
"""
function test_1layerqg_background_flow(dev::Device=CPU(); n=256, L=10, dt=0.01)

prob = SingleLayerQG.Problem(dev; nx=n, Lx=L, dt, U = -1, stepper="FilteredRK4")
x, y = gridpoints(prob.grid)

q₀ = lambdipole(1,1,prob.grid,center=(1e-10,0))
mncrowe marked this conversation as resolved.
Show resolved Hide resolved
SingleLayerQG.set_q!(prob, q₀)

stepforward!(prob, Int(5/dt))

~,i₀ = findmax(q₀)
mncrowe marked this conversation as resolved.
Show resolved Hide resolved
~,i₁ = findmax(prob.vars.q)

x₀ = prob.grid.x[i₀[1]] # initial vortex position
x₁ = prob.grid.x[i₁[1]] # final vortex position

return isapprox(x₀, x₁, atol=0.2)
end