Mesh settings: BFgeometries-wind tunnel-blockmesh-snappymesh_levels-layers of various type

Hi,
HOW TO SET THE MESH CORRECTLY is my big question right now.

I read several (if not all) posts on Github and here, but various are from 2016, with the old grading component and the refinement regions, so at the moment I am pretty confused about what still applies and what doesn’t…

For SnappyHexMesh I read https://openfoamwiki.net/images/f/f0/Final-AndrewJacksonSlidesOFW7.pdf and I also found this other interesting document by the way: http://www.training.prace-ri.eu/uploads/tx_pracetmo/snappyHexMesh.pdf + I read the correspondent part of OF user manual.
I am sort of getting at least the logic behind, not the details just yet.

However, there are inputs in BF components that I really struggle to understand. In particular, what I can’t find any explanations about are the inputs for the BF geometry component, which seem then to be repeated in similar ways also in the tunnel and/or in the snappy.

As it’s probably difficult to explain here what I mean, please see the 9 points on the following images:

![Slide3|690x388]

My overall understanding is:
A. there is a geometry that is made into a BF geometry
B. the bounding box wraps these geometries, sets parametrically the dimensions of the windtunnel + defines what is the refinement region for the blockmesh to be applied
C. The blockmesh is applied through the use of the autograding, which defines a denser mesh in correspondence of the bounding box, and a progressively less dense mesh going towards the tunnel’s extremes.
D. The SnappyHexMesh refines the mesh around the buildings (or any other thing, object of the study) by diving the cells, etc etc as per documents above.

Is this pretty much correct please?

If so, in this ABCD process, what I really don’t get are the 9 points of my images above and in particular points 1, 2, 3, and 4 (incl.my assumption on bounding box function), if answering all 9 is too much.

Please can anyone help me with this, possibly soon-ish…? Thank you very much in advance.

Viola

@viola.maffessanti
9 questions you raised about butterfly I’ve had some of them. Here are some of my own thoughts.
Q1: refineLevel is about surface refinement.The higher level, the mesh refine detailed. Please reference the picture below. And nSrflayers is setting for layer generating. If you are not intend for layer, you can set it as default.


Q2:the boundary setting is equal to other CFD software. The value of temperature boundary is according to your thermal model such as energy modeling.

Thank you for answering Mingganggyin.

Re Q2: yes, but I don’t have an energy model, as it’s only a early stages cfd study. I was wondering if there is a typical temperature to use in this case, otehrwise I will approximate.

Re Q1: yes, that is the definition for the Snappy though if I am not wrong, so I was putting it in my point 7 and 8 at “surface feature level” and “nr. cells between levels” and “global refinem. level”. Are you saying I also have to put it in my point 1 then, so it knows since the beginning how much to refine the BlockMesh? Or what’s the difference between these 4 parameters otherwise?

What I am trying to get is mainly what are the fundamental parameters to change for increasing the mesh refinement.

Thank you! Viola

@viola.maffessanti
Q2: If it’s only a early stages cfd study and you only intend to CFD simulation for ventilation, you can use the default value of temperatue.The value will not efftect in the CFD process.

Hello @viola.maffessanti apologize for the late reply. Let’s take this one at a time.

1a. Refinement levels, as @minggangyin pointed out is setting the surface refinement for each BF geometry. Each level halves the previous cell size, which starts as the size of your are of interest (usually 1m with autograding) at level 0.

1b. nSurfLayers are layers added to surfaces to assist with resolving flow and calculating flow parameters in the near wall boundary. You should not worry or use them for the type of cases you are doing.

  1. You should not use temperature for isothermal cases in the urban environment. In your case you can freely ignore the input

  2. the mesh settings is simply to adjust preview I believe, I will need to check if it actually affects .stl export quality (I doubt it).

  3. refRegions are additional refinement options in case you wish to refine some parts of your geometry further. I would suggest avoiding them unless you know what you’re doing. Using the autograding refinement is safer and faster, with usually equal or better results.

  4. These values just tell BF to ‘extend’ the refined / graded blockMesh for the leeward and top sides. We do this generally to assure the quality of the results. There is no correct value, depends on your case, scales, etc. I am not sure what the error you mention is, it should work with pretty much any value (that doesn’t violate your wind tunnel size)

  5. That’s precisely the count of cells you get during your blockMesh. It’s your starting point. It’s hard, almost impossible to predict the cells after snappyhex, although you get better at it with experience. I would allow for at least double the blockMesh cells as globalcells, maybe more depends on geometry.

  6. all you need to care about there is globalCells, all the rest you can ignore. As mentioned put a high number, at least 2xblockMesh cells (I would go higher). Remember to be smth your computer can handle (about 1million cells for 1GB of RAM).

I hope this clears some things out!

Kind regards,
Theodore.

4 Likes

Many thanks Theodore, this is very helpful.
Viola