https://linen.dev logo
Testing SHM Meshing with buffer layers before snap...
# meshing
l
First I'm gonna test if BARAM even works with this, BARAM is a GUI for openFOAM that uses a modified openFOAM code
Seems like I can't get rid of the diamond cells across the surface even if I mess with these settings, so yeah the approach to this meshing causes this with these double curved surfaces
Now I am gonna run it in a simulation and see if I can see the distinct "ripples" or "waves" of wallshearstress and then also see if a higher refinement can get rid of them
y
the level here is just the refinement level applied on the surface, but it is independent of the buffer layer (which is just a switch)
l
To me this looks good if there werent those angled cells, but rn Im having more issues with the boundary layer than those cells tbh
f
I have been using castellated buffer mesh now aswel but it did help with smoothing the upper layer (or I think it did), however as can be seen still on the inside snapping lead to falling in cells that lead to these teras sites https://cdn.discordapp.com/attachments/1439185746589122661/1439969171541852291/image.png?ex=691c734b&is=691b21cb&hm=cc969051fd918a56f7ac3b59482b303a43acb1ce4b329dd648a09f8753c6134f&
Copy code
snapControls
{
    //- Number of patch smoothing iterations before finding correspondence
    //  to surface
    nSmoothPatch 5; // changed from 3 09/10/2025 19:45

    // Number of smoothing of internal points on refinement interfaces 
    nSmoothInternal $nSmoothPatch;  // not in OF10

    //- Relative distance for points to be attracted by surface feature point
    //  or edge. True distance is this factor times local
    //  maximum edge length.
    tolerance 1.0; // changed from 4 09/10/2025 19:45

    //- Number of mesh displacement relaxation iterations.
    nSolveIter 30;

    //- Maximum number of snapping relaxation iterations. Should stop
    //  before upon reaching a correct mesh.
    nRelaxIter 20;

    //- Highly experimental and wip: number of feature edge snapping
    //  iterations. Leave out altogether to disable.
    nFeatureSnapIter 10; 

    //- Detect (geometric only) features by sampling the surface
    //  (default=false).
    implicitFeatureSnap false;

    //- Use castellatedMeshControls::features (default = true)
    explicitFeatureSnap true; 

    //- Detect points on multiple surfaces (only for explicitFeatureSnap)
    multiRegionFeatureSnap true; 

    strictRegionSnap true;

    solver  displacementPointSmoothing;
    displacementPointSmoothingCoeffs
    {
       // Use laplacian to untangle problem areas
       pointSmoother           laplacian;
       nPointSmootherIter      10;
    }
}
Including the buffer layer leads to:
Copy code
Iteration 39
Moving mesh using displacement scaling : min:0 max:1
Checking faces in error :
    non-orthogonality > 65  degrees                        : 4403
    faces with face pyramid volume < 1e-16                 : 0
    faces with face-decomposition tet quality < 1e-09      : 0
    faces with concavity > 40  degrees                     : 0
    faces with area < 1e-16 m^2                            : 0
    faces with skewness > 2   (internal) or 4   (boundary) : 0
    faces with interpolation weights (0..1)  < 0.05        : 0
    faces with volume ratio of neighbour cells < 0.01      : 0
    faces with face twist < 0.05                           : 0
    faces on cells with determinant < 0.02                 : 0
Moved mesh in = 508.01 s
Many non ortho cells
What do you think it is might be the stl not being fine enough... Would be weird as I think it is pretty fine. I am now turning off strictRegionSnap, and increasing nSmoothInternal to something large (100)
y
did you have the non-ortho cells before? (I mean without the buffer layer)
f
No I do not atleast not in OF10, but I can check for you to be 100% sure
y
And do you get non-ortho cells after splitting the mesh into regions?
f
Also have to check, but this is in the end not the problem (or it will become a problem), what I want to fix are the teras sites./ It does not happen when the background mesh is less fine, so it might be the stl not being fine enough... you might be correct it is not the problem of the buffer itself rather moving the mesh.
Orthogonality without castellatedBuffer, also results in problematic non orthogonal cells, so I will look into resolving this first, as this was not the case in OF10 (probably nSmoothInternal causes problems). Or that I set planarAngle to 180
y
I was asking this because in my experience when meshing multiregion, you often ends with non-orthogonality when snapping to curved surfaces (cylinders, spheres,...) typically for specific orientation of the background mesh relative to the surface, due to the fact you keep cells on both sides of the surface. As a result snappy tends to damage snapping to reduce non-orthogonality. These non-ortho faces do not exist anymore after splitting the mesh (as those faces become boundaries after splitting) So it can help to increase the non-ortho criteria in ``meshQualityControls`` to improve snapping.
probably not an acceptable solution in your case, if you also need to use the unsplit mesh
f
There are overlapping regions
How do I explain this
Some variables are only solved inside the grey box, some are both inside the grey box and outside, so orthogonality does matter as there is kindoff not such a thing as internal boundary (for some region there is for another there isnt)
y
yeah that's why I was saying this is probably not acceptable for you
f
I tried with castellationBuffer mesh but it led to no change in the mesh (not even sure if is there).
nSmoothInternal 1; nSmoothPatch 1;
65 degrees ortho around not much higher with max
There cells also dimple inwards
l
Yeah that STL looks good visually but when the cells become smaller than your tris it can become weird
The STL I use is like 70 mb and most of that is just within the trailing edge because the cells are so small there
f
might make it somewhat smaller, I have a super fine version which is 3gb bit overkill, but I do homogeneous sized triangles
l
My home pc is running a simulation now with about 7 million cells. Its the body from before but with a nice and even same cell size distribution across the surface and I managed to get an entire boundary layer around it with SHM. I will show the results once theyre in but I am aiming for 1e-08 residual convergence if it can reach it to see if that diffuses those ripples. I have looked at preliminary results and zooming in I can still see the ripples but they are very small. My question is now: do I get these better results because of - even surface refinement? - even boundary layer? - higher convergence with residuals
The original case that brough up this issue did not have amazing residuals but the forces did not change anymore after 300 iterations and I made it run until 1500 iterations, so thats that
For now I would like to use BARAM CFD as its pretty damn convenient and I enjoy working with it a lot, simplifies the workflow a lot. But setting it up to offload onto a server is difficult. It shows a cluster option for parallization but does not explicitly state where or how.
f
How did you get the surface with 1 layer around, castellatedBuffer mesh and then add a layer?
Could you clarify on the mesh a bit more so I can reproduce it for my geometry
But you still have those cells?
l
wdym exactly
f
Did you now use castellatedBuffer? And this helped or did you addLayer nSurfaceLayer 1?
l
If you follow up on the messages above I am using BARAM Meshing for this, I like the GUI but it just uses Openfoam code as a base It does use Buffer during snapping which you can see above aswell where from the castellation to the snapping the polygons on the surface disappear
. from here specfiically
f
Yes so you use GETMe smoothing, not sure if that is avialable in openfoam itself
Okay so that did the trick pretty much, so not additional layer snapping, just the buffer layer
But from your message it is clear those teras sites still are there?
l
Well i would call them diamond cells I guess, but yes those that sit 45° degrees to other cells on the surface are there
They get generated at the points were poly cells would otherwise be
I would love to just generate a polyhedral mesh, this would resolve all of this, but I dont think there is an opensource poly mesher out there, and if there is I couldnt find it.
f
teras sites as a chemist I like
copy understood if you find something let me know, I am also on the lookout
Results look fine to me, some diffusion and frequency in the results but overall okay
atleast much better than what I had before
I do see some of the typical oddities here that I did on my other simulation of the aircraft surface, just less visible
and probably more because of the frequency
Be aware this was calculated using first order equations, I will go up to second order tomorrow evening
f
I had a discussion about this with prof, and for me he thought it had to do with aspect ratio of where these cells squish others
I would also not recommend using plot over line from paraview, but rather use openfoams
For me it did not resolve anything it decrease the number of them occuring but they are still there
l
openfoam has a plot over line?
I just used the intersection curve plot in paraview
f
yes postProcessing tool, it showed me much more feasible results
For me switching the blockMesh to conformal ish shape worked the best, it is bit tricky with very complex shapes though. The problems arise with slip type boundary conditions for me
2 Views