Skip to content
Snippets Groups Projects
Commit f19248f8 authored by Konstantin Kutscher's avatar Konstantin Kutscher
Browse files

fix undefine of variable interfaceWidth in LBMKernel, add variable phaseFieldBC for BC on the wall

parent cd86d26c
No related branches found
No related tags found
2 merge requests!171Newest Update,!83Fix MPICommunicator
......@@ -16,11 +16,11 @@ Re = 10
logToFile = false
newStart = false
newStart = true
restartStep = 10
cpStart = 10
cpStep = 10
cpStart = 1000
cpStep = 1000
outTime = 10
endTime = 10
\ No newline at end of file
endTime = 1000
\ No newline at end of file
#pathname = d:/temp/MultiphaseDropletTest
pathname = E:/Multiphase/DropletTest_new_corr5
pathname = E:/Multiphase/DropletTest_Test
numOfThreads = 4
availMem = 10e9
......
......@@ -73,7 +73,7 @@ void run(string configname)
#if defined(__unix__)
double lastTimeStep = 0;
if (!newStart)
//if (!newStart)
{
std::ifstream ifstr(fileName);
ifstr >> lastTimeStep;
......@@ -143,7 +143,7 @@ void run(string configname)
//kernel = SPtr<LBMKernel>(new MultiphaseScratchCumulantLBMKernel());
// kernel = SPtr<LBMKernel>(new MultiphaseCumulantLBMKernel());
//kernel = SPtr<LBMKernel>(new MultiphaseTwoPhaseFieldsPressureFilterLBMKernel());
kernel = SPtr<LBMKernel>(new MultiphasePressureFilterCompressibleAirLBMKernel());
kernel = SPtr<LBMKernel>(new MultiphasePressureFilterLBMKernel());
mu::Parser fgr;
fgr.SetExpr("-(rho-rho_l)*g_y");
......
pathname = E:/Multiphase/RisingBubble2D_dr10
pathname = E:/Multiphase/RisingBubble2D_dr10_test
numOfThreads = 4
availMem = 10e9
......@@ -32,12 +32,12 @@ Mobility = 0.056 # 0.01 ./. 0.08, fine correction of Phase-field Relaxation para
logToFile = false
newStart = false
restartStep = 50000
restartStep = 10
cpStart = 1000
cpStep = 1000
cpStart = 10
cpStep = 10
outTime = 100
endTime = 100000
outTime = 10000
endTime = 20
rStep = 159990 #160000
\ No newline at end of file
......@@ -71,19 +71,19 @@ void run(string configname)
std::string fileName = "./LastTimeStep" + std::to_string((int)boundingBox[1]) + ".txt";
#if defined(__unix__)
double lastTimeStep = 0;
if (!newStart)
{
std::ifstream ifstr(fileName);
ifstr >> lastTimeStep;
restartStep = lastTimeStep;
if(endTime >= lastTimeStep)
endTime = lastTimeStep + rStep;
else
return;
}
#endif
//#if defined(__unix__)
// double lastTimeStep = 0;
// if (!newStart)
// {
// std::ifstream ifstr(fileName);
// ifstr >> lastTimeStep;
// restartStep = lastTimeStep;
// if(endTime >= lastTimeStep)
// endTime = lastTimeStep + rStep;
// else
// return;
// }
//#endif
//Sleep(30000);
......@@ -165,6 +165,7 @@ void run(string configname)
kernel->setDensityRatio(densityRatio);
kernel->setMultiphaseModelParameters(beta, kappa);
kernel->setContactAngle(theta);
dynamicPointerCast<MultiphasePressureFilterLBMKernel>(kernel)->setPhaseFieldBC(1.0);
SPtr<BCProcessor> bcProc(new BCProcessor());
......@@ -413,23 +414,23 @@ void run(string configname)
if (myid == 0)
UBLOG(logINFO, "Simulation-end");
#if defined(__unix__)
//if (!newStart)
//{
if (myid == 0)
{
std::ofstream ostr(fileName);
ostr << endTime;
cout << "start sbatch\n";
//system("./start.sh");
//system("echo test!");
std::string str = "sbatch startJob" + std::to_string((int)boundingBox[1]) + ".sh";
//system("sbatch startJob512.sh");
system(str.c_str());
}
//MPI_Barrier((MPI_Comm)comm->getNativeCommunicator());
//}
#endif
//#if defined(__unix__)
// //if (!newStart)
// //{
// if (myid == 0)
// {
// std::ofstream ostr(fileName);
// ostr << endTime;
// cout << "start sbatch\n";
// //system("./start.sh");
// //system("echo test!");
// std::string str = "sbatch startJob" + std::to_string((int)boundingBox[1]) + ".sh";
// //system("sbatch startJob512.sh");
// system(str.c_str());
// }
// //MPI_Barrier((MPI_Comm)comm->getNativeCommunicator());
// //}
//#endif
} catch (std::exception &e) {
cerr << e.what() << endl << flush;
......
......@@ -103,16 +103,16 @@ void CalculateTorqueCoProcessor::calculateForces()
SPtr<ILBMKernel> kernel = block->getKernel();
if (kernel->getCompressible())
{
calcMacrosFct = &D3Q27System::calcCompMacroscopicValues;
compressibleFactor = 1.0;
}
else
{
calcMacrosFct = &D3Q27System::calcIncompMacroscopicValues;
compressibleFactor = 0.0;
}
//if (kernel->getCompressible())
//{
// calcMacrosFct = &D3Q27System::calcCompMacroscopicValues;
// compressibleFactor = 1.0;
//}
//else
//{
// calcMacrosFct = &D3Q27System::calcIncompMacroscopicValues;
// compressibleFactor = 0.0;
//}
SPtr<BCArray3D> bcArray = kernel->getBCProcessor()->getBCArray();
SPtr<DistributionArray3D> distributions = kernel->getDataSet()->getFdistributions();
......@@ -160,10 +160,10 @@ void CalculateTorqueCoProcessor::calculateForces()
//if we have got discretization with more level
// deltaX is LBM deltaX and equal LBM deltaT
//double deltaX = 0.5; // LBMSystem::getDeltaT(block->getLevel()); //grid->getDeltaT(block);
double deltaXquadrat = deltaX*deltaX;
torqueX1 *= deltaXquadrat;
torqueX2 *= deltaXquadrat;
torqueX3 *= deltaXquadrat;
//double deltaXquadrat = deltaX*deltaX;
//torqueX1 *= deltaXquadrat;
//torqueX2 *= deltaXquadrat;
//torqueX3 *= deltaXquadrat;
distributions->swap();
......@@ -182,6 +182,8 @@ void CalculateTorqueCoProcessor::calculateForces()
values.push_back(torqueX2global);
values.push_back(torqueX3global);
//UBLOG(logINFO, "counter = " << counter);
rvalues = comm->gather(values);
if (comm->getProcessID() == comm->getRoot())
{
......@@ -204,8 +206,8 @@ UbTupleDouble3 CalculateTorqueCoProcessor::getForces(int x1, int x2, int x3, SP
LBMReal fs[D3Q27System::ENDF + 1];
distributions->getDistributionInv(fs, x1, x2, x3);
LBMReal /*rho = 0.0,*/ vx1 = 0.0, vx2 = 0.0, vx3 = 0.0, drho = 0.0;
calcMacrosFct(fs, drho, vx1, vx2, vx3);
//LBMReal /*rho = 0.0,*/ vx1 = 0.0, vx2 = 0.0, vx3 = 0.0, drho = 0.0;
//calcMacrosFct(fs, drho, vx1, vx2, vx3);
//rho = 1.0 + drho * compressibleFactor;
if(bc)
......
......@@ -165,7 +165,7 @@ protected:
LBMReal phiH;
LBMReal tauH;
LBMReal mob;
LBMReal interfaceWidth;
LBMReal interfaceWidth { 4.0 };
private:
void checkFunction(mu::Parser fct);
......
......@@ -87,6 +87,7 @@ SPtr<LBMKernel> MultiphasePressureFilterLBMKernel::clone()
kernel->setDeltaT(deltaT);
kernel->setGhostLayerWidth(2);
dynamicPointerCast<MultiphasePressureFilterLBMKernel>(kernel)->initForcing();
dynamicPointerCast<MultiphasePressureFilterLBMKernel>(kernel)->setPhaseFieldBC(this->phaseFieldBC);
return kernel;
}
......@@ -252,14 +253,8 @@ void MultiphasePressureFilterLBMKernel::calculate(int step)
+ (mfabb + mfcbb) + (mfbab + mfbcb) + (mfbba + mfbbc) + mfbbb;
LBMReal rho = rhoH + rhoToPhi * ((*phaseField)(x1, x2, x3) - phiH);
//! variable density -> TRANSFER!
//LBMReal rho = rhoH * ((*phaseField)(x1, x2, x3)) + rhoL * ((*phaseField2)(x1, x2, x3));
(*pressureOld)(x1, x2, x3) = (*pressure)(x1, x2, x3) + rho * c1o3 * drho;
//(*pressure)(x1, x2, x3) = (((*phaseField)(x1, x2, x3)) + ((*phaseField2)(x1, x2, x3)) - c1) * c1o3;
////!!!!!! relplace by pointer swap!
//(*pressureOld)(x1, x2, x3) = (*pressure)(x1, x2, x3);
}
}
}
......@@ -1586,7 +1581,7 @@ void MultiphasePressureFilterLBMKernel::findNeighbors(CbArray3D<LBMReal, Indexer
if (!bcArray->isSolid(x1 + DX1[k], x2 + DX2[k], x3 + DX3[k])) {
phi[k] = (*ph)(x1 + DX1[k], x2 + DX2[k], x3 + DX3[k]);
} else {
phi[k] = 0.0;
phi[k] = phaseFieldBC;
}
}
}
......
......@@ -52,6 +52,16 @@ public:
void calculate(int step) override;
SPtr<LBMKernel> clone() override;
double getCalculationTime() override { return .0; }
void setPhaseFieldBC(LBMReal bc)
{
phaseFieldBC = bc;
}
LBMReal getPhaseFieldBC()
{
return phaseFieldBC;
}
protected:
virtual void initDataSet();
void swapDistributions() override;
......@@ -94,6 +104,8 @@ protected:
LBMReal forcingX1;
LBMReal forcingX2;
LBMReal forcingX3;
LBMReal phaseFieldBC { 0.0 }; // if 0.0 then light fluid on the wall, else if 1.0 havy fluid
};
#endif
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