Initial condition for the 2D Rayleigh-Benard example

231 views
Skip to first unread message

Jason Lee

unread,
May 8, 2015, 8:10:34 AM5/8/15
to dedalu...@googlegroups.com
Dear all,

I'm new to the Dedalus. What makes me confused is the initial condition setting of the 2D case of RB convection. I found these lines:
 66 # Initial conditions                                                            
 
67 x = domain.grid(0)                                                              
 
68 z = domain.grid(1)                                                              
 
69 b = solver.state['b']                                                            
 
70 bz = solver.state['bz']
 According to the tutorial I assume that these lines just take the default values for the variables, but should there be some fluctuation of the velocity as the initial conditions? If so, what's the process of configuration? I really didn't see any.

Hope some one could give me some hints.

Thanks

j s oishi

unread,
May 8, 2015, 11:29:52 AM5/8/15
to dedalus-users
Hi Jason,

Welcome to Dedalus!

In your snippet, lines 67-68 are getting the grid you have defined when you set up the domain. These are not variables; they are fixed during the course of the simulation. Lines 69-70 are indeed getting a pointer to the buoyancy ('b') variable and its first derivative in z ('bz'). These are initialized to zero.

Typically, in RB convection problems, it's easier to put a fluctuation in the buoyancy variable rather than the velocity, because then you don't need to worry about ensuring that the perturbation is incompressible! If you look at lines 72-82 in that same file, you'll see that first we create some noise:

# Random perturbations, initialized globally for same results in parallel
gshape = domain.dist.grid_layout.global_shape(scales=1)
slices = domain.dist.grid_layout.slices(scales=1)
rand = np.random.RandomState(seed=42)
noise = rand.standard_normal(gshape)[slices]

and then we put that noise into the buoyancy variable:

zb, zt = z_basis.interval
pert =  1e-3 * noise * (zt - z) * (z - zb)
b['g'] = -F*(z - pert)
b.differentiate('z', out=bz)
masked by (zt - z) * (z - zb) to ensure there aren't perturbations right at the top and bottom plates.

I hope this is helpful.

Jeff


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/dedalus-users/68d12aac-bbb4-4238-996f-af1126d97276%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jason Lee

unread,
May 9, 2015, 5:29:36 AM5/9/15
to dedalu...@googlegroups.com
Hey Jeff,

Thank you very much for your thorough analysis. 
Another question: which lines are for the top and bottom BC configuration? I only found left and right as the periodic ones.

Regards

Jason

j s oishi

unread,
May 9, 2015, 10:25:16 AM5/9/15
to dedalus-users
Hi Jason,

That's a dedalus-ism. "Left" is always the lower edge of the Chebyshev basis in the domain, and "Right" is the upper edge. In this case, since the Chebyshev basis represents the z direction, Left --> Bottom; Right --> Top.

Jeff

Jason Lee

unread,
May 10, 2015, 9:38:21 PM5/10/15
to dedalu...@googlegroups.com
Cool! Thanks Jeff!

Jason
Reply all
Reply to author
Forward
0 new messages