Merge "duct.stl";
CreateTopology;

ll[] = Line "*";
l = newl;
For j In {0 : #ll[]-1}
	Compound Line(l+j) = ll[j];
EndFor

ss[] = Surface "*";
s = news;
For i In {0 : #ss[]-1}
	Compound Surface(s+i) = ss[i];
EndFor

bl = newl;
bs = news;

Field[1] = MathEval;
Field[1].F = "0.1";

Background Field = 1;

Mesh.CharacteristicLengthExtendFromBoundary = 0;

Physical Surface("Side-01") = {s};
Physical Surface("Top") = {s+1};
Physical Surface("Side-02") = {s+2};
Physical Surface("Outlet") = {s+3};
Physical Surface("Bottom") = {s+4};
Physical Surface("Inlet") = {s+5};

sl = newsl; Surface Loop(sl) = {s:s+5};
vo = newv; Volume(vo) = {sl};

//Physical Volume("V_Fluid") = {vo};

pp[] = Point "*";

Field[2] = BoundaryLayer;
//Field[2].AnisoMax = 60;
Field[2].FacesList = {s:bs-1};
Field[2].EdgesList = {l:bl-1};
Field[2].NodesList = {pp[0]:pp[7]};
//Field[2].FanNodesList = {pp[0]:pp[7]};
//Field[2].IntersectMetrics = 0;
//Field[2].Quads = 0;
//Field[2].hfar = 0.1;
Field[2].hwall_n = 0.025;
//Field[2].hwall_t = 0.1;
Field[2].ratio = 1.1;
Field[2].thickness = 0.05;
BoundaryLayer Field = 2;
//Background Field = 2;

