|
[Sponsors] |
November 14, 2016, 04:38 |
Sudden divergence of simulation
|
#1 | ||
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Hello alltogether,
I am currently running a simulation with a custom transient solver (based on pisoFoam, version OF2.2.2) on a grid created with cfMesh (v1.1.1, blood vessel geometry with one inlet and several outlets). The checkMesh output is fine, the option allGeometry gives some errors though. Previous simulations with the same errors and solver did not produce errors, so I assume the mesh is ok. The simulation runs for a few timesteps, however at some point the adjustable timestepping shrinks until the solver breaks down. When looking at the results and reconstructing the last timestep I can see a velocity (and pressure, nu, nuSgs, k) divergence right at the inlet of the model, apparently only a few cells on the inlet produce this divergence - and no cells going further in the direction of the flow seem impacted. Just from looking at it, the cells seem allright (and it is not any of the cells producing the errors in checkMesh -allGeometry - I looked at those with foamToVTK). I tried running the simulation with different settings, too. But laminar flow (instead of LES), Newtonian transportModel (instead of a custom transportModel) and a ramp to build up the pressure at the inlet linearly (and more slowly) until the oscillating transient pressure is applied did not help. Also running a simulation with pisoFoam produced the same error at some poinnt. The only thing that did not produce the error (so far) was applying a velocity boundary condition at the inlet (instead of pressure), however the applied velocities were small in comparison to the resulting velocities with pressure inlet BC. So I don't know if simply the velocity regime is the problem here - if so, I wouldn't know why? I attached images of the cells on the inlet of the velocity divergence and the checkMesh-file of the grid. In the following the solver output for the first few timesteps (with pressure ramp on the inlet), this runs fine upt to ~0.9267 Quote:
Quote:
Thanks a lot for anyone looking into this! I hope I did not forget anything of importance! If someone has an idea, what else I could try, please let me know!! All help is highly appreciated! Thanks again! Best regards Johannes |
|||
November 17, 2016, 05:29 |
|
#2 | ||
Senior Member
|
Hello,
It is an interesting problem. Can you please try some of the suggestions listed below? Quote:
In your situation, the obstacles come from the misalignment of the mesh with the flow. It is very likely causes oscillations the of gradient in the neighbour cells that magnify over time. Can you please make a mesh with two or more boundary layers at the inlet patch? This shall improve mesh-to-flow alignment at the inlet and hopefully solve the problem. Another suggestion is to activate boundary layer optimisation available in cfMesh. Can you construct you geometry such that you have a straight stretch at the inlet to develop the flow before entering the domain of interest? Quote:
Please let me know if any of this helps you solve the problem.
__________________
Principal Developer of cfMesh and CF-MESH+ www.cfmesh.com Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram |
|||
November 23, 2016, 04:18 |
|
#3 |
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Dear franjo_j, dear all,
thanks a lot for your reply, the explanationans and suggestions and please excuse my delayed response. In fact I did already try the simulations with an extra boundary layer at the inlet and it did not help. The option to optimizeLayers in cfMesh was also switched on for the meshes I created. (In this regard I asked myself does this also have an effect, if I did not create any boundary layers? In other words does this improve the shape of cells on the boundary in any case? Maybe I will try this sometime...) I also started some simulation runs with different gradSchemes and divSchemes. It did improve the issue a little bit in that the simulation ran longer. However, it still crashed at some later point for the same reasons... I attached the fvSchemes from the latest computation. I guess I need to lower the blending factor of the limited divSchemes even more. I chose the schemes according to the mesh quality, and these parameters worked with other hexahedral meshes of comparable quality, where the grid cells were oriented with the flow direction. Further reducing this factor troubles me a little since this also tampers the solution, which is obtained... Your idea of changing the goemetry such that I have a straight pipe-like element in the beginning sounds interesting. I will look into that, and hope to be able to do this soon! Thanks a lot again for looking into this!! Best regards Johannes |
|
July 20, 2017, 09:03 |
Still searching...
|
#4 | |||||
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Finally got back to handle this problem now and I am still looking for a solution on this! :-(
By now, I understand, that pressure driven flow is somewhat more complicated to simulate then flow due to a velocity inlet boundary condition. However, application of pressure is the way I need to go, since this is the data I have at hand, and furthermore, I do not want to make any assumption about the velocity profile across the model inlet... I managed to get the pressure driven simulations to work with a fully hexahedral grid at the inlet oriented with the flow direction (meshed with software ICEM by ANSYS). So I am pretty sure now, that it is the orientation of the cells, that cause the problem. However, meshing with this Ansatz (ICEM) is highly complicated since it requires much user intervention to assure sufficient grid quality. The complexer the geometry gets, the more difficult and time consuming this task becomes - and this forbids its usage on highly complex geometries, which I need to treat also with pressure inlet BC. So fully automated meshing approaches (such as cfMesh or snappyHexMesh) are the thing to do here! So for these reasons I am dependent on getting these simulations to work. In the meantime I tried different gradSchemes such as Quote:
Currently I am waiting for the performance of the following (I assume most diffusive option) of Gauss linear: Quote:
Quote:
So far I did not want to change the divScheme for Quote:
Quote:
I attached the latest fvSchemes-dict and the checkMesh-file if anybody is interested to look closer into this. The mesh was created with cfMesh-1.0.1 and according to checkMesh it is totally fine!! the option -allGeometry gives a few bad cells and faces (concaveFaces, lowqualityTetFaces and concaveCells) however all in completely different spots, then where the divergence occurs... If more information is needed, please let me know. I am glad for anyone looking into this and all advice! As you can see, I am still really stuck in this issue! Thanks a lot!! By the way, the software version I am using is OF231 and a custom solver, transportModel and turbulenceModel. However, as I said the errors occur with newtonian transportModel, laminar flow and conventional solver pisoFoam, too. |
||||||
July 20, 2017, 12:23 |
Another try
|
#5 |
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Just tried another option, and extruded the mesh at the inlet for 50 cells (2mm). The first test run again showed the undesired behaviour quite much straightaway...
I will give this possibility another go however with a longer inlet passage of 6mm... All other ideas are most welcome!!! |
|
July 21, 2017, 03:51 |
divScheme upwind
|
#6 |
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Furthermore I tried a simulation with the most diffusive divScheme I could think of, upwind. However, again bounding k explodes at some point and time stepping decreases. I guess the simulation will probably break down, soon enough, too...
I am pretty much through with all ideas I have :-( If anybody else can give another suggestion on how I could solve this problem, I will be very happy to try anything! I don't understand, how the obviously good mesh with checkMesh (better than anything I managed to mesh with ICEM (purely hexahedral and supposedly cells oriented with flow direction) - and there it worked) fails so badly in this case... Maybe I'll give it a try with snappyHexMesh... Thanks again for anybody reading this and thinking it through! Please let me know, what you think! All help and comments are highly appreciated!! |
|
July 21, 2017, 06:29 |
|
#7 |
Senior Member
Oskar
Join Date: Nov 2015
Location: Poland
Posts: 184
Rep Power: 11 |
Hello KingKraut.
I have just finish my rans and les pressure driven flow simulations. I had problems with bounding of k and epsilon too! Solution for my problem was setting relaxations factors for k and epsilon to 0.05 In fvSolutions file I have had put: relaxationFactors { U 1; k 0.05; epsilon 0.05; } to fix my bounding k and epsilon problem. Hope it helps. Have a nice day. Sheaker |
|
July 21, 2017, 07:39 |
relaxation factors
|
#8 |
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Hello sheaker,
thank you so much for the response! I will try this straightaway! I thought about this option before, however, I was not sure about how "advisable" the usage of underrelaxation is in transient problems? But my knowledge on this is pretty limited, too... But thanks again - another straw to clutch! :-) Have a nice day, too |
|
July 21, 2017, 12:04 |
|
#9 |
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Thanks again for the help, but it did not help either... :-(
|
|
July 21, 2017, 18:47 |
|
#10 |
Senior Member
Oskar
Join Date: Nov 2015
Location: Poland
Posts: 184
Rep Power: 11 |
Sorry to hear that.
You said before Your checkmesh looks ok. But I think there are some things You should recheck. Code:
Mesh non-orthogonality Max: 64.95229193 average: 15.76192355 Code:
***Error in face tets: 33 faces with low quality or negative volume decomposition tets. <<Writing 33 faces with low quality or negative volume decomposition tets to set lowQualityTetFaces Min/max edge length = 1.947880873e-05 0.0003059821334 OK. *There are 738 faces with concave angles between consecutive edges. Max concave angle = 78.5494773 degrees. <<Writing 738 faces with concave angles to set concaveFaces I have just tried simpleFoam on my case and found it diverging due to Uy velocity. There were 1000 iterations of Uy velocity equation so I change relaxation factor for U to 0.5. In Your case there are hundreds of iteration of pressure equation. For my amateur usage I found pressure most sensitive to non orthogonality and skewness. Wish You best. |
|
July 24, 2017, 03:25 |
|
#11 |
Member
Jo Mar
Join Date: Jun 2015
Posts: 54
Rep Power: 11 |
Hello sheaker,
thank you very much again for looking deeper into this! This is highly appreciated! The mesh non-orthogonality max of 64 is quite the best I managed to achieve with different meshing software packages... I am not sure, if I can improve this any further :-/ I looked at the other two checkMesh fails in more detail by means of foamToVTK with paraView and these were spread over the mesh with single cells at very different locations. However, none were on or even close to the inlet, where the discontinuity occurs. So I am not sure if these are the cause... Futhermore, to get rid of these I wouldn't know how to do this. Another thing that came to my mind over the weekend was the physical and physiologic relevance of my boundary conditions. And it appears to me, that these might actually be quite unrealistic. Possibly the pressure difference between inlet and outlets is too high, resulting in high flow velocites, which thus cause strong gradients too high for this mesh to handle. However, it still troubles me a lot, that with a mesh of this quality I think I should manage to get a simulation running in some way - at least with the most conservative discretization schemes and relaxation factors. Like this in the end I should be able to look at the results and say: "yes these boundary conditions are unrealistic, I have to change them." Still I quite like the idea of playing around with the relaxation factors, and I am not quite done yet adjusting these. Hopefully at some point I will succed to get this running. Thanks again for the ideas suggestions! Have a nice day, Johannes |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Population Balance Modeling (PBM) - Ansys Fluent | chittipo | FLUENT | 164 | November 18, 2023 12:54 |
Floating Point Exception Error | nyox | FLUENT | 11 | November 30, 2018 13:31 |
[ANSYS Meshing] Help with element size | sandri_92 | ANSYS Meshing & Geometry | 14 | November 14, 2018 08:54 |
divergence of scaled residuals (steady simulation) | hanka | FLUENT | 6 | December 16, 2010 05:45 |
problems simulation ideal gas, divergence in AMG S | Ralf Schmidt | FLUENT | 11 | October 1, 2005 14:21 |