Skip to content
Snippets Groups Projects
Commit fa72b3a4 authored by kutscher's avatar kutscher
Browse files

remove LODI in BoundaryConditions

parent 39a9512b
No related branches found
No related tags found
2 merge requests!171Newest Update,!83Fix MPICommunicator
......@@ -159,10 +159,14 @@ void bflow(string configname)
GbSystem3D::writeGeoObject(sphere.get(), outputPath + "/geo/sphere", WbWriterVtkXmlBinary::getInstance());
SPtr<D3Q27Interactor> sphereInt(new D3Q27Interactor(sphere, grid, noSlipBCAdapter, Interactor3D::SOLID));
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY));
////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//restart
SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, outputPath, comm));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, metisVisitor, outputPath, comm));
restartCoProcessor->setLBMKernel(kernel);
restartCoProcessor->setBCProcessor(bcProc);
//restartCoProcessor->setNu(k);
......
......@@ -118,7 +118,8 @@ void run(string configname)
// grid->setPeriodicX2(true);
// grid->setPeriodicX3(true);
grid->setGhostLayerWidth(2);
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE));
//////////////////////////////////////////////////////////////////////////
......@@ -134,7 +135,8 @@ void run(string configname)
rcp->setLBMKernel(kernel);
rcp->setBCProcessor(bcProc);
//////////////////////////////////////////////////////////////////////////
// BC Adapter
//////////////////////////////////////////////////////////////////////////////
mu::Parser fctF1;
// fctF1.SetExpr("vy1*(1-((x1-x0)^2+(x3-z0)^2)/(R^2))");
// fctF1.SetExpr("vy1*(1-(sqrt((x1-x0)^2+(x3-z0)^2)/R))^0.1");
......@@ -154,6 +156,32 @@ void run(string configname)
SPtr<BCAdapter> velBCAdapterF1(new MultiphaseVelocityBCAdapter(true, false, false, fctF1, phiH, 0.0, startTime));
SPtr<BCAdapter> velBCAdapterF2(new MultiphaseVelocityBCAdapter(true, false, false, fctF2, phiH, startTime, endTime));
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new MultiphaseNoSlipBCAlgorithm()));
SPtr<BCAdapter> denBCAdapter(new DensityBCAdapter(rhoLB));
denBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new MultiphaseNonReflectingOutflowBCAlgorithm()));
mu::Parser fctPhi_F1;
fctPhi_F1.SetExpr("phiH");
fctPhi_F1.DefineConst("phiH", phiH);
mu::Parser fctPhi_F2;
fctPhi_F2.SetExpr("phiL");
fctPhi_F2.DefineConst("phiL", phiL);
mu::Parser fctvel_F2_init;
fctvel_F2_init.SetExpr("U");
fctvel_F2_init.DefineConst("U", 0);
velBCAdapterF1->setBcAlgorithm(SPtr<BCAlgorithm>(new MultiphaseVelocityBCAlgorithm()));
//////////////////////////////////////////////////////////////////////////////////
// BC visitor
MultiphaseBoundaryConditionsBlockVisitor bcVisitor;
bcVisitor.addBC(noSlipBCAdapter);
bcVisitor.addBC(denBCAdapter); //Ohne das BB?
bcVisitor.addBC(velBCAdapterF1);
SPtr<D3Q27Interactor> inflowF1Int;
SPtr<D3Q27Interactor> cylInt;
if (newStart) {
......@@ -233,34 +261,6 @@ void run(string configname)
GenBlocksGridVisitor genBlocks(gridCube);
grid->accept(genBlocks);
// BC Adapter
//////////////////////////////////////////////////////////////////////////////
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new MultiphaseNoSlipBCAlgorithm()));
SPtr<BCAdapter> denBCAdapter(new DensityBCAdapter(rhoLB));
denBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new MultiphaseNonReflectingOutflowBCAlgorithm()));
mu::Parser fctPhi_F1;
fctPhi_F1.SetExpr("phiH");
fctPhi_F1.DefineConst("phiH", phiH);
mu::Parser fctPhi_F2;
fctPhi_F2.SetExpr("phiL");
fctPhi_F2.DefineConst("phiL", phiL);
mu::Parser fctvel_F2_init;
fctvel_F2_init.SetExpr("U");
fctvel_F2_init.DefineConst("U", 0);
velBCAdapterF1->setBcAlgorithm(SPtr<BCAlgorithm>(new MultiphaseVelocityBCAlgorithm()));
//////////////////////////////////////////////////////////////////////////////////
// BC visitor
MultiphaseBoundaryConditionsBlockVisitor bcVisitor;
bcVisitor.addBC(noSlipBCAdapter);
bcVisitor.addBC(denBCAdapter); //Ohne das BB?
bcVisitor.addBC(velBCAdapterF1);
SPtr<WriteBlocksCoProcessor> ppblocks(new WriteBlocksCoProcessor(
grid, SPtr<UbScheduler>(new UbScheduler(1)), pathname, WbWriterVtkXmlBinary::getInstance(), comm));
......@@ -359,8 +359,6 @@ void run(string configname)
intHelper.setBC();
grid->accept(bcVisitor);
// initialization of distributions
mu::Parser fct1;
fct1.SetExpr("phiL");
......@@ -405,6 +403,8 @@ void run(string configname)
//ThreeDistributionsSetConnectorsBlockVisitor setConnsVisitor(comm);
grid->accept(bcVisitor);
ThreeDistributionsDoubleGhostLayerSetConnectorsBlockVisitor setConnsVisitor(comm);
grid->accept(setConnsVisitor);
......
......@@ -169,7 +169,7 @@ void pf1()
//grid=SPtr<Grid3D>(new Grid3D(comm));
//restartCoProcessor->restart(200);
SPtr<MPIIOMigrationBECoProcessor> migCoProcessor(new MPIIOMigrationBECoProcessor(grid, mSch, pathOut + "/mig", comm));
SPtr<MPIIOMigrationBECoProcessor> migCoProcessor(new MPIIOMigrationBECoProcessor(grid, mSch, metisVisitor, pathOut + "/mig", comm));
migCoProcessor->setLBMKernel(kernel);
migCoProcessor->setBCProcessor(bcProc);
migCoProcessor->setNu(nuLB);
......
......@@ -172,10 +172,14 @@ void bflow(string configname)
SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3));
if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), outputPath + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance());
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE));
////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//restart
SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, outputPath, comm));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, metisVisitor, outputPath, comm));
//SPtr<MPIIORestartCoProcessor> restartCoProcessor(new MPIIORestartCoProcessor(grid, mSch, outputPath, comm));
restartCoProcessor->setLBMKernel(kernel);
restartCoProcessor->setBCProcessor(bcProc);
......@@ -277,10 +281,7 @@ void bflow(string configname)
}
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::RECURSIVE));
////////////////////////////////////////////
/////delete solid blocks
if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start");
InteractorsHelper intHelper(grid, metisVisitor);
......
......@@ -221,10 +221,14 @@ void bflow(string configname)
SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3));
if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), outputPath + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance());
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY));
////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//restart
SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, outputPath, comm));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, metisVisitor, outputPath, comm));
restartCoProcessor->setLBMKernel(kernel);
restartCoProcessor->setBCProcessor(bcProc);
//restartCoProcessor->setNu(k);
......
......@@ -280,30 +280,6 @@ public:
void setBoundaryDensity(float density) { this->bcDensity = density; }
float getBoundaryDensity() { return this->bcDensity; }
////Lodi extension
void setDensityLodiDensity(const float &bcLodiDensity) { this->bcLodiDensity = bcLodiDensity; }
void setDensityLodiVelocityX1(const float &bcLodiVelocityX1) { this->bcLodiVelocityX1 = bcLodiVelocityX1; }
void setDensityLodiVelocityX2(const float &bcLodiVelocityX2) { this->bcLodiVelocityX2 = bcLodiVelocityX2; }
void setDensityLodiVelocityX3(const float &bcLodiVelocityX3) { this->bcLodiVelocityX3 = bcLodiVelocityX3; }
void setDensityLodiLength(const float &bcLodiLentgh) { this->bcLodiLentgh = bcLodiLentgh; }
float getDensityLodiDensity() const { return this->bcLodiDensity; }
float getDensityLodiVelocityX1() const { return this->bcLodiVelocityX1; }
float getDensityLodiVelocityX2() const { return this->bcLodiVelocityX2; }
float getDensityLodiVelocityX3() const { return this->bcLodiVelocityX3; }
float getDensityLodiLength() const { return this->bcLodiLentgh; }
float &densityLodiDensity() { return this->bcLodiDensity; }
float &densityLodiVelocityX1() { return this->bcLodiVelocityX1; }
float &densityLodiVelocityX2() { return this->bcLodiVelocityX2; }
float &densityLodiVelocityX3() { return this->bcLodiVelocityX3; }
float &densityLodiLentgh() { return this->bcLodiLentgh; }
const float &densityLodiDensity() const { return this->bcLodiDensity; }
const float &densityLodiVelocityX1() const { return this->bcLodiVelocityX1; }
const float &densityLodiVelocityX2() const { return this->bcLodiVelocityX2; }
const float &densityLodiVelocityX3() const { return this->bcLodiVelocityX3; }
const float &densityLodiLentgh() const { return this->bcLodiLentgh; }
/*======================= Qs =============================*/
void setQ(const float &val, const int &direction) { q[direction] = val; }
float getQ(const int &direction) { return q[direction]; }
......@@ -354,13 +330,6 @@ protected:
float bcDensity{ 0.0f };
float bcPhaseField{ 0.0f };
//FIXME: remove LODI variables, don't forget to adjust MPIIOCoProcessors
float bcLodiDensity{ 0.0f };
float bcLodiVelocityX1{ 0.0f };
float bcLodiVelocityX2{ 0.0f };
float bcLodiVelocityX3{ 0.0f };
float bcLodiLentgh{ 0.0f };
float nx1{ 0.0f }, nx2{ 0.0f }, nx3{ 0.0f };
char algorithmType { -1 };
......
......@@ -413,7 +413,7 @@ void TimeAveragedValuesCoProcessor::calculateAverageValues(double timeSteps)
(*av)(Vz, ix1, ix2, ix3) = uz;
}
// fluctuations
// mean fluctuations
if ((options & Fluctuations) == Fluctuations) {
uxx = (*af)(Vxx, ix1, ix2, ix3) / timeSteps;
uyy = (*af)(Vyy, ix1, ix2, ix3) / timeSteps;
......@@ -431,7 +431,7 @@ void TimeAveragedValuesCoProcessor::calculateAverageValues(double timeSteps)
}
if ((options & Triplecorrelations) == Triplecorrelations) {
// triple-correlations
// mean triple-correlations
(*at)(Vxxx, ix1, ix2, ix3) =
(*at)(Vxxx, ix1, ix2, ix3) / timeSteps - 3.0 * uxx * ux + 2.0 * ux * ux * ux;
(*at)(Vxxy, ix1, ix2, ix3) = (*at)(Vxxy, ix1, ix2, ix3) / timeSteps -
......
......@@ -293,7 +293,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step)
LBMReal rhoH = 1.0;
LBMReal rhoL = 1.0 / densityRatio;
//LBMReal rhoToPhi = (rhoH - rhoL) / (phiH - phiL);
LBMReal rhoToPhi = (rhoH - rhoL) / (phiH - phiL);
LBMReal drho = (mfaaa + mfaac + mfaca + mfcaa + mfacc + mfcac + mfccc + mfcca)
+ (mfaab + mfacb + mfcab + mfccb) + (mfaba + mfabc + mfcba + mfcbc) + (mfbaa + mfbac + mfbca + mfbcc)
......@@ -532,7 +532,7 @@ void MultiphaseTwoPhaseFieldsPressureFilterLBMKernel::calculate(int step)
LBMReal rhoH = 1.0;
LBMReal rhoL = 1.0 / densityRatio;
//LBMReal rhoToPhi = (rhoH - rhoL) / (phiH - phiL);
LBMReal rhoToPhi = (rhoH - rhoL) / (phiH - phiL);
LBMReal dX1_phi = gradX1_phi();
LBMReal dX2_phi = gradX2_phi();
......
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