# Unsteady solver in OpenFOAM: problems with using buoyantPimpleFoam for validation

 Register Blogs Members List Search Today's Posts Mark Forums Read

 March 9, 2016, 09:28 Unsteady solver in OpenFOAM: problems with using buoyantPimpleFoam for validation #1 New Member   MUKUL Join Date: Mar 2016 Posts: 4 Rep Power: 9 Hello every one. I am new to openfoam and need your help. I am trying to validate a simple unsteady natural convection problem in a tall cavity aspectratio (1:8) at Rayleigh number 3.4e5 and prandtl number 0.71. iI am using buoyantPimpleFoam for this case. My problem is that the temperature probe at a particular location (0.181,7.370) shows a constant line with time where as in the literature it shows fluctuations with time. I tryed using ddtSchemes as Euler and CrankNickolson. Can any one suggest where i may be wrong. Thanks

 March 11, 2016, 18:23 #2 Member   Thomas Boucheres Join Date: May 2013 Posts: 41 Rep Power: 11 Hello, you should post an attachment of your test case if you want some help I think. The 0, constant,system you have used (since allowable size is very limited here, if your mesh came from blockMesh, don't attach constant/polyMesh)

March 13, 2016, 09:52
Test case attached
#3
New Member

MUKUL
Join Date: Mar 2016
Posts: 4
Rep Power: 9
hello thomas,
I am attaching the test case. The problem is a unsteady natural convection in a tall cavity A/R=1:8. Rayleigh number is 3.4E5 Prandtl number 0.71.
I have taken air as fluid at initial temperature 300 K. temperature difference coefficient i.e (Thot-Tcold)/(2.0*Tmean)=0.001 which corresponds to Boussinesq convection. The hot and cold wall temperatures are (Tmean*(1.0+0.001)) =300.3 and (Tmean*(1.0-0.001))=299.7. Viscocity of air is taken as 2.13E-5 at mean temperature 300K and density 1.17. Based on Rayleigh number widh of cavity is W=0.2m and height 1.6m. A temperature probe is set at location ( 0.1810*W, 7.3700*W ) i.e(0.0632, 1.474).

I have also attached the paper which i want to validate the problem is that the NonDimensional temperature (T-Tmean)/(Thot-Tcold) shows a constant variation with time around (0.26) which matches with the literature but there are no fluctuations. Thanks
Attached Files
 TestCase.zip (156.3 KB, 29 views)

March 13, 2016, 12:48
#4
Member

Thomas Boucheres
Join Date: May 2013
Posts: 41
Rep Power: 11
Hello,

it is an interesting benchmark. I think someone in the world has already do it on OF but since this people is not here () it is good job that you try by yourself.

Since I'm also interested by this benchmark, I will try to help you. Nevertheless I am quite busy so I cannot spend many many time on it. So, the hard job is still to be done by yourself!!

Ok, if you are agree we work together on this benchmark, and since I haven't read seriously the reference paper, I have some questions before starting:

1- in the paper, the reference meshes are about 20x100, 40x200 and 80x400. In your case, you use a 160x80 one. It is far from being well for this case I guess. So why are you using such a mesh? Also, in the paper, they suggest the use of a graded mesh (following reference [3]). Have you read this reference and why don't you use a graded mesh?

2- you are using a laminar case so all the k-epsilon are useless in your settings. Ok?

3- are you sure that the case you are running is at Ra=3.4e5? I haven't use the thermo library for a long time and I don't remember how the standard perfectGas you are using compute the dilation coefficient? Have you checked this thing?

4- from the reference paper, what is the estimate you take for the time period? I found something around 10s. Is it good for you?

5- there are many other interesting quantities to bench throughout the case. Have you begin to build the necessary postProcessing tools for these? If yes, can you send them to me please? If not, why?

6- as I have said, I am busy so I cannot work daily on this problem. I think that if we work together we could end the work at end of the week. Is it good for you?

7- why are you doing this study? Student? Professional job? Have you planned to write a report on it and let it to the OF community freely?

PS: attached is a time history of a first try. Obviously not good but at least it moves!
Attached Images
 theta_v1.png (4.3 KB, 38 views)

Last edited by thomasArk47; March 13, 2016 at 12:49. Reason: mistake

March 13, 2016, 13:20
#5
Member

Thomas Boucheres
Join Date: May 2013
Posts: 41
Rep Power: 11
Ok,

I have rerun the case with two important modifications:

1- first I use the solver buoyantBoussinesqPimpleFoam and not buoyantPimpleFoam.
The former is an incompressible solver with Boussinesq assumption. The second one is a compressible one. The goal of the benchmark is to test the Boussinesq model, not the compressible one if I have read well the paper. So it is the buoyantBoussinesqPimpleFoam we must use I think. Note that it is a very interesting job to test also the compressible one but I think it is beyond the scope of the benchmark.

2- I use the required mesh 21x101.

Now the results are the expected ones as you can see on the attached picture.

Ok, the job is not finish / it just begins I am afraid

Now, we must:

1- define all postProcessing tools for having all datas required by the paper

2- compare different numerical settings: meshes and numerical solvers. It is the core of the benchmark I think.

Can you work on the first topic and send me files please?
Attached Images
 theta_v2.png (4.6 KB, 29 views)

 March 14, 2016, 03:09 BuoyantBoussinesqpimpleFoam #6 New Member   MUKUL Join Date: Mar 2016 Posts: 4 Rep Power: 9 Thomas thank you for your time. Can you please send me your case file. i tried running the same problem as per your suggestions using buoyantBoussinesqPimpleFoam for a 21 X 101 mesh and i am not able to get fluctuations at point 1 as you do. Reading your case file i may be able to figure out the mistake. Actually i did try using BoussinesqpimpleFoam solver earlier but failed to get correct answer. I am a student and i want to solve large temperature difference Thermo-buoyant flows with Radiation effects, As boussinesq approximation wont hold true at large temperature difference i coded my own LowMach solver. I wanted to check my results with a compressible solver using OpenFoam. As i dont have any expertise in using OpenFoam i tried to learn it by validating a very simple case with which i am stuck. Your case file will be helpful in learning the Boussinesq solver and may be it will give some idea regarding the compressible solver. Thanks and regards Mukul

March 14, 2016, 06:07
#7
Member

Thomas Boucheres
Join Date: May 2013
Posts: 41
Rep Power: 11
Hello,

here is the case test.

As i have said it is an interesting subject so if you can post sometimes about the advances of your study it will be great for many people.

Thanks.
Attached Files
 case1.tar.gz (8.0 KB, 23 views)

March 16, 2016, 14:44
#8
New Member

MUKUL
Join Date: Mar 2016
Posts: 4
Rep Power: 9
I have some doubts after working with your case file. i ran your case as it is and i got exactly the same results. After that i tried few changes like

1 You have used
Thermal expansion coefficient
beta beta [0 0 0 -1 0 0 0] 0.00542668088038937;
i think it should be around 3.3E-3 for air at 300K. Why beat =0.0054??. Results were very different for beta=3.3E-3

2. You have used adjustTimeStep yes;
The code works fast when you enable it, as it calculates DeltaT based on courant number. For this case DeltaT was around 0.16-0.27 where as when i used DeltaT 1.0E-3 with adjustTimeStep no, and i got different results. The Fig2 is output.

3. i tried to increase the nOuterCorrectors to 5 in PIMPLE for your case file and it gives a steady result. Fig3

I have tested few steady buoyantBoussinesqSimpleFoam naturalconvection in a differentially heated cavity problem (De Valh Davis) and few steady natural convection with radiation using a compressible buoyantPimpleFoam solver and the results were very close with literature. Do yo have any idea what might be wrong with solving unsteady problems using openFoam???
Attached Images
 Fig2.jpg (59.4 KB, 23 views) Fig3.jpg (50.8 KB, 21 views)

 March 16, 2016, 15:52 #9 Member   Thomas Boucheres Join Date: May 2013 Posts: 41 Rep Power: 11 Hello, nice to see that your work is on progress. 1- I think the good datas are the following: g = 9.81 W = 0.2 nu = 2.13e-5 Pr = 0.71 --> alpha = 3e-5 dT = 300.3 - 299.7 = 0.6 Ra = 3.4e5 = g.beta.dT.W^3/(nu.alpha) --> beta ~ 0.00461391437309 In my case, I have used nu=2.13e-5 in the transportProperties dictionary BUT to compute the beta parameter, I have used 2.31e-5 which leads to the 0.0054 value. Clearly a mistake. 2- It is a classical fact: using a time step well above or below 1 increases the numerical diffusion. So the oscillations are strongly damped. 3- It is normal: the nOuterCorrectors parameter is by definition meaningless for unsteady simulation. Taking it to a value > 1 put you "de facto" in a steady point of view (no temporal consistency).

March 17, 2016, 02:04
#10
Senior Member

Anton Kidess
Join Date: May 2009
Location: Germany
Posts: 1,377
Rep Power: 28
Quote:
 Originally Posted by thomasArk47 3- It is normal: the nOuterCorrectors parameter is by definition meaningless for unsteady simulation. Taking it to a value > 1 put you "de facto" in a steady point of view (no temporal consistency).
I disagree. You can even apply under-relaxation if you like (PIMPLE).
__________________
*Spend as much time formulating your questions as you expect people to spend on their answer.

 March 17, 2016, 03:20 #11 Member   Thomas Boucheres Join Date: May 2013 Posts: 41 Rep Power: 11 Hello, akidess, you have right. One can use the PIMPLE algorithm to emulate unsteady computations. For this to be interesting, clearly you need to use relaxation. But when doing this, one MUST use a final relaxation at 1 like here: PIMPLE { nNonOrthogonalCorrectors 0; nCorrectors 1; nOuterCorrectors 2; } relaxationFactors { fields { p 0.3; pFinal 1; } equations { "U|k|epsilon" 0.3; "(U|k|epsilon)Final" 1; } } Otherwise it is right that one DOESN'T have temporal consistency. Mukul, is it good/clear for you this stuff? Are your cases well done so? You can have a look at the blog of Tobi (a member of this site who has an external blog). He writes good tuto on these topics.

 March 17, 2016, 03:31 #12 Senior Member     Anton Kidess Join Date: May 2009 Location: Germany Posts: 1,377 Rep Power: 28 Thomas, I agree, and in newer versions of OpenFOAM this is done automatically: http://www.cfd-online.com/Forums/ope...tml#post443828 Without under-relaxation you can also run with outer iterations, just that it might not make sense in terms of computational efficiency. __________________ *On twitter @akidTwit *Spend as much time formulating your questions as you expect people to spend on their answer.

 March 17, 2016, 03:46 #13 Member   Thomas Boucheres Join Date: May 2013 Posts: 41 Rep Power: 11 Oh... thanks for the information I don't known it. I will check if in the versions i used it is the case. Mukul, check it also carefully for your case i think. Now, if the temporal consistency is indeed recovered by good implicit settings of the PIMPLE parameters, the strong damping of the osciallations you have seen can only by due to the point 2 of my previous post I think (increase of numerical diffusion on the |CFL-1| value). To check it, I think that a good thing is that you run your cases (PISO, PIMPLE(nOuterCorrectors=5)) with CFL=0.01, CFL=1 and CFL=100. If I don't tell too much "betises" (in French ), you should see a better fitting with the expected oscillations in the CFL=1 case. On the other hand, for the benckmark you are doing, this study of the accuracy of the results depending on the numerical settings is very interesting but I think that in order to be representative your case should be done in a similar framework that the studies of other autors. From memory -- but check it in the reference article -- they work indeed around CFL=1, which is natural since we are dealing with a case for which temporal accuracy is the key. and don't forget to post the progress of your job!!!

 Tags cfd - post, openfoam, openfoam 2.0.x, openfoam 2.1.0