hexagon logo

How to control the prism layer thickness in scFLOW?

I have been testing prism layer insertion settings in my scFLOW model.  My main goal is to increase the total thickness of prism layer coverage. However, when I increase the [Number of layers] setting, the thickness of the 1st prism layer keeps getting smaller. Shouldn’t the 1st layer thickness stay at a fixed fraction  (0.2 as default) of the local octant size?



N/A
[edited by: Rodrigo Auza Gutierrez at 3:04 PM (GMT -5) on May 29, 2025]
  • Hi Rodrigo, thanks for your question on prism layer insertion.

    I understand what you're saying about the 1st prism layer getting smaller when you increase the number of layers.  And I can see how this is not what you expected.  The reason is that it's actually the outermost prism layer that has its size set to the fixed fraction of the local octant size.  - With the default prism insertion settings, the size of the outermost layer is calculated first, then the sizes of the lower layers are calculated one at a time, successively applying the [Variation rate of thickness] setting (default value = 1.1) to reduce the prism thickness as we move towards the wall.

    So, if you have 2 prism layers, the 1st prism layer (the prism layer on the wall), should be 1/1.1 times the size of the local octant.  But if you specify 5 prism layers, the 1st prism layer thickness will be reduced to 1/(1.1^4) of the octant size.  - Going from 2 layers to 5 layers, that overall ratio is reduced from 0.909 to 0.683, meaning that the thickness of the 1st prim layer will be noticeably smaller.

    You said that your goal was to increase the total thickness of prism layer coverage.  Given the simple example above, just increasing the number of prism layers isn't going to give you a straightforward way to control the total coverage, especially if you want to maintain the same 1st prism layer thickness when you vary the number of layers. - You probably want to keep that "y1" size, to maintain the same y+ value on the wall, while increasing the total coverage to take in more of the boundary layer.

    A more effective way to increase the total prism coverage will be to deselect the checkbox for [Calculate thickness automatically from octant size] and then manually set [Thickness of 1st layer] = 0.2 times the local octant size.  With this approach, the size of each prism layer will then be successively calculated from the innermost layer (layer-1) to the outermost layer.  - The opposite order to the default settings order.  When you increase the number of prisms, you will see a much larger (and more easily predictable) increase in their total coverage.  Here's a screenshot showing this modified type of prism layer setting:  (This assumes a local octant size of 0.01 [m] and [Thickness coefficient] = 0.2))

    Your question is actually quite timely as Cradle CFD 2025.1 has just been released and the scFLOW Preprocessor Reference manual now includes a more detailed explanation of how the prism layer thicknesses are calculated.  You can find that in this section of the manual: [Condition] - [Mesh Parameter] - [Parameters for Prism Layer Insertion] - (Supplement 2).

    I hope my comments are helpful.  Please let me know if you have any follow-up questions.

  • Hello David,

    Thank you for your detailed explanation. Your explanation of how the prism layer thickness is controlled makes a lot of sense. As you say, since I am interested in controlling the total thickness height, I will specify the first layer thickness and ensure that there are enough layers to cover the total height.

    I have a follow up question related to the [Timing of Prism Layer Insertion] setting. Does this play a role in either the first layer height or the total thickness?

    I see that there are 3 options: Before volume meshing, after volume meshing, and after polyhedral conversion – how do these affect the outcome of the mesh, and do you have recommendations to pick one over the other?

  • Hi Rodrigo,

    I'm glad my explanation made sense.  Thanks for your follow-up question.

    I've previously tested and compared the 3 different settings for [Timing of Prism Layer Insertion], using a simple model of flow over a sphere.  I tried inserting 2, 5, and 10 prisms and in each case I found that the timing of prism insertion had very little effect on the resulting prisms.  However, that is for an external flow case, where there's not really anything to get in the way of prism insertion.  There might be some more noticeable differences in an internal flow case, especially if the width of a flow path is narrow relative to the local octant size.  One reason I say this is that the detailed settings for prism insertion change depending on the setting of [Timing of Prism Layer Insertion].

    I'm referring to the settings under [Mesh Parameter] - [Detailed setting] - [Mesh Parameter] - [Detailed Settings of Prism Layers].  If the timing setting is [Before volume meshing] or [After volume meshing], the detailed settings dialog looks like this:

    But if the timing is [After polyhedral conversion], we get this dialog instead:

    For internal flow with a narrow flow path, the mesh generation algorithm will try to insert the requested prisms, but if their specified dimensions are not fully compatible with the width of the path, it will have to scale them down, by reducing prism thicknesses and/or the number of prisms.  Some of the detailed settings above refer to these adjustments and as you can see, the prism adjustment algorithm uses different settings depending on the timing of prism insertion (I've put a red box around one of these in the bottom image).  I think this is a consequence of the different status/form of the volume mesh for the different timing options.  All of these settings are documented in the Preprocessor Reference manual, but as you can imagine, the prism insertion results can be very case-specific for internal flow.

    All that being said, my recommendation is to set [Timing of Prism Layer Insertion] to [Before volume meshing].  I say this for two reasons:

    1) It allows prism insertion on "a blank slate". - With that timing, there is only a surface mesh, so there's no need for the mesh generations algorithm to fit prism layers in between volume mesh elements and the walls.  So, it's easier for the algorithm to insert the requested prisms, although the width of a narrow flow path will still be taken into account.

    2) I've found that inserting prisms [Before volume meshing] saves time in the mesh generation stage.  In fact, this is strongly related to 1).  The algorithm can avoid the iterative smoothing steps that are needed for optimum compatibility between the prisms and pre-existing volume mesh elements.  I've typically found that inserting prisms first can reduce meshing time by about 40%.

    But as I said, prism insertion can be very case-specific for an internal flow.  So, I recommend checking your prisms in the final computational mesh.  And you'll also get an "insertion percentage" report in the [Message] window of the Preprocessor.  If you find that [Before volume meshing] doesn't seem to work that well for a particular model and set of prism parameters, then by all means, I encourage you to try the other timing options.

    I hope this answers your follow-up question sufficiently.  Prism insertion can be a complex business, but certainly not always!  In fact, I rarely have to change any of the detailed settings in the dialogs shown above.  The insertion algorithm has been developed and enhanced over several years and software versions and at this point it's really quite robust.