DNS Rayleigh-Benard instability

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
leguichet
Posts: 34
Joined: Wed Sep 03, 2014 1:00 pm

DNS Rayleigh-Benard instability

Post by leguichet »

Dear Saturne users,

Inspired from the tutorial on line "Heated square cavity flow", I trying to set up a test case for Rayleigh-Benard instability. I would like to obtain the instability onset procedure through the unsteady solver.

I made a 2D mesh, with 1m high (in x), 8m long (in y), and 0.01 m thick (y). The periodic condition by translation is imposed in the x direction in the "mesh selection" part. The bottom wall is set to 303.15K and the top wall is set to 293.15K. The Boussinesq approximation is implemented with a variable density with respect to the temperature as in the tutorial.

However, I can not obtain the convection rolls at Ra=2000, whereas the instability threshold is known at 1708. So I am wondering if and how we can do some DNS with code_saturne? The time step dt=0.1 too large for a mesh dx=0.01? Or the mesh is fine enough? or something wrong with my setup? If somebody can have a look at my case, that will be very helpful.

Thank you very much!

Zhenlan
Attachments
Cavity.py
(5.31 KiB) Downloaded 217 times
RB.xml
(7.77 KiB) Downloaded 210 times
cs_user_physical_properties.f90
(82.31 KiB) Downloaded 216 times
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: DNS Rayleigh-Benard instability

Post by Yvan Fournier »

Hello,

In any case, for DNS-type computations, you will need a CFL around 1, so you need to adjust your time step so that max (velocity*time_step / cell size) <= 1.

Some people have done DNS-type computations with Code_Saturne in the past, but I am not sure what options they used. I have never seen the results, but heard they were quite OK (of course, the code is slower than a specialized DNS code). It might be useful to switch from laminar to LES, so that you move to a second order time scheme (otherwise, you can also force the second order scheme setting the ischtp keyword to 2 in cs_user_parameters.f90 / usipsu.

Regards,

Yvan
leguichet
Posts: 34
Joined: Wed Sep 03, 2014 1:00 pm

Re: DNS Rayleigh-Benard instability

Post by leguichet »

Dear Yvan,

Thank you for your reply.

In SRC/REFERENCE/cs_user_parameters.f90, I found the subroutine usipsu, but there is no option for ischtp. Could you tell me in which file it is?

I am using the version 3.0.5

Best regards

Zhenlan
Yvan Fournier wrote:Hello,

In any case, for DNS-type computations, you will need a CFL around 1, so you need to adjust your time step so that max (velocity*time_step / cell size) <= 1.

Some people have done DNS-type computations with Code_Saturne in the past, but I am not sure what options they used. I have never seen the results, but heard they were quite OK (of course, the code is slower than a specialized DNS code). It might be useful to switch from laminar to LES, so that you move to a second order time scheme (otherwise, you can also force the second order scheme setting the ischtp keyword to 2 in cs_user_parameters.f90 / usipsu.

Regards,

Yvan
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: DNS Rayleigh-Benard instability

Post by Yvan Fournier »

Hello,

All you need is to add

Code: Select all

ischtp = 2
somewhere in usipsu (many of the keywords described as "advanced" in the user documentation do not have a "resident" example in the reference usipsu).

Regards,

Yvan
leguichet
Posts: 34
Joined: Wed Sep 03, 2014 1:00 pm

Re: DNS Rayleigh-Benard instability

Post by leguichet »

Thank you for your reply. Here I give some feedbacks and pose some new questions.

I indeed observed the Rayleigh-Benard cells by runing code_saturne. In fact, we need the width D between the plates is set to about 10mm for air, if the \beta is set to 1/T_0 as suggested in the tutorial. However, if we set D=1m, and varying \beta as function of D, \mu, g, etc, as suggested in the tutorial, we can not obtain the Benard cells. The explanation seems about the length scale for diffusion, I am not totally sure.

So my question is about, what is a proper way to implement the Boussinesq approximation in Code_Saturne? If it is possible to do it in a non-dimensional way? Thank you.

Merry Christmas

Zhenlan
Yvan Fournier wrote:Hello,

All you need is to add

Code: Select all

ischtp = 2
somewhere in usipsu (many of the keywords described as "advanced" in the user documentation do not have a "resident" example in the reference usipsu).

Regards,

Yvan
leguichet
Posts: 34
Joined: Wed Sep 03, 2014 1:00 pm

Re: DNS Rayleigh-Benard instability

Post by leguichet »

Dear Yvan,

I have a further question about the temporal second order scheme.
For the Rayleigh-Benard convection, we have the base flow, an analytical solution:
u = 0; v = 0; w =0; linear profile for temperature.

I use the cs_user_intialisation.f90 to initialize this field.
The table rtp can be set, but rtpa is not allowed to be set.

So how do the code to intialize the flow? since we need two previous time steps to do the first calculation.

For instance, I found there is a small oscillation in the beginning of the simulation. It seems that some random noises were introduced for the velocity field (maybe not verify the divergence zero condition), so it takes a short time to reach the base flow?

By the way, for the tutorial of differentially heated cavity, I have a comment about the physics.

The tutorial is supposed to use the Boussinesq approximation, so the density of air should be constant. The right way to this is to introduce a source term as the Buoyancy force.
In the tutorial, the density is considered as a variable depending on the temperature. It is not the Boussinesq approximation. That is why I could not capture the onset of first instability at Ra=1708 correctly, when I started the study.

Unless, for the Non-Boussinesq case, the viscosity and conductivity should also be considered as temperature depended variables. See the paper by Le Maître or by Suslov & Paolucci
http://perso.limsi.fr/olm/biblio_dwnload/siam_0mach.pdf
http://eprints.usq.edu.au/355/1/Suslov_Paolucci_AO.pdf

I think that it is better to correct this point in the tutorial file.

Regards

Zhenlan
Yvan Fournier wrote:Hello,

All you need is to add

Code: Select all

ischtp = 2
somewhere in usipsu (many of the keywords described as "advanced" in the user documentation do not have a "resident" example in the reference usipsu).

Regards,

Yvan
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: DNS Rayleigh-Benard instability

Post by Yvan Fournier »

Hello,

Did you try setting rtpa anyways ? Did the compiler complain, or the code overwrite rtpa with rtp ?

I am not the "time scheme" specialist for Code_Saturne, so I'll let colleagues pick up from here... I'll remind them to take a look at your post early next week.

Regards,

Yvan
leguichet
Posts: 34
Joined: Wed Sep 03, 2014 1:00 pm

Re: DNS Rayleigh-Benard instability

Post by leguichet »

Hello,

I tried to set rtpa, it gives the following errors during the compilation

Boussinesq4/SRC/cs_user_initialization.f90(130): error #6917: This array with adjustable declarators must be declared a dummy argument. [RTPA]
double precision dt(ncelet), rtp(ncelet,*), propce(ncelet,*), rtpa(ncelet,*)
--------------------------------------------------------------^
compilation aborted for /Boussinesq4/SRC/cs_user_initialization.f90 (code 1)

rtpa is not an argument passed in the function

subroutine cs_user_initialization &
( nvar , nscal , &
dt , rtp , propce , propfa , propfb )
Yvan Fournier wrote:Hello,

Did you try setting rtpa anyways ? Did the compiler complain, or the code overwrite rtpa with rtp ?

I am not the "time scheme" specialist for Code_Saturne, so I'll let colleagues pick up from here... I'll remind them to take a look at your post early next week.

Regards,

Yvan
Post Reply