model choice/ meshing/ convergence problem

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
Garret-mouse

model choice/ meshing/ convergence problem

Post by Garret-mouse »

Hello, I'm new to Code Saturne (3.0.0)* and am struggling with modeling flow into a small chamber.
I am aiming for the simulation to show me where the chamber design needs to change to promote clean flow (ie minimal dead-zone regions with no flow velocity), primarily as a visual check on the design. *(btw I'm working from a CAELinux 2013 live DVD rather than an installation).

I have struggled getting the simulation to converge. I have tried several things over the past few days, from simplifying the geometry, trying different meshes etc. etc.
I have a few basic questions that I'm sure someone with more experience could answer quickly.

1) I'll get the 'Gotcha' out the way first. The total volume I am simulating is 1cm^2. Can Code Saturne cope OK with geometry this small? I'm hoping it can handle 'small numbers' just as well as 'big' ones, but are there any special considerations?

2) The Flow from a fag-packet calculation has Reynolds number of about 1400 so I am expecting to be not be inherently turbulent (will just have eddies forming as a result of the flow - the aim of my simulation). Which is the best flow regime to use?
What I did that did work. I got a solution using Lamina flow only with the Viscosity wildly high and the inlet velocity reduced to 0.05m/s {Re <162} whereas many previous runs with velocities approaching the actual application of 0.34m/s {Re=1105} didn't converge.
I also got a mixing length model to converge with heavily simplified geometry (0.34m/s), however then re-adding in some of the small features of the 'real' scenario then didn't converge – produced wildly wrong streamlines and velocities.
What I did that didn't work. Other turbulence models either didn't converge (containing warnings about mesh coarseness) some didn't run at all (produced errors in the main window).

3) What should we be looking for in the “** INFORMATION ON CONVERGENCE” - I have been looking for “Norm. residual” and “derive” numbers to be going down. Is the last “Norm. residual” perhaps a measure of the final accuracy of the solution?

4) I am aware that the mesh check gives the warning “Criterion 3: Least-Squares Gradient Quality:
Number of bad cells detected: 306 --> 3 %” however I can't seem to track the cause of this down, nor get rid of it. What is this actually a measure of? Is there a way of seeing which mesh cells are affected?

5) I have created tetrahedral meshes (NetGen 1D-2D-3D in Salome v6.6.0) of various fineness excluding many features that might cause an issue, getting at best “Criterion 3: Least-Squares Gradient Quality of 2% on a really fine mesh. Might this warning be the cause? (my successful solutions also had this warning). If so, what is the way to generate a mesh that will pass the quality checks and allow the solution to converge?

6) I have been using a pressure_relaxation=0.9 as I saw on this forum a user suggest this helps with convergence. Is 0.9 low enough? What are the side-effects of not using the default of 1?

7) Finally, is someone able to look at what I have done (Listing file and mesh attached) and maybe suggest a simulation that will reflect the situation I am trying to model: where the incoming flow is not already turbulent.
Cheers. :)
Attachments
Mesh_1_rads-removed.txt
mesh in .med format (rename from .txt)
(1.64 MiB) Downloaded 226 times
listing.log
listing
(79.68 KiB) Downloaded 207 times
setup.xml
setup file
(6.35 KiB) Downloaded 209 times
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: model choice/ meshing/ convergence problem

Post by Yvan Fournier »

Hello,

Having a small number of bad cells relative to the least squares gradient quality is probably not so bad, but if your geometry is not confidential, posting a view of your geometry and mesh might allow us to offer suggestions for improvement.

The small domain size should not be an issue.

As you have low Re numbers, the laminar model should be OK, but using a Low-Reynolds (or even standard) turbulence model during the setup phase might help you see whether convergence issues are related to this (i.e. run with a turbulence model such as k-epsilon or Rij, then deactivate it).
This is in a way similar to what you did when you increased viscosity. Once convergence issues are solved with increased velocity or a turbulence models, you can go further, but if that part does no work first, you probably have a mesh quality (or other, harder to guess at) issue.

Looking at your listing, the CFL number is very high in some areas, so limiting the reference time step to a smaller value may help here.

As for the "derive" value, it should go down if the computation leads to a steady flow, but is of no use if the computation exhibits even small oscillations around a mean value. In version 4.0 of Code_Saturne, the norm. residual should be the norm of the "true" residual, but in version 3.0, it is only the norm of an intermediate linear system solve, so difficult to interpret.

Also, version 3.0.0 does not contain all possible bug fixes (the current bug-fix release for 3.0 is 3.0.7), and 4.0 (currently 4.0.3) is recommended (though that would mean building/installing the code rather than using the preinstalled version from CAELinux).

Best regards,

Yvan
Garret-mouse

Re: model choice/ meshing/ convergence problem

Post by Garret-mouse »

Hi Yvan,
Thanks for the reply. I'm glad that you are expecting the domain size not to be an issue. :)

Re my question 4) I have attached a view of the latest mesh I have just created “mesh3”. This has 2% LSQ Gradient bad cells. I have also a view of its quality check output in Paraview – see images attached. It might be hard to see from the 2D image but there are volumes that have a LSQ Gradient >0 throughout the mesh rather than concentrated in any particular region. (In the views attached the threshold is set to >0.1 visible in grey colour)

Yes, I too was expecting the lamina model to work well, especially as I used lower and lower Re looking for convergence. However I wasn't sure what effect the geometry was going to have as the flow jetted into the chamber from the small inlet tube, and whether a lamina model could be expected to cope with this.

The lamina study I ran since yesterday's posting had a Re of approx 1100 for the inlet tube and the listing contained many warnings about the mesh not being refined enough at the wall. It may have converging though as the 'derive' number is slowly getting smaller...

I think I will run a study with a very low velocity and the very fine mesh “mesh3” (to try and overcome the 'mesh too coarse' warnings). View of this mesh new is attached. I'd welcome comments about the geometry / mesh.

What is considered a high CFL number, and where is this reported? (I can only see “target CFL” in the listing).
What would be a good CFL number to achieve through adjusting the timestep?

Do you suggest I also try a k-epsilon model again this time with a really inlet high velocity to see if that converges / still reports the mesh being too fine at the walls.

Thanks for your help.
Roberto
Attachments
zip1.zip
images of the old and new meshes and the listing file from latest lamina study of mesh1
(369.06 KiB) Downloaded 220 times
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: model choice/ meshing/ convergence problem

Post by Yvan Fournier »

Hello,

Either trying either a turbulence model such as k-epsilon or increasing viscosity should work, but with a turbulence model, you won't have to worry about setting a good viscosity value, so I would probably start there first (then once that works, try laminar with a higher viscosity or lower velocity, the finally, the flow regime you want).

The CFL number appears in its "other" name, that is "Courant" number (of Courant Friedrichs Lewy).
With the pseudo-stationary flow time scheme you selected, you provide a target CFL, but give a reference time step, and the chosen time step can only be a certain factor (10x smaller, 1000x larger by default) times larger or smaller, and can only vary by another factor from time step to time step (10x by default). These parameters are the ones you see in the GUI.

So if you start with a too large reference time step, the code won't be able to honor the target CFL, and once huge CFL values are reached, divergence is usually not far away.

Regards,

Yvan
martin.spel@rtech.fr

Re: model choice/ meshing/ convergence problem

Post by martin.spel@rtech.fr »

Hi, I recently developed a converter from the GridPro mesh generator to the Code-Saturn MED format.
I created a structured mesh for your case with GridPro that I converted to MED format. I post only the coarse mesh due to file size limits. I can share the medium (8 times finer) and fine mesh (64 times finer) with you if you wish.
The fine mesh however is finer than the surface mesh that I extracted from your tet-mesh. So if you are interested you can send me a high fidelity STL file I can rerun the mesher for you. I hope this is of help for you.
Martin
Attachments
gridpro-coarse.med.gz
(3.6 MiB) Downloaded 210 times
Post Reply