CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Natural Convection Simulation - buoyantSimpleRadiation - Convergence Problem (https://www.cfd-online.com/Forums/openfoam/76698-natural-convection-simulation-buoyantsimpleradiation-convergence-problem.html)

msarkar June 2, 2010 01:57

Natural Convection Simulation - buoyantSimpleRadiation - Convergence Problem
 
Hello,

I am trying to simulate natural convection inside a square cavity with radiation effects using OpenFOAM-1.6.x. The simulation geometry is a simple 2D square, left and right side has constant temperature of 373 K and 323 K respectively and top and bottom are adiabatic. I am facing difficulty to get converged results. I have reduced the under relaxation factor and currently using 0.1 and 0.5 respectively for pressure and U but still not getting converged solutions. After 1,00,000 iterations, the final residual for Ux = 0.0032839, Uy = 0.003738 and for p = 0.008235. These residuals are not reducing more than that and the results (velocity distribution inside cavity) does not look reasonable.

Anyone has any suggestions to tackle this problem? Any help would be very much appreciated.

Thanks and Regards
M. Sarkar

AlanR June 3, 2010 00:08

I have had similar problems with simpleFoam. If the mesh cells are too small in zones with flow separation, those regions don't converge. Without changing the geometry, make a very coarse mesh (large cells) and see if that converges. If it does, then gradually refine the mesh. When you get to a cell size that starts to have convergence problems, you have found the resolution limit of the solution. Good luck,

Alan

msarkar June 3, 2010 06:29

Thank you Alan for your reply. I tried with coarse mesh as you suggested but it did not solve my problem. In my simulation the domain is 1m x 1m and the coarsest mesh I tried 50 x 50 i.e the element size is 0.02 m (2 cm). Do you think that is enough coarse mesh to resolve this issue? give me some idea how coarse I should use. I was wondering if I use coarser mesh than this then the Y+ value may be in buffer region. Could you please tell me how to check Y+ value in OenFOAM and what is suggested range of it?

I do not know the reason but I got good converged results with same set up and same mesh (100 x 100 with mesh gradation towards wall) with buoyantSimpleFoam solver. However I did not get any good results with buoyantSimpleRadiationFoam solver for same case. I think only change between these two solvers is the radiation part inclusion. I am wondering it is making big difference in convergence and results? If anybody has any clue, please help me.

Thanks!

fgal June 3, 2010 09:56

Hi msarkar,
I have very similar problems to you but with fireFoam, which is a Large eddy simulation fire solver. The flow is also driven by buoyancy.
I noticed different things. First, yes the cells sizes have a big influence, and it is not easy to setup. a too coarse mesh does not necessary leads to an easier convergence because the turbulence/sgs model must be used in its validity domain.
The numerical schemes have also a big influence, and the error message when the code stops and the analysis of the solution given by the solver at that instant can give you clues on what to modify.

Are you using a steady state solver ? if yes, are you sure that it makes sense to look for a steady solution to your problem ? Because natural convection can lead to "hot air bubbles" detachment form the ground in different places depending on the time, which is completely unsteady.

If you have any idea to share on these subjects, I would appreciate them !
Cheers,

Francois

AlanR June 4, 2010 00:52

I think the mesh you tried should be coarse enough. I have not worked with the solvers you are using. You can search the forum for people with similar problems, or on the solver name for ideas. There's a yplus utility that will give yplus values for your mesh. I haven't used it, but it's widely used and often discussed in the forum.

Good luck, sorry I can't offer more help.

Alan

msarkar June 7, 2010 00:08

Quote:

Originally Posted by AlanR (Post 261620)
I think the mesh you tried should be coarse enough. I have not worked with the solvers you are using. You can search the forum for people with similar problems, or on the solver name for ideas. There's a yplus utility that will give yplus values for your mesh. I haven't used it, but it's widely used and often discussed in the forum.

Good luck, sorry I can't offer more help.

Alan

Hello Alan,

Still I did not get converge results and I did not get any discussions for this particular solver I am using. However, thanks a lot for your reply regarding yplus value. I found yplus utility and used it. You mentioned that you had similar convergence problem with SimpleFoam solver, your problem is solved? Are you using OpenFOAM-1.6.x or other version of OF?

Regards
M Sarkar

msarkar June 7, 2010 00:26

Quote:

Originally Posted by fgal (Post 261548)
Hi msarkar,
I have very similar problems to you but with fireFoam, which is a Large eddy simulation fire solver. The flow is also driven by buoyancy.
I noticed different things. First, yes the cells sizes have a big influence, and it is not easy to setup. a too coarse mesh does not necessary leads to an easier convergence because the turbulence/sgs model must be used in its validity domain.
The numerical schemes have also a big influence, and the error message when the code stops and the analysis of the solution given by the solver at that instant can give you clues on what to modify.

Are you using a steady state solver ? if yes, are you sure that it makes sense to look for a steady solution to your problem ? Because natural convection can lead to "hot air bubbles" detachment form the ground in different places depending on the time, which is completely unsteady.

If you have any idea to share on these subjects, I would appreciate them !
Cheers,

Francois

Hello Francois,

In my case it is not giving any error message, it is running fine but not converging. The final residuals are greater than 10e-2 for pressure and velocities and the results (velocity field) does not look reasonable to me. I did not get any clues yet how to solve this problem and still I am trying some tricks. If you have suggestions, please let me know. Your problem is already solved with fireFOAM? Are you using OF-1.6.x or any other version?
Yes, I am using steady state solver. I think this is appropriate for this case. This problem is natural convection inside a closed cavity with radiation. So, essentially it will reach steady state. I simulated same case using OF-1.5 previously using same solver (buoyantSimpleRadiationFOAM) and I got good results. I do not know the exact reason but I am facing problem with OF-1.6.x version to get good results. I tried the same case using buoyantSimpleFOAM (i.e. with out radiation) that is also giving reasonable results. I am thinking there may be problem with inclusion of radiation but I am not sure what problem is there. Anyway, if you have any comments/suggestions, please let me know.

Thanks and Regards
M Sarkar

AlanR June 7, 2010 01:11

M Sarkar,
I solved my convergence problems by adjusting the mesh - I my case, increasing the cell size in blockMesh made the difference. I'm still trying to improve my mesh generation to refine cells exactly where I need them and not everywhere on the surface. I'm using OF 1.6.x.

Alan

msarkar June 7, 2010 01:22

Thank you Alan for your reply.

Regards
M. Sarkar

arjun June 7, 2010 04:44

Quote:

Originally Posted by msarkar (Post 261296)
Hello,

I am trying to simulate natural convection inside a square cavity with radiation effects using OpenFOAM-1.6.x. The simulation geometry is a simple 2D square, left and right side has constant temperature of 373 K and 323 K respectively and top and bottom are adiabatic. I am facing difficulty to get converged results. I have reduced the under relaxation factor and currently using 0.1 and 0.5 respectively for pressure and U but still not getting converged solutions. After 1,00,000 iterations, the final residual for Ux = 0.0032839, Uy = 0.003738 and for p = 0.008235. These residuals are not reducing more than that and the results (velocity distribution inside cavity) does not look reasonable.

Anyone has any suggestions to tackle this problem? Any help would be very much appreciated.

Thanks and Regards
M. Sarkar


first thing to do is switch off all second order schemes. Switch them on after some time with may be restart .

In the start i would switch off radiation too and try to get some velocity profile.

Plus natural convection simulations greatly benefit from fine meshes.


I remember one of my friend was working on natural convection problem and after 2 months of efforts he had nothing. Then he told me that he probably won't be able to finish his msc on time because of this.
Anyway i asked him to let me try. I checked his mesh was very coarse, we created new refined mesh and next day morning he had results he used to finish his project.

msarkar June 8, 2010 06:41

Quote:

Originally Posted by arjun (Post 261892)
first thing to do is switch off all second order schemes. Switch them on after some time with may be restart .

In the start i would switch off radiation too and try to get some velocity profile.

Plus natural convection simulations greatly benefit from fine meshes.


I remember one of my friend was working on natural convection problem and after 2 months of efforts he had nothing. Then he told me that he probably won't be able to finish his msc on time because of this.
Anyway i asked him to let me try. I checked his mesh was very coarse, we created new refined mesh and next day morning he had results he used to finish his project.

Hello Arjun,

Thank you for your reply. I tried various mesh sizes (50 x 50 to 200 x 200) with mesh gradation towards the wall. In my simulation, the coarsest mesh size is 0.02 m (2 cm) and the finest mesh is 0.0003125m (0.03125 cm) but did not get any converged/reasonable results yet. I am trying the tricks you suggested like initially turning off radiation/second order scheme terms with my finest mesh i.e. 200 x 200 with 1/16 mesh gradation towards wall. If I get any good results, I will let you know. If you think I need to make further finer mesh, please let me know.

However, you mentioned about your friend's problem and you resolved it. Did you use OpenFOAM-1.6.x or any other version? Which solver did you use, is it same as mine (buoyantSimpleRadiationFoam)? Actually, I simulated same cavity problem before using OpenFOAM-1.5 and got good results with mesh size: 100 x 100. I don't know what are the changes they made in this new version (OF-1.6.x), it is not converging and velocity field does not look reasonable. Still I am trying various tricks to resolve this issue. Any comments/suggestions would be very much appreciated.

Thanks
M. Sarkar

fgal June 8, 2010 07:10

Hi msarkar,

I also noticed that the grid size had a big influence on the results, but I could not give any advice, because as you I tried many configurations without obtaining good results. There is just the standard idea that the numerical precision of the schemes must be in accordance with the refinement of the mesh, and first order schemes are usually easier to make converge in RANS.

You said that you achieved these simulations with OF 1.5, you know that the formulation of the PISO solver has changed in 1.6 and the pd formulation has been abandoned. The pressure field must be really good because of the structure of the PISO loop otherwise the velocity will be degraded. Also the boundary conditions must be properly set up and I had problems with the hydrostatic pressure gradient, which drives the buoyancy. Are you sure that the boundary conditions that you set on the orthogonal walls to the gravity for the pressure field allow the hydrostatic gradient to be computed correctly ? Have you tried for example to swich off the buoyancy by setting all the walls temperatures to the same value and checked that your solver gives you a pressure field like p(z)=p0+rho*g*z ?

Then could you gives us a screenshot of the topology of your mesh ?

Good luck

Francois

msarkar June 9, 2010 00:12

5 Attachment(s)
Hello Francois,

Yes, I tried several mesh sizes. The screen shot of meshes are attached below. I tried the following meshes: (1) 50 x 50 (1/5 mesh gradation towards wall), (2) 60 x 60 (no mesh gradation), (3) 100 x100 (1/5 mesh gradation), (4) 200 x 200 (1/16 mesh gradation) and (5) 200 x 200 (1/5 mesh gradation that is not attached here). However none of the cases give me good results, somehow it is over predicting the velocity and velocity field does not seems to be correct.

I am sure about my temperature boundary condition but not very sure about pressure. I am attaching my pressure and temperature boundary condition files. If you think something is wrong there, please let me know. I just attached the temperature file to give an idea about temperature variation. In my simulation gravity is acting in -Y direction.

Currently I am checking the pressure field you suggested and I will update on that. any comments/suggestions would be very helpful.

Thanks and Regards
M. Sarkar

msarkar June 9, 2010 00:15

1 Attachment(s)
Hello Francois,

I could not attach temperature boundary condition with my previous reply, it is attached here.

arjun June 9, 2010 01:44

Quote:

Originally Posted by msarkar (Post 261296)
Hello,

I am trying to simulate natural convection inside a square cavity with radiation effects using OpenFOAM-1.6.x. The simulation geometry is a simple 2D square, left and right side has constant temperature of 373 K and 323 K respectively and top and bottom are adiabatic. I am facing difficulty to get converged results. I have reduced the under relaxation factor and currently using 0.1 and 0.5 respectively for pressure and U but still not getting converged solutions. After 1,00,000 iterations, the final residual for Ux = 0.0032839, Uy = 0.003738 and for p = 0.008235. These residuals are not reducing more than that and the results (velocity distribution inside cavity) does not look reasonable.

Anyone has any suggestions to tackle this problem? Any help would be very much appreciated.

Thanks and Regards
M. Sarkar



you forgot to mention the dimensions of your case and direction of gravity. If you mentioned it, i might have tried to run with another software and see how it works.

PS: My friend used Fluent 6.18 (i belive).

msarkar June 9, 2010 02:11

Hi Arjun,

Thanks a lot for your help. Dimension of of my simulation domain is 1m x 1m. Gravity is acting in -Y (negative Y) direction. I think I mentioned it in my previous post.
However, I also simulated the same problem using FLUENT previously and got reasonably good results with a mesh size of 120 x 120 with 1/5 mesh gradation towards the wall using standard K-Omega turbulence model. I had difficulty of getting converged results using standard K-Epsilon and Realizable K-Epsilon turbulence model. Using both K-E methods, the continuity residual was greater than 1 where as for K-Omega method the same residual was well below 10^-5. Anyway If you reproduce this simulation please share your findings.

Thanks and Regards
M. Sarkar

fgal June 9, 2010 05:56

Hello msarkar,
I also had problems like you when using buoyantPressure everywhere, in my slover there was a particular treatment when the case is "closed" in pressure. Could you try a fixedValue 100 000 of pressure at the bottom and a zeroGradient condition at the top ? That solved my problem.
Your mesh topology seems ok.
Do you use wall functions in the correct y+ area? If you have a convergence, it will be interresting to compute y+.
Good luck
francois

arjun June 9, 2010 07:09

@msarkar I am too busy at the moment trying to finalize some documents. But i can confirm you this one thing. I did try one set up as you mentioned that is 1m x 1m square 2D mesh. With temperature as you mentioned, plus k-epsilon model on. Without radiation and beta = 2.1E-4, density = 1.225.

In my 20 iterations run on Fluent there was no convergence issues, no warnings. After 20 iterations continuity , k, epsilon were already in 1E-3 in terms of residuals.

msarkar June 9, 2010 07:10

2 Attachment(s)
Hello Francois,

I tried to switch off the buoyancy by setteing all the walls temperatures to the same value and checked the pressure field. It does not seems to be correct. The pressure field is attached below (P.png).
I was expecting the pressure field should look like the attachment P2.png that one I got using other solver (buyantSimpleFoam). I am thinking there may be some bug with pressure calculation. Anyway I am trying the pressure boundary conditions you suggested fixedValue at bottom and zeroGradient at the top. I will update on it.

Thanks and Regards
Mita

Have you tried for example to swich off the buoyancy by setting all the walls temperatures to the same value and checked that your solver gives you a pressure field like p(z)=p0+rho*g*z ?

msarkar June 9, 2010 07:17

1 Attachment(s)
Quote:

Originally Posted by msarkar (Post 262265)
Hello Francois,

I tried to switch off the buoyancy by setteing all the walls temperatures to the same value and checked the pressure field. It does not seems to be correct. The pressure field is attached below (P.png).
I was expecting the pressure field should look like the attachment P2.png that one I got using other solver (buyantSimpleFoam). I am thinking there may be some bug with pressure calculation. Anyway I am trying the pressure boundary conditions you suggested fixedValue at bottom and zeroGradient at the top. I will update on it.

Thanks and Regards
Mita

Have you tried for example to swich off the buoyancy by setting all the walls temperatures to the same value and checked that your solver gives you a pressure field like p(z)=p0+rho*g*z ?

Hi Francois,
wrongly I attached the same pressure diagram twice but did not attach the one I wanted to show you. The pressure diagram is attached here, that one I got from buoyantSimpleRadiationFoam solver which on which I am interested. This pressure field does not seems to be correct. The above attached pressure field was expected to me but I did not get it using this solver.

fgal June 9, 2010 07:24

Ok, that is what I thought.
Could you try to put fixedValue 100 000 at the bottom and zeroGradient at the top for the pressure boundary conditions ?
The pressure is the motor of the flow with the buoyancy effect, as long as it is incorrect, the computation will not converge.
Francois.

msarkar June 10, 2010 01:55

2 Attachment(s)
Hello Francois,

I tried that fixedValue 100 000 at bottom and zeroGradient at top but it did not give me any good results. The pressure and velocity fields are unrealistic. Pressure and velocity fields are attached below. I am trying some other pressure boundary conditions. If you have any other suggestions, please let me know.

Thanks and Regards
M. Sarkar

fgal June 10, 2010 04:51

Hello,
Could you please rescale the pressure field between 100 000 and 100 010 ? I have the impression that now the hydrostatic gradient is correct. You have something weird at the angle but that could come from something else. Could you share all your boundary, system and constant files ?

Cheers,

François

msarkar June 10, 2010 06:21

3 Attachment(s)
Hi,

Yes I can rescale the pressure field but there is a glitch in the corner and I guess because of that it is not predicting velocity and temperature fields correctly. Anyway I will rescale it and post it later. I am attaching the 0, constant and system files as you requested. If I am wrong anywhere, please let me know.

Thanks
M. Sarkar

arjun June 10, 2010 08:11

Okay , i decided to add bouss. method to inavier just to see how your problem works.

Here are some plots after running with iNavier
den = 1.225
Tref = 288
beta = 2.1E-4
visc = 1.789E-5

Temperature

http://farm5.static.flickr.com/4027/...24b023bcc0.jpg

Pressure

http://farm5.static.flickr.com/4015/...8951115999.jpg

y vel

http://farm5.static.flickr.com/4062/...a21a3416d8.jpg


I believe these results look alright because something similar i got from Fluent too.


Please note that this is very first thing i ran with iNavier in name of bouss. model. So iNavier is not tested.


About convergence, i noticed that normalised residual is not good idea in this case to judge about convergence because normalised residual work by deviding maximum error found in first 5 or 10 iterations. But in this case velocity field is zero in the start and there is no flow in or out. So initial abs residual is very low. Which increases with iterations and then fall down.

msarkar June 15, 2010 05:18

Hi Arjun,

I did not see any result files here. Could you please upload your results? Did you use OpenFOAM-1.6.x for this simulation? I am sorry, I did not understand what is that iNavier you mentioned? If you use OF-1.6.x, which solver did you use, buoyantSimpleRadiatioFoam or something else?

arjun June 15, 2010 09:36

Quote:

Originally Posted by msarkar (Post 263042)
Hi Arjun,

I did not see any result files here. Could you please upload your results? Did you use OpenFOAM-1.6.x for this simulation? I am sorry, I did not understand what is that iNavier you mentioned? If you use OF-1.6.x, which solver did you use, buoyantSimpleRadiatioFoam or something else?


i uploaded it on flickr and probably that is not visible to you. Coudl you give me your email i will mail you tecplot file.

msarkar June 16, 2010 02:08

Quote:

Originally Posted by arjun (Post 263097)
i uploaded it on flickr and probably that is not visible to you. Coudl you give me your email i will mail you tecplot file.

Hi Arjun,

My email id is below, please send me the files. If it is possible, send me the files in .jpg or .png format. I do not have Techplot. Can I open the files you mentioned using paraview? You did not mention anything about the tool you used to simulate this problem. I guess you used OF-1.6.x.



arjun June 16, 2010 05:19

Quote:

Originally Posted by msarkar (Post 263168)
Hi Arjun,

My email id is below, please send me the files. If it is possible, send me the files in .jpg or .png format. I do not have Techplot. Can I open the files you mentioned using paraview? You did not mention anything about the tool you used to simulate this problem. I guess you used OF-1.6.x.

email: mita.sarkar@airbus.com


i will email, it is on my other computer so might take a while.

About tecplot, there is one beautiful tool people do not use:

https://wci.llnl.gov/codes/visit/home.html

download it for tecplot Files.

I could send you paraview based files too but i export ensight gold format and somehow paraview goofs up when dealing with 2D data. In three D things seems to be alright.

About tool i used (iNavier), it is just a small code i wrote this reads mesh files in fluent format and runs segreggated SIMPLE algorithm.

I am working on releasing next version but still busy doing documentations etc etc. So still not in public domain. I will email you exe though, you could play with it.

arjun June 16, 2010 06:12

i sent email , read the doc, please understand that solver is still under testing.

msarkar June 16, 2010 06:21

Quote:

Originally Posted by arjun (Post 263206)
i sent email , read the doc, please understand that solver is still under testing.

Hi Arjun,

Sorry to request you again. Please send me the files in my other email id. I did not receive your email. My company email system quarantined it as it contained an attachment which is against the company policy.

email: mita.sarkar@gmail.com

So you did not use OpenFOAM but anyway I can look at your results.

arjun June 16, 2010 06:23

Quote:

Originally Posted by msarkar (Post 263210)
Hi Arjun,

I am sorry to request you again. Please send me the files in my other email id. I did not receive your email. My company email system quarantined it as it contained an attachment which is against the company policy.

email: mita.sarkar@gmail.com


do you have anything other than gmail because my attachment contains exe and gmail does not allow it.

This is why i do not use gmail.

fgal June 16, 2010 06:27

Hello,

I used second order schemes (Gauss linear for all div terms) and used 100x100 cells in your blocks instead of 50x50, used the same boundary conditions and get rid of that pressure problem. The results are still not ok because of the Epsilon equation but there is still some work to do. I keep you aware.

Francois
Francois


All times are GMT -4. The time now is 08:32.