Skip to content

Material number 0.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1849
    aliiab
    Member

    Hello!rnrnI’m interested to simulate the fluid flow in a rectangular channel with sphere in its center. Required geometry is almost the same like in your example cylinder2d, but I need 3D geometry. So my code for geometry preparation:rnrnVector<T, 3> center(centerSphereX, centerSphereY, centerSphereZ);rnVector<T, 3> normVector(1.0, 1.0, 1.0);rnIndicatorCircle3D<T> sphere(center, normVector, 0.5*sphereDiam);rnrnsuperGeometry.rename(0, 2); //OKrnsuperGeometry.rename(2, 1, 1, 1, 1); //OKrnrnVector<T,3> minPhysR1 = superGeometry.getStatistics().getMinPhysR( 1 );rnVector<T,3> maxPhysR1 = superGeometry.getStatistics().getMaxPhysR( 1 );rnVector<T,3> minPhysR2 = superGeometry.getStatistics().getMinPhysR( 2 );rnVector<T,3> maxPhysR2 = superGeometry.getStatistics().getMaxPhysR( 2 );rnrnVector<T,3> origin(minPhysR2[0] – L, minPhysR1[1], minPhysR1[2]);rnVector<T,3> extend(minPhysR1[0] – origin[0], maxPhysR1[1] – origin[1], maxPhysR1[2] – origin[2]);rnrn/// Set material number for inflowrnIndicatorCuboid3D<T> inflow(extend, origin);rnsuperGeometry.rename(2, 3, 1, inflow); //OKrnrn/// Set material number for outflowrnorigin[0] = maxPhysR2[0] – L;rnorigin[1] = minPhysR1[1];rnorigin[2] = minPhysR1[2];rnrnextend[0] = maxPhysR2[0] + L – origin[0];rnextend[1] = maxPhysR1[1] – origin[1];rnextend[2] = maxPhysR1[2] – origin[2];rnrnIndicatorCuboid3D<T> outflow(extend, origin);rnsuperGeometry.rename(2, 4, 1, outflow); //OKrnrn/// Set material number for spherernsuperGeometry.rename(1, 5, sphere); //OKrnrn/// Removes all not needed boundary voxels outside the surfacern superGeometry.clean(); //FAIL!!!rnrnBut there are not cells with material number 0 after cleaning the geometry:rnrn[SuperGeometryStatistics3D] materialNumber=1; count=1950382; minPhysR=(0.01,0.01,0.01); maxPhysR=(1.99,0.99,0.99)rn[SuperGeometryStatistics3D] materialNumber=2; count=80400; minPhysR=(0,0,0); maxPhysR=(2,1,1)rn[SuperGeometryStatistics3D] materialNumber=3; count=9801; minPhysR=(0,0.01,0.01); maxPhysR=(0,0.99,0.99)rn[SuperGeometryStatistics3D] materialNumber=4; count=9801; minPhysR=(2,0.01,0.01); maxPhysR=(2,0.99,0.99)rn[SuperGeometryStatistics3D] materialNumber=5; count=17; minPhysR=(0.97,0.47,0.47); maxPhysR=(1.03,0.53,0.53)rnrnrnWhy? Code for cylinder2d is almost the same:rnrn/// Set material number for cylinderrnsuperGeometry.rename(1,5,circle);rnrnMaterial number 0 is not presented in geometry.rnrnsuperGeometry.clean();rnrnMaterial number 0 is presented in geometry now:rn[SuperGeometryStatistics2D] materialNumber=0; count=238; minPhysR=(0.16,0.16); maxPhysR=(0.24,0.245)rn[SuperGeometryStatistics2D] materialNumber=1; count=35686; minPhysR=(0.005,0.005); maxPhysR=(2.195,0.41)rn[SuperGeometryStatistics2D] materialNumber=2; count=882; minPhysR=(0,0); maxPhysR=(2.2,0.415)rn[SuperGeometryStatistics2D] materialNumber=3; count=82; minPhysR=(0,0.005); maxPhysR=(0,0.41)rn[SuperGeometryStatistics2D] materialNumber=4; count=82; minPhysR=(2.2,0.005); maxPhysR=(2.2,0.41)rn[SuperGeometryStatistics2D] materialNumber=5; count=74; minPhysR=(0.155,0.155); maxPhysR=(0.245,0.25)rnrnHow can I “”fill”” the sphere by zero material number?

    #2417
    robin.trunk
    Keymaster

    Hi aliiab,rnrnyou are usingrn

    Quote:
    IndicatorCircle3D<T> sphere(center, normVector, 0.5*sphereDiam);

    rnfor your sphere. This creates just a disc in 3D, therefore no voxel gets the material number 0 assigned, since everything is surface.rnTo create a 3D-sphere, I suggest using IndicatorSphere3D<T> sphere(center, radius).rnrnBestrnRobin

    #2418
    aliiab
    Member

    Thanks, Robin! Now it works correctly.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.