Skip to content
Snippets Groups Projects
Commit a5c030c4 authored by schoen's avatar schoen
Browse files

Merge branch 'develop' of https://git.rz.tu-bs.de/irmb/VirtualFluids_dev into develop

parents 837b09f2 c2f23670
No related branches found
No related tags found
1 merge request!35Kernel factory simplified
Showing
with 681 additions and 173 deletions
# Contributing
If you want to contribute to VirtualFluids, your help is very welcome.
To contribute use a pull request as follows:
To contribute use a merge request as follows:
### How to make a clean pull request
### How to make a clean merge request
- Create a personal fork of VirtualFluids.
- Clone the fork on your local machine. Your remote repo on gitea is called `origin`.
- Clone the fork on your local machine. Your remote repo on gitlab is called `origin`.
- Add the original repository as a remote called `upstream`.
- If you created your fork a while ago be sure to pull upstream changes into your local repository.
- Create a new branch to work on! Branch from `develop` or `open_source`.
......@@ -16,10 +16,10 @@ To contribute use a pull request as follows:
- Write or adapt tests as needed.
- Add or change the documentation as needed.
- Push your branch to your fork on gitea, the remote `origin`.
- From your fork open a pull request in the correct branch. Target the project's `develop` or `open_source` branch
- From your fork open a merge request in the correct branch. Target the project's `develop` or `open_source` branch
-
- If we requests further changes just push them to your branch. The PR will be updated automatically.
- Once the pull request is approved and merged you can pull the changes from `upstream` to your local repo and delete
- If we requests further changes just push them to your branch. The MR will be updated automatically.
- Once the merge request is approved and merged you can pull the changes from `upstream` to your local repo and delete
your extra branch(es).
And last but not least: Always write your commit messages in the present tense. Your commit message should describe what the commit, when applied, does to the code – not what you did to the code.
......
......@@ -69,4 +69,5 @@ add_subdirectory(${APPS_ROOT_CPU}/HerschelBulkleyModel)
add_subdirectory(${APPS_ROOT_CPU}/rheometer)
add_subdirectory(${APPS_ROOT_CPU}/CouetteFlow)
add_subdirectory(${APPS_ROOT_CPU}/Multiphase)
add_subdirectory(${APPS_ROOT_CPU}/ViskomatXL)
......@@ -100,7 +100,7 @@ void bflow(string configname)
double c = 10; // 1.0 / 6.0;
double mu0 = 1e-4;
SPtr<Thixotropy> thix = Thixotropy::getInstance();
SPtr<Rheology> thix = Rheology::getInstance();
//Herschel-Bulkley
thix->setPowerIndex(n);
thix->setViscosityParameter(k);
......@@ -111,9 +111,9 @@ void bflow(string configname)
thix->setMu0(mu0);
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new PowellEyringModelNoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyPowellEyringModelNoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm()));
//BS visitor
BoundaryConditionsBlockVisitor bcVisitor;
......@@ -124,7 +124,7 @@ void bflow(string configname)
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new PowellEyringModelLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new HerschelBulkleyModelLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyK17LBMKernel());
SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new BinghamModelLBMKernel());
SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyBinghamModelLBMKernel());
kernel->setForcingX1(forcing);
kernel->setWithForcing(true);
kernel->setBCProcessor(bcProc);
......
......@@ -120,7 +120,7 @@ void bflow(string configname)
double c = 10; // 1.0 / 6.0;
double mu0 = 1e-4;
SPtr<Thixotropy> thix = Thixotropy::getInstance();
SPtr<Rheology> thix = Rheology::getInstance();
//Herschel-Bulkley
thix->setPowerIndex(n);
thix->setViscosityParameter(k);
......@@ -131,9 +131,9 @@ void bflow(string configname)
thix->setMu0(mu0);
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new PowellEyringModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyPowellEyringModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm()));
//BS visitor
BoundaryConditionsBlockVisitor bcVisitor;
......
......@@ -94,7 +94,7 @@ void bflow(string configname)
double omegaMin = 1.0e-8;
SPtr<Thixotropy> thix = Thixotropy::getInstance();
SPtr<Rheology> thix = Rheology::getInstance();
thix->setPowerIndex(n);
thix->setViscosityParameter(k);
thix->setYieldStress(tau0);
......@@ -102,8 +102,8 @@ void bflow(string configname)
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm()));
SPtr<BCAdapter> slipBCAdapter(new SlipBCAdapter());
slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleSlipBCAlgorithm()));
......
########################################################
## C++ PROJECT ###
########################################################
PROJECT(viskomat)
vf_add_library(BUILDTYPE binary PRIVATE_LINK VirtualFluidsCore basics ${MPI_CXX_LIBRARIES} FILES viskomat.cpp )
\ No newline at end of file
nuLB = 1.5e-3
\ No newline at end of file
outputPath = d:/temp/rheometer/rheometerBinghamqQBB/rheometerBingham_tau_20e-7_nu_1.5e-3_new_lim
viscosityPath = d:/Projects/VirtualFluidsCombined/apps/cpu/rheometer
numOfThreads = 4
availMem = 8e9
logToFile = false
blocknx = 8 8 1
#boundingBox = 32 32 1
deltax = 1
#boundingBox = 0.02 0.02 0.00125
#deltax = 0.000625
refineLevel = 0
OmegaLB = 4e-5
tau0 = 20e-7
resolution = 32
scaleFactor = 1
newStart = true
restartStep = 100000
cpStart = 10000
cpStep = 10000
outTime = 10000
endTime = 100000
\ No newline at end of file
#include <iostream>
#include <string>
#include <VirtualFluids.h>
using namespace std;
void bflow(string configname)
{
try
{
ConfigurationFile config;
config.load(configname);
string outputPath = config.getValue<string>("outputPath");
string viscosityPath = config.getValue<string>("viscosityPath");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blocknx = config.getVector<int>("blocknx");
vector<double> boundingBox = config.getVector<double>("boundingBox");
//double nuLB = 1.5e-3;//config.getValue<double>("nuLB");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
int refineLevel = config.getValue<int>("refineLevel");
bool logToFile = config.getValue<bool>("logToFile");
double restartStep = config.getValue<double>("restartStep");
double deltax = config.getValue<double>("deltax");
double cpStep = config.getValue<double>("cpStep");
double cpStart = config.getValue<double>("cpStart");
bool newStart = config.getValue<bool>("newStart");
double OmegaLB = config.getValue<double>("OmegaLB");
double tau0 = config.getValue<double>("tau0");
double scaleFactor = config.getValue<double>("scaleFactor");
double resolution = config.getValue<double>("resolution");
ConfigurationFile viscosity;
viscosity.load(viscosityPath + "/viscosity.cfg");
double nuLB = viscosity.getValue<double>("nuLB");
outputPath = outputPath + "/rheometerBingham_" + config.getValue<string>("resolution") + "_" + config.getValue<string>("OmegaLB");
SPtr<Communicator> comm = MPICommunicator::getInstance();
int myid = comm->getProcessID();
if (logToFile)
{
#if defined(__unix__)
if (myid == 0)
{
const char* str = outputPath.c_str();
mkdir(str, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
}
#endif
if (myid == 0)
{
stringstream logFilename;
logFilename << outputPath + "/logfile" + UbSystem::toString(UbSystem::getTimeStamp()) + ".txt";
UbLog::output_policy::setStream(logFilename.str());
}
}
LBMReal rhoLB = 0.0;
//akoustic
OmegaLB /= scaleFactor;
nuLB *=scaleFactor;
endTime *= scaleFactor;
//outTime = endTime;
cpStart = endTime;
cpStep = endTime;
//diffusive
//OmegaLB /= scaleFactor * scaleFactor;
//tau0 /= scaleFactor * scaleFactor;
//endTime *= scaleFactor * scaleFactor;
//outTime = endTime;
//cpStart = endTime;
//cpStep = endTime;
SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter());
// double uWorld = (N * PI) / 30.0; //0.0037699111843
// double rhoWorld = 2350.0; //kg/m^3
//double R0 = boundingBox[0] * 0.5;
//SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter(deltax, uWorld*R0, rhoWorld, 1.0, uLB));
//if (myid == 0) UBLOG(logINFO, conv->toString());
//bounding box
double g_minX1 = 0;
double g_minX2 = 0;
double g_minX3 = 0;
double g_maxX1 = boundingBox[0];
double g_maxX2 = boundingBox[1];
double g_maxX3 = boundingBox[2];
//double g_minX1 = -boundingBox[0]/2.0;
//double g_minX2 = -boundingBox[1] / 2.0;
//double g_minX3 = -boundingBox[2]/2.0;
//double g_maxX1 = boundingBox[0]/2.0;
//double g_maxX2 = boundingBox[1]/2.0;
//double g_maxX3 = boundingBox[2]/2.0;
// double blockLength = 3.0 * deltax;
// double d = 2.0 * radius;
// double U = uLB;
// double Gamma = U / d;
// double muWorld = 20; //Pa*s
// double k = 0.0015; // muWorld / rhoWorld * conv->getFactorViscosityWToLb(); //(U * d) / (Re);
// //double k = (U * d) / (Re * std::pow(Gamma, n - 1));
// double yielStressWorld = 20; //Pa
// double tau0 = 1e-6;// 3e-6;//yielStressWorld * conv->getFactorPressureWToLb(); //Bn * k * std::pow(Gamma, n);
//double k = 0.05; // (U * d) / (Re * std::pow(Gamma, n - 1));
//double tau0 = 3e-6; //Bn * k * std::pow(Gamma, n);
//double forcing = 8e-7;
//double omegaMin = 1.0e-8;
SPtr<Rheology> thix = Rheology::getInstance();
//thix->setPowerIndex(n);
//thix->setViscosityParameter(k);
thix->setYieldStress(tau0);
//thix->setOmegaMin(omegaMin);
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm()));
//SPtr<BCAdapter> slipBCAdapter(new SlipBCAdapter());
//slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleSlipBCAlgorithm()));
mu::Parser fctVx;
//fctVx.SetExpr("omega*(r-x2)");
fctVx.SetExpr("-Omega*(x2-r)");
fctVx.DefineConst("Omega", OmegaLB);
//fctVx.DefineConst("r", R0);
fctVx.DefineConst("r", g_maxX1*0.5);
mu::Parser fctVy;
fctVy.SetExpr("Omega*(x1-r)");
fctVy.DefineConst("Omega", OmegaLB);
//fctVy.DefineConst("r", R0);
fctVy.DefineConst("r", g_maxX2 * 0.5);
mu::Parser fctVz;
fctVz.SetExpr("0.0");
SPtr<BCAdapter> velocityBCAdapter(new VelocityBCAdapter(true, true, true, fctVx, fctVy, fctVz, 0, BCFunction::INFCONST));
//velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityBCAlgorithm()));
//velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleVelocityBCAlgorithm()));
//velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityWithDensityBCAlgorithm()));
velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelVelocityBCAlgorithm()));
//SPtr<BCAdapter> densityBCAdapter(new DensityBCAdapter());
//densityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NonEqDensityBCAlgorithm()));
////densityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NonReflectingOutflowBCAlgorithm()));
//BS visitor
BoundaryConditionsBlockVisitor bcVisitor;
bcVisitor.addBC(noSlipBCAdapter);
//bcVisitor.addBC(slipBCAdapter);
bcVisitor.addBC(velocityBCAdapter);
//bcVisitor.addBC(densityBCAdapter);
SPtr<BCProcessor> bcProc;
bcProc = SPtr<BCProcessor>(new BCProcessor());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CumulantLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new CompressibleCumulant4thOrderViscosityLBMKernel());
SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new RheologyK17LBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new HerschelBulkleyModelLBMKernel());
//SPtr<LBMKernel> kernel = SPtr<LBMKernel>(new BinghamModelLBMKernel());
kernel->setBCProcessor(bcProc);
//kernel->setForcingX1(forcing);
//kernel->setWithForcing(true);
SPtr<Grid3D> grid(new Grid3D(comm));
grid->setPeriodicX1(false);
grid->setPeriodicX2(false);
grid->setPeriodicX3(true);
grid->setDeltaX(deltax);
grid->setBlockNX(blocknx[0], blocknx[1], blocknx[2]);
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());
//////////////////////////////////////////////////////////////////////////
//restart
SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart));
SPtr<MPIIOMigrationCoProcessor> restartCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, outputPath, comm));
restartCoProcessor->setLBMKernel(kernel);
restartCoProcessor->setBCProcessor(bcProc);
//restartCoProcessor->setNu(k);
//////////////////////////////////////////////////////////////////////////
////stator
SPtr<GbObject3D> stator(new GbCylinder3D(0.5 * g_maxX1, 0.5 * g_maxX2, g_minX3-2.0*deltax, 0.5 * g_maxX1, 0.5 * g_maxX2, g_maxX3+ 2.0 * deltax, 0.5 * g_maxX1));
GbSystem3D::writeGeoObject(stator.get(), outputPath + "/geo/stator", WbWriterVtkXmlBinary::getInstance());
SPtr<D3Q27Interactor> statorInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(stator, grid, velocityBCAdapter, Interactor3D::INVERSESOLID));
////rotor (cylinder)
SPtr<GbObject3D> rotor(new GbCylinder3D(0.5 * g_maxX1, 0.5 * g_maxX2, g_minX3- 2.0 * deltax, 0.5 * g_maxX1, 0.5 * g_maxX2, g_maxX3+ 2.0 * deltax, 0.25 * g_maxX1));
GbSystem3D::writeGeoObject(rotor.get(), outputPath + "/geo/rotor", WbWriterVtkXmlBinary::getInstance());
SPtr<D3Q27Interactor> rotorInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(rotor, grid, noSlipBCAdapter, Interactor3D::SOLID));
if (myid == 0)
{
UBLOG(logINFO, "Parameters:");
//UBLOG(logINFO, "forcing = " << forcing);
UBLOG(logINFO, "rho = " << rhoLB);
UBLOG(logINFO, "uLB = " << OmegaLB);
UBLOG(logINFO, "nuLB = " << nuLB);
// UBLOG(logINFO, "Re = " << (U * d) / (k * std::pow(Gamma, n - 1)));
// UBLOG(logINFO, "Bn = " << tau0 /(k * std::pow(Gamma, n)));
// UBLOG(logINFO, "k = " << k);
// UBLOG(logINFO, "n = " << n);
UBLOG(logINFO, "tau0 = " << tau0);
UBLOG(logINFO, "scaleFactor = " << scaleFactor);
UBLOG(logINFO, "deltax = " << deltax);
UBLOG(logINFO, "number of levels = " << refineLevel + 1);
UBLOG(logINFO, "number of threads = " << numOfThreads);
UBLOG(logINFO, "number of processes = " << comm->getNumberOfProcesses());
UBLOG(logINFO, "blocknx = " << blocknx[0] << " " << blocknx[1] << " " << blocknx[2]);
UBLOG(logINFO, "resolution = " << resolution);
// UBLOG(logINFO, "boundingBox = " << boundingBox[0] << " " << boundingBox[1] << " " << boundingBox[2]);
// UBLOG(logINFO, "sphereCenter = " << sphereCenter[0] << " " << sphereCenter[1] << " " << sphereCenter[2]);
UBLOG(logINFO, "output path = " << outputPath);
UBLOG(logINFO, "Preprozess - start");
}
if (newStart)
{
GenBlocksGridVisitor genBlocks(gridCube);
grid->accept(genBlocks);
if (refineLevel > 0)
{
GbCuboid3DPtr refCube(new GbCuboid3D(-10, -10, -10, 0, 0, 0));
if (myid == 0) GbSystem3D::writeGeoObject(refCube.get(), outputPath + "/geo/refCube", WbWriterVtkXmlASCII::getInstance());
if (myid == 0) UBLOG(logINFO, "Refinement - start");
RefineCrossAndInsideGbObjectHelper refineHelper(grid, refineLevel, comm);
//refineHelper.addGbObject(sphere, refineLevel);
refineHelper.addGbObject(refCube, refineLevel);
refineHelper.refine();
if (myid == 0) UBLOG(logINFO, "Refinement - end");
}
//walls
//GbCuboid3DPtr wallZmin(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_minX3 - blockLength, g_maxX1 + blockLength, g_maxX2 + blockLength, g_minX3));
//if (myid == 0) GbSystem3D::writeGeoObject(wallZmin.get(), outputPath + "/geo/wallZmin", WbWriterVtkXmlASCII::getInstance());
//GbCuboid3DPtr wallZmax(new GbCuboid3D(g_minX1 - blockLength, g_minX2 - blockLength, g_maxX3, g_maxX1 + blockLength, g_maxX2 + blockLength, g_maxX3 + blockLength));
//if (myid == 0) GbSystem3D::writeGeoObject(wallZmax.get(), outputPath + "/geo/wallZmax", WbWriterVtkXmlASCII::getInstance());
////wall interactors
//SPtr<D3Q27Interactor> wallZminInt(new D3Q27Interactor(wallZmin, grid, noSlipBCAdapter, Interactor3D::SOLID));
//SPtr<D3Q27Interactor> wallZmaxInt(new D3Q27Interactor(wallZmax, grid, noSlipBCAdapter, Interactor3D::SOLID));
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::BSW, MetisPartitioner::KWAY));
////////////////////////////////////////////
/////delete solid blocks
if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start");
InteractorsHelper intHelper(grid, metisVisitor);
//intHelper.addInteractor(wallZminInt);
//intHelper.addInteractor(wallZmaxInt);
intHelper.addInteractor(statorInt);
intHelper.addInteractor(rotorInt);
intHelper.selectBlocks();
if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - end");
//////////////////////////////////////
SPtr<CoProcessor> ppblocks(new WriteBlocksCoProcessor(grid, SPtr<UbScheduler>(new UbScheduler(1)), outputPath, WbWriterVtkXmlBinary::getInstance(), comm));
ppblocks->process(0);
unsigned long nob = grid->getNumberOfBlocks();
int gl = 3;
unsigned long nodb = (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nod = nob * (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nodg = nob * (blocknx[0] + gl) * (blocknx[1] + gl) * (blocknx[1] + gl);
double needMemAll = double(nodg * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
if (myid == 0)
{
UBLOG(logINFO, "Number of blocks = " << nob);
UBLOG(logINFO, "Number of nodes = " << nod);
int minInitLevel = grid->getCoarsestInitializedLevel();
int maxInitLevel = grid->getFinestInitializedLevel();
for (int level = minInitLevel; level <= maxInitLevel; level++)
{
int nobl = grid->getNumberOfBlocks(level);
UBLOG(logINFO, "Number of blocks for level " << level << " = " << nobl);
UBLOG(logINFO, "Number of nodes for level " << level << " = " << nobl * nodb);
}
UBLOG(logINFO, "Necessary memory = " << needMemAll << " bytes");
UBLOG(logINFO, "Necessary memory per process = " << needMem << " bytes");
UBLOG(logINFO, "Available memory per process = " << availMem << " bytes");
}
SetKernelBlockVisitor kernelVisitor(kernel, nuLB, availMem, needMem);
grid->accept(kernelVisitor);
if (refineLevel > 0)
{
SetUndefinedNodesBlockVisitor undefNodesVisitor;
grid->accept(undefNodesVisitor);
}
//BC
intHelper.setBC();
//initialization of distributions
InitDistributionsBlockVisitor initVisitor;
grid->accept(initVisitor);
if (myid == 0) UBLOG(logINFO, "Preprozess - end");
}
else
{
restartCoProcessor->restart((int)restartStep);
grid->setTimeStep(restartStep);
SetBcBlocksBlockVisitor v1(rotorInt);
grid->accept(v1);
rotorInt->initInteractor();
SetBcBlocksBlockVisitor v2(statorInt);
grid->accept(v2);
statorInt->initInteractor();
}
omp_set_num_threads(numOfThreads);
//set connectors
//InterpolationProcessorPtr iProcessor(new ThixotropyInterpolationProcessor());
//static_pointer_cast<ThixotropyInterpolationProcessor>(iProcessor)->setOmegaMin(thix->getOmegaMin());
//SetConnectorsBlockVisitor setConnsVisitor(comm, true, D3Q27System::ENDDIR, nuLB, iProcessor);
//grid->accept(setConnsVisitor);
OneDistributionSetConnectorsBlockVisitor setConnsVisitor(comm);
grid->accept(setConnsVisitor);
grid->accept(bcVisitor);
SPtr<UbScheduler> geoSch(new UbScheduler(1));
WriteBoundaryConditionsCoProcessor ppgeo = WriteBoundaryConditionsCoProcessor(grid, geoSch, outputPath, WbWriterVtkXmlASCII::getInstance(), comm);
ppgeo.process(0);
SPtr<UbScheduler> nupsSch(new UbScheduler(10, 30, 100));
SPtr<CoProcessor> npr(new NUPSCounterCoProcessor(grid, nupsSch, numOfThreads, comm));
//write data for visualization of macroscopic quantities
SPtr<UbScheduler> visSch(new UbScheduler(outTime));
//SPtr<UbScheduler> visSch(new UbScheduler(10,1));
SPtr<WriteMacroscopicQuantitiesCoProcessor> writeMQCoProcessor(new WriteMacroscopicQuantitiesCoProcessor(grid, visSch, outputPath, WbWriterVtkXmlBinary::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter()), comm));
//writeMQCoProcessor->process(0);
SPtr<UbScheduler> forceSch(new UbScheduler(100));
SPtr<CalculateTorqueCoProcessor> fp = make_shared<CalculateTorqueCoProcessor>(grid, forceSch, outputPath + "/torque/TorqueRotor.txt", comm);
fp->addInteractor(rotorInt);
SPtr<CalculateTorqueCoProcessor> fp2 = make_shared<CalculateTorqueCoProcessor>(grid, forceSch, outputPath + "/torque/TorqueStator.txt", comm);
fp2->addInteractor(statorInt);
SPtr<WriteThixotropyQuantitiesCoProcessor> writeThixotropicMQCoProcessor(new WriteThixotropyQuantitiesCoProcessor(grid, visSch, outputPath, WbWriterVtkXmlBinary::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter()), comm));
SPtr<UbScheduler> stepGhostLayer(new UbScheduler(1));
SPtr<Calculator> calculator(new BasicCalculator(grid, stepGhostLayer, endTime));
calculator->addCoProcessor(npr);
calculator->addCoProcessor(fp);
calculator->addCoProcessor(fp2);
calculator->addCoProcessor(writeMQCoProcessor);
calculator->addCoProcessor(writeThixotropicMQCoProcessor);
calculator->addCoProcessor(restartCoProcessor);
if (myid == 0) UBLOG(logINFO, "Simulation-start");
calculator->calculate();
if (myid == 0) UBLOG(logINFO, "Simulation-end");
}
catch (std::exception& e)
{
cerr << e.what() << endl << flush;
}
catch (std::string& s)
{
cerr << s << endl;
}
catch (...)
{
cerr << "unknown exception" << endl;
}
}
//////////////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])
{
if (argv != NULL)
{
if (argv[1] != NULL)
{
//pflowForcing(string(argv[1]));
bflow(string(argv[1]));
}
else
{
cout << "Configuration file is missing!" << endl;
}
}
return 0;
}
......@@ -125,7 +125,7 @@ void bflow(string configname)
//double omegaMin = 1.0e-8;
SPtr<Thixotropy> thix = Thixotropy::getInstance();
SPtr<Rheology> thix = Rheology::getInstance();
//thix->setPowerIndex(n);
//thix->setViscosityParameter(k);
thix->setYieldStress(tau0);
......@@ -133,8 +133,8 @@ void bflow(string configname)
SPtr<BCAdapter> noSlipBCAdapter(new NoSlipBCAdapter());
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new HerschelBulkleyModelNoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelNoSlipBCAlgorithm()));
//noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyHerschelBulkleyModelNoSlipBCAlgorithm()));
noSlipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelNoSlipBCAlgorithm()));
//SPtr<BCAdapter> slipBCAdapter(new SlipBCAdapter());
//slipBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleSlipBCAlgorithm()));
......@@ -159,7 +159,7 @@ void bflow(string configname)
//velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityBCAlgorithm()));
//velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new SimpleVelocityBCAlgorithm()));
//velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new VelocityWithDensityBCAlgorithm()));
velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new BinghamModelVelocityBCAlgorithm()));
velocityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new RheologyBinghamModelVelocityBCAlgorithm()));
//SPtr<BCAdapter> densityBCAdapter(new DensityBCAdapter());
//densityBCAdapter->setBcAlgorithm(SPtr<BCAlgorithm>(new NonEqDensityBCAlgorithm()));
......
......@@ -121,34 +121,34 @@
#include <BoundaryConditions/VelocityBCAdapter.h>
#include <BoundaryConditions/VelocityBCAlgorithm.h>
#include <BoundaryConditions/VelocityWithDensityBCAlgorithm.h>
#include <BoundaryConditions/DensityAndThixotropyBCAlgorithm.h>
#include <BoundaryConditions/NoSlipAndThixotropyBCAlgorithm.h>
#include <BoundaryConditions/VelocityAndThixotropyBCAlgorithm.h>
#include <BoundaryConditions/NonReflectingOutflowAndThixotropyBCAlgorithm.h>
#include <BoundaryConditions/VelocityWithDensityAndThixotropyBCAlgorithm.h>
#include <BoundaryConditions/SimpleVelocityBCAlgorithm.h>
#include <BoundaryConditions/ThixotropyDensityBCAlgorithm.h>
#include <BoundaryConditions/ThixotropyNoSlipBCAlgorithm.h>
#include <BoundaryConditions/BinghamModelNoSlipBCAlgorithm.h>
#include <BoundaryConditions/HerschelBulkleyModelNoSlipBCAlgorithm.h>
#include <BoundaryConditions/ThixotropyVelocityBCAlgorithm.h>
#include <BoundaryConditions/ThixotropyNonReflectingOutflowBCAlgorithm.h>
#include <BoundaryConditions/ThixotropyVelocityWithDensityBCAlgorithm.h>
#include <BoundaryConditions/SimpleVelocityBCAlgorithm.h>
#include <BoundaryConditions/RheologyNoSlipBCAlgorithm.h>
#include <BoundaryConditions/RheologyBinghamModelNoSlipBCAlgorithm.h>
#include <BoundaryConditions/RheologyHerschelBulkleyModelNoSlipBCAlgorithm.h>
#include <BoundaryConditions/SimpleSlipBCAlgorithm.h>
#include <BoundaryConditions/PowellEyringModelNoSlipBCAlgorithm.h>
#include <BoundaryConditions/BinghamModelVelocityBCAlgorithm.h>
#include <BoundaryConditions/RheologyPowellEyringModelNoSlipBCAlgorithm.h>
#include <BoundaryConditions/RheologyBinghamModelVelocityBCAlgorithm.h>
#include <BoundaryConditions/MultiphaseNoSlipBCAlgorithm.h>
#include <BoundaryConditions/MultiphaseNonReflectingOutflowBCAlgorithm.h>
#include <BoundaryConditions/MultiphaseVelocityBCAdapter.h>
#include <BoundaryConditions/MultiphaseVelocityBCAlgorithm.h>
#include <Connectors/Block3DConnector.h>
#include <Connectors/Block3DConnectorFactory.h>
#include <Connectors/CoarseToFineBlock3DConnector.h>
#include <Connectors/CoarseToFineNodeSetBlock3DConnector.h>
#include <Connectors/ConnectorFactory.h>
//#include <Connectors/Block3DConnectorFactory.h>
//#include <Connectors/CoarseToFineBlock3DConnector.h>
//#include <Connectors/CoarseToFineNodeSetBlock3DConnector.h>
//#include <Connectors/ConnectorFactory.h>
#include <Connectors/D3Q27ETCFOffVectorConnector.h>
#include <Connectors/D3Q27ETFCOffVectorConnector.h>
#include <Connectors/D3Q27ETFullDirectConnector.h>
#include <Connectors/D3Q27ETFullVectorConnector.h>
#include <Connectors/FineToCoarseBlock3DConnector.h>
#include <Connectors/FineToCoarseNodeSetBlock3DConnector.h>
//#include <Connectors/FineToCoarseBlock3DConnector.h>
//#include <Connectors/FineToCoarseNodeSetBlock3DConnector.h>
#include <Connectors/LocalBlock3DConnector.h>
#include <Connectors/RemoteBlock3DConnector.h>
#include <Connectors/TwoDistributionsFullDirectConnector.h>
......@@ -230,13 +230,14 @@
#include <LBM/ThixotropyLBMKernel.h>
#include <LBM/ThixotropyExpLBMKernel.h>
#include <LBM/CumulantLBMKernel.h>
#include <LBM/ThixotropyModelLBMKernel.h>
#include <LBM/ThixotropyModelLBMKernel2.h>
#include <LBM/BinghamModelLBMKernel.h>
#include <LBM/HerschelBulkleyModelLBMKernel.h>
#include <LBM/ThixotropyInterpolationProcessor.h>
//#include <LBM/RheologyModelLBMKernel.h>
//#include <LBM/RheologyModelLBMKernel2.h>
#include <LBM/RheologyBinghamModelLBMKernel.h>
#include <LBM/RheologyHerschelBulkleyModelLBMKernel.h>
#include <LBM/RheologyInterpolationProcessor.h>
#include <LBM/Rheology.h>
#include <LBM/RheologyK17LBMKernel.h>
#include <LBM/PowellEyringModelLBMKernel.h>
#include <LBM/RheologyPowellEyringModelLBMKernel.h>
#include <LBM/MultiphaseCumulantLBMKernel.h>
......@@ -298,7 +299,7 @@
#include <Visitors/BoundaryConditionsBlockVisitor.h>
#include <Visitors/ChangeBoundaryDensityBlockVisitor.h>
#include <Visitors/CoarsenCrossAndInsideGbObjectBlockVisitor.h>
#include <Visitors/ConnectorBlockVisitor.h>
//#include <Visitors/ConnectorBlockVisitor.h>
#include <Visitors/CreateTransmittersHelper.h>
#include <Visitors/GenBlocksGridVisitor.h>
#include <Visitors/Grid3DVisitor.h>
......
......@@ -56,17 +56,17 @@ public:
static const char ThinWallNoSlipBCAlgorithm = 6;
static const char VelocityWithDensityBCAlgorithm = 7;
static const char NonReflectingOutflowBCAlgorithm = 8;
static const char VelocityAndThixotropyBCAlgorithm = 9;
static const char DensityAndThixotropyBCAlgorithm = 10;
static const char NoSlipAndThixotropyBCAlgorithm = 11;
static const char NonReflectingOutflowAndThixotropyBCAlgorithm = 12;
static const char VelocityWithDensityAndThixotropyBCAlgorithm = 13;
static const char BinghamModelNoSlipBCAlgorithm = 14;
static const char HerschelBulkleyModelNoSlipBCAlgorithm = 15;
static const char ThixotropyVelocityBCAlgorithm = 9;
static const char ThixotropyDensityBCAlgorithm = 10;
static const char ThixotropyNoSlipBCAlgorithm = 11;
static const char ThixotropyNonReflectingOutflowBCAlgorithm = 12;
static const char ThixotropyVelocityWithDensityBCAlgorithm = 13;
static const char RheologyBinghamModelNoSlipBCAlgorithm = 14;
static const char RheologyHerschelBulkleyModelNoSlipBCAlgorithm = 15;
static const char SimpleVelocityBCAlgorithm = 16;
static const char SimpleSlipBCAlgorithm = 17;
static const char PowellEyringModelNoSlipBCAlgorithm = 18;
static const char BinghamModelVelocityBCAlgorithm = 19;
static const char RheologyPowellEyringModelNoSlipBCAlgorithm = 18;
static const char RheologyBinghamModelVelocityBCAlgorithm = 19;
static const char MultiphaseNoSlipBCAlgorithm = 20;
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// This file is part of VirtualFluids. VirtualFluids is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file EqDensityBCAlgorithm.cpp
//! \ingroup BoundarConditions
//! \author Konstantin Kutscher
//=======================================================================================
#include "EqDensityBCAlgorithm.h"
#include "BoundaryConditions.h"
#include "DistributionArray3D.h"
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// This file is part of VirtualFluids. VirtualFluids is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file EqDensityBCAlgorithm.h
//! \ingroup BoundarConditions
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef EqDensityBCAlgorithm_h__
#define EqDensityBCAlgorithm_h__
......
#ifndef HerschelBulkleyModelNoSlipBCAlgorithm_h__
#define HerschelBulkleyModelNoSlipBCAlgorithm_h__
#include "ThixotropyNoSlipBCAlgorithm.h"
#include "Thixotropy.h"
class HerschelBulkleyModelNoSlipBCAlgorithm : public ThixotropyNoSlipBCAlgorithm
{
public:
HerschelBulkleyModelNoSlipBCAlgorithm()
{
BCAlgorithm::type = BCAlgorithm::HerschelBulkleyModelNoSlipBCAlgorithm;
BCAlgorithm::preCollision = true;
}
~HerschelBulkleyModelNoSlipBCAlgorithm() {}
SPtr<BCAlgorithm> clone() override
{
SPtr<BCAlgorithm> bc(new HerschelBulkleyModelNoSlipBCAlgorithm());
return bc;
}
protected:
LBMReal getThyxotropyCollFactor(LBMReal omegaInf, LBMReal shearRate, LBMReal drho) const override
{
return Thixotropy::getHerschelBulkleyCollFactor(omegaInf, shearRate, drho);
}
};
#endif // HerschelBulkleyModelNoSlipBCAlgorithm_h__
\ No newline at end of file
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// This file is part of VirtualFluids. VirtualFluids is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file HighViscosityNoSlipBCAlgorithm.cpp
//! \ingroup BoundarConditions
//! \author Konstantin Kutscher
//=======================================================================================
#include "HighViscosityNoSlipBCAlgorithm.h"
#include "BoundaryConditions.h"
#include "DistributionArray3D.h"
......
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// This file is part of VirtualFluids. VirtualFluids is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file HighViscosityNoSlipBCAlgorithm.h
//! \ingroup BoundarConditions
//! \author Konstantin Kutscher
//=======================================================================================
#ifndef HighViscosityNoSlipBCAlgorithm_h__
#define HighViscosityNoSlipBCAlgorithm_h__
......
#include "NoSlipAndThixotropyBCAlgorithm.h"
#include "DistributionArray3D.h"
#include "BoundaryConditions.h"
NoSlipAndThixotropyBCAlgorithm::NoSlipAndThixotropyBCAlgorithm()
{
BCAlgorithm::type = BCAlgorithm::NoSlipAndThixotropyBCAlgorithm;
BCAlgorithm::preCollision = false;
BCAlgorithm::thixotropy = true;
}
//////////////////////////////////////////////////////////////////////////
NoSlipAndThixotropyBCAlgorithm::~NoSlipAndThixotropyBCAlgorithm()
{
}
//////////////////////////////////////////////////////////////////////////
SPtr<BCAlgorithm> NoSlipAndThixotropyBCAlgorithm::clone()
{
SPtr<BCAlgorithm> bc(new NoSlipAndThixotropyBCAlgorithm());
return bc;
}
//////////////////////////////////////////////////////////////////////////
void NoSlipAndThixotropyBCAlgorithm::addDistributions(SPtr<DistributionArray3D> distributions)
{
this->distributions = distributions;
}
//////////////////////////////////////////////////////////////////////////
//void NoSlipAndThixotropyBCAlgorithm::addDistributionsF(SPtr<DistributionArray3D> distributions)
//{
// this->distributionsf = distributions;
//}
//////////////////////////////////////////////////////////////////////////
void NoSlipAndThixotropyBCAlgorithm::addDistributionsH(SPtr<DistributionArray3D> distributions)
{
this->distributionsH = distributions;
}
//////////////////////////////////////////////////////////////////////////
void NoSlipAndThixotropyBCAlgorithm::applyBC()
{
LBMReal f[D3Q27System::ENDF + 1];
LBMReal feq[D3Q27System::ENDF + 1];
LBMReal h[D3Q27System::ENDF + 1];
LBMReal heq[D3Q27System::ENDF + 1];
distributions->getDistributionInv(f, x1, x2, x3);
distributionsH->getDistributionInv(h, x1, x2, x3);
LBMReal rho, vx1, vx2, vx3;//, concentration, fl1, fl2, fl3, m100;
calcMacrosFct(f, rho, vx1, vx2, vx3);
calcFeqFct(feq, rho, vx1, vx2, vx3);
//calcDiffusionMacrosFctPost(h, concentration, fl1, fl2, fl3, m100, collFactor);
LBMReal lambda = D3Q27System::getDensity(h);
D3Q27System::calcCompFeq(heq, lambda, 0., 0., 0.);
for (int fdir = D3Q27System::FSTARTDIR; fdir <= D3Q27System::FENDDIR; fdir++)
{
if (bcPtr->hasNoSlipBoundaryFlag(fdir))
{
//quadratic bounce back
const int invDir = D3Q27System::INVDIR[fdir];
LBMReal q = bcPtr->getQ(invDir);
LBMReal fReturnf = ((1.0 - q) / (1.0 + q))*((f[invDir] - feq[invDir]) / (1.0 - collFactor) + feq[invDir]) + ((q / (1.0 + q))*(f[invDir] + f[fdir]));
LBMReal fReturnh = ((1.0 - q) / (1.0 + q))*((h[invDir] - heq[invDir]) / (1.0 - collFactor) + heq[invDir]) + ((q / (1.0 + q))*(h[invDir] + h[fdir]));
distributions->setDistributionForDirection(fReturnf, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir);
distributionsH->setDistributionForDirection(fReturnh, x1 + D3Q27System::DX1[invDir], x2 + D3Q27System::DX2[invDir], x3 + D3Q27System::DX3[invDir], fdir);
}
}
}
#ifndef NoSlipAndThixotropyBCAlgorithm_h__
#define NoSlipAndThixotropyBCAlgorithm_h__
#include "BCAlgorithm.h"
class NoSlipAndThixotropyBCAlgorithm : public BCAlgorithm
{
public:
NoSlipAndThixotropyBCAlgorithm();
virtual ~NoSlipAndThixotropyBCAlgorithm();
SPtr<BCAlgorithm> clone();
void addDistributions(SPtr<DistributionArray3D> distributions);
//void addDistributionsF(DistributionArray3DPtr distributions);
void addDistributionsH(SPtr<DistributionArray3D> distributions);
void applyBC();
protected:
SPtr<DistributionArray3D> distributionsH;
private:
};
#endif // NoSlipAndThixotropyBCAlgorithm_h__
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// This file is part of VirtualFluids. VirtualFluids is free software: you can
// redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// VirtualFluids is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
// for more details.
//
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file NonEqDensityBCAlgorithm.cpp
//! \ingroup BoundarConditions
//! \author Konstantin Kutscher
//=======================================================================================
#include "NonEqDensityBCAlgorithm.h"
#include "BoundaryConditions.h"
......
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