# Very thin boundary layers and y+ on complex geometry

Hi folks,

Okay on my simulation I’ve been using the default boundary layer inflation values with relative sizing. This is achieving y+ values that are a bit high for me to feel confident in them. I have followed the master class tutorial comparing results with/without proper boundary layer configuration, so I understand the importance. Though the tail section is the area of most interest, I need flow to be realistically developed when it hits them.

So I’ve begun trying to refine the boundary layer. I’m using all faces in my boundary layer expansion. Initially I turn off the relative layer sizing with this toggle.

Then I used the y+ calculator with default values for density and viscosity, U=31m/s. I’ve tried a variety of reference lengths, from chord length of the wing to the entire aircraft (~1m - 12m) and a variety of y+ (from 1 - 300) and have built the recommended excel calculator to back-calculate final layer thickness. For purposes of this request, here are two extremes:

L=1m, y_+=1

Expansion ratio 1.3
Desired first layer thickness 0.00001199
Layer 1 0.000011990
Layer 2 0.000015587
Layer 3 0.000020263
Layer 4 2.6342E-05
Layer 5 0.000034245
Total thickness 0.000108427

L=12m, y_+=200

Expansion ratio 1.3
Desired first layer thickness 0.00286
Layer 1 0.002860000
Layer 2 0.003718000
Layer 3 0.004833400
Layer 4 0.00628342
Layer 5 0.008168446
Total thickness 0.025863266

In both cases, the layers are quite thin. When I then plug the appropriate values into the boundary layer inflation refinement, I inevitably get a failure in the mesh validity checks. Initially the layers look good:

But after refinement they are completely butchered:

If I revert back to relative sizing and the defaults values for the boundary layer inflation, it all passes successfully.

I’ve reviewed the extensive discussion in @cweisheng’s post and my only inkling is perhaps surface refinement and BL on complex geometry don’t play well together?

Project is here. The simulation I’ve been using for BL refinement is “510G Deflected”.

While I wait I’m going to remove the feature refinement and attempt a remesh.

3 Likes

EDIT on 11-2-2023: The project where this WHOLE topic is mostly summarized is located here: 'Crop duster lateral stability' simulation project by jhartung

Try the link I gave to cweisheng here Boundary Layer Does Not Form - Except When Default Settings Used - #10 by DaleKramer

It should help explain what you are seeing.

I have chosen not to generally use feature refinements but I forget the actual reason that I don’t, I think it was because it was hard to stop it from refining edges where surfaces that are almost parallel meet.

1 Like

For posterity, that post is here.

@DaleKramer thanks for your hard work on that post. I had seen the mesh solver discard all my precious faces as well and was becoming extremely frustrated. But before I try your method, I’m going to try cfMesh.

Hi guys,

Odd thing was I needed to have feature refinement for mine. I think because my geometry was quite “small” especially at the trailing edge, and “twisty”? But then again, it doesn’t fail this way for me in a commercial mesher.

I also just tried the relative sizing after I read about it somewhere else - didn’t work well for me. I should also have followed @DaleKramer’s instructions almost totally… but well…

It’s abit on the backburner for me as I’m sizing up another platform and also I feel like I have tried quite alot of permutations. But would really like to see SimScale work for me. Also intended to try CFmesh but haven’t got round to it. Would be glad to learn what works.

Hi @cweisheng!

Definitely a good issue to mention! I think at some point I would have to create a tutorial on how to really use this ominous y+ value and how to achieve reasonable results. We have many posts on it though but not a video where we explicitly show how to iteratively optimize the layers to achieve wanted y+ values.

Will work on it as soon as my exams are over Tagging @Get_Barried, @yosukegb4 and @pfernandez here as well who might give you some tips in the meantime. I will jump in at a later point, hope that’s fine.

Best,

Jousef

Hi @cweisheng,

I believe that the nature of SnappyHexMesh being a meshing algorithm that “layers” the mesh onto an existing “mesh” i.e the geometry is why it is difficult to get things right.

Most commercial meshes “grow” the mesh rather than layer it if I’m not wrong. This has the advantage of having better mesh behavior and control.

SnappyHexMesh has its advantages in that very complex but well defined geometries are easily meshed and increases in mesh quality can very quickly be increased via the simple refinement levels.

Then again, back to the layering issue, it has and still continues to be very hard to control for whatever reason. An illusive and frustrating problem indeed. Some insights have been derived from Dale and the other PowerUser’s work but it remains difficult to get consistent results.

Sorry to not have much input, its still quite the challenge at the moment. Do try out other meshers and upload the mesh to here on Simscale to take advantage of the processing power avaliable to you.

Cheers.

Regards,
Barry

Thanks for the insight, all. I’m putting off cfMesh for a bit as I don’t want to install all of openFOAM just to get it. Adding significant surface refinement helped - I went from 6 to 8 to match my final layer thickness per @DaleKramer’s post and for the first time, some very thin boundary layers remained after meshing. Unfortunately I’m running out of memory again on subsequent refinements. It seems that simulating lateral stability on an entire airframe is just the edge of the “hobbyist” capabilities.

EDIT
Thought it would be worth posting the layer/refinement level calculator results. Per Dale’s post, the goal is for the surface refinement level to be a similar dimension to the final layer thickness.

Expansion ratio 1.3
Desired first layer thickness 0.000139
Layer 1 0.000139000
Layer 2 0.000180700
Layer 3 0.000234910
Layer 4 0.000305383
Layer 5 0.000396998
Total thickness 0.001256991
Axis Edge Length (m) 40
# Cells along it 40
Refinement Level Refinement Level Edge Length (m)
0 1.000000
1 0.500000
2 0.250000
3 0.125000
4 0.062500
5 0.031250
6 0.015625
7 0.007813
8 0.003906
9 0.001953
10 0.000977
11 0.000488
12 0.000244
Max first layer volume 1.55E-07

OK, I see final layer thickness at ~0.0004 but level 8 is ~0.004 so I think you need to have your surface refinement go to at least 10 but 11 would be better.

I suggest JUST using a surface refinement by itself on all surfaces to keep mesh size down until you get the layering sorted out, then add further refinements as needed and to the limit of your # of cores you can use.

My cores to use rule is the smallest # of cores that will make your mesh without erroring. This will use least core hours.

Ugh, yes so many zeroes I gleefully missed. Cancelling mesh in process.

@DaleKramer in your experiments did you fix surface refinement at the highest level necessary or did you use a reduced range, ie 10 - 10 or 6 - 10?

That is dependent on whether you can mesh without memory errors.
10-10 uses least memory but may ultimately be too steep gradient to BMB or next refinement grid size.
6-10 gives shallower gradient I think…

EDIT: @jhartung Actually I think you need to use 10-10 to keep all surface cells at 10, I think there is a different way to change the gradient after that… sorry trying to do this from memory…

Well after most of the day playing with it, there is clearly no way that I’m going to fit a level 10 surface refinement into this model with 16 cores. It was running out of memory in about 5 minutes. Even on the modest level of refinement of 4-6 I’m cresting 11MM cells.

I’ve gotta say, blown away with the simulation side of SimScale… it’s everything you would want it to be. Sadly I’m blowing all my core-hours trying to get an acceptable mesh with Snappy so I may never get to actually enjoy the simulation side

Hi @jhartung,

CfMesh is standalone if you want it. Check their website. There is no GUI however. At least, not for free. So you’ll have to do all your mesh checks some other way.

Also I believe this project may be beneficial to us all so let me tag @jousefm who may be able to help you on this.

Cheers.

Regards,
Barry

I think you need to take a close look at your boundary layer thickness calculations. Those are awfully thin layers you are requesting for that size and speed of aircraft.

Also, when you have ‘Layer Size’ (used to be Relative layering) enabled in the mesh parameters, you need to specify your final layer thickness (FLT) as a ratio of the nearest cell size. You have it enabled and are requesting a FLT of 0.0003 which is a very small ratio, I used ~0.3 to 0.4 when using relative layers.

EDIT: Thinking out of the box here, I think you will have a hard time getting a suitably layered mesh on the whole plane that is less than 15 million cells. Perhaps you could mesh only 1/2 the plane in SimScale, then export the mesh and use other software to mirror the mesh into the whole plane, at which point you could bring it back into SimScale and see if your account has enough horsepower to run a simulation on a 15M cell mesh.

Don’t get discouraged, you will find a way…

I am working on a generalized procedure that might help you, this has not been validated by anyone but me yet!!!

From my personal experience so far, I believe that a good External Layered CFD Mesh, THAT USES SLIP WALLS ON THE BACKGROUND MESH BOX ‘TUNNEL’, can be achieved with the following elements:

1. Decide on the Level 0 grid mesh size. In my case my 1/2 wingspan geometry (the geometry file is the full aircraft but the simulation will be symmetrical about the fuselage center-line so all geometry bounds here are with respect to the 1/2 geometry) is about 3 meters wide, 4 meters long and 3 meters high. I chose a Level 0 grid size of 1.28 meters since Level 8 would be 0.005 meters (a good number to commit to memory). This 1.28m grid size seems to work for me and could maybe be generalized to about 1/4 of the longest geometry bounds.

2. Decide on what turbulence model to use and its initial values. From what I can determine, the best turbulence model to use for incompressible simulations and which SimScale has available is the k-omega SST model. Dylan has provided a very nice set of formulas which I am showing here that made it very easy to set initial turbulence values and to determine a good reference length for the simulation. Here is an image of my spreadsheet that shows the yellow inputs, green outputs, formulas used and a link to their sources:

• For CFD aircraft use, the last input to enter would be reference length ‘c’ and you simply set ‘c’ to a value that makes ut/u in the range of 0.1 to 2. Since my input of 57 mps for speed is at the high end of my analysis range for this geometry I chose to keep ut/u closer to 2 at 57mps. This resulted in a need for a 2 meter reference length.
_
1. Decide on what yPlus value the mesh will be analyzed at. This will determine the optimum thickness of the boundary layer cell nearest the geometry surface (the ‘estimated wall thickness’ or EWD from the online yPlus calculator). EWD mostly varies based on aircraft speed, reference length and desired yPlus of the simulation. I have learned that unless using ‘full resolution’ wall treatment in the simulations boundary conditions, it is recommended to target a yPlus of 30 to 300 (or an average of 165). I have been using a desired yPlus of 50 lately. I have read that yPlus values from 1 to 30 are just as good as 30 for results accuracy. Areas of yPlus from 1 to 30 simply means your mesh has more refinement than truly needed in that area (from the Q&A section of a tutorial video I watched, can provide this reference if needed).The aircraft speed you need is the easiest decision to be made. The reference length is another story on which very little guidance has been written. I have decided that it is likely best to use that same reference length for yPlus calculations as for the turbulence initial value calculations of item 2 above.

2. Create a Background Mesh Box (BB for short) that is generously sized as a starting point to get the optimization process started. The final size will be optimized later. This BBorg should be larger than any intuitive size that your vast CFD knowledge would guess at. My experience says that the clearance between any axis’s maximum geometry extent and the BBorg wall of that axis for a generous sized box should be ~3 times the maximum geometry range of that axis.

Items 5 to 8 will come at some point after a 2.5% undefined error that I have discovered in BB sizing and positioning is resolved (Hint hint @jprobst )

Here is point #9 on layering:

1. Create a refinement that layers your mesh. You should take your best guess based on your CFD knowledge and some research at number of layers and expansion ratio for now. We will make sure this is optimized later. I really find that relative layering gives me a better yPlus map than absolute layering. The trick was to select the correct Final Wall thickness ratio to give me my desired yPlus. You can determine the proper Final Wall thickness ratio (a good ratio to shoot for is ~0.3 to 0.4) to use based on the grid size of my Item 6 above (which is a surface refinement on all surfaces that get layered). Say you want a final layer of 0.002 meters. Also if your Item 6 surface refinement is a Level 8 grid and is 0.005 meters (from a Level 0 grid of 1.28 meters), then you use thickness of final layer ratio of 0.4.

Items 10 to 14+ will come after I am able to address the 2.5% undefined error mentioned above

5 Likes

Absolutely right. Like I said before, I am not a CFD expert in the sense of knowing how the meshing algo is done or how to get perfect mesh quality… but I have had experience in running lots of CFD and comparing with wind tunnel results… so I really am interested in being able to get data. So, its a bit frustrating that now I am stuck at the layering stage where I am not even at the y+ stage @jousefm is talking about.

@jhartung
You have no idea how much I feel the same way… just last week… Yes, I also would like to refine my mesh to make it work but then I “ran out of memory”.

@Get_Barried
With all these frustrations in mind… how successful is CFmesh at generating the boundary layer? Let’s say SimScale now on average is generating 40% of my layers (in truth, it is lower), how would you say CFmesh performs on an arbitrary geometry for beginners like me and @jhartung? My home laptop is not running Linux so I am trying to figure out how much I want to go into this…

Hi @cweisheng!

Let me comfort you a bit here. I will work on a video on y+ next week which will include my posts, some theoretical background but also applying the knowledge to a case where you we go through this iterative process of improving y+, does that sound good to you?

The problem I see is that a lot of people write and talk about y+ but almost nobody shows how to actually do it.

Keeping you up-to-date!

Jousef

2 Likes

Hi @jousefm! Good to see this topic has sparked some discussion and apologies for dipping into the negativity a bit in my frustration. As you know I’m very bullish on SimScale in general, however I do think there needs to be some work in this area. An iterative example would be very helpful… I’ve been through the “mastering CFD” course you offer and I understand the Law of the Wall at least well enough to apply it here (I think), but the combination of a LOT of possible settings in the mesher, inability to do detailed inspection at high cell counts (mesh clip always fails), and 20+ core-hour runs per iteration has me shooting in the dark

For my little project I think I’m going to scale back to the automatic settings which were working passably well and then run comparative simulations from there. While they may not be objectively correct, they should show me the differences between geometries as long as I’ve made the same mistakes in each one.

1 Like

Hi @DaleKramer, many thanks for BOTH of your very interesting posts. My problem is that I’m simulating a high beta AND alpha angle for lateral stability, so there isn’t much in the way of symmetry I can use. I’m investigating tendency of the aft control surfaces to become ineffective and why.

Also, when you have ‘Layer Size’ (used to be Relative layering) enabled in the mesh parameters, you need to specify your final layer thickness (FLT) as a ratio of the nearest cell size. You have it enabled and are requesting a FLT of 0.0003 which is a very small ratio, I used ~0.3 to 0.4 when using relative layers.

I think you may have simply looked at the project after I had reverted to my simpler mesh settings to be able to move forward. I had it “layer size” disabled and was specifying in meters. I think in the future I would probably revert to relative layering to help the solver automagic out any discrepancies.

I think you need to take a close look at your boundary layer thickness calculations. Those are awfully thin layers you are requesting for that size and speed of aircraft.

Perhaps this is an indicator that I DONT really understand y+ then. Certainly I’m using an arbitrary reference length (~1/3 of the fuselage), but I’ve tried a range and the reference length doesn’t seem to have a large effect on the y+ result. Here’s the results from the y+ calculator, would love your thoughts:

1 Like

Very interesting, I am about to make a long post to help, but first off I see your p an u values are significantly different than SimScales default values of 1.1965 and 0.000015295. This makes a huge difference in the wall spacing.

Can you look into the difference while I make my long post

1 Like