-
Notifications
You must be signed in to change notification settings - Fork 32
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 passive tracer advection-diffusion in 2D flows #279
base: main
Are you sure you want to change the base?
Add passive tracer advection-diffusion in 2D flows #279
Conversation
OMG! I totally forgot about this PR! |
Really, really sorry! |
This is very related with what's @jbisits been up to lately over in |
So @BrodiePearson this is great! The nice thing about this implementation compared to that done in FourierFlows/PassiveTracerFlows.jl#53 is that here both tracers and flow are evolved simultaneously with the same time-stepping scheme and thus time-stepping can have the same accuracy. I'm debating what's the best way forward here. There is a fair bit of overlap between modules @glwagner would be keen to hear your opinion on this. |
Sorry to jump into the thread here but I agree this is great! |
I added a passive tracer to the 2D module for some personal experiments, and I wondered if this would be a useful addition for others. This is related, but not identical, to Issue #20. I wasn't sure whether this module fit in
GeophysicalFlows.jl
,PassiveTracersFlows.jl
, or another project (I want to expand to reacting tracers in the future).I approached this problem using the multi-layer QG module's framework of a 3D solution (where the top layer is dynamics, and other layers are tracers).
Adds tracer to new 2D dynamics module
. There were also numerous small modifications to the code after this commit.The general properties of the module are:
ntracers
). The examples I have in this PR use 3 tracers.κ
with ordernκ
.set_ζ_and_tracers!
function.twodnavierstokeswithtracer.jl
) frames the solution (sol
) as ank x nl x nlayers
array, wherenlayers = ntracers +1
. The first layer (sol[:,:,1]
) is the vorticity and the lower layers are each of the tracers.calcN!
step, and this could probably be made more efficient.Decaying 2D turbulence (upper left two panels are identical to existing example)
twodturbtracer.mp4
Stochastically-Forced 2D turbulence (upper left two panels are identical to existing example)
twodturb_forced_tracer.mp4
Benchmarking on an Apple M1 chip
Decaying 2D example without tracers
Decaying 2D example with 3 tracers
Stochastically-forced 2D example without tracers
Stochastically-forced 2D example with 3 tracers