Page 1 of 2
Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Tue Nov 01, 2016 4:29 pm
by kennethchaw
Dear all,
I am trying out the tutorial 3 that written based on version 3.0, but I am using version 4.0.5 on windows. May I know how should I call the use of "cs_user_physical_properties" in the GUI after I selected the "variable" choice for density ???
Thanks!
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Tue Nov 01, 2016 10:15 pm
by Luciano Garelli
Hello
In CS 4.0.5 you can use the Mathematical Expression Editor for a variable density
)
and write the Boussinesq Model with the correspondig thermal expansion coefficient of the fluid that you want to simulate.
The following is an example:
Code: Select all
#air expansion coefficient (1/K)
b=0.00343;
#Ref temperature
tref=300;
# Density of air
density = rho0*(1-b*(temperature-tref));
I hope you find it useful.
Regards,
Luciano
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Thu Nov 03, 2016 9:15 am
by kennethchaw
Hey,
Thanks for your help,
I have tried, but wonder why my solution not converging ?
Anything else i did wrongly ?? I attached the study zip file.
Pls help~ thanks much.
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Thu Nov 03, 2016 1:20 pm
by Luciano Garelli
Hello,
I was checking you case and the problem it is with the value of the air expasion coeff that you compute. With the data that you defined you get a

, so something in your formula is wrong. If you set

the flow start moving. Also, if you look at the listing file all the velocities were zero,
Another improvement to do is with the mesh, you have 80 cells in the "z" axis and you need only one, so you will reduce the size of your mesh and your problem will run faster.
Regards,
Luciano
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Thu Nov 03, 2016 2:59 pm
by kennethchaw
Hi,
Thanks for your help,
I have corrected the value of beta. But the flow only starts when I use tref=300 as you recommended early. I cannot understand why have to start with 300 K ?
Also, for convergence checking, am I only looking for the magnitudes of Norm_residual ?
Thanks much!
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Thu Nov 03, 2016 4:01 pm
by Luciano Garelli
Hello,
You need a temperature reference state for the Boussinesq approximation. The tutorial mention that "The reference state is taken at the cold wall temperature", so the Tref sould be 293.15K.
For convergence checking as mentioned in the tutorial you can " Verify that the residuals listed under ‘derive’ in the ‘Information on Convergence’ table have dropped several order of magnitudes for all the
solved variables (pressure, velocity, temperature),", additionally you can add probes in your domain to check if the variable has reach a steady state condition.
Regards,
Luciano
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Thu Nov 03, 2016 5:38 pm
by kennethchaw
Hi,
Ok got it! Thanks a lot!
By the way, mind telling how the tutorial come to a CFL number of 8? I have searched the forum, but seems non really stating the formula to get this number ?
Thanks again!
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Thu Nov 03, 2016 5:55 pm
by Luciano Garelli
Hello,
CFL -> Courant–Friedrichs–Lewy (CFL) condition.
https://en.wikipedia.org/wiki/Courant%E ... _condition
Regards,
Luciano
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Tue Nov 08, 2016 11:36 am
by kennethchaw
Hi,
Anyway, I got this
when I view the velocity in ParaView. Is this acceptable ?
Thanks
Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0
Posted: Wed Nov 09, 2016 4:45 am
by Luciano Garelli
Hello,
Are you following the tutorial? The expected results are shown at the end of the pdf.
Could you post the listing file.
Regards,
Luciano