linear stability calculator? #3000
Replies: 10 comments 10 replies
-
@navidcy put together an example that uses the "power method" for this purpose for Kelvin-Helmholz instability: https://clima.github.io/OceananigansDocumentation/stable/generated/kelvin_helmholtz_instability/ @kburns thinks we can generalize this method to find all eigenvalues / eigenfunctions with something called "Arnoldi iteration". Not sure this is what you had in mind, but its a start perhaps. I'm not sure how hard it would be to design a general abstraction for this purpose. If its not too much code I think it could be appropriate to go in the src. Another option is to create an independent package that uses Oceananigans (with the possibility of using other models too) for this purpose. |
Beta Was this translation helpful? Give feedback.
-
Yes, that is pretty much what I had in mind but for a different physical problem. There are a variety of ways one can do this. Below are a few that come to mind.
As for where they appera I don't kown but at some point, after I get a ShallowWaterModel off the ground, I will play around with different solvers and see what looks promising. This won't happen this week I'm pretty sure. |
Beta Was this translation helpful? Give feedback.
-
The issue with the power method is that its convergence depends on the difference between the two largest eigenvalues, and this can be really slow. Arnoldi iteration does a lot better, and gives you multiple eigenmodes. I think it should also be easy to add since most implementations (including ArnoldiMethod.jl, it looks like) are matrix-free. Directly calculating the full spectrum might be harder -- Dedalus can do this because it forms sparse matrices for the global linear operator, but I don't think oceananigans does this? |
Beta Was this translation helpful? Give feedback.
-
Thanks @kburns for the suggestion. I will look at Dedalus to see what they do and learn from them. I don't think we would want to find the full spectrum unless the problem is one-dimensional, but I guess it depends on what we want it to do. Lots of potential here I'm sure. |
Beta Was this translation helpful? Give feedback.
-
@glwagner or @ali-ramadhan would know better -- I don't think oceananigans forms a global LHS matrix for timestepping, but it might be feasible to build it just for eigenvalue problems. But on the other hand, the oceananigans forward evaluation is so fast that I think Arnoldi would probably really rip if you can do it all on the gpu! |
Beta Was this translation helpful? Give feedback.
-
There might be fancy ways to build the matrix using existing abstractions, but I'm not sure due to the pressure solver + fractional step stuff. With immersed boundaries I think we are out of luck for getting a matrix too, since that again makes non-trivial modifications to the discretization and time-stepping algorithm. A matrix free method that uses the user API might be easier to maintain as well. Arnoldi sounds like a pretty sweet idea... |
Beta Was this translation helpful? Give feedback.
-
I'm going to convert this to a discussion. The example linked above illustrates how to do linear stability calculations with Oceananigans. Any other tips people have to add are welcome! |
Beta Was this translation helpful? Give feedback.
-
My field of research is the study of instability mechanisms, and I am a huge fan of Oceananigans.jl. This really helps me a lot, especially KH intability you put on Oceananigans.example. I thank you for that. However, I do have some issues need handling. |
Beta Was this translation helpful? Give feedback.
-
thanks. Oceananigans is a great platform for us all. I will do my best to make some contribution.
…---- Replied Message ----
From
Navid C. ***@***.***>
Date
9/10/2023 16:27
To
***@***.***>
Cc
jialin ***@***.***>
,
***@***.***>
Subject
Re: [CliMA/Oceananigans.jl] linear stability calculator? (Discussion #3000)
Hi @caojialin000,
Thanks for pointing out that the KH example does not work on GPU. It'd be great if you can help us fix it. There are a few times at https://clima.github.io/OceananigansDocumentation/stable/simulation_tips/ that could be helpful. Usually it's a few minor changes that are needed, e.g. some constant appended with const. We'll very much appreciate a PR if you figure it out!
Unfortunately, we don't have any plans at the moment for putting more stability problems together. But we would very much welcome a contribution by you if you'd like! If you have any idea of a stability calculation then it'd be nice if you first put it forward here so we can all have a discussion before you go ahead putting work to it towards a PR.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
thanks~look forward to your new work, it really helps me a lot.
…---- Replied Message ----
From
Francis J. ***@***.***>
Date
9/11/2023 01:16
To
***@***.***>
Cc
jialin ***@***.***>
,
***@***.***>
Subject
Re: [CliMA/Oceananigans.jl] linear stability calculator? (Discussion #3000)
I will add that the Shallow Water model example looks at a barotropic instability, in case that is of interest to you.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Inspired by @glwagner's script from this morning with a beautiful movie of Rayeigh-Taylor instability, I thought it would be great to set up code to solve the linear stability problem for the example (and for others). I'm not sure if others are interested so I will work to do this sometime, and this issue is a way for me not to forget about it.
Beta Was this translation helpful? Give feedback.
All reactions