Convergence Problem to Simulate Natural Convection (Buoyancy Driven Flow) Simulation

Hello,

I am trying to simulate natural convection inside a cavity (buoyancy
driven flow) with radiation effect. The solution is not converging.
Could anyone please let me know how to look at the residuals during
calculations? I am simulating this problem using steady state
algorithm. I guess if I reduce the relaxation coefficient, it will help
to converge. If that is the case, what value of relaxation coefficient
would be optimum?
I tried to simulate the same problem using standard algorithm, i.e.
unsteady algorithm with a constant and uniform time-step but it did not
help, this is also diverging. Any tricks to tackle this problem? Any
help would be very much appreciated.

Thanks
Mita

Hi,
could you attach your settings file? Do you have user sources?
My first advise is to use a unsteady algorithm and particularly “variable time step, constant in space”. Then, for buoyancy driven flow, you have to be very careful with the time step: in the GUI, in the Time Step heading, I advise you to check the button “control of the thermal time step” (I don’t remember the exact label, but the keyword is IPTLRO). This button is enable if you use an unsteady algorithm, you have a thermal scalar, and gravity is not null.

Hello Jean,

My case file is attached here. I have usphyv subroutine to define density variation law. Following your suggestion, I use unsteady algorithm and particularly use time step option as “variable in time and uniform in space” and I also checckk the button “time step limitation with the local thermal time step” but the solution did not converge. I have attached the listing file for two cases: (1) unsteady algorithm with a constant and uniform time step which diverge the solution and (2) unsteady algorithm with time step option as “variable in time and uniform in space”.
05201440.tar.gz (40.9 KB)

Hi Mita,
I’d like to reproduced your computation. Do you think, you could attached your mesh too? If it is too big, could you described it or upload it in an external site for file sharing like sendspace for example?

Hello Alexandre,

The mesh file is attached here. Please let me know if you get any better solution.

Thanks

Mita
2dcavity1.msh.gz (191 KB)

Hello Alexandre,

Is there any updates on this convergence issue. I could not resolve this yet and waiting for your response.

Thanks

Mita

Hi Mita,

I think that the trouble with your convergence is due to the mesh: you use a full tetrahedron mesh, and for a 2D computation it is not appropriate. In the thickness of the mesh you should have a single prism or hexahedron.

In the attached file, you will find a example of a mesh made of hexahedrons, with a parameters file. This set up fails with your mesh 2dcavity1.msh , but works with the attached one (but I try quickly :slight_smile: ).

More generally, here are some tips for buoyancy driven flow:

  • density: check the validity of the law for the density and check the variation of the density in the listing, particularly at the initialization step
  • time step: use the unsteady algorithm “variable in time and uniform in space” with the option “Time step limitation with local thermal time step” (see user guide for more explanations, keyword IPTLRO)
  • turbulence modeling: check the Grashof number of the situation. For a vertical plate, the flow transitions to turbulent around a Grashof number between 10 8 and 10 9 . The v2f could be useful for cases around these critical values. For a well established turbulence, I prefer to use a RSM.
  • thermal radiation transfer modeling: do a first set up without radiative transfer. Then iff the computation works, add to the set up the radiative transfer. It is more easy to avoid mistake like this.
    buoyancy-tar.bz2 (43.5 KB)

Hello Alexandre,

Thanks a lot for your help! I downloaded the attached file but I could not run it on my machine, it is giving me error at pre-processing stage. Somehow Saturne could not support MED format which is unusual. I could not figure out why it can not support it. The listpre file is attached here. Could you tell me what is wrong with my version of Saturne (Code_Saturne-2.0-rc1), why it can not support MED format? Another thing I noticed on the attached case file, you simulated as constant density but in buoyancy driven flow, density is not constant. If I use density as constant, it is running fine with my mesh file itself. Did you try your mesh file (cavity_hex_2d.med) with variable density and turbulence model also? i think I am facing problem to simulate variable density. I will try to make hex mesh as you suggested and try to run it though I don’t understand why it is not running with tet mesh!

Once again thank you!

Mita
listpre-06011546.txt (626 Bytes)

Hello,

It would seem that you did not configure/compile Code_Saturne with MED file support (which is optional). This may be due either to not defining the correct “–with-med=<med_prefix_path>” configure options for the Preprocessor and the FVM library, giving a wrong path, or not having MED or its developpement header files installed on your machine.

You probably need to reinstall Code_Saturne with MED support. Depending on the architecture you are running on, MED may be available through your package manager (Debian, Ubuntu for example), or you may need to download it at: http://files.opencascade.com/Salome/Salome5.1.3/med-fichier_2.3.6.tar.gz (it also requires HDF5, available at: http://www.hdfgroup.org).

Best regards,

Hello Mita,

the attached mesh is an example. If you could not use the med format, just redo a convenient mesh with gmsh, or add the support of the med library as said by Yvan. Nevertheless, I confirm that I use a variable density with the formula rho = 1.293 * (273.15 / TempK) so I have simulated a buoyancy driven flow. With your mesh, if you use a constant density, no flow occurs (velocity is null) that why the computation does not crash.

I do not use a turbulence model, because in my little test, the flow is not turbulent.

I converted the mesh to the unv format. You just have to change the mesh name to cavity_hex_2d.unv in the GUI. :slight_smile:
cavity_hex_2d-unv.bz2 (39.3 KB)

Hi Alexandre,

Thanks a lot for your continuous help. This time also Saturne gave me error in preprocessing stage (to read .unv file attached by you). When I check the mesh it gives me error. The error message is attached here. Please let me know why it is giving this error.

I am using gmsh to create geometry and mesh and I am not able to create pure hex mesh. If you know how to make pure hex mesh using gmsh, please let me know. I was wondering why the solution is not converging for tet mesh but converging for hex mesh (you mentioned it is converging for your hex mesh), is that a limitation of Saturne?

Thanks and Regards

Mita
error-msg2.txt (1.47 KB)

Hello,

I just tested Alexandre’s mesh using our build of Code_Saturne 2.0-rc1, and I do not reproduce your crash (running on an intel Xeon E5504, Linux2.6.31 kernel, glibc 2.3.6, gcc 4.2.1 used for the Preprocessor compilation).

Could you check if the file was correpted on download ?

“md5sum cavity_hex_2d.unv” should return a1d9221e3200698729ec80d9ed90d8eb

Otherwise, you may use addr2line -e cs_preprocess (with adress values taken from hte call stack in the error message you posted) to help where the crash occurs.

Best regards,

Yvan Fournier

Hello,

Have you downloaded the mesh from Windows? In this case, you could have some “spurious” characters at the end of each line. We should have handled this issue for long, but well… maybe the bug reappeared :wink:

If this is the case, try to run dos2unix in order to get rid of these Windows characters (I don’t remember how to install this tool…).

David

Hi David,

I did not download the file from Windows. I downloaded the file on my Linux machine, extracted and used it and it is giving the error that I posted. If you have any suggestions for this, please let me know.

Thanks and Regards

Mita

Please, could you return the results of the command md5sum cavity_hex_2d.unv?

Do you try addr2line?

Could you with GMSH build a real 2D mesh of triangles and then extrude it with a single element in the thickness in order to have a mesh made of prism?

Hi Alexandre,

There might be some problem while I am trying the command md5sum cavity_hex_2d.unv. Is there any particular location from where I should run this command or I can run it from my study directory? When I run this command, it says “md5sum: cavity_hex_2d.unv: No such file or directory”. So, I do not have any results of this command.

I tried ‘addr2line’ also and it says “bash: syntax error near unexpected token `newline’”.

No, I did not create any 2D mesh and extrude it. Instead I created 6 surfaces, one volume and set the target element size. In that way I made sure that in ‘Z’ direction, there is only one element. If I use extrude surface, I faced difficulty to define my boundaries. Anyway I will try it again by extruding the 2D surface as you suggested. If you have any other suggestions, please let me know.

Thanks

Mita

Hello,

to run md5sum on your mesh file (to check for damage to the file), just run it in the directory where the file resides, passing the file name as an argument.

Regards,

Yvan

Hi Yvan,

I ran md5sum on my mesh file and it returns a1d9221e3200698729ec80d9ed90d8eb cavity_hex_2d.unv. What does it mean? Is that mesh file corrupted?

Thanks and Regards

Mita
trial-mesh-error.txt (1.66 KB)

Hello,

You obtain the same result as we do ith md5sum, so your file does not seem corrupted, which means the issue is with the Code_Saturne preprocessor.

As we are unable to reproduce this issue on our side, it may be due to a compiler or library issue. What hardware and software (OS version, compiler versions, …) are you running on ?

Regards,

Yvan