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

Adding Surface QG dynamics? #106

Closed
BrodiePearson opened this issue Sep 11, 2020 · 2 comments · Fixed by #111
Closed

Adding Surface QG dynamics? #106

BrodiePearson opened this issue Sep 11, 2020 · 2 comments · Fixed by #111
Labels
🤥 enhancement New feature or request

Comments

@BrodiePearson
Copy link
Collaborator

BrodiePearson commented Sep 11, 2020

Are there plans to include a SurfaceQG model in GeophysicalFlows, to complement the other 2D and QG systems that can be modelled?

I started making an SQG model for GeophysicalFlows and I'd be happy to share/collaborate on it if there is not one already being developed. A very rough example code is here, and the SurfaceQG.jl file is also in that branch. It produces flow fields that look reasonable but I am still working to reproduce the results of a specific paper. I'd be happy to put together a doc of the equation set I'm trying to solve if that would be helpful (it is essentially the Equations of Section 2.1 in this paper).

@navidcy
Copy link
Member

navidcy commented Sep 11, 2020

We don't have any such plans at the moment so feel free to continue work on SurfaceQG.jl. Ping us if you run into trouble or you want to chat about anything!

@navidcy navidcy added the 🤥 enhancement New feature or request label Sep 11, 2020
@glwagner
Copy link
Member

I have no plans!

I'd suggest opening a PR sooner rather than later so we can collaborate on the new module + docs!

The main challenge is coming up with dynamics / physics unit tests. For example, for two-dimensional turbulence we use the Lamb dipole:

function test_twodnavierstokes_lambdipole(n, dt, dev::Device=CPU(); L=2π, Ue=1, Re=L/20, ν=0.0, nν=1, ti=L/Ue*0.01, nm=3)
nt = round(Int, ti/dt)
prob = TwoDNavierStokes.Problem(dev; nx=n, Lx=L, ν=ν, nν=nν, dt=dt, stepper="FilteredRK4")
zeta₀ = lambdipole(Ue, Re, prob.grid)
TwoDNavierStokes.set_zeta!(prob, zeta₀)
xzeta = zeros(nm) # centroid of abs(zeta)
Ue_m = zeros(nm) # measured dipole speed
x, y = gridpoints(prob.grid)
zeta = prob.vars.zeta
for i = 1:nm # step forward
stepforward!(prob, nt)
TwoDNavierStokes.updatevars!(prob)
xzeta[i] = mean(@. abs(zeta)*x) / mean(abs.(zeta))
if i > 1
Ue_m[i] = (xzeta[i]-xzeta[i-1]) / ((nt-1)*dt)
end
end
isapprox(Ue, mean(Ue_m[2:end]), rtol=rtol_lambdipole)
end

Perhaps there's a simple analogue for SQG, or we can come up with something else. Often such tests are nice sanity checks to have in place before publishing anything, too. @BrodiePearson have you come up with any tests?

It'd be fun to make an example out of a script that reproduces the results of the paper, too.

@navidcy navidcy linked a pull request Sep 15, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤥 enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants