CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   STAR-CCM+ (https://www.cfd-online.com/Forums/star-ccm/)
-   -   volumetric control total cell count (https://www.cfd-online.com/Forums/star-ccm/94054-volumetric-control-total-cell-count.html)

sieginc. November 3, 2011 19:57

volumetric control total cell count
 
Here is a picture of the mesh I am using for my simulation:

http://img15.imageshack.us/img15/4571/meshissue.jpg

The base size is 10 mm, the size for the volume control is 2.5 mm and absolute. With these values I have a cell count of about 195,000. I tried doing a mesh refinement, but something odd happened. When I refine the mesh for the volume control to 2 mm, the total cell count jumps up over 900,000. I played around with the mesh size for the volume control, and found that when I go from 2.18 mm to 2.17 mm, there is an increase in cell count of about 700,000. How does that many extra cells get added for a one hundredths of a millimeter change!? Its only when I hit this "threshold" value that the cell count just blows up and becomes huge. Where are all these extra cells being packed in? I took mesh scenes cut in different planes and everything looked normal.

Keep in mind that above 2.18 mm there is only a gradual increase in cell count as I refine the mesh, which seems normal, so I do not understand where this huge sudden change from 200,000 to over 900,000 based upon a 1/100 millilmeter change is coming from.

ping November 5, 2011 04:47

I agree it seems strange. Create a threshold (or several) based on cell volume with appropriate lower and upper limits and use this to determine where and how many cells of a few size ranges are in each model.

abdul099 November 5, 2011 15:29

It is a trimmed mesh, so all relations of cell sizes will be nth power of 2. It might happen, the mesher can't place smaller cells when you decrease the cell size only slightly, as it wouldn't be half the size of the next bigger cell.

Now when you reduce the target size below a certain value, the mesher finds out, it can half a cell in all directions without breaking the minimum size.
And to produce twice the cells in every direction is a total of 8 times more cells. When you volumetric control with the bigger settings contains only about 100 000 cells (which is half of the total cell count, that's often a reasonable value), you will get 800 000 cells when the cell size is halfed.

You can prove this by measuring the cell size with both settings. Just place a ruler tool along an edge of a cell and see how it changes when changing the cell size in your volumetric control.

ping November 6, 2011 04:21

abdul is on the right track - I did not notice that you were using a volume source. with a base size of 10mm your vol source cell sizes will only change when you set its size to 5, 2.5, 1.25mm etc.. at some point in between these values the mesher decides to go to the next lower size - you have discovered by accident this transition point for the change from 2.5 to 1.25mm at about 2.17 - I did a test on a simple box with one vol source and confirmed this. a good lesson for all trimmer mesh users - keep boundary and vol source sizes as power of 2 multiples or fractions of the base size if you don't want to see the effect which puzzled you.

sieginc. November 7, 2011 02:57

Thank you for the responses. If that's the case then that really hampers any attempt at a mesh refinement study, since I would only be able to test two mesh sizes of 5 mm and 2.5 mm. That does not give me a whole lot of insight into any convergence. If I get down to 1.25 mm my processing time becomes too impractical. To be honest my intuition tells me 2.5 mm is a sufficient mesh size for what I'm doing, but this is going to be for a thesis so I need to 'prove' the quality of the mesh with some sort of convergence study.

Would I be better off not using the trimmer and just using a tetrahedral mesh?

ping November 7, 2011 04:08

if you change the base size rather than the local size on the vol source or boundary (and ensure these are all set to relative rather than absolute sizing), then you can use any value, and then all the mesh will change size in proportion, and you will be able to get much greater control of the mesh count

sieginc. November 7, 2011 18:50

Quote:

Originally Posted by ping (Post 331011)
if you change the base size rather than the local size on the vol source or boundary (and ensure these are all set to relative rather than absolute sizing), then you can use any value, and then all the mesh will change size in proportion, and you will be able to get much greater control of the mesh count

If I wanted to keep the base size constant, could I just switch the vol source size to relative, and vary that % instead?

Ex: base size 10 mm for all tests

Test 1: vol source size 50% relative to base
Test 2: 40%
Test 3: 30%

etc. etc

ping November 8, 2011 03:20

please read what abdul and i said previously - all local refinements are powers of 2 of the base size - nothing to do with absolute or relative. i cant see why you dont want to change the base size - this is the correct way to do this - if you are not happy with the cells sizes elsewhere then make other local adjustments. alternatively you could create a new region for the area you are concerned about with its own mesh model and so mesh sizes in each region could then be quite independent. need to interface the regions which is dead easy with 3d-cad and parts these days.

abdul099 November 11, 2011 13:24

Ping is absolutely right, I would refine the complete mesh by reducing the base size to study mesh dependendy.
Anyway, when you want to reduce the mesh in your volumetric control without touching the rest of your mesh, you can either use two regions (with additional inaccuracies at the non-conformal interface) or use a polyhedral mesh. I recommend not to use a tetrahedral mesh, as a polyhedral mesh increases the accuracy and significantly reduces the cell count.

sieginc. November 13, 2011 04:46

OK I understand now. Well, I eliminated the problem of the cell count jumping by varying the base size. I do have a more general question relating to meshes and mesh size. I am relatively new to CFD, but for those more experienced, what is your meshing procedure like? Do you arbitrarily pick a mesh size you think will yield good results, or do you perform some type of convergence study every time?

In my case I'm looking at the average and peak surface temperatures of a block that generates heat being cooled by a fan. I gradually refined the mesh using the method discussed in this thread, but I didn't notice any type of convergence as the mesh got finer. The average surface temperature decreased at a constant rate. The peak temperatures increased and decreased at random, but stayed within a certain range.

I guess if someone asked me about my mesh quality, I wouldn't really be able to "prove" its a quality mesh. But then again, what makes a quality mesh anyway? I don't have real data to compare my results to.

abdul099 November 13, 2011 17:42

I would get fired when I would do a mesh study every time! :eek:
On simple problems, I usually pick a mesh size, look at the mesh (often the geometry is complex and therefore the mesh looks bad) and decide where to refine until the mesh looks nice. Keep in mind, a bad looking mesh usually is bad - a nice looking mesh COULD be nice but there is NO GUARANTEE IT IS nice. Of course, it's much easier when you've got some experience from another simulation or a colleague did something similar before etc. Another good point is to compare results with measurement data, this gives a good indication whether you should do something on the mesh or not.
While running the simulation, I have a look on the solution. Best to plot scalar data filled, not smoth or blended filled, so you can see better where gradients might be too big. When your velocity field has a red and a blue cell connected to each other (with automatic range), you should refine your mesh ;)

It would be best to do a mesh study, especially on more complicated problems. But these tend to be too complicated or too big. Reducing cell size by 1.5 in each direction on a 50 million cells mesh might work for the first refinement - but is very expensive and might be even impossible at the second time at the latest.
In your case, the surface average temperature goes down at a constant rate when refining the mesh? So you don't have a mesh independent solution. Keep on refining when it's possible or as long as it is necessary*. When not, make sure you're always using similar meshes when comparing data! And keep in mind, even then results might be "wrong" due to mesh dependency.
By the way, max / min temperature is often defined by boundary condition like wall temperatures, inlet temperature or whatever. In this case you can't use the max or min temperature to judge your mesh, except when the max temperature gets significantly higher than the highest wall temperature. When this occurs in some cells, it's an indicator for a bad mesh.

* Results could even show a wrong trend due to bad mesh sizes or bad boundary condition. In this case, you need to find the reason for this issue.

"Mesh quality" is hard to define. There are a lot different criterias, like change in volume between adjacent cells, angles between cell centers and face normals etc... As long as the invalid cell remover doesn't find much cells to remove, the mesh should be suitable to get a solution. Whether it's a good solution is something different...

sieginc. November 14, 2011 16:14

Quote:

Originally Posted by abdul099 (Post 331904)
I would get fired when I would do a mesh study every time! :eek:
On simple problems, I usually pick a mesh size, look at the mesh (often the geometry is complex and therefore the mesh looks bad) and decide where to refine until the mesh looks nice. Keep in mind, a bad looking mesh usually is bad - a nice looking mesh COULD be nice but there is NO GUARANTEE IT IS nice. Of course, it's much easier when you've got some experience from another simulation or a colleague did something similar before etc. Another good point is to compare results with measurement data, this gives a good indication whether you should do something on the mesh or not.
While running the simulation, I have a look on the solution. Best to plot scalar data filled, not smoth or blended filled, so you can see better where gradients might be too big. When your velocity field has a red and a blue cell connected to each other (with automatic range), you should refine your mesh ;)

It would be best to do a mesh study, especially on more complicated problems. But these tend to be too complicated or too big. Reducing cell size by 1.5 in each direction on a 50 million cells mesh might work for the first refinement - but is very expensive and might be even impossible at the second time at the latest.
In your case, the surface average temperature goes down at a constant rate when refining the mesh? So you don't have a mesh independent solution. Keep on refining when it's possible or as long as it is necessary*. When not, make sure you're always using similar meshes when comparing data! And keep in mind, even then results might be "wrong" due to mesh dependency.
By the way, max / min temperature is often defined by boundary condition like wall temperatures, inlet temperature or whatever. In this case you can't use the max or min temperature to judge your mesh, except when the max temperature gets significantly higher than the highest wall temperature. When this occurs in some cells, it's an indicator for a bad mesh.

* Results could even show a wrong trend due to bad mesh sizes or bad boundary condition. In this case, you need to find the reason for this issue.

"Mesh quality" is hard to define. There are a lot different criterias, like change in volume between adjacent cells, angles between cell centers and face normals etc... As long as the invalid cell remover doesn't find much cells to remove, the mesh should be suitable to get a solution. Whether it's a good solution is something different...

Thank you very much for the insight. I actually believe I may have found the culprit... my prism layer thickness was too great. I had them about the same size as what was in my volume control, and just made them smaller. Now my results seem better.

abdul099 November 14, 2011 16:49

Okay, don't forget to have a look on your Y+ values when twiddling with the prism layer settings...


All times are GMT -4. The time now is 09:41.