52 bool includeOuterCells =
false;
54 if (indicator->getSuperGeometry().getOverlap() == 1) {
55 includeOuterCells =
true;
56 clout <<
"WARNING: overlap == 1, boundary conditions set on overlap despite unknown neighbor materials" << std::endl;
58 for (
int iCloc = 0; iCloc < sLattice.
getLoadBalancer().size(); ++iCloc) {
59 setWallFunctionBoundary<T,DESCRIPTOR>(sLattice.
getBlock(iCloc),
60 indicator->getBlockIndicatorF(iCloc),
64 addPoints2CommBC(sLattice, std::forward<
decltype(indicator)>(indicator), _overlap);
75 bool includeOuterCells)
80 const int margin = includeOuterCells ? 0 : 1;
81 std::vector<int> discreteNormal(4, 0);
82 blockGeometryStructure.forSpatialLocations([&](
auto iX,
auto iY,
auto iZ) {
83 if (blockGeometryStructure.getNeighborhoodRadius({iX, iY, iZ}) >= margin
84 && indicator(iX, iY, iZ)) {
85 discreteNormal = blockGeometryStructure.getStatistics().getType(iX, iY, iZ);
86 std::vector<int> missingIndices;
87 for (
int x = -1 ; x < 2; ++x) {
88 for (
int y = -1 ; y < 2; ++y) {
89 for (
int z = -1 ; z < 2; ++z) {
90 if (blockGeometryStructure.getMaterial(iX + x, iY + y, iZ + z) == 0) {
91 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
92 if (descriptors::c<DESCRIPTOR>(iPop,0) == x &&
93 descriptors::c<DESCRIPTOR>(iPop,1) == y &&
94 descriptors::c<DESCRIPTOR>(iPop,2) == z) {
95 missingIndices.push_back(descriptors::opposite<DESCRIPTOR>(iPop));
102 if (discreteNormal[1]!=0 || discreteNormal[2]!=0 || discreteNormal[3]!=0) {
103 discreteNormal.erase(discreteNormal.begin());
106 clout <<
"setWallFunctionBoundary<" << discreteNormal[0] <<
","<< discreteNormal[1] <<
","<< discreteNormal[2] <<
">(" << iX <<
", "<< iX <<
", " << iY <<
", " << iY <<
", " << iZ <<
", " << iZ <<
" )" << std::endl;
108 auto postProcessor = std::unique_ptr<PostProcessorGenerator3D<T, DESCRIPTOR>>{
new WallFunctionBoundaryProcessorGenerator3D<T, DESCRIPTOR>(iX, iX, iY, iY, iZ, iZ, indicator.
getBlockGeometry(), discreteNormal, missingIndices,
115 clout <<
"Warning: Could not setWallFunctionBoundary (" << iX <<
", " << iY <<
", " << iZ <<
"), discreteNormal=(" << discreteNormal[0] <<
","<< discreteNormal[1] <<
","<< discreteNormal[2] <<
","<< discreteNormal[3] <<
"), set to bounceBack" << std::endl;
116 _block.template defineDynamics<BounceBack>({iX, iY, iZ});
virtual void addPostProcessor(std::type_index stage, LatticeR< DESCRIPTOR::d > latticeR, PostProcessorPromise< T, DESCRIPTOR > &&promise)=0
Schedule post processor for application to latticeR in stage.
void addPoints2CommBC(SuperLattice< T, DESCRIPTOR > &sLattice, FunctorPtr< SuperIndicatorF2D< T > > &&indicator, int _overlap)
Adds needed Cells to the Communicator _commBC in SuperLattice.
void setWallFunctionBoundary(SuperLattice< T, DESCRIPTOR > &sLattice, SuperGeometry< T, 3 > &superGeometry, int material, UnitConverter< T, DESCRIPTOR > const &converter, wallFunctionParam< T > const &wallFunctionParam, IndicatorF3D< T > *geoIndicator=NULL)
Initialising the WallFunctionBoundary on the superLattice domain.