Swift-Hohenberg equation with periodic boundary conditions.

214 views
Skip to first unread message

carlos lugo

unread,
May 11, 2018, 9:29:56 AM5/11/18
to Dedalus Users
Hello Everyone!

I am starting to use Dedalus and there are a couple of questions regarding boundary conditions. 

The problem I'm investigating at the minute is fairly simple, it is the Swift-Hoehenberg  equation: u_t=((nabla)^2 +1)^2u+au+u^3 Or

u_t+Lu=F(u) where L=(nabla^2+2nabla)

on a rectangular domain [0,Lx] x [0,Ly].

My question is how to implement periodic boundaries on both directions? I assume this can only be done using a Fourier basis? 

Sorry for the hassle.

Carlos

Daniel Lecoanet

unread,
May 11, 2018, 9:39:20 AM5/11/18
to dedalu...@googlegroups.com
Hi Carlos,

Yes, typically you'd want to use Fourier basis in both x and y.  It's technically possible to use a Chebyshev basis and impose the periodic BCs by something like "left(u) - right(u) = 0", "dz(u) - uz = 0", "left(uz) - right(uz) = 0", etc.

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/c964dc22-6484-401d-8294-ba0c9a8a7def%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Carlos Lugo

unread,
May 11, 2018, 11:01:05 AM5/11/18
to dedalu...@googlegroups.com
Hi Daniel,

Thanks for your prompt reply,   Is there any documentation describing how to do this? actually, I am still looking for documentation about the time-stepping methods available, any pointers? 

Carlos

Ben Brown

unread,
May 11, 2018, 11:34:13 AM5/11/18
to dedalu...@googlegroups.com
Carlos,
      All of the current timesteppers are in timesteppers.py; the documentation in that file includes the literature references for each timestepper.

Fourier bases automatically enforce periodic boundary conditions. In fact, with Fourier only, you will not be able to include "add_bc()" calls. Remove those lines if you have them and it should work fine.

You're welcome to send your script to this email thread if you'd like someone to look over it.

--Ben

On Fri, May 11, 2018 at 9:01 AM Carlos Lugo <kupka...@gmail.com> wrote:
Hi Daniel,

Thanks for your prompt reply,   Is there any documentation describing how to do this? actually, I am still looking for documentation about the time-stepping methods available, any pointers? 

Carlos
On 11 May 2018 at 14:38, Daniel Lecoanet <leco...@princeton.edu> wrote:
Hi Carlos,

Yes, typically you'd want to use Fourier basis in both x and y.  It's technically possible to use a Chebyshev basis and impose the periodic BCs by something like "left(u) - right(u) = 0", "dz(u) - uz = 0", "left(uz) - right(uz) = 0", etc.

Daniel
On Fri, May 11, 2018 at 6:29 AM, carlos lugo <kupka...@gmail.com> wrote:
Hello Everyone!

I am starting to use Dedalus and there are a couple of questions regarding boundary conditions. 

The problem I'm investigating at the minute is fairly simple, it is the Swift-Hoehenberg  equation: u_t=((nabla)^2 +1)^2u+au+u^3 Or

u_t+Lu=F(u) where L=(nabla^2+2nabla)

on a rectangular domain [0,Lx] x [0,Ly].

My question is how to implement periodic boundaries on both directions? I assume this can only be done using a Fourier basis? 

Sorry for the hassle.

Carlos

--
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.

--
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.

To post to this group, send email to dedalu...@googlegroups.com.

--
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.

To post to this group, send email to dedalu...@googlegroups.com.

geoff

unread,
May 11, 2018, 11:22:20 PM5/11/18
to dedalu...@googlegroups.com
Hi Carlos, 

The example scripts in dedalus/examples/ivp/kvd_burgers/ (for example) give a lot of what you need to get going. The documentation is also very useful of course.

A while back I was introducing someone to dedalus. I adapted a script from one of the examples to make it a little simpler; not that it needed to change much. 

This morning, I took the liberty of adapting it to the 2D SHE. I think these two scripts show you everything you need to know to be dangerous in a periodic domain. Compare some of the differences carefully. There are a few subtle things different. 

For example, the grid in 1D x.shape = (nx , ) . In 2D, x.shape = (nx,1) and y.shape = (1, nx). This is a python thing. It’s really useful once you get used to it. But there are a handful of catchy little things like this. 

Anyhow. Hope this helps. 

space_time.py
2d_system.py

Carlos Lugo

unread,
May 14, 2018, 4:39:18 AM5/14/18
to dedalu...@googlegroups.com
Ooooh Hello Geoff!

Thanks for this, I also worked on this a littyle bit over the weekend independently,  I share my implementation now as well (It is not very elegant of course) which is just a modification of the 2d Rayleygh script with Fourier bases. I alsgo share a pic of what I get which I should probably check with the literature....

In any case thanks, this is a fantastic tool!.


​Now I'm gonna compare with your solution! 

Thanks again!




--
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.

For more options, visit https://groups.google.com/d/optout.

--
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.

For more options, visit https://groups.google.com/d/optout.


For more options, visit https://groups.google.com/d/optout.

--
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.
swift_hohenberg.py

Geoff Vasil

unread,
May 14, 2018, 4:45:38 AM5/14/18
to dedalu...@googlegroups.com
Really nice image. The SHE is great for lots of reasons. When your interested, we also have a trick for easily upping the resolution of the output for making nice images. It’s a bit of a cheat, since it can make things look nicer than they should be. But you can set_scales = 4 for the output. This pads the output by a factor of 4. 

It looks like your script is setup up correctly. The reason I wanted to send you what I did is to make the point that Fourier domains don’t need all the extra variables that Chebyshev does. It’s faster to compute and easier to read. 

Anyhow. Glad you are having fun! 

On 14 May 2018, at 6:39 pm, Carlos Lugo <kupka...@gmail.com> wrote:

Ooooh Hello Geoff!

Thanks for this, I also worked on this a littyle bit over the weekend independently,  I share my implementation now as well (It is not very elegant of course) which is just a modification of the 2d Rayleygh script with Fourier bases. I alsgo share a pic of what I get which I should probably check with the literature....

In any case thanks, this is a fantastic tool!.

<write_000069.png>

Thanks again!



To unsubscribe from this group and stop receiving emails from it, send an email to dedalus-user...@googlegroups.com.

To post to this group, send email to dedalu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
<swift_hohenberg.py>

Reply all
Reply to author
Forward
0 new messages