📄 mainoiltest.html
字号:
<TITLE>COG 2.1: A bore-hole</TITLE><PRE>#include "<A HREF="coglib.hxx">cog/coglib.hxx</A>"#include <math.h></PRE><H1>3D Example application: a bore-hole</H1> <P>In this example application we want to create a 3D grid with athin bore-hole consisting of a vertical part with isolation and anon-isolated horizontal part: <P><IMG SRC="oiltest.gif"><PRE>static wzRegion Ground(2);static wzRegion BoreHole(3);static wzRegion Isolation(4);static wzFace Hole(2); // boundary condition for the upper end of the hole.</PRE> <P>The problematic point is the relation between the distanceparameters: the diameter of the hole layer is bore-hole is 10,000times the diameter of the bore-hole. This requires highlyanisotropical grids to reduce the number of points.<PRE>static wzFloat H = 1;static wzFloat h = H / 2;static wzFloat d = H/100;static wzFloat D = 1.4 * d;static wzFloat l = 1.5*H; //5 * H;static wzFloat R = 100*H; //100 * H;</PRE> <P>We use three systems of coordinates. Inside the vertical bore-hole(vert) we use standard cylindrical coordinates (cylXY). For the groundoutside the bore-hole (oil) we use a variant: the complex exponentialfunction - this makes the coordinates conformal in xy-direction(expXY). For the horizontal bore-hole we use cylindrical coordinatesin y-direction (cylXZ). Note that we use exponential scaling along thebore-hole to avoid <A HREF="matchproblem.html">match problems</A> inradial direction.<PRE>int main(){ wz3dmap cylXY = new wz3Dcylinder; wz3dmap expXY = new wz3Dcylindrical(new wz2Dexp); wz3dmap cylXZ = new wz3Dcylindrical(new wz2Dpolar,new wz1Dexp); cylXZ->switchYZ(); cogenOctree oil_base = new CogenOctree; oil_base->addBox(Ground, -wzInfty,log(R), -wzPi/2,wzPi/2, h-H,h); oil_base->addBox(Isolation, log(d),log(D), -wzPi/2,wzPi/2, 1.1*d,h); oil_base->setBorder( log(d*D/2),log(R), -wzPi/2,wzPi/2, h-H,h); oil_base->addPlaneX(log(l)); oil_base->addPlaneX(log(2*D)); oil_base->addPlaneZ(d); oil_base->addPlaneZ(1.05*d); oil_base->addPlaneZ(1.5*d); oil_base->addPlaneZ(3*d); oil_base->refinementGlobal(0.2*log(R/d),0.11,0.13*H); oil_base->faceRefinementGlobal(0.6*log(D/d),1.0); cogenChart oil = new CogenChart(oil_base->generator(),expXY); cogenOctree vert_base = new CogenOctree; wzIndex boreHole = vert_base->addBox(BoreHole, 0,d, -wzPi/2,wzPi/2, -d,h); wzIndex isolation = vert_base->addBox(Isolation,d,D, -wzPi/2,wzPi/2, 1.1*d,h); vert_base->setBorder( 0,d*D/2, -wzPi/2,wzPi/2, h-H,h);</PRE> <P>Now, we introduce the same coarse grid subdivisions in z-directionas for the ground. Else, we obtain <A HREF="matchproblem.html">matchproblems</A> in z-direction.<PRE> vert_base->addPlaneZ(d); vert_base->addPlaneZ(1.05*d); vert_base->addPlaneZ(1.5*d); vert_base->addPlaneZ(3*d); vert_base->setFaceOfBoxSide(Hole,boreHole,wzZ); vert_base->refinementGlobal(0.3*d,0.11,0.13*H); cogenChart vert = new CogenChart(vert_base->generator(),cylXY); cogenOctree hor_base = new CogenOctree; hor_base->addBox(BoreHole, 0.0, d, -wzPi/2,wzPi/2, -wzInfty,log(l)); hor_base->setBorder( 0.0,3.0*d, -wzPi/2,wzPi/2, log(2*D),log(1.1*l)); cogenRefine hor_ref = new CogenRefine(hor_base->generator()); hor_ref->refinementGlobal(0.9*d,0.4,0.2*log(R/d)); cogenChart hor = new CogenChart(hor_ref->generator(),cylXZ); cogenComposite gen = new CogenUnion; gen->add(oil->generator()); gen->add(vert->generator()); gen->add(hor->generator());</PRE><PRE> wzgrid grid = (*gen)(); grid->write("oil.sg");}</PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -