<div dir="ltr"><div>Dear all,</div><div><br></div><div>I try to create a mesh based on a hyperbolic-tangent function. This .geo file works perfectly in gmsh, however, implementing this in OpenFoam causes problems. My guess is that OpenFoam does not like how the layer command is used. I try already couple of stuff to fix it, but it is somehow not possible. <br></div><div><br></div><div>I would be pleasd about any problem to fix my problem.</div><div><br></div><div>Regards</div><div><br></div><div>Sebastian Tietjen  <br></div><div><br></div><div><br></div><div><br></div><div>SetFactory("OpenCASCADE");<br>//+<br>Mesh.RecombineAll=1;<br>g2=1.5;<br>g3=1.5;<br>A3=4;<br>A1=2;<br>L2=1/A3;<br>L3=A3*L2;<br>L1=A1*L2;<br>N1=10;//128;<br>N2=16;//156;<br>N3=20;//312<br><br>//vertical direction - x3 (y)<br>one[0] = 1; <br>layer[0] = 0; <br>For i In {2:N3+1}<br>   one[i] = 1;   <br>       X3=g3*(2*(i-1)/N3-1);<br> layer[i]=(L3/2)*(1+Tanh (X3)/Tanh (g3));<br>EndFor <br>//Extrusion part in vertical direction<br>Point(1) = {0, 0, 0, 1.0};<br>Extrude {0,L3,0} {    <br>Point{1}; <br>Layers{one[], layer[]}; }<br>//horizontal direction - x2 (x)<br>oneX[0] = 1; <br>layerX[0] = 0; <br>For j In {2:N2+1}   <br>        oneX[j] = 1;   <br>      X2=g2*(2*(j-1)/N2-1);<br> layerX[j]=(L2*4/2)*(1+Tanh (X2)/Tanh (g2));<br>EndFor <br>//Extrusion part in 1. vertical direction<br>Extrude {L2,0,0} {    <br>Line{1}; <br>Layers{oneX[], layerX[]}; }<br>//+<br><br>//+Extrude surface<br>Extrude {0, 0, L1} {<br>  Surface{1}; Layers{N1}; Recombine;<br>}<br>//+<br>Transfinite Surface {1};<br>//+<br>Physical Surface("Back") = {7};<br>//+<br>Physical Surface("Front") = {1};<br>//+<br>Physical Surface("HotWall") = {5};<br>//+<br>Physical Surface("ColdWall") = {3};<br>//+<br>Physical Surface("Top") = {4};<br>//+<br>Physical Surface("Bottom") = {6};<br>//+<br>Physical Volume("Fluid") = {1};<br>//+<br><br></div></div>