62 center[1]=bl.
position[1]+.25*rTunnel;
66 auto tunnel(-(generateDFCylinder(rTunnel, makeAVec(l,0.,0.), center) &
67 generateDFPlane(makeAVec(0.,-1.,0.), centerG)));
69 return normalize(tunnel, dx);
73int main(
int argc,
char* argv[])
80 appParamsManager.
load(argc, argv);
87 AVec<int> size(makeAVec(150., 37., 53.2)*(1./dx.v()));
88 asl::Block bl(size,dx.v(),makeAVec(-10.,-1.63, -31.6));
90 Param nuNum(nu.
v()*dt.
v()/dx.v()/dx.v());
92 std::cout <<
"Data initialization..." << endl;
96 asl::Block block(locomotive->getInternalBlock());
98 auto tunnelMap(asl::generateDataContainerACL_SP<FlT>(block, 1, 1u));
101 auto forceField(asl::generateDataContainerACL_SP<FlT>(block, 3, 1u));
104 std::cout <<
"Finished"<<endl;
106 std::cout <<
"Numerics initialization..." << endl;
118 std::vector<asl::SPNumMethod> bc;
119 std::vector<asl::SPNumMethod> bcV;
121 bc.push_back(generateBCVelocity(lbgk, vfTunnel, tunnelMap));
122 bcV.push_back(generateBCVelocityVel(lbgk, vfTunnel, tunnelMap));
124 bc.push_back(generateBCNoSlip(lbgk, locomotive));
125 bcV.push_back(generateBCNoSlipVel(lbgk, locomotive));
127 bc.push_back(generateBCConstantPressureVelocity(lbgk, 1., makeAVec(0.1,0.,0.), {
asl::X0,
asl::XE}));
132 auto computeForce(generateComputeSurfaceForce(lbgk, forceField, locomotive));
133 computeForce->init();
135 cout <<
"Finished" << endl;
136 cout <<
"Computing..." << endl;
143 writer.
addVector(
"v", *lbgk->getVelocity());
148 computeForce->execute();
153 for(
unsigned int i(1); i < 2001; ++i)
161 computeForce->execute();
167 cout <<
"Finished" << endl;
169 cout <<
"Computation statistic:" << endl;
170 cout <<
"Real Time = " << timer.
realTime() <<
"; Processor Time = "
void load(int argc, char *argv[])
const V getBPosition() const
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.
void addVector(std::string name, AbstractData &data)
void addScalars(std::string name, AbstractData &data)
SPDataWithGhostNodesACLData readSurface(const string &fileName, double dx, acl::CommandQueue queue=acl::hardware.defaultQueue)
std::shared_ptr< DistanceFunction > SPDistanceFunction
SPPositionFunction generatePFConstant(const AVec< double > &a)
const VectorTemplate & d3q15()
Vector template.
VectorOfElements generateVEConstant(T a)
Generates VectorOfElements with 1 Element acl::Constant with value a.
asl::UValue< double > Param
asl::SPDistanceFunction generateTunnel(asl::Block &bl)
std::shared_ptr< LBGKUtilities > SPLBGKUtilities
std::shared_ptr< LBGK > SPLBGK
void initData(SPAbstractData d, double a)