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

Uncontrolled blowup in simpleFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HPE

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 2, 2022, 10:59
Question Uncontrolled blowup in simpleFoam
  #1
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Hello everyone.

I am a new user to OpenFoam and I would like to use this tool to obtain a base flow in a axisymmetric jet flow at Reynolds 10^4.

I have started with the case detailed in : https://turbmodels.larc.nasa.gov/jetsubsonic_val.html that I refer to as ASJ. Using NASA's mesh in an incompressible setting, with significantly slower flow and a velocity driven inlet, I have obtained results for simpleFoam with a SA model that look reasonable (see step 500 attached). This case is at Re=10^5.

My case file is attached, I use the mesh available at : https://turbmodels.larc.nasa.gov/Jet..._129.p3dfmt.gz.

Copying the p3dfmt file inside the case and using ./Allrun should work.

However, when I try my own mesh made with gmsh (nozzle case) the calculation always blows up in about 10 iterations (floating point error, arbitrary velocities, there's a picture at the first calculation step attached). I have made minimal changes compared to the above case - running a diff --recursive between the two provided case directories should return 4 entries only.
  • Two changes are related to the inlet and coflow boundary conditions that have a different speed.
  • The other two are related to handling the mesh from gmsh properly (running gmshToFoam, replacing boundary types, and moving directly to patchSummary instead of calling autoPatch and createPatch).
Clearly the biggest difference in the two cases is moving from a NASA structured polygon mesh to a gmsh unstructured tetrahedron mesh - the geometry is not identical but very similar.

Changing mesh refinement (my mesh is less adaptative than the NASA one but finer by one order of magnitude), time step or viscosity doesn't seem to help. I cannot share my mesh file because of attachment size constraint, but I can share the .geo file.

I'm running gmsh v4.7.1 and openfoam v2112. I'm out of ideas.
Attached Images
File Type: png nozzle_1.png (29.0 KB, 31 views)
File Type: png ASJ_500.png (23.6 KB, 29 views)
Attached Files
File Type: zip ASJ.zip (10.0 KB, 3 views)
File Type: zip nozzle.zip (10.3 KB, 2 views)
File Type: zip nozzle_geo.zip (1.2 KB, 3 views)
Quentin Chevalier is offline   Reply With Quote

Old   March 2, 2022, 11:16
Default Scaled mesh
  #2
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Writing the above message there was a scale difference in the geometry between the cases. It's removed in the attached geo file, my problem remains.
Attached Files
File Type: zip nozzle_geo_scaled.zip (1.2 KB, 0 views)
Quentin Chevalier is offline   Reply With Quote

Old   March 24, 2022, 06:07
Default
  #3
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Implementing a continuation method for viscosity (incrementally reducing viscosity, see Viscouscont script) and a structured mesh (see attached pictures, the .geo file is also included) allows me to get more results, but I still get a blowup before getting to interesting regions.

Worse, the flows I am getting look laminar (see the attached picture, meant to be a Re=10^3 flow right before blowup, the inlet wall is a 2D baffle) - which raises the question of why to go for a RANS model to obtain something a Newton solver could have spewed...

I am pretty disappointed with OpenFoam. It is a very opaque tool (I once had a gmshToFoam error because of excessive refinement on a boundary that was more misleading than human-readable), the documentation is spread across very shallow guides, gigabytes of tutorials and a wiki that's more designed for supporters of the software than end user and often presents a single line of explanation for the meaning of anything.

Besides, my previous posts on this forum (very old-school) have gone unanswered despite almost 80 views. I feel like OpenFoam is only open-source in name and designed for paid users - when confronted to any practical problem with it, one has to know an expert to get anything done...
Attached Images
File Type: png mesh_interesting.png (66.6 KB, 26 views)
File Type: jpg mesh_structure.jpg (47.6 KB, 16 views)
File Type: png Re103.png (19.1 KB, 12 views)
Attached Files
File Type: zip nozzle.zip (14.7 KB, 2 views)

Last edited by Quentin Chevalier; March 28, 2022 at 05:54.
Quentin Chevalier is offline   Reply With Quote

Old   March 24, 2022, 07:10
Default
  #4
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
Without full understanding of your case... You have a disputable mesh: High aspect ratio, sudden changes of element sizes come into view. It looks unnecessary complex for me.

My recommendation: Start with an setup more straightforward, less nodes, lower Re, stay with blockmesh. Use first simple 2d and not a wedge. And look what happens.

> I am pretty disappointed with OpenFoam. It is a very opaque tool

I don't sign this. In contrary, nothing is hidden here. But you need to understand what you do. OpenFoam is not pocket calculator.
__________________
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 24, 2022, 09:30
Default
  #5
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Thanks for the input !

As said in my first post, my progression went from a case with a provided mesh (attached, it looks complex with elongated structures to me) to the same physical equations being solved with my geometry (created with gmsh, that I knew how to use).

I understand how the entire process looks debatable from the outside, but I think my mistake instead comes from thinking it would be simple and easy to extrapolate from this case to my case. I've been at it for months now.

I'm pretty sure part of the blame lays with me, but I still can't help but feel it shouldn't be this hard to move from one mesh to another. On the whole, OpenFoam seems extremely sensible to mesh quality.
Attached Images
File Type: jpg toy_mesh.jpg (102.4 KB, 21 views)

Last edited by Quentin Chevalier; March 28, 2022 at 05:54.
Quentin Chevalier is offline   Reply With Quote

Old   March 24, 2022, 10:15
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
Nevertheless, you need a point where to start. If changing the mesh is not an option that change the physics. Start with potential flow, change to laminar and then to low Re flow. And look what happens.

Often, boundary conditions are unphysical or at least introducing instability.

A sketch of your case with the b.c. would be helpful. So wen don't need to analyze your files in the first step.
__________________
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 25, 2022, 13:23
Default
  #7
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Quote:
Nevertheless, you need a point where to start.
I'll take the advice on rolling back and starting simple, even if it feels a lot like going backwards.

Quote:
You have a disputable mesh: High aspect ratio, sudden changes of element sizes come into view. It looks unnecessary complex for me.

My recommendation: Start with an setup more straightforward, less nodes, lower Re, stay with blockmesh. Use first simple 2d and not a wedge. And look what happens.
In that case, I'll stick to the same solver, that will reduce tedious adaptation tasks. Adapting the case to pure 2D with a simpler mesh is very straightforward, and my continuation method has low Re in there to begin with.

Not sure how to quantify "less nodes", and I'm definitely not diving into blockMesh. I have made a simpler mesh (picture attached, as well as the whole case) and calculations run until about the same viscosity. As before, there's a pressure blowup at the top right that gradually breaks everything down (again, picture attached).

Quote:
Often, boundary conditions are unphysical or at least introducing instability.
I agree about the boundary conditions - they are clearly so critical I had to include them in full. However, a drawing can't hurt. Attached is the plane I'm interested in (it's axisymmetric, I control the viscosity to get the high Re I want). Notice that the wall is an infinitely thin baffle.

Maybe there's something wrong with these but I have difficulty to see how they produce a blowup... I'll stress again I don't observe this in the NASA case.

On the other hand, this could have something to do with the "relative" small dimension in R ? I'll think about it.
Attached Images
File Type: jpg new_grid.jpg (99.4 KB, 12 views)
File Type: jpg p_blow.jpg (14.2 KB, 10 views)
File Type: jpg schema.jpg (46.6 KB, 13 views)
Attached Files
File Type: zip nozzle_stupid.zip (14.3 KB, 8 views)

Last edited by Quentin Chevalier; March 28, 2022 at 06:57.
Quentin Chevalier is offline   Reply With Quote

Old   March 25, 2022, 15:29
Default
  #8
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 don't understand your b.c. for U. You have three inlets with differen velocities. Are there regions where the meet? Most probably. What happens in the corner elements?
__________________
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 25, 2022, 16:37
Default
  #9
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Quote:
You have three inlets with differen velocities
Not exactly. In my sketch you can see all velocity conditions in x (the others are all 0 or zeroGradient) the inlet and coflow regions that have different but similar profiles. These are my two inlets, that are both velocity-driven in x (with u_y=u_z=0). The top boundary, far, is more of a no-slip condition ; it does not bring fluid to the domain, merely drives a weak parallel coflow to the jet axis.

Quote:
Are there regions where the meet? Most probably.
The two inlet profiles meet at the wall where all three BCs (inlet, wall, & coflow) should be compatible and go to u<-(0 0 0).

As for far & coflow, I believe these two are compatible with u<-(0.1 0 0), this corresponds to the maximum of the hyperbolic tangent profile at r=r_1. Again, at the x,r=0,r_1 corner, I expect u_y=u_z=0.


Quote:
What happens in the corner elements?
The question for the top-right corner (x,r=L,r_1) is more interesting - I didn't think a problem could arise from a fixed Value going into a zeroGradient.


I'm not entirely sure what happens at the bottom with the wedge condition to be perfectly honest.

Now in the case files there are three codeStreams because of the initial condition that is taken to be the extension of the boundary condition at x=0 all across the domain. In other words at t=0, there is a cylindrical double hyperbolic tangent with u=0 at the shear layer in place of a jet (it's very clear at step 0 of the Viscouscont script).

This could be an issue I suppose, but my blowup occurs so late that I think it's a stretch. I think of this initial condition as more of a shortcut to get results faster.
Quentin Chevalier is offline   Reply With Quote

Old   March 26, 2022, 02:22
Default
  #10
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
> The two inlet profiles meet at the wall where all three BCs (inlet, wall, & coflow) should be compatible and go to u<-(0 0 0).

yes, I see.

I recommend calculation to time shortly before exploding. Then reduce time step by far and restart calculation. In the p and U graphics you should where the irregulariyte starts.
__________________
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 26, 2022, 10:56
Default
  #11
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Quote:
reduce time step by far
I'm not sure the timestep changes anything in a steadyState computation - it certainly had no influence when I tried changing it...
Quote:
I recommend calculation to time shortly before exploding.
Yeah I will take that piece of advice concerning the origin of the unsteadiness (it could be originating from somewhere else as the top right corner). This (and refining / complexifying the mesh) has been my process so far with limited success. It's a very time-consuming process, too...
Quentin Chevalier is offline   Reply With Quote

Old   March 26, 2022, 11:38
Default
  #12
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
Refining the mesh ist not the first thing I would do. Rather omitting the tanh b.c. firts end replacing by a wall.

You may change to pimple Foam and use my timestep advice. I don't use simpleFoam very often because pimpleFoam finishes with steady state too. But may be you may stop the simulation at at certain point and re-run it "slower", means slower convergence. It is important to see where the problem ist.

I see problems with the mesh. But of course, I am not sure.
__________________
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 26, 2022, 15:32
Default
  #13
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 931
Rep Power: 13
HPE is on a distinguished road
Please check the mesh quality with "checkMesh -allGeometry -allTopology", and see any differences in the mesh metrics for the meshes you have. Please do use the same boundary conditions you have used for the NASA case as a first step (just try to replicate the NASA setup as closely as possible.)

For "simpleFoam", using "consistent true;" (SIMPLEC; you will need to change the relaxationFactors, especially p=1) and "bounded" for the schemes can improve the numerical stability. See the web for further info.

And a small warning: OpenFOAM is not free and, to my knowledge, it was never free or was never meant to be. I think it is only another business model, which Google and Facebook use a version of it as well (they are also not "free".) So if you do serious/paid work and are short of time, you may need serious/paid help or training.
arjun likes this.
HPE is offline   Reply With Quote

Old   March 27, 2022, 01:41
Default
  #14
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
Just another thought: What kind of b.c. do you have at the upper and lower wall? Your input stream is full developed there and the b.c. should bi symmtrical or slip. If you have a wall (noslip) bent the wall slightly around the corner.

OpernFoam is free in the sence that is under the Free Software License.
https://openfoam.org/licence/

But it is not a free lunch.
__________________
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 28, 2022, 05:57
Default
  #15
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Quote:
Rather omitting the tanh b.c. firts end replacing by a wall.
Let me get this straight - you are telling me to replace the inlet BCs that are driving the flow by walls ? What would that achieve ? Make sure that the blame lies with the mesh not the BC ?

Quote:
It is important to see where the problem ist.
It's hard to disagree with that statement, but I guess my reflex recently to refine problematic regions and this turned out to be frustrating and slow. I manage to get a pretty good idea of where the jumbo starts by reducing writeInterval most of the time.
Quote:
For "simpleFoam", using "consistent true;" (SIMPLEC; you will need to change the relaxationFactors, especially p=1)
I actually have seen this already ; I tried with a consistent scheme for my case, though it is not required in the NASA case, and it doesn't save me. I hadn't read about the relaxation factor though.
Quote:
"bounded" for the schemes can improve the numerical stability.
My divSchemes are bounded, my gradSchemes limited.
Quote:
And a small warning: OpenFOAM is not free and, to my knowledge, it was never free or was never meant to be.
Guess I learned that lesson the hard way
Quote:
What kind of b.c. do you have at the upper and lower wall?
It's all on the graphic and in my previous posts :
  • bottom boundary is not specified in my axisymmetric case (I thought wedge did the job automatically)
  • top boundary is called far, it has a no slip condition. It has atmospheric pressure and a prescribed velocity that is purely axial with the jet and coincides with coflow maximum
Quentin Chevalier is offline   Reply With Quote

Old   March 28, 2022, 06:22
Default
  #16
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
> Let me get this straight - you are telling me to replace the inlet BCs that are driving the flow by walls ?

only the two tanh conditions. We have to be sure that they don't arise a problem.

> top boundary is called far, it has a no slip condition. It has atmospheric pressure and a prescribed velocity that is purely axial

I don't recommend this. If there are tiny differences in the velocity you have nonphaysical b.c. I recommend at least first a slip b.c.
__________________
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 28, 2022, 06:55
Default
  #17
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Quote:
In the p and U graphics you should where the irregulariyte starts.
It seems that in the nozzle_stupid case, which is real 2D with a simplistic mesh, the problem arises from a gradual pressure drop at the top right corner.
Quote:
only the two tanh conditions.
In my case these are the same. I prefer @HPE suggestion to go back to parabolic profiles then replacing them with walls. I feel like a non-driven cavity would just not move.
Quote:
Please do use the same boundary conditions you have used for the NASA case as a first step (just try to replicate the NASA setup as closely as possible.)
I agree that is very sensible. For the nozzle_stupid case, I went back to parabolic BCs and I tried changing the velocity condition at the outlet from zeroGradient to pressureInletOutletVelocity as in the NASA case. The latter broke my case (it now blows up in a few timesteps with negative pressure at the inlet).
Quote:
Please check the mesh quality with "checkMesh -allGeometry -allTopology", and see any differences in the mesh metrics for the meshes you have.
I tried that with the simpler mesh I made and posted for the nozzle_stupid case. Logs files are attached, I don't see anything useful to be extracted from these. Both have cells with low determinant, but that doesn't help me much.
Attached Files
File Type: zip logs_checkMesh.zip (4.2 KB, 1 views)

Last edited by Quentin Chevalier; March 28, 2022 at 10:30.
Quentin Chevalier is offline   Reply With Quote

Old   March 28, 2022, 11:48
Default Summary
  #18
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
To sum things up :
  • I went from axisymmetric to 2D
  • I simplified massively my mesh
  • Moved back to a parabolic velocity profile
Currently my calculation breaks up because of a gradual pressure blow up at the top-right (see attached image).
Attached Images
File Type: jpg p_blow2.jpg (16.9 KB, 8 views)
Quentin Chevalier is offline   Reply With Quote

Old   March 28, 2022, 11:50
Default
  #19
New Member
 
Quentin Chevalier
Join Date: Jan 2022
Posts: 15
Rep Power: 4
Quentin Chevalier is on a distinguished road
Ok I have a fix it works fine now.

The secret sauce was a much stronger coflow. with a 1% coflow I was getting instabilities, with a 5% one I get stable stuff, even when dropping continuation, reducing mesh quality, and shrinking the box.

Thanks for your help folks.
Quentin Chevalier is offline   Reply With Quote

Reply

Tags
axis symmetric, gmsh 4.7.1, simplefoam convergence


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
simpleFoam tutorial PitzDaily using Reynolds stress tensor (LRR RASModel) dlahaye OpenFOAM Running, Solving & CFD 24 August 4, 2023 15:29
interFoam vs. simpleFoam channel flow comparison DanM OpenFOAM Running, Solving & CFD 12 January 31, 2020 16:26
simpleFoam parallel solver & Fluent polyhedral mesh Zlatko OpenFOAM Running, Solving & CFD 3 September 26, 2014 07:53
Trying to run a benchmark case with simpleFoam spsb OpenFOAM 3 February 24, 2012 10:07
SimpleFoam pipe flow velocity blowup gzink OpenFOAM Running, Solving & CFD 0 June 9, 2006 17:52


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