Advective vs flux form of transport equations

225 views
Skip to first unread message

Geoff Vallis

unread,
Oct 25, 2016, 1:16:13 PM10/25/16
to Dedalus Users

Hello,

In the examples of some IVP problems, e.g. Rayleigh Benard, you write the equations in an advective form rather than a flux form. So typically you have
    u db/dx + w db/dz   and not  d(ub)/dx + d(wb)/dz . 
 Is there a real difference and/or is one to be preferred in Dedalus?

You also tend to write out subsidiary equations for z derivatives (in Chebyshev examples at least) so that you might have
  wz - dz(w) = 0 
And then you use wz as a variable, not dz(w). Is this stilll necessary? There was some chatter about this some time ago, and I got the impression this was for technical reasons that a new release of Daedalus would overcome? 

The reason I ask is that I have some transport equations of the form
   d/dx (r u b) + d/dz(r w b)    
and the velocities are not divergence free, and r is another evolving field, a bit like a variable density. Can I write the transport term simply as
  dx(r*u*b) + dz(r*w*b)          
or do I have to expand it out and/or define subsidiary variables like wb - w*b = 0  and  wbz  - dz(wb)  = 0, etc? 

Thanks
Geoff

Daniel Lecoanet

unread,
Oct 25, 2016, 2:21:30 PM10/25/16
to dedalu...@googlegroups.com
Hi,

Right now we require the _linear_ part of the equations to be first order in the Chebyshev direction.  There's no restriction on the nonlinear terms, although there may be a speed difference in calculating u*dx(b) vs dx(u*b).  You could definitely have terms like dx(r*u*b)+dz(r*w*b) on the RHS of your equations.

We're still working on implementing higher order derivatives for the linear parts of the equations.  Geoff or Keaton may be able to provide an update on that.

Daniel

--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-users+unsubscribe@googlegroups.com.
To post to this group, send email to dedalu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/adaa1f2d-1d19-43a9-9f25-b0a94fff9d27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Geoff Vallis

unread,
Oct 25, 2016, 2:45:01 PM10/25/16
to Dedalus Users, leco...@princeton.edu
Thanks Daniel, that's helpful.  (I'm learning by example, and trial and error,  but if it's documented just point me to it.) 

geoff

unread,
Oct 25, 2016, 5:41:10 PM10/25/16
to dedalu...@googlegroups.com
On 26 Oct 2016, at 4:16 AM, Geoff Vallis <gkva...@gmail.com> wrote:


Hello,

In the examples of some IVP problems, e.g. Rayleigh Benard, you write the equations in an advective form rather than a flux form. So typically you have
    u db/dx + w db/dz   and not  d(ub)/dx + d(wb)/dz . 
 Is there a real difference and/or is one to be preferred in Dedalus?

Like Daniel said, there could be speed difference between these. The reason is something like the following. Computing each term requires something like the following:

transpose u, b, w, dz(b) in (z,x); make dx(b);  FFT(u), FFT(dx(b)), FFT(w), FFT(dz(b)); multiply and add; f = FFT(u*dx(b)+wdz(b)); FFT(f); transpose f (x,z).

transpose u, b, w in (z,x); FFT(u), FFT(b), FFT(w), multiply gx = u*b, gz=w*b, FFT(gx), FFT(gz); make fx = dx(gx) transpose fx, gz in (x,z); make fz= dz(gz); add fx + fz

In this example, each different method requires 5 data transposes (MPI communication), and 5 FFTs. Along with 2 multiplications, one add, and one dx().  I don’ think balancing happens for 3D. But it’s been awhile since I thought about it.  


You also tend to write out subsidiary equations for z derivatives (in Chebyshev examples at least) so that you might have
  wz - dz(w) = 0 
And then you use wz as a variable, not dz(w). Is this stilll necessary?

I wish we had a prize to give you. You indeed correctly realised that the wz is not needed, but the uz is. I think the 2D RB example is confusing for this reason. 

We currently need a 1st-order formulation for the chebyshev direction. There is a working prototype for including higher-order chebyshev derivatives. The original 1st-order design was for some technical reason. I won’t go into it unless you *really* want to hear about it. But I will say they were good reasons at the time. It allowed us to get a lot of powerful things working quickly and reliably. Now that we know a lot more about the subtitles of higher-order formulations we can reproduce exactly the same results under the hood.

But I have started to like the 1st order formulation quite a lot for the momentum equations. But I mean the vorticity formulation in particular. 

dt(u) + dx(p) - nu*dz(q) = - q*w
dt(v) + dz(p) +nu*dx(q) =   q*u
dx(u) + dz(w) = 0
q + dz(u) - dx(w) = 0

It has the appealing features that: (a) every equation has exactly one dz(), (2) every variable has exactly one dz(), (3) we care about the vorticity anyway; so why not solve for it. (4) the nonlinear terms are purely a product of the solved variables; no further derivatives. 

The equations are just as nice in 3D. It’s especially helpful in polar coordinates. The 3D equations still fit on one line.


There was some chatter about this some time ago, and I got the impression this was for technical reasons that a new release of Daedalus would overcome? 

The reason I ask is that I have some transport equations of the form
   d/dx (r u b) + d/dz(r w b)    
and the velocities are not divergence free, and r is another evolving field, a bit like a variable density. Can I write the transport term simply as
  dx(r*u*b) + dz(r*w*b)          
or do I have to expand it out and/or define subsidiary variables like wb - w*b = 0  and  wbz  - dz(wb)  = 0, etc? 


A lot of what i’ve said probably doesn’t apply to the more complicated terms you have. But I want to make the point that sometimes a good choices of variable definitions can really clean up the equations in several ways. 


Thanks
Geoff


--
You received this message because you are subscribed to the Google Groups "Dedalus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.

Geoff Vallis

unread,
Oct 26, 2016, 5:42:58 AM10/26/16
to Dedalus Users
Thanks for the reply. The direct applicability to my complicated equations is of less importance to me than getting an idea of what is and what is not possible, and it's good to get a sense of that. 

Your formulation of the moment equations (the`vector invariant' form) indeed has nice properties, another one being that it is the same in all coordinate systems, so it is also often used on the sphere.  The down side is that if you add a variable Coriolis term, f = \beta y say, and want to do it in a Cartesian periodic domain, you have to add sponges or similar (as per your earlier post) because f is not periodic.  Just integrating the vorticity equation itself makes that problem go away on the beta plane. Still, I think it may be the case that part of the popularity of doubly-periodic beta planes has been in the relative ease and speed of coding Fourier series in both directions, and if Chebyshev's  are just as easy to use then that reason goes away. (This comment is tangential to my original post, though.)

Reply all
Reply to author
Forward
0 new messages