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

Sharp corner with O-grid non-convergence

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 5, 2015, 19:05
Question Sharp corner with O-grid non-convergence
  #1
New Member
 
Daniel Linton
Join Date: Mar 2014
Posts: 4
Rep Power: 12
dlinton is on a distinguished road
Hi Foamers,

Long-time listener, first-time caller. I've been having trouble getting OpenFOAM to converge with simpleFOAM in cases where I have an O-grid wrapped around a sharp, 90 degree corner. I've created a simple test-case to demonstrate this. The geometry is a cube in a planar channel for which I've created two structured meshes in ICEM: the first is a purely orthogonal mesh with refinement near the surfaces of the cube extending all the way to the boundaries, the second has an O-grid around the cube. See the attached image named sharpEdgeMeshComparison.

With the orthogonal mesh the convergence is fine and the resulting flow field is good. With the non-orthogonal O-grid case, very high velocities are generated at the cells adjacent to the corner of the cube. The non-orthogonal case will converge using smoothSolver and a straight Gauss-Seidel method as the smoother, however there is still unusually high velocities in the corner cells. Using a GAMG or PCG solver results in non-convergence.

Originally I was attempting an unsteady solution using pimpleFOAM, so this is what I've tried so far:
  • Adding outer loops to the solution algorithm and dropping the under-relaxation factors a lot (as far as 0.01 for the pressure)
  • Adding up to 20 non-orthogonal correctors
  • Reducing the CFL number (as low as 0.05)
  • Ramping the inlet velocity slowly
  • Reverting to first-order schemes for the divergence operator
  • Starting from an approximate, divergence free solution generated from a potential flow solver
  • Attempting a steady-state RANS solution using k-epsilon and Spalart-Allmaras

None of these led to a successful solution. I found both of the RANS simulations as well as the potential solution also resulted in very high velocities in the corner cells.

I've put exactly the same mesh into two other solvers (FLUENT and a research code) and both have converged smoothly and rapidly with no special treatment. CheckMesh says that everything is OK.

Does anyone have any ideas about what might be causing this problem? I hope I'm missing something very straight-forward.

I've attached the two versions of the cube test-case albeit without the meshes as they're too large. If you think it would be helpful I can upload the meshes elsewhere and link to them.

Kind Regards,
Daniel
Attached Images
File Type: png sharpEdgeMeshComparison.png (127.5 KB, 112 views)
Attached Files
File Type: gz sharpCornerTestSansMesh.tar.gz (14.4 KB, 11 views)

Last edited by dlinton; October 5, 2015 at 22:01. Reason: Forgot to attach case files!
dlinton is offline   Reply With Quote

Old   October 6, 2015, 04:05
Default
  #2
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 143
Rep Power: 20
JNSN is on a distinguished road
Hi Daniel,

try
Code:
laplacianSchemes
{
      default Gauss linear limited corrected 0.333;
}

snGradSchemes
{ 
      default limited corrected 0.333;
}
Best regards,
Jan
JNSN is offline   Reply With Quote

Old   October 6, 2015, 04:50
Default
  #3
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Quote:
Originally Posted by dlinton View Post
I've attached the two versions of the cube test-case albeit without the meshes as they're too large. If you think it would be helpful I can upload the meshes elsewhere and link to them.
It would, since the problem appears on certain mesh at least post a link to O-type mesh file.

Otherwise you will get bunch of generic advises like limiting non-orthogonal correction, using more viscous gradient schemes (faceLimited/cellLimited variants), etc.
alexeym is offline   Reply With Quote

Old   October 6, 2015, 10:39
Default
  #4
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Do you get any warnings in the log output?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 6, 2015, 20:33
Default
  #5
New Member
 
Daniel Linton
Join Date: Mar 2014
Posts: 4
Rep Power: 12
dlinton is on a distinguished road
Thanks for the replies everyone. Here's a link to the two meshes I've been using: https://www.dropbox.com/sh/3q3wu6qxp...7W0DiiNUa?dl=0.

Jan, thanks for the suggestions, no improvement unfortunately.

Rodriguez, I don't get any warnings in the log file or from checkMesh.

A suggestion from elsewhere (and from Alexey!) was to try using a face or cell limited gradient scheme (e.g. cellLimited Gauss linear 1). This stabilized the solution a bit but did not lead to convergence.

Thanks,
Daniel

Last edited by dlinton; October 6, 2015 at 20:35. Reason: Credit where credit's due
dlinton is offline   Reply With Quote

Old   October 7, 2015, 04:10
Default
  #6
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 143
Rep Power: 20
JNSN is on a distinguished road
Hi Daniel,

your settings for relaxation Factors are wrong for simpleFoam. Copy the fvSolution from the motorbike tutorial. Then it will work.

Best regards,
Jan
JNSN is offline   Reply With Quote

Old   October 7, 2015, 04:32
Default
  #7
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Could you explain why number of cells in non-orthogonal mesh is 3 time lower than in orthogonal mesh? Though visual comparison of the mesh near cube did not reveal any significant difference, since it is k-epsilon who diverges (and divergence starts nowhere near corners, see screenshot at 4th iteration), the problem could be in mesh quality.
Attached Images
File Type: png diverning-epsilon.png (16.2 KB, 39 views)
alexeym is offline   Reply With Quote

Old   October 7, 2015, 04:35
Default
  #8
New Member
 
Daniel Linton
Join Date: Mar 2014
Posts: 4
Rep Power: 12
dlinton is on a distinguished road
Thanks Jan, you have a sharp eye. For anyone wondering, the problem was that I was missing an "s". Instead of the "fields" subdictionary in the fvSolution file I had a "field" subdictionary so no relaxation factor was applied to the pressure field. It so happens that on a fully orthogonal mesh OpenFOAM can just handle that, but not on a non-orthogonal mesh.

That was frustrating.
dlinton is offline   Reply With Quote

Old   October 7, 2015, 04:35
Default
  #9
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Ok, several things:
1) You messed up the under relaxation. Its "fields" and not "field" in fvSolution. In your case, pressure is not under-relaxated which results in very fast divergence of SIMPLE.
2) In my case I needed to limit the pressure gradient scheme "grad(p) faceLimited Gauss linear 1.0;" in order to get a half-decent converge. Anyway, I could not get convergence, residuals remained stable but high.
3) I run yPlusRAS. It says y+ on the cube is average: 46160148. Are you sure your wall mesh is capable of this velocity?

@Jan, you were faster
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 7, 2015, 04:45
Default
  #10
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 143
Rep Power: 20
JNSN is on a distinguished road
Hi Philipp,

from my experience you should NEVER limit grad(p).

Best regards,
Jan
JNSN is offline   Reply With Quote

Old   October 7, 2015, 04:48
Default
  #11
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
I though it's just not p and U at the same time, but why not p?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 7, 2015, 04:51
Default
  #12
Senior Member
 
JNSN's Avatar
 
Jan
Join Date: Jul 2009
Location: Hamburg
Posts: 143
Rep Power: 20
JNSN is on a distinguished road
I should not adorn myself with borrowed plumes, it was an advice from the OpenFOAM support.

And one additional thing (from my experience): in most cases faceLimited is way too divusive to get reasonable results. If you have to use it, it is better trying to get a better mesh quality.
JNSN is offline   Reply With Quote

Old   October 7, 2015, 04:53
Default
  #13
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Ok, then limit U...
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 7, 2015, 05:00
Default
  #14
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
If I initialize with potentialFoam, I get a converged solution that looks pretty normal. What plane do you use for the picture in the first post?
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 7, 2015, 05:34
Default
  #15
New Member
 
Daniel Linton
Join Date: Mar 2014
Posts: 4
Rep Power: 12
dlinton is on a distinguished road
Hi Philipp,

I've spent so long staring at this file and I couldn't see the mistake. I post it here and two people spot it straight away!

The mesh is supposed to be pretty coarse (I'm not actually interested in this cube), but I still get a yPlus of 200 for the cube from yPlusRAS.

If I initialize with potentialFoam I don't get a particularly good flow field. The pictures are sliced on the y = 0 plane but they're not from potentialFoam.

Cheers,
Daniel

Last edited by dlinton; October 7, 2015 at 05:37. Reason: Get my facts right.
dlinton is offline   Reply With Quote

Old   October 7, 2015, 06:12
Default
  #16
Senior Member
 
RodriguezFatz's Avatar
 
Philipp
Join Date: Jun 2011
Location: Germany
Posts: 1,297
Rep Power: 27
RodriguezFatz will become famous soon enough
Maybe I was unclear, sorry.
I initialize the solution with potentialFoam, then I run simpleFoam. The solution looks pretty good after 300 simple iterations.
If I don't initialize with potentialFoam and use your init values, I don't get convergence in simple.

If you can't manage to reproduce that, just write again.
__________________
The skeleton ran out of shampoo in the shower.
RodriguezFatz is offline   Reply With Quote

Old   October 7, 2015, 06:54
Default
  #17
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

If I start relaxing everything (i.e. just set 0.1 for pressure, velocity, and turbulence parameters), simpleFoam converges:

Code:
Time = 1204

DILUPBiCG:  Solving for Ux, Initial residual = 3.56632251337e-07, Final residual = 3.93417365132e-09, No Iterations 2
DILUPBiCG:  Solving for Uy, Initial residual = 7.28635772125e-06, Final residual = 7.25794741745e-07, No Iterations 1
DILUPBiCG:  Solving for Uz, Initial residual = 1.03913367289e-06, Final residual = 9.15517461521e-08, No Iterations 1
DICPCG:  Solving for p, Initial residual = 9.99430261887e-06, Final residual = 8.71289306071e-07, No Iterations 6
DICPCG:  Solving for p, Initial residual = 2.09467760212e-06, Final residual = 2.03791204349e-07, No Iterations 17
DICPCG:  Solving for p, Initial residual = 1.00325820883e-06, Final residual = 9.67900054717e-08, No Iterations 14
time step continuity errors : sum local = 1.63018398046e-08, global = 9.08197474318e-10, cumulative = 0.0055360900495
DILUPBiCG:  Solving for epsilon, Initial residual = 3.44504920843e-07, Final residual = 2.12140675228e-08, No Iterations 1
DILUPBiCG:  Solving for k, Initial residual = 1.00005177154e-06, Final residual = 1.10085675766e-09, No Iterations 2
ExecutionTime = 606.56 s  ClockTime = 609 s


SIMPLE solution converged in 1204 iterations

End
(well, around iteration 800 I have switched to standard values of relaxation factors for simpleFoam (p - 0.3, U - 0.7, k/epsilon - 0.5), guess, if I keep 0.1, convergence would take longer).
Attached Images
File Type: png Ux.png (43.1 KB, 46 views)
Attached Files
File Type: gz nonOrtho.tar.gz (2.7 KB, 5 views)
alexeym is offline   Reply With Quote

Reply

Tags
convergence, o-grid, orthogonality, sharp corner, simplefoam

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
having problems with performing grid convergence study in SWFS drdet FloEFD, FloWorks & FloTHERM 12 January 22, 2015 05:44
Is convergence criterion (residual value) related with grid size? rdeepakkumar FLUENT 2 November 9, 2014 02:19
Problem with Grid convergence study dialolema CFX 1 June 14, 2010 19:33
Convergence of CFX field in FSI analysis nasdak CFX 2 June 29, 2009 02:17
Relative Error in Grid Convergence Christopher Haugh Main CFD Forum 2 March 9, 2007 13:42


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