Skip to content
Snippets Groups Projects
Commit b3d735e0 authored by Shina Maini's avatar Shina Maini
Browse files

fix refinement setup

parent 761d925a
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ void run()
double g_maxX1 = 4.096 + offs1;
double g_maxX2 = 2.048;
double g_maxX3 = 2.048;
double radius_inlet = 0.012;
double radius_inlet = 0.006;
if (myid == 0)
{
......@@ -108,37 +108,23 @@ void run()
SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3));
if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathOut + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance());
GenBlocksGridVisitor genBlocks(gridCube);
SPtr<GbObject3D> gridCylinder(new GbCylinder3D(-0.1317,- radius_inlet,- radius_inlet, -0.1107, + radius_inlet, + radius_inlet, radius_inlet));
GenBlocksGridVisitor genBlocks(gridCylinder);
grid->accept(genBlocks);
////create pseudo pipe
double offset1 = 30e-3;
//GbCuboid3DPtr pipe(new GbCuboid3D(g_minX1, g_maxX2*0.5 - offset1, g_maxX3*0.5 - offset1, 270e-3, g_maxX2*0.5 + offset1, g_maxX3*0.5 + offset1));
//if (myid == 0) GbSystem3D::writeGeoObject(pipe.get(), pathOut + "/geo/pipe", WbWriterVtkXmlASCII::getInstance());
//////////////////////////////////////////////////////////////////////////
//refinement
double blockLengthX3Fine = grid->getDeltaX(refineLevel) * blocknx[2];
//double refHight = 0.002;
//GbCuboid3DPtr refineBoxTop(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_maxX3 - refHight, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3));
//if (myid == 0) GbSystem3D::writeGeoObject(refineBoxTop.get(), pathOut + "/geo/refineBoxTop", WbWriterVtkXmlASCII::getInstance());
////GbCuboid3DPtr refineBoxBottom(new GbCuboid3D(g_minX1-blockLength, g_minX2-blockLength, g_minX3, g_maxX1+blockLength, g_maxX2+blockLength, g_minX3+offsetMinX3+blockLengthX3Fine));
//GbCuboid3DPtr refineBoxBottom(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3, g_maxX1 + blockLength, g_maxX2 + blockLength, g_minX3 + refHight));
//if (myid == 0) GbSystem3D::writeGeoObject(refineBoxBottom.get(), pathOut + "/geo/refineBoxBottom", WbWriterVtkXmlASCII::getInstance());
SPtr<GbSphere3D> refineSphereL5(new GbSphere3D(g_minX1, 0.0, 0.0, 3.0*L));
if (myid == 0) GbSystem3D::writeGeoObject(refineSphereL5.get(), pathOut + "/geo/refineSphereL5", WbWriterVtkXmlASCII::getInstance());
//full pipe refine
SPtr<GbObject3D> refineBoxL7(new GbCuboid3D(-0.1107, -0.0165, -0.0165, 0.1317, 0.0165, 0.0165));
if (myid == 0) GbSystem3D::writeGeoObject(refineBoxL7.get(), pathOut + "/geo/refBoxL7", WbWriterVtkXmlASCII::getInstance());
if (myid == 0) GbSystem3D::writeGeoObject(refineBoxL7.get(), pathOut + "/geo/refineBoxL7", WbWriterVtkXmlASCII::getInstance());
//refine languid and upperlip
SPtr<GbObject3D> refineBoxL9(new GbCuboid3D(-0.1007, -0.0165, -0.0165, -0.0627, 0.0165, 0.0165));
if (myid == 0) GbSystem3D::writeGeoObject(refineBoxL9.get(), pathOut + "/geo/refBoxL7", WbWriterVtkXmlASCII::getInstance());
if (myid == 0) GbSystem3D::writeGeoObject(refineBoxL9.get(), pathOut + "/geo/refineBoxL9", WbWriterVtkXmlASCII::getInstance());
SPtr<GbSphere3D> refineSphereL9(new GbSphere3D(g_minX1+76e-3, 0.0, g_minX3+15e-3, 24e-3));
SPtr<GbSphere3D> refineSphereL9(new GbSphere3D(g_minX1+75e-3, 0.0, 0.015, 24e-3));
if (myid == 0) GbSystem3D::writeGeoObject(refineSphereL9.get(), pathOut + "/geo/refineSphereL9", WbWriterVtkXmlASCII::getInstance());
if (refineLevel > 0)
......@@ -164,9 +150,9 @@ void run()
//walls
GbCuboid3DPtr addWallYmin(new GbCuboid3D(g_minX1-0.001 , g_minX2-0.001, g_minX3-0.001, g_maxX1+0.001, g_minX2, g_maxX3+0.001));
if (myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathOut + "/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance());
if (myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathOut + "/geo/addWallYmin", WbWriterVtkXmlASCII::getInstance());
GbCuboid3DPtr addWallYmax(new GbCuboid3D(g_minX1-0.001, g_maxX2, g_minX3-0.001, g_maxX1+0.001, g_maxX2+0.001, g_maxX3+0.001));
if (myid == 0) GbSystem3D::writeGeoObject(addWallYmin.get(), pathOut + "/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance());
if (myid == 0) GbSystem3D::writeGeoObject(addWallYmax.get(), pathOut + "/geo/addWallYmax", WbWriterVtkXmlASCII::getInstance());
GbCuboid3DPtr addWallZmin(new GbCuboid3D(g_minX1-0.001, g_minX2-0.001, g_minX3-0.001, g_maxX1+0.001, g_maxX2+0.001, g_minX3));
if (myid == 0) GbSystem3D::writeGeoObject(addWallZmin.get(), pathOut + "/geo/addWallZmin", WbWriterVtkXmlASCII::getInstance());
GbCuboid3DPtr addWallZmax(new GbCuboid3D(g_minX1-0.001, g_minX2-0.001, g_maxX3, g_maxX1+0.001, g_maxX2+0.001, g_maxX3+0.001));
......@@ -179,15 +165,16 @@ void run()
SPtr<D3Q27Interactor> addWallZmaxInt(new D3Q27Interactor(addWallZmax, grid, velBCAdapter, Interactor3D::SOLID));
//inflow
GbCylinder3DPtr geoInflow(new GbCylinder3D(g_minX1-0.001, -radius_inlet-0.001, -radius_inlet-0.001, g_minX1+0.001, radius_inlet+0.001, radius_inlet + 0.001, radius_inlet));
GbCylinder3DPtr geoInflow(new GbCylinder3D(g_minX1- deltaXcoarse, 0.0, 0.0, g_minX1 + deltaXcoarse, 0.0, 0.0, radius_inlet));
if (myid == 0) GbSystem3D::writeGeoObject(geoInflow.get(), pathOut + "/geo/geoInflow", WbWriterVtkXmlASCII::getInstance());
//outflow
GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2-0.001, g_minX3-0.001, g_maxX1+0.001, g_maxX2+0.001, g_maxX3+0.001));
GbCuboid3DPtr geoOutflow(new GbCuboid3D(g_maxX1, g_minX2 - deltaXcoarse, g_minX3 - deltaXcoarse, g_maxX1 + deltaXcoarse, g_maxX2 + deltaXcoarse, g_maxX3 + deltaXcoarse));
if (myid == 0) GbSystem3D::writeGeoObject(geoOutflow.get(), pathOut + "/geo/geoOutflow", WbWriterVtkXmlASCII::getInstance());
//inflow
SPtr<D3Q27Interactor> inflowIntr = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoInflow, grid, velBCAdapter, Interactor3D::SOLID));
//outflow
SPtr<D3Q27Interactor> outflowIntr = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, outflowBCAdapter, Interactor3D::SOLID));
}
//////////////////////////////////////////////////////////////////////////
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment