[Gmsh] separate boundary layer settings

Felix Salazar felix.salazar at polymtl.ca
Tue May 21 20:50:03 CEST 2019


Just rereading your latest message,

According to gmsh documentation, there are several ways to specify mesh size
<http://gmsh.info/doc/texinfo/gmsh.html#Specifying-mesh-element-sizes>.
Global mesh, mesh size at a point/vertex/ curvature meshing (gives you more
nodes in curves than in straight lines), and background mesh.

The boundary layer field you are using can only be properly implemented as
a mesh size indicator if used as background mesh. My guess is that in your
case is partially working, because gmsh creates and evaluates the field and
use it as background due to the command "BoundaryLayer Field = 1". But if
other field is evaluated, the previous is overwritten. That's why you can't
get the combination of your boundary layers. You can only see the cylinder
BL when you comment lines 53-61, which is where you create the 2nd BL.

I'm not sure if using a BoundaryLayer Field = {1,2} would work. In any
case, you can create the 2 fields (BL1, BL2), and then create a 3rd field
that takes the minimum of those other 2. And set the background mesh as
these 3rd field. It will only take 3 extra lines on your .geo file. Check
the example 10 to see some examples of fields and combinations
<http://gmsh.info/doc/texinfo/gmsh.html#t10_002egeo>.

Comment lines 48, 61, and add this after line 62.

Field[3] = Min;
Field[3].FieldsList = {1, 2};
Background Field = 3;

Post the results if satisfied



------------------------------------

*Félix Salazar**felix.salazar at polymtl.ca <felix.salazar at polymtl.ca>*
------------------------------------


On Mon, May 20, 2019 at 8:58 PM Ziad Boutanios <ziad at binkz.ca> wrote:

> Don't worry about it. I'll take a look at background fields, but off the
> bat it seems like a substantial detour for additional boundary layers,
> assuming it works.
>
> Maybe one of the developers can comment whether separate instances of
> BoundaryLayer can be implemented in a mesh at all?
> On 2019-05-20 3:29 p.m., Felix Salazar wrote:
>
> Sorry for not replying sooner. I'm using my phone to read your messages
> and couldn't open gmsh. But you're right, the extrusion lines were
> commented. My bad.
>
> You need to specify a background field. That field needs to somehow
> integrate the effect of your 3 boundary layers. Take a look at this example
> http://gmsh.info/doc/texinfo/gmsh.html#t10_002egeo
>
> Several fields are computed, and the background field used for meshing is
> the minimum of all of them
>
> Not sure if it will work on your version of gmsh
>
> Hope that helps
>
> On Mon, May 20, 2019, 1:16 PM Ziad Boutanios <ziad at binkz.ca> wrote:
>
>>
>> On 2019-05-20 11:59 a.m., Ziad Boutanios wrote:
>>
>>
>> On 2019-05-20 11:26 a.m., Felix Salazar wrote:
>>
>> Based on the .geo file, what you're seeing on the top and bottom surfaces
>> is due to the extrusions. The combination of these plus the BL fields
>> creates more layers than the 5 specified in the extrusions.
>>
>> Try disabling (commenting) either the extrude or the BL field and remesh.
>>
>>
>> The Extrude sections in the bottom of the provided geo file are already
>> commented.
>>
>>
>> Around the cylinder, there's a BL. You have smaller quads there. If you
>> want finer control, try using an O-grid mesh
>> <https://www.researchgate.net/figure/O-grid-around-the-circular-cylinder_fig11_280028215>,
>> similar to the one on the previous link.
>>
>> Thanks for the suggestion but it doesn't help me. I'm looking for a way
>> to implement different instances of BoundaryLayer, each with its own
>> settings. Any idea how this can be done?
>>
>> BTW, I have to use gmsh 3.0.6 for compatibility reasons.
>>
>> Forgot to mention that what you see in the original snapshot around the
>> cylinder is not a BoundaryLayer. That's just the unstructured quad result
>> of Recombine. If you comment lines 53-61 you can see what the cylinder BL
>> looks like. I attached a snapshot of it.
>>
>> The problem is that when I use successive instances of BoundaryLayer,
>> only the last one in the geo file is produced. I need to have them all work
>> so I can customize each with its own settings.
>>
>>
>> ------------------------------------
>>
>> * Félix Salazar **felix.salazar at polymtl.ca <felix.salazar at polymtl.ca>*
>> ------------------------------------
>>
>>
>> On Sun, May 19, 2019 at 11:11 AM Ziad Boutanios <ziad at binkz.ca> wrote:
>>
>>> Hi,
>>>
>>> The geometry I'm meshing is that of a cylinder in a straight rectangular
>>> channel in 2D. The geo file is attached, as well as a screenshot of the
>>> result. I would like to use separate settings for the boundary layer
>>> around the cylinder and at the top and bottom surfaces. To do this I
>>> implemented two BoundaryLayer Field sections (lines 40-48 and 53-61).
>>> Unfortunately only the boundary layer corresponding to the last section
>>> is produced. Can that be fixed using BoundaryLayer?
>>>
>>> Thanks,
>>>
>>> Ziad
>>>
>>>
>>> _______________________________________________
>>> gmsh mailing list
>>> gmsh at onelab.info
>>> http://onelab.info/mailman/listinfo/gmsh
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20190521/b630a06c/attachment.html>


More information about the gmsh mailing list