CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Natural Convection - cavity - problem

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

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 26, 2020, 13:31
Default Natural Convection - cavity - problem
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Hello,

I have a problem in a simulation of natural convection and would like help/opinion.

Below I attached one graph of the comparison between the temperature results of the 2D mesh (the green color line = kOmegaSST; red line = kOmega) with DNS data (the black color line).
*I also uploaded a probe that I used to monitor convergence of T and simulation residuals (kOmegaSST).

I refined the mesh, secured y+ at the top, bottom and walls of the cavity. However the curves are distant from the DNS curves, could this be due to mesh refining (vertical refining?!)?
*The mesh is simple and was made in blockMesh with 1x64x360 divisions.
**The mesh made by the 3D DNS study has the following divisions: 64x138x326 (see the geometry attachment below).

...and out of curiosity I am also adding my fvSchemes and fvSolution file below.

fvSchemes:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default          steadyState;
}

gradSchemes
{
    default          Gauss linear;
}

divSchemes
{
    default          none;
    
    div(phi,U)       Gauss linearUpwindV grad(U);
    div(phi,T)       Gauss linearUpwind default;
    div(phi,k)       Gauss linearUpwind default;
    div(phi,omega)   Gauss linearUpwind default;
    
    div((nuEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default          Gauss linear orthogonal;
}

interpolationSchemes
{
    default          linear;
}

snGradSchemes
{
    default          orthogonal;
}

wallDist
{
    method 	     meshWave;
}
fvSolution:
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p_rgh
    {
        solver 		GAMG;
        smoother	GaussSeidel;
	tolerance 	1e-8;
	relTol 		0.0;
    }

    U
    {
        type coupled;
        solver 		PBiCCCG;
        preconditioner  DILU;
        tolerance 	(1e-6 1e-6 1e-6);
	relTol 		(0.0 0.0 0.0);
	nPreSweeps      0;
    }
    
    "(T|k|omega)"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-6;
        relTol          0;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue       0;

    residualControl
    {

    }
}

relaxationFactors
{
    fields
    {
        p_rgh           0.7;
    }
    equations
    {
        U               0.3;
        T               0.7;
        k               0.7;
        omega           0.7;
    }
}
What could be happening?

*OpenFOAM 5.0 - steadyState - buoyantBoussinesqSimpleFoam - kOmegaSST
Attached Images
File Type: png residual.png (112.1 KB, 76 views)
File Type: png convergT.png (41.5 KB, 64 views)
File Type: jpeg GEOMETRY.jpeg (80.6 KB, 83 views)
File Type: jpg cavity_T_2D.jpg (35.0 KB, 43 views)
File Type: png c.png (23.5 KB, 55 views)
saidc. likes this.

Last edited by gu1; August 3, 2020 at 10:27.
gu1 is offline   Reply With Quote

Old   August 3, 2020, 10:31
Default
  #2
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Anyone can help me?
gu1 is offline   Reply With Quote

Old   August 3, 2020, 12:00
Default
  #3
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Hi !

What is the delta T°C between the two walls ?
Do you know the rayleigh number of the flow ?

If there are too high, it is not advised to use the boussinesq approximation but rather to predict the flow as a compressible one, for instance you can use the solver buoyantSimpleFoam (compressible & steady).

I think the mesh is relatively fine. Are you using low or high Reynolds wall models ?

Regarding the numerical schemes, I don't know why but I had on a similar case (closed cavity) a better convergence and thus a better prediction of the temperature with bounded first order schemes (div schemes for U, k, T, omega : bounded Gauss upwind)

Cheers.
gu1 likes this.
john myce is offline   Reply With Quote

Old   August 3, 2020, 12:21
Default
  #4
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Hi John,

Thank you very much for your answer and I am happy to see that you have already had experience with this type of simulation.

Quote:
Originally Posted by john myce View Post
What is the delta T°C between the two walls ?
Do you know the rayleigh number of the flow ?
deltaT = 0.5 (hot_wall = 1; cold_wall = 0)
Ra = 10^10

I followed the recommendations of the article I'm referring to:
Quote:
"...an incompressible Newtonian viscous fluid of kinematic viscosity ν and thermal diffusivity α. To account for the density variations, the Boussinesq approximation is used. Thermal radiation is neglected."
For that reason I am using such a solver. Article link.

Quote:
Originally Posted by john myce View Post
I think the mesh is relatively fine. Are you using low or high Reynolds wall models ?
For k and omega variables I used the fixedValue BC (1e-15) because y+ is less than 1.

The other variables I used the BC on the wall:
U = noSlip;
T = fixedValue (1 and 0);
p_rgh = fixedFluxPressure;
p and nut = calculated;
alphat = alphatJayatillekeWallFunction;

...for kOmegaSST.

Quote:
Originally Posted by john myce View Post

Regarding the numerical schemes, I don't know why but I had on a similar case (closed cavity) a better convergence and thus a better prediction of the temperature with bounded first order schemes (div schemes for U, k, T, omega : bounded Gauss upwind)
I will try and give you feedback. Thanks.
gu1 is offline   Reply With Quote

Old   August 3, 2020, 13:15
Default
  #5
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
As promised,

I did the tests with the ''bounded Gauss upwind'' scheme, but unfortunately the results have not changed much.
(Green results)
Attached Images
File Type: jpg cavity_T_2D.jpg (34.8 KB, 49 views)
gu1 is offline   Reply With Quote

Old   August 5, 2020, 14:31
Default
  #6
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Quote:
Originally Posted by gu1 View Post
As promised,

I did the tests with the ''bounded Gauss upwind'' scheme, but unfortunately the results have not changed much.
(Green results)
Thanks for providing these curves & the reference literature.
The temperature as you said is no very well computed far from the walls and this gap for the case I ran, was linked to the numerical schemes but your residuals had converged.

I have read roughly the paper & maybe you can try the RNG K Epsilon turbulence model that can fit this kind of flow behaviour.
john myce is offline   Reply With Quote

Old   August 6, 2020, 09:03
Default
  #7
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Quote:
Originally Posted by john myce View Post
Thanks for providing these curves & the reference literature.
The temperature as you said is no very well computed far from the walls and this gap for the case I ran, was linked to the numerical schemes but your residuals had converged.

I have read roughly the paper & maybe you can try the RNG K Epsilon turbulence model that can fit this kind of flow behaviour.
Hi,

Well, it has a curious aspect that caught my attention... in the first images I attached in this forum thread I was using the ''omegaWallFunction'' boundary condition, even though I guaranteed that the y+ on the wall was less than 1. However, then I paid attention to that and replaced this BC with ''fixedValue'', the results were better and the residues somewhat different, I attached the image below (residual).
It is precisely this gap that is occurring in the middle curves that is bothering me!!! If you want, I can share the case with you. If you authorize, I will send you the link to the downloaded case in Drive so that you can download it.
In fact, I kept the same fvSchemes that I put in the first topic of this post (#1). I tried the ''QUICK'' and ''bonded Gauss upwind'' models and the results were VERY similar.
I was wondering if this difference in the results at the center of the domain has anything to do with the BC that I am using.

About the ''RNG ke'': Could you tell me what boundary conditions should I use? I have no experience with this solver.

Another addition is that I tried to use the v2f model and I was also not lucky, the properties that monitors using the probes fluctuated a lot. I also attached an image for your curiosity.

Thanks
Attached Images
File Type: png residual.png (117.6 KB, 32 views)
File Type: png convergT.png (116.3 KB, 26 views)
gu1 is offline   Reply With Quote

Old   August 6, 2020, 10:12
Default
  #8
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Quote:
Originally Posted by gu1 View Post
About the ''RNG ke'': Could you tell me what boundary conditions should I use? I have no experience with this solver.

Another addition is that I tried to use the v2f model and I was also not lucky, the properties that monitors using the probes fluctuated a lot. I also attached an image for your curiosity.

Thanks
Hi,

For the RNGkEpsilon, I used epsilonWallFunction for a mesh closed, even lower than 1 for the two walls with a delta T°C, & around y+ ~ 20 for the other walls.

For the initial value it was calculated thanks to the equation attached. Capture.PNG

Then I just replaced the word omega in the fvSolution and fvSchemes with epsilon (same numerical schemes and relaxation factor).

This resulted in a better prediction in the middle of the cavity and a worse one near the walls for a number of Rayleigh = 0.86x10^6 compared to kOmegaSST. But the gap was not huge.

Yes it would be great to have just the case to see how it is setup.

Thanks.
john myce is offline   Reply With Quote

Old   August 6, 2020, 12:13
Default
  #9
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Quote:
Originally Posted by john myce View Post
Hi,

For the RNGkEpsilon, I used epsilonWallFunction for a mesh closed, even lower than 1 for the two walls with a delta T°C, & around y+ ~ 20 for the other walls.
Hi,

I performed the simulation using the RNGkEpsilon model and on the wall it showed better results than the kOmegaSST. However, the center of the cavity still remains with the gap. I attached the results.

Then I sent you the file to download my case in private. Check your messages. I also left my email if you want privacy.

The case I attached is with the boundary conditions I used for the kOmegaSST model and the v2f model. For the case of the RNGkEpsilon model, just modify the ''epsilon'' file for the considerations you recommended. I used the initial estimate for ''epsilon'' of 1e-6.

* Remembering that for the kOmegaSST model you hear the convergence of the residuals only when I used the ''omegaWallFunction''. However, the results were worse when comparing the conditions that are in the file sent.

** In fact, I am curious, how do you calculate the y+ for these cases of natural convection?

I await your reply.
Attached Images
File Type: jpg cavity_T_2D.jpg (29.0 KB, 29 views)
gu1 is offline   Reply With Quote

Old   August 10, 2020, 08:58
Default
  #10
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Quote:
Originally Posted by gu1 View Post
** In fact, I am curious, how do you calculate the y+ for these cases of natural convection?

I await your reply.
Hi,

For the y+ I used a post processing command line to run after the end of the solver.

mpirun -np 12 buoyantSimpleFoam -postProcess -latestTime -func yPlus

You can also declare the resolution of the yPlus in the controlDict file to run it automatically :

yPlus
{
type yPlus;
libs (fieldFunctionObjects); // v1912, it has been changed regarding the version
writeControl writeTime;
writeControl timeStep;
writeInterval 100;
}

For the nut, k, omega ... I found that the guy which created the tutorial buoyantCavity (buoyantSimpleFoam), use the mean root square of the velocity (Urms in the publication) measured by Betts et al. (P.L. Betts, I.H. Bokhari / Int. J. Heat and Fluid Flow 21 (2000) 675±683) Experiments on turbulent natural convection in an enclosed tall
cavity. In the publication they did not say how they calculate/measured this term.

I do not know if everyone is doing this or there is an alternative way for natural convection case.

Cheers.
gu1 likes this.

Last edited by john myce; August 11, 2020 at 07:36.
john myce is offline   Reply With Quote

Old   August 18, 2020, 14:08
Default
  #11
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Quote:
Originally Posted by john myce View Post
Cheers.
John,
Give me some good news... haha.
gu1 is offline   Reply With Quote

Old   August 19, 2020, 06:18
Default
  #12
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Quote:
Originally Posted by gu1 View Post
John,
Give me some good news... haha.
Yes, sorry I have been busy these days. I am bit confused because I did not see anything wrong in your case. I could not test anything because the mesh is too fine and it would take a lot of time.

You were right in your first post, the mesh is "coarse" far from the wall but still way below y+ = 1 after 8000 iterations. I think I underrated the mesh , because I have made a checkMesh and the aspectRatio is around 207 !! So I think now you can focus on the mesh and the transition near and far the wall.
john myce is offline   Reply With Quote

Old   August 19, 2020, 08:53
Default
  #13
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Quote:
Originally Posted by john myce View Post
You were right in your first post, the mesh is "coarse" far from the wall but still way below y+ = 1 after 8000 iterations. I think I underrated the mesh , because I have made a checkMesh and the aspectRatio is around 207 !! So I think now you can focus on the mesh and the transition near and far the wall.
I did some tests and realized that for probes placed in the center of the domain, where the profiles are not adequate, the monitored properties are varying, that is, there is instability.

Best.
gu1 is offline   Reply With Quote

Old   August 20, 2020, 17:21
Default
  #14
New Member
 
John
Join Date: Nov 2013
Location: USA
Posts: 22
Rep Power: 12
Gallienus is on a distinguished road
Quote:
Originally Posted by gu1 View Post
Hi,

I performed the simulation using the RNGkEpsilon model and on the wall it showed better results than the kOmegaSST.
** In fact, I am curious, how do you calculate the y+ for these cases of natural convection? ...
Hi,

I'm quite new to OF and am in fact trying to set up my 1st case: a natural convection using icoFOAM.

You mentioned that you were using RNG-ke and later k-Omega for turbulence models. How do you know in fact that the flow isn't laminar? You mentioned that the \DeltaT is 1 C. This doesn't seem a very big driving force offhand.

You've shown residual plots but could you display perhaps a vector plot of the flow field?
Gallienus is offline   Reply With Quote

Old   August 24, 2020, 09:44
Default
  #15
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Quote:
Originally Posted by Gallienus View Post
I'm quite new to OF and am in fact trying to set up my 1st case: a natural convection using icoFOAM.
The icoFoam solver is not a solver for natural convection problems.

@John, I tried everything and I don't know what could be causing this divergence in the temperature profile. I modified mesh, turbulence model, fvSchemes, fvSolution and nothing! Sad.
gu1 is offline   Reply With Quote

Old   August 24, 2020, 11:52
Default
  #16
New Member
 
John
Join Date: Nov 2013
Location: USA
Posts: 22
Rep Power: 12
Gallienus is on a distinguished road
Quote:
Originally Posted by gu1 View Post
The icoFoam solver is not a solver for natural convection problems.
Thanks for the info.
According to another thread here quoting wiki, it is but requires adding the solver for temperature. Let me add the wiki link:
https://openfoamwiki.net/index.php/H...ure_to_icoFoam
--- from:
"Later, you need to include the temperature into the solver so that the temperature field is being calculated every time step.

Hope this helps;
Saideep"

If there is a better way than adding new fields and recompiling a custom version of icoFoam for natural convection I'd like to know what it is?

Running the OF-7 Dev version under xUbuntu 18.04. Case is transient, laminar, 2-D, natural convection, maybe 50,000 cells or less.

I also have a list of OpenFOAM solvers from cfd.direct :v7-standard-solvers and it doesn't list anything I can find more appropriate than icoFOAM.
Gallienus is offline   Reply With Quote

Old   August 24, 2020, 12:51
Default
  #17
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Quote:
Originally Posted by gu1 View Post
@John, I tried everything and I don't know what could be causing this divergence in the temperature profile. I modified mesh, turbulence model, fvSchemes, fvSolution and nothing! Sad.
It is such a pity ! I was hoping that the mesh could improve a bit your results. Maybe you have reached the limitation of this solver ? I found that in the new version OFv7, buoyantBoussinesqSimpleFoam has been removed and included in buoyantSimpleFoam as an option. I do not know so far if this change improves the solution but I doubt it.
john myce is offline   Reply With Quote

Old   August 24, 2020, 12:59
Default
  #18
Member
 
Join Date: Sep 2018
Location: France
Posts: 62
Rep Power: 7
john myce is on a distinguished road
Quote:
Originally Posted by Gallienus View Post
Running the OF-7 Dev version under xUbuntu 18.04. Case is transient, laminar, 2-D, natural convection, maybe 50,000 cells or less.

I also have a list of OpenFOAM solvers from cfd.direct :v7-standard-solvers and it doesn't list anything I can find more appropriate than icoFOAM.
buoyantPimpleFoam seems to suit to your case. If you want to solve an incompressible flow:
Conjugate Heat transfer for Incompressible Fluids
john myce is offline   Reply With Quote

Old   August 24, 2020, 16:49
Default
  #19
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 216
Rep Power: 9
gu1 is on a distinguished road
Quote:
Originally Posted by john myce View Post
It is such a pity ! I was hoping that the mesh could improve a bit your results. Maybe you have reached the limitation of this solver ? I found that in the new version OFv7, buoyantBoussinesqSimpleFoam has been removed and included in buoyantSimpleFoam as an option. I do not know so far if this change improves the solution but I doubt it.
...Well, there is a chance that the data is wrong too (I find it difficult... but it can happen).
gu1 is offline   Reply With Quote

Old   March 15, 2021, 11:49
Default
  #20
Senior Member
 
abdikerim kurbanaliev
Join Date: Jun 2010
Location: Kyrgyzstan, Osh
Posts: 120
Rep Power: 15
kerim is on a distinguished road
Quote:
Originally Posted by gu1 View Post
...Well, there is a chance that the data is wrong too (I find it difficult... but it can happen).
Hi,

I simulated natural convection in a square cavity using OpenFOAM7, installed on ubuntu 18.04LTS. The numerical simulation results were compared against experimental data of Ampofo F. and Karayiannis T.,2003.
The correspondence of the vertical velocity profile at the mid-height of the cavity with the experiment is good. However, the average temperature profile is under-predicted than the corresponding experimental data. When calculating using different versions of the OpenFOAM package(OF5, OF6, OF8), the average temperature profiles are small compared to the experiment. I will be happy if someone can help to solve this issue.
Kerim
Attached Images
File Type: png picture1.png (21.4 KB, 50 views)
File Type: png picture2.png (18.9 KB, 44 views)
kerim is offline   Reply With Quote

Reply

Tags
buoyantboussinesqsimple, natural convection

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Natural convection regime in a small cavity AntonioDesah FLUENT 7 May 5, 2020 08:48
Natural convection regime in a small cavity AntonioDesah Main CFD Forum 1 April 29, 2020 14:45
SU2-7.0.1 on ubuntu 18.04 hyunko SU2 Installation 7 March 16, 2020 05:37
UDF for body force for rotating cavity with natural convection s.jaiswal FLUENT 0 February 18, 2014 03:01
Natural Convection Problem Eduardo FLUENT 0 October 21, 2006 15:04


All times are GMT -4. The time now is 09:13.