<div dir="ltr">Hi Alexander,<br>I know it has been a while since your last answer, but I have to try.<br>I need to create a boundary layer arround a wing imported in STEP. I try with Boundary Layer Field but I can't make it work. Could you make your boundary layer? Can you explain to me how this field works? A general explanation of size fields would be really helpful. <br>I attach my code so you can take a look.<br><br>Please take into account that my wing is shaped by surfaces 5 and 6 (intrados and extrados). Since I want to run a 2D case the wing is placed between two planes.<br><br><div class="prettyprint" style="background-color: rgb(250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;"><code class="prettyprint"><div class="subprettyprint"><span style="color: #800;" class="styled-by-prettify">//Boundary Layer</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">]</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">BoundaryLayer</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #606;" class="styled-by-prettify">Quads</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">0</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #000;" class="styled-by-prettify">hfar </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">1</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #000;" class="styled-by-prettify">hwall_n </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">1</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #000;" class="styled-by-prettify">hwall_t </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #000;" class="styled-by-prettify">thickness </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">10</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #606;" class="styled-by-prettify">FacesList</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">{</span><span style="color: #066;" class="styled-by-prettify">5</span><span style="color: #660;" class="styled-by-prettify">,</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">6</span><span style="color: #660;" class="styled-by-prettify">};</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #606;" class="styled-by-prettify">AnisoMax</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">1000000</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #660;" class="styled-by-prettify">[</span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">].</span><span style="color: #606;" class="styled-by-prettify">IntersectMetrics</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">1</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"><br></span><span style="color: #606;" class="styled-by-prettify">Background</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #606;" class="styled-by-prettify">Field</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #660;" class="styled-by-prettify">=</span><span style="color: #000;" class="styled-by-prettify"> </span><span style="color: #066;" class="styled-by-prettify">2</span><span style="color: #660;" class="styled-by-prettify">;</span><span style="color: #000;" class="styled-by-prettify"> <br></span></div></code></div><br>I don't even know how big must be hwall and hfar parameters. If my chord is 1000 mm, how large should these parameters be if I want a 10 mm BL? I know boundary layer depends on y+, I just want to know if these parameters are mm, m or some kind of ratio.<br>And finally I'd like to know how "Background Field" works. If I set my Boundary Layer field [2] as background, the whole mesh is refined with the same size (tetra). If I set another field as background, the boundary layer field is not noticed. <br><br>Thank you very much and I hope you can help me,<br><br>El domingo, 9 de febrero de 2014, 15:04:26 (UTC+1), Alexander Tismer  escribió:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Dear Christophe,
<br>
<br>many thanks for your help.
<br>
<br>If I try to create the layer by extrusion I get an error:
<br>
<br>"Impossible to extrude entity 8 (of type 306)"
<br>
<br>As I mentioned in the first post I create my geometry using my own-written subclasses of GFace, GVertex and GEdge. 
<br>Is it necessary to code the extrusion-function for my own geometry entity types?
<br>
<br>After spending some hours to the gmsh code and to the manual I figured out another way. I used a BoundaryLayer field. 
<br>
<br>Field[1] = BoundaryLayer;
<br>Field[1].FacesList = {1,3,8,9};
<br>Field[1].hfar = .5;
<br>Field[1].hwall_n = .5;
<br>Field[1].hwall_t = .5;
<br>Field[1].thickness = 10.;
<br>Field[1].ratio = 1.1;
<br>Field[1].Quads = 0;
<br>Field[1].IntersectMetrics = 1;
<br>BoundaryLayer Field = 1;
<br>
<br>Using the mentioned field I get a mesh with a boundary layer. The mesh looks nice, but if I convert it by using "gmshToFoam" and check it with "checkMesh" I get some errors. The mesh fails the open boundary check.
<br>
<br>***Boundary openness (-0.00152301 -0.000276836 -0.00087618) possible hole in boundary description.
<br> ***Open cells found, max cell openness: 1, number of open cells 21
<br>
<br>The boundary layer looks very fine. Please find attached two pictures.
<br>
<br>If I don't create a boundary layer then my mesh is ok (according to checkMesh). But openfoam runs into problems with the periodic patches (cyclicAMI). I figured out that it is possible to set a master surface to a surface and gmsh copies the mesh from the master surface. I try to do that with my own function:
<br>
<br>void gmshVolume::<wbr>setPeriodicPairOfFaces( GModel *gm, int const numFaceMaster, std::vector<int> const & EdgeListMaster,int const numFaceSlave, std::vector<int> const & EdgeListSlave) const {
<br>                
<br>int NEdges=EdgeListMaster.size();
<br>GFace *gf = gm->getFaceByTag(abs(<wbr>numFaceSlave));
<br>gf->setMeshMaster(<wbr>numFaceMaster);
<br>        for (int i = 0; i < NEdges; i++){
<br>                gf-><wbr>edgeCounterparts[<wbr>EdgeListSlave[i]] = EdgeListMaster[i];
<br>                GEdge *ges = gm->getEdgeByTag(abs(<wbr>EdgeListSlave[i]));
<br>                ges-><wbr>setMeshMaster(EdgeListMaster[<wbr>i]);
<br>        }
<br>}
<br>
<br>Gmsh tries to mesh but ends with
<br>
<br>Error   : Only rotations or translations can be currently taken into account for periodic faces: face 2 not meshed
<br>
<br>Isn't it enough to set the master edges to edgeCounterparts on the slave surface? Because I'm sure that my two surfaces are axially symmetric.
<br>
<br>Thanks
<br>Alex
<br>
<br>
<br>
<br>
<br>
<br>-----Ursprüngliche Nachricht-----
<br>Von: Christophe Geuzaine [mailto:<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WoiH18kK7NYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">cgeu...@ulg.ac.be</a>] 
<br>Gesendet: Freitag, 7. Februar 2014 19:12
<br>An: Alexander Tismer
<br>Cc: <a href="javascript:" target="_blank" gdf-obfuscated-mailto="WoiH18kK7NYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">gm...@geuz.org</a>
<br>Betreff: Re: [Gmsh] Create a Boundary Layer around a blade
<br>
<br>
<br>On 07 Feb 2014, at 19:10, Christophe Geuzaine <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WoiH18kK7NYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">cgeu...@ulg.ac.be</a>> wrote:
<br>
<br>> 
<br>> On 06 Feb 2014, at 10:05, Alexander Tismer <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="WoiH18kK7NYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">alexande...@ihs.uni-<wbr>stuttgart.de</a>> wrote:
<br>> 
<br>>> Hello,
<br>>> 
<br>>> I try to create a boundary layer around a blade of a hydraulic turbine with gmsh.
<br>>> 
<br>>> According to the paper “Gmsh: a three-dimensional finite element mesh generator with built-in pre- and post-processing facilities” (page 18-19) gmsh is able to create such a layer from a set of source surfaces. For me it is not really clear how to do it.
<br>>> Has anybody an example geo file?
<br>>> Furthermore I want to do that with my own written subclasses of GEdge, GFace and GVertex using gmsh as a library. Is this also possible? Currently I created a 3-d mesh of my channel using my own written classes successfully. However I’m in trouble with the boundary layer creation around the blade, hub and shroud.
<br>>> 
<br>> 
<br>> Dear Alexander,
<br>> 
<br>> The feature mentioned in the paper can be accessed by simply using the "Extrude" command (see the attached example).
<br>
<br>With the attachment:
<br>
<br>
<br>> This creates actual geometrical entities for the layer. A more "classical" boundary layer mesh generator (which does not create new entities, but simply extrudes a layer inside the volume) is also under development, but it's not documented yet.
<br>> 
<br>> Christophe
<br>> 
<br>>> Any help is really appreciated.
<br>>> 
<br>>> Many Thanks
<br>>> Alex
<br>>> ______________________________<wbr>_________________
<br>>> gmsh mailing list
<br>>> <a href="javascript:" target="_blank" gdf-obfuscated-mailto="WoiH18kK7NYJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">gm...@geuz.org</a>
<br>>> <a href="http://www.geuz.org/mailman/listinfo/gmsh" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.geuz.org%2Fmailman%2Flistinfo%2Fgmsh\46sa\75D\46sntz\0751\46usg\75AFQjCNEJ3QLvAdHWrw4QzBDqKw4PAU6GzA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.geuz.org%2Fmailman%2Flistinfo%2Fgmsh\46sa\75D\46sntz\0751\46usg\75AFQjCNEJ3QLvAdHWrw4QzBDqKw4PAU6GzA';return true;">http://www.geuz.org/mailman/<wbr>listinfo/gmsh</a>
<br>> 
<br>> --
<br>> Prof. Christophe Geuzaine
<br>> University of Liege, Electrical Engineering and Computer Science 
<br>> <a href="http://www.montefiore.ulg.ac.be/~geuzaine" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.montefiore.ulg.ac.be%2F~geuzaine\46sa\75D\46sntz\0751\46usg\75AFQjCNEmdacRlcY6sK29fZnmB1uwQmsWWQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.montefiore.ulg.ac.be%2F~geuzaine\46sa\75D\46sntz\0751\46usg\75AFQjCNEmdacRlcY6sK29fZnmB1uwQmsWWQ';return true;">http://www.montefiore.ulg.ac.<wbr>be/~geuzaine</a>
<br>> 
<br>> 
<br>> 
<br>
<br>--
<br>Prof. Christophe Geuzaine
<br>University of Liege, Electrical Engineering and Computer Science <a href="http://www.montefiore.ulg.ac.be/~geuzaine" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.montefiore.ulg.ac.be%2F~geuzaine\46sa\75D\46sntz\0751\46usg\75AFQjCNEmdacRlcY6sK29fZnmB1uwQmsWWQ';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.montefiore.ulg.ac.be%2F~geuzaine\46sa\75D\46sntz\0751\46usg\75AFQjCNEmdacRlcY6sK29fZnmB1uwQmsWWQ';return true;">http://www.montefiore.ulg.ac.<wbr>be/~geuzaine</a>
<br>
<br>
<br>
<br></blockquote></div>