#include <utilities/aslParametersManager.h>
#include <math/aslTemplates.h>
#include <aslGeomInc.h>
#include <math/aslPositionFunction.h>
#include <aslDataInc.h>
#include <acl/aclGenerators.h>
#include <acl/aclMath/aclVectorOfElements.h>
#include <writers/aslVTKFormatWriters.h>
#include <num/aslLBGK.h>
#include <num/aslLBGKBC.h>
#include <num/aslBasicBC.h>
#include <num/aslCrystalGrowthBC.h>
#include <num/aslFDAdvectionDiffusion.h>
#include <utilities/aslTimer.h>
{
double rBath(1.);
auto bath(-(generateDFCylinderInf(rBath, makeAVec(0.,0.,1.), dx*AVec<>(size)*.5) &
generateDFPlane(makeAVec(0.,0.,1.), center*1.99) &
generateDFPlane(makeAVec(0.,0.,-1.), center*0.)));
return normalize(bath, dx);
}
{
double rDisk(.9);
double hDisk(0.1);
double rAxis(0.05);
double hAxis(.5);
double wPillar(.2);
double dPillar(.1);
vector<asl::AVec<>> pillar1{makeAVec(wPillar*.5, dPillar*.5,0.),
makeAVec(-wPillar*.5, dPillar*.5,0.),
makeAVec(-wPillar*.5, -dPillar*.5,0.),
makeAVec(wPillar*.5, -dPillar*.5,0.)};
vector<asl::AVec<>> pillar2{
makeAVec(dPillar*.5, wPillar*.5,0.),
vector<asl::AVec<>> pillarC{
makeAVec(center[0]+rDisk-dPillar*.5, center[1], 0.),
makeAVec(center[0]-rDisk+dPillar*.5, center[1], 0.),
makeAVec(center[0], center[1]+rDisk-dPillar*.5,0.),
makeAVec(center[0], center[1]-rDisk+dPillar*.5,0.)};
vector<vector<asl::AVec<>>> pillarsPoints(4);
for(unsigned int i(0); i<4; ++i)
pillarsPoints[i].resize(4);
for(unsigned int i(0); i<4; ++i)
{
pillarsPoints[0][i] = pillar2[i] + pillarC[0];
pillarsPoints[1][i] = pillar2[i] + pillarC[1];
pillarsPoints[2][i] = pillar1[i] + pillarC[2];
pillarsPoints[3][i] = pillar1[i] + pillarC[3];
}
makeAVec(center[0], center[1], .5*hDisk)));
makeAVec(center[0], center[1], -.5*hDisk - hAxis + dx*size[2])));
makeAVec(center[0], center[1], - .5*hAxis - hDisk*.25 + dx*size[2])));
auto dfPillars((dfPillar1 | dfPillar2 | dfPillar3 | dfPillar4) &
return normalize(diskBottom | diskTop | axis | dfPillars, dx);
}
{
double aCrystal(.5);
double hCrystalBase(.5);
double hCrystalPyramid(.5);
double hDisk(0.1);
center+
makeAVec(-aCrystal, aCrystal,0.),
center+
makeAVec(-aCrystal, -aCrystal,0.),
center+
makeAVec( aCrystal, -aCrystal,0.)}) &
auto cCrPyrBase(
makeAVec(center[0],center[1],hDisk+hCrystalBase-.01));
cCrPyrBase+
makeAVec(-aCrystal, aCrystal,0.),
cCrPyrBase+
makeAVec(-aCrystal, -aCrystal,0.),
cCrPyrBase+
makeAVec( aCrystal, -aCrystal,0.)},
cCrPyrBase+
makeAVec(0.,0.,hCrystalPyramid)));
}
{
double tPeriod(128);
double wMax(6.*3.14*2./60.);
double tPlato(tPeriod * .25);
double tAcceleration(tPeriod * .1);
double tStop(tPeriod * .05);
double intPart;
double tRel(modf(t/tPeriod, &intPart));
double x(0);
if(tRel<=tAcceleration)
x = tRel / tAcceleration;
if(tRel>tAcceleration && tRel<=tAcceleration+tPlato)
x = 1.;
if(tRel>tAcceleration+tPlato && tRel<=2.*tAcceleration+tPlato)
x = (2.*tAcceleration + tPlato - tRel) / tAcceleration;
if(tRel>2.*tAcceleration+tPlato && tRel<=2.*tAcceleration+tPlato+tStop)
x = 0;
if(tRel>2.*tAcceleration+tPlato+tStop && tRel<=3.*tAcceleration+tPlato+tStop)
x = -(tRel-2.*tAcceleration-tPlato-tStop) / tAcceleration;
if(tRel>3.*tAcceleration+tPlato+tStop && tRel<=3.*tAcceleration+2.*tPlato+tStop)
x = -1.;
if(tRel>3.*tAcceleration+2.*tPlato+tStop && tRel<=4.*tAcceleration+2.*tPlato+tStop)
x = -(4.*tAcceleration+2.*tPlato+tStop-tRel)/tAcceleration;
if(tRel>4.*tAcceleration+2.*tPlato+tStop)
x = 0;
return wMax*x;
}
int main(
int argc,
char* argv[])
{
"1.0");
appParamsManager.load(argc, argv);
Param difCNum(difC.v()*dt.v()/
dx.v()/
dx.v());
Param wNum(w.v()*dt.v());
AVec<> gSize(
dx.v()*AVec<>(size));
std::cout << "Data initialization...";
std::cout << "Finished" << endl;
std::cout << "Numerics initialization...";
templ));
lbgk->init();
difCNum.v(),
lbgk->getVelocity(),
templ,
true));
nmDif->init();
std::vector<asl::SPNumMethod> bc;
std::vector<asl::SPNumMethod> bcV;
std::vector<asl::SPNumMethod> bcDif;
0.,
bathPlatformMap,
bathPlatformCrystalMap,
templ));
-9.32e-6/difC.v()*
dx.v(),
crystalMap,
bathPlatformCrystalMap,
templ));
std::cout << "Finished" << endl;
std::cout << "Computing...";
writer.addScalars("mapBath", *bathMap);
writer.addScalars("mapPlatformCrys", *platformCrysMap);
writer.addScalars("mapBathPlatformCrystal", *bathPlatformCrystalMap);
writer.addScalars("mapCrys", *crystalMap);
writer.addScalars("rho", *lbgk->getRho());
writer.addScalars("c", *cField);
writer.addVector("v", *lbgk->getVelocity());
writer.write();
for (unsigned int i(0); i <= 8001 ; ++i)
{
lbgk->execute();
nmDif->execute();
if (!(i%2000))
{
cout << i << endl;
writer.write();
}
}
cout << "Finished" << endl;
cout << "Computation statistic:" << endl;
cout <<
"Real Time = " << timer.
realTime() <<
"; Processor Time = "
return 0;
}
const DV & getSize() const
Numerical method for fluid flow.
contains different kernels for preprocessing and posprocessing of data used by LBGK
const double realTime() const
const double processorTime() const
const double processorLoad() const
Updatable value. This class stores value and its TimeStamp.
asl::SPDistanceFunction generateCrystal(asl::Block &bl)
asl::SPDistanceFunction generateBath(asl::Block &bl)
double getWRotation(double t)
asl::SPDistanceFunction generatePlatform(asl::Block &bl)
SPDataWrapperACLData generateDataContainerACL_SP(const Block &b, unsigned int n=1)
generates pointer to ACL Data field with n components
acl::VectorOfElements dx(const TemplateVE &a)
differential operator
SPBCond generateBCConstantGradient(SPAbstractDataWithGhostNodes d, double v, const VectorTemplate *const t, const std::vector< SlicesNames > &sl)
Bondary condition that makes fixed gradient <>
SPDistanceFunction generateDFCylinder(double r, const AVec< double > &l, const AVec< double > &c)
generates cylinder
SPDistanceFunction generateDFConvexPolygonPyramid(std::vector< AVec< double > > points, AVec< double > a)
generates pyramid with convex polygon at its base and apex a
SPDistanceFunction generateDFPlane(const AVec< double > &n, const AVec< double > &p0)
SPDistanceFunction generateDFConvexPolygonPrism(std::vector< AVec< double > > points)
generates infinite prism with convex polygon at its base
std::shared_ptr< DistanceFunction > SPDistanceFunction
SPFDAdvectionDiffusion generateFDAdvectionDiffusion(SPDataWithGhostNodesACLData c, double diffustionCoeff, SPAbstractDataWithGhostNodes v, const VectorTemplate *vt, bool compressibilityCorrection=false)
SPPositionFunction generatePFRotationField(const AVec< double > &axis, const AVec< double > &c)
const VectorTemplate & d3q19()
Vector template.
SPNumMethod generateBCVelocityVel(SPLBGK nm, SPPositionFunction v, SPAbstractDataWithGhostNodes map)
SPNumMethod generateBCNoSlipVel(SPLBGK nmU, SPAbstractDataWithGhostNodes map)
SPNumMethod generateBCVelocity(SPLBGK nm, SPPositionFunction v, SPAbstractDataWithGhostNodes map)
SPBCond generateBCNoSlip(SPLBGK nm, const std::vector< SlicesNames > &sl)
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
QuaternionOfElements normalize(QuaternionOfElements &a)
SPNumMethod generateBCLinearGrowth2(SPAbstractDataWithGhostNodes d, double cEq, double beta, SPAbstractDataWithGhostNodes map, const VectorTemplate *const t)
void initAll(std::vector< T * > &v)
std::shared_ptr< LBGK > SPLBGK
void initData(SPAbstractData d, double a)
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
void executeAll(std::vector< T * > &v)