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

simpleFoam blows up - no error (MWE included)

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 2 Post By alexeym
  • 1 Post By Yeru
  • 1 Post By alexeym

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 14, 2017, 13:49
Default simpleFoam blows up - no error (MWE included)
  #1
New Member
 
Dominik Pöltl
Join Date: Jul 2013
Location: Hamburg
Posts: 21
Rep Power: 13
Yeru is on a distinguished road
Hi all,

I'm stuck with a should-be-easy simpleFoam case.
Long story short:
  • mesh generated by SnappyHexMesh based on .STL file
    Y-junction followed by meandering pools, straight outlet sufficiently far away
  • mesh_cropped.png
  • BC inlet:
    U: surfaceNormalFixedValue p: zeroGradient
  • BC outlet:
    U: zeroGradient p: fixedMeanValue 0;
simpleFoam should easily converge to a stationary solution.
The problem:
The first two time steps look fine.
But then, large fluctuations on the bordering walls appear, that don't dampen down anymore.
So: no convergence.

meshFault_01.png

meshFault_02.png

meshFault_03.png

You can find a GIF of the evolution here

What did I check so far?
checkMesh -> OK.
other BC -> still blows up
faulty assignment of patches in the STL file -> nope.

Honestly - what didn't I check?
The fvSolutions entries - since they're copied from an earlier case, that worked just fine.
The levels of refinement of SnappyHexMesh

What is my question?
What can I change to prevent this blow up and get nice convergence?

The STL file is 3.6MB large, so no nice upload here.
You can finde a zipped Minimal Working Example here
Yeru is offline   Reply With Quote

Old   December 14, 2017, 18:00
Default
  #2
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,

Just basics (I did not check any further after spotting these "features"):

- Your mesh is non-orthogonal (max 55).
- You have 0 non-orthogonal correctors (I would suggest 1 or 2).
- You use "Gauss linear" for gradient, "leastSquares" would be more suitable.
- You use "corrected" for laplacian and snGrad (try limited correction)
- Start with upwind, converge, and then proceed with second order schemes.
Eldrael and allanZHONG like this.
alexeym is offline   Reply With Quote

Old   December 15, 2017, 09:38
Smile some tweaks work
  #3
New Member
 
Dominik Pöltl
Join Date: Jul 2013
Location: Hamburg
Posts: 21
Rep Power: 13
Yeru is on a distinguished road
Alexey, I owe you.
long story short: with some tweaks according to your advice, the error doesn't occur. Instead of 16h, my sim ran 53 min.

Quote:
Originally Posted by alexeym View Post
- Your mesh is non-orthogonal (max 55).
I adapted
Code:
maxNonOrtho 25;
in the snappyHexMeshDict. Earlier, the value was 75 and checkMesh yielded a max of non-orthogonality of 55.
Now, with a value of 25, checkMesh yields -can you guess?- 45. Don't know why.

Quote:
Originally Posted by alexeym View Post
- You have 0 non-orthogonal correctors (I would suggest 1 or 2).
Did that. Works magic.

Quote:
Originally Posted by alexeym View Post
- You use "Gauss linear" for gradient, "leastSquares" would be more suitable.
Strange, but: The sim breaks down when using "leastSquares" since the residiual explodes with values >e+22. "Gauss cubic" runs fine, but very long.

Anyway. Thanks for your advice!
Eldrael likes this.
Yeru is offline   Reply With Quote

Old   December 16, 2017, 13:20
Default
  #4
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
Quote:
Originally Posted by Yeru View Post
I adapted
Code:
maxNonOrtho 25;
in the snappyHexMeshDict. Earlier, the value was 75 and checkMesh yielded a max of non-orthogonality of 55.
Now, with a value of 25, checkMesh yields -can you guess?- 45. Don't know why.
If you check snappyHexMesh output, you find, that it complains about unsuccessful snapping. maxNonOrtho just defines quality check criterion, quality of generated mesh is defined by other parameters.

Quote:
Strange, but: The sim breaks down when using "leastSquares" since the residiual explodes with values >e+22. "Gauss cubic" runs fine, but very long.
It is a question of relaxation. With 0.9 and leastSquares there are linear solver convergence problems, with 0.7 or 0.8 pressure equation linear solvers converge quite OK.
alexeym is offline   Reply With Quote

Old   March 5, 2018, 09:01
Default clarifications
  #5
New Member
 
Dominik Pöltl
Join Date: Jul 2013
Location: Hamburg
Posts: 21
Rep Power: 13
Yeru is on a distinguished road
Dear Alexey,

I've been running a few sims with this little tweak and that little tweak - all bearing in mind your recommendations.
Problem is: none of the "leastSquare" ones converge.

So I want to ask some things, just to make sure, I don't misunderstood:

  1. You mentioned "pressure equation linear solvers". So do I have to switch the solver from simpleFoam to (e.g.) pimpleFoam?
  2. You mentioned the relaxation factors. All the relaxation factors in the simpleFoam tutorials feature
    Code:
    relaxationFactors
    {
        equations
        {
            U               0.9; // 0.9 is more stable but 0.95 more convergent
            ".*"            0.9; // 0.9 is more stable but 0.95 more convergent
        }
    }
    Should I put 0.7-0.8 as relaxation factor on U or should I simply define one for p?
Thanks.
Yeru is offline   Reply With Quote

Old   March 5, 2018, 09:20
Default
  #6
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
I recommend to build up the case step by step:

- start with a single meander
- if possible (and its should be) make it with blockmesh, and make a mesh which is well balanced
- experiment a bit with different boundary conditions and mesh densities.
- then - with this experience - add a second meandering or the junction
- with that in heart you may built the case all in all
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   March 10, 2018, 19:27
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
Dear Dominik,

1. No, I did not mean that. In both cases you have "pressure equation linear solvers" (i.e. in simpleFoam you have SIMPLE, in pimpleFoam you have PISO with outer iterations).

2. Yes, relaxation factors influence your convergence.

Now real question is: do you need leastSquares? The reason for bad convergence could be:
- Oscillations due to second order. So basically, we have second order but no convergence.
- Since there are no plots of residuals in your post, I assume 'none of the "leastSquare" ones converge.' are in fact "I did not put enough iterations till convergence".
- For "consistent yes" relaxation factors of 0.9 are OK, yet in general it is 0.7/0.3 for U/p (0.8/0.2 in original papers, sum should be 1).
allanZHONG likes this.
alexeym is offline   Reply With Quote

Reply

Tags
blowing up, convergence, simplefoam


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
Definition of y+ in yPlusRAS (1.7.1) Taka1 OpenFOAM Programming & Development 41 May 23, 2020 13:05
error compiling modified applications yvyan OpenFOAM Programming & Development 21 March 1, 2016 05:53
simpleFoam temperature blows up tellico OpenFOAM Running, Solving & CFD 0 June 24, 2013 14:19
simpleFoam Blows up with Parabolic Inlet Pipe Flow swahono OpenFOAM 0 December 6, 2010 20:37
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 07:59


All times are GMT -4. The time now is 05:17.