Boundary Layers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Boundary Layers

Leon Robers
This post was updated on .
Dear Johan (correct, right?)

Is it possible to not only have boundary layers at internal boundaries (holes) but also on other boundaries?
In the attached model (the same as in the other questions) I would like to have at least at the very left boundary additional boundary layers. But the ideal would be if you could choose which boundaries shall have a boundary layer or if it's easier, just make all boundaries have a boundary layer. Thanks!

The reason behind this is that my CFD colleagues highly doubt that the simulation will give good results if there are no boundary layers included.

CFD_V5_2D.fea
Reply | Threaded
Open this post in threaded view
|

Re: Boundary Layers

Precise Simulation
Administrator
Dear Leon,

The default "Gridgen2D" mesh generator was designed for external aerodynamics applications and can therefore in its current state only make boundary layers for hole regions (or all boundaries if no holes are present).

You can maybe try the "Triangle" mesh generator (select in the "Grid Generation Algorithm" drop-down box) and manually specify a "Boundary Grid Size" for each boundary to your liking (string of mesh sizes per boundary), which maybe is easiest create on the command line for your model as it has quite a number of boundaries, for example:

    gs = 0.08*ones(1,15); gs([4 8 12]) = 0.5; sprintf('%g ',gs)

    >>  0.08 0.08 0.08 0.5 0.08 0.08 0.08 0.5 0.08 0.08 0.08 0.5 0.08 0.08 0.08

(Also set the "Subdomain Grid Size" to 0.5, and decrease the number of grid smoothing steps for this to work for your geometry.)

Gmsh can also be used to generate structured boundary layers for CFD simulations. If you "Export Geometry" in "GEO/Gmsh Format" you can then manually add "Boundary Layer" field commands to the corresponding edges as in the attached unit square example below (the Gmsh executable binary will usually be downloaded to the "%USERPROFILE%/MATLAB/.featool" folder)

    unit-square-boundary-layer.geo

Unfortunately, with boundary layers Gmsh exports some cells with an additional number of tags which the current gmsh_import function does not expect. This will be supported in the next release, but you can also manually remove/fix the extra tags from the exported msh file to make it import now. In the generated msh file from the unit square example you can see that mesh "$Elements" number 31-34, is of type 2=triangle, and have 4 tags (columns 3-7) instead of 2 as all the others.

Another possibility is to try to use the GiD preprocessor which I also believe supports boundary layers and import the grid.

Finally, if you have a custom meshing software that you prefer you can also manually convert and import your mesh to FEATool grid format which is fairly straight forward.


Leon Robers wrote
Is it possible to not only have boundary layers at internal boundaries (holes) but also on other boundaries?
In the attached model (the same as in the other questions) I would like to have at least at the very left boundary additional boundary layers. But the ideal would be if you could choose which boundaries shall have a boundary layer or if it's easier, just make all boundaries have a boundary layer. Thanks!

The reason behind this is that my CFD colleagues highly doubt that the simulation will give good results if there are no boundary layers included.

CFD_V5_2D.fea
Reply | Threaded
Open this post in threaded view
|

Re: Boundary Layers

Leon Robers
alright, thanks!!
I'll try out the first approach and see how this goes.
Since I am constantly changing the geometry by an automated loop, manual changes or external programs which are not easily accessible by matlab are quite a challenge. But I'm confident that it'll work with the triangle mesh generator :)

Reply | Threaded
Open this post in threaded view
|

Re: Boundary Layers

Precise Simulation
Administrator
This post was updated on .
I have made a new build with support for Gmsh boundary layer generation which should work better for your type of geometries. You can download and try it from the link below:

FEATool Multiphysics v1.12 Alpha with Gmsh bounday layers

Please report any issues or strange behaviour as Gmsh API and mesh syntax has been changed quite a lot without much documentation over the last few versions so there could still be edge cases that will cause issues.
Reply | Threaded
Open this post in threaded view
|

Re: Boundary Layers

Leon Robers
This post was updated on .
this is nice, thanks!

For the boundary layers, i get issues when I choose several boundaries with gmsh.
For example: I can generate boundary layers  on boundary 7 and 9. Or I can generate boundary layers on boundary 13,14,15. But I cannot generate boundary layers on 7,9,13,14,15 alltogether. This occurs with all kind of boundary selection combinations, whereas boundary layers always are generated when I only choose 1 or 2 boundaries. The occuring error is
"Number of field in structure arrays being concenated do not match. Concenation of structure arrays requires that these array have the same set of fields"

Only if I choose all boundaries, the Boundary Layers are generated everywhere but there is no mesh everywhere else (weird, isn't it?)

any suggestions where this comes from?

CFD_V8_2D_archive.stl

all_Boundaries.PNG
Reply | Threaded
Open this post in threaded view
|

Re: Boundary Layers

Precise Simulation
Administrator
This post was updated on .
This was caused due to some boundaries with sharp angles (> 60 degrees) getting the "FanNodesList" property (while others didn't), I have updated the alpha build to correct this:

FEATool Multiphysics Alpha Release

Unfortunately, Gmsh does not seem to allow for correct meshing with boundary layers for this geometry. You can perhaps try open and modify the .geo file manually in the Gmsh GUI by itself and see if there is a way to make it work. You can export the .geo files with a command like the following:

    hmax = 0.3;
    bl = get_boundary_layers( fea, [], 0.3 );
    grid = gridgen(fea, 'hmax', hmax, 'gridgen', 'gmsh', 'blayer', [bl.gmsh], ...
                        'fdir', 'gmsh_output_directory', ...
                        'fdir', 'gmsh_filename', ...
                        'clean', false )


Leon Robers wrote
For the boundary layers, i get issues when I choose several boundaries with gmsh.
For example: I can generate boundary layers  on boundary 7 and 9. Or I can generate boundary layers on boundary 13,14,15. But I cannot generate boundary layers on 7,9,13,14,15 alltogether. This occurs with all kind of boundary selection combinations, whereas boundary layers always are generated when I only choose 1 or 2 boundaries. The occuring error is
"Number of field in structure arrays being concenated do not match. Concenation of structure arrays requires that these array have the same set of fields"

Only if I choose all boundaries, the Boundary Layers are generated everywhere but there is no mesh everywhere else (weird, isn't it?)

any suggestions where this comes from?

CFD_V8_2D_archive.stl

all_Boundaries.PNG
Reply | Threaded
Open this post in threaded view
|

Re: Boundary Layers

Leon Robers
alright, this works now better within the FEATool Inteface, thanks!

I'm checking the matlab code in the next days :)