Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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!
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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.
Attachments
HSC.rar
This is the study file
(3.65 MiB) Downloaded 279 times
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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!
Attachments
HSC.rar
The latest study
(2.19 MiB) Downloaded 282 times
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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!
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post by Luciano Garelli »

Hello,

CFL -> Courant–Friedrichs–Lewy (CFL) condition.

https://en.wikipedia.org/wiki/Courant%E ... _condition

Regards,

Luciano
kennethchaw
Posts: 36
Joined: Sat Oct 01, 2016 6:31 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post by kennethchaw »

Hi,

Anyway, I got this
1.png
when I view the velocity in ParaView. Is this acceptable ?

Thanks
Luciano Garelli
Posts: 284
Joined: Fri Dec 04, 2015 1:42 pm

Re: Heated square cavity flow Tutorial 3 in Code Saturne 4.0

Post 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
Post Reply