[Gmsh] Refinement in a box region

Johannes Theron jantheron at hotmail.com
Wed May 1 10:25:27 CEST 2013


Good morning!

I am meshing a canoe hull inside a box to use in an OpenFoam simulation and
want to refine the water-air interface region. I first import an msh file
created by importing an STL file, then reclassifying and re-saving the
resulting new surface. These surfaces are then subtracted from the
simulation box with the goal of meshing the region outside the hull. I
looked at various posts and decided on using the Field functionality, but my
approach seems to not be working. Can anyone point to an obvious problem?

Jan Theron

-- 
Dr. Johannes N. Theron

Borsteler Chaussee 85-99A, Haus 9
22453 Hamburg
Germany
Tel: +49 176-877-57828


Mesh.Algorithm3D = 1;  //1=delaunay and 4=frontal
Mesh.Optimize=0;
Mesh.RemeshAlgorithm=1;
Geometry.Tolerance = 1.e-12;
Merge 
"4.8m-double-ender-rev4-decked-double-flipped-origin-in-center-refined1-recl
assified.msh";
//RefineMesh;
CreateTopology;

Surface Loop(300)={2,3,4};

minX = -2.6;
maxX =  2.6;
minY = -1;
maxY =   1;
minZ = -.5;
maxZ =  0.6;

IFc  = 0.125;  // Interface
WLt  = 0.05;   // Half thickness of interface layer

pt = 0.05;

Field[1] = Box;
Field[1].VIn =  pt/10;
Field[1].VOut = pt*2;
Field[1].XMin = minX;
Field[1].XMax = maxX;
Field[1].YMin = minY;
Field[1].YMax = maxY;
Field[1].ZMin = IFc-WLt;
Field[1].ZMax = IFc+WLt;

BackgroundField = pt;

p1=newp; Point(p1) = {minX, minY, minZ, pt};
p2=newp; Point(p2) = {maxX, minY, minZ, pt};
p3=newp; Point(p3) = {maxX, maxY, minZ, pt};
p4=newp; Point(p4) = {minX, maxY, minZ, pt};
p5=newp; Point(p5) = {minX, maxY, maxZ, pt};
p6=newp; Point(p6) = {maxX, maxY, maxZ, pt};
p7=newp; Point(p7) = {maxX, minY, maxZ, pt};
p8=newp; Point(p8) = {minX, minY, maxZ, pt};
k2=newreg; Line(k2) = {p5, p8};
k3=newreg; Line(k3) = {p8, p1};
k4=newreg; Line(k4) = {p1, p4};
k5=newreg; Line(k5) = {p4, p5};
k6=newreg; Line(k6) = {p6, p7};
k7=newreg; Line(k7) = {p7, p2};
k8=newreg; Line(k8) = {p2, p3};
k9=newreg; Line(k9) = {p3, p6};
k10=newreg; Line(k10) = {p5, p6};
k11=newreg; Line(k11) = {p4, p3};
k12=newreg; Line(k12) = {p8, p7};
k13=newreg; Line(k13) = {p1, p2};
ll14=newreg; Line Loop(ll14) = {k2, k3, k4, k5};
Plane Surface(15) = {ll14};
ll16=newreg; Line Loop(ll16) = {k10, -k9, -k11, k5};
Plane Surface(17) = {ll16};
ll18=newreg; Line Loop(ll18) = {k12, k7, -k13, -k3};
Plane Surface(19) = {ll18};
ll20=newreg; Line Loop(ll20) = {k6, k7, k8, k9};
Plane Surface(21) = {ll20};
ll22=newreg; Line Loop(ll22) = {k11, -k8, -k13, k4};
Plane Surface(23) = {ll22};
ll24=newreg; Line Loop(ll24) = {k2, k12, -k6, -k10};
Plane Surface(25) = {ll24};
Surface Loop(26) = {15, 25, 19, 21, 23, 17};
Volume(600)={26,300};








-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130501/e71a14fc/attachment.html>