Skip to content

Reply To: How to create the cuboidGeometry for a inclined 2D cuboid geometry

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics How to create the cuboidGeometry for a inclined 2D cuboid geometry Reply To: How to create the cuboidGeometry for a inclined 2D cuboid geometry

#6129
Fany
Participant

Dear Gloriousface,
Thanks very much for your suggestion of creating the geometry boundary. Is that used to rename the boundary but not using the class supergeometry.rename in OpenLB?
Actually, I feel the serrated boundary was caused by the class CuboidGeometry2D because the boundary would changed with the different parameter noofCuboids and increasingly approximate to a rectangle with the increasing noofcuboids. I mean the problem may occurred in the process of constructing cuboid, shrinking remaining cuboids, distributing the load balancer and renaming material. I adapted the functor IndicatorCuboid2D to creating the 2D cuboid with a rotation angle. But it is normal when the angle=90, but abnormal when the angle was 45 (seen in the above image).

`/// === 2nd Step: Prepare Geometry ===
std::vector<T> extend(2,T());
extend[0] = lx;
extend[1] = ly;
std::vector<T> origin(2,T());
IndicatorCuboid2D<T> cuboid(extend, origin, theta);

/// Instantiation of a cuboidGeometry with weights
#ifdef PARALLEL_MODE_MPI
const int noOfCuboids = 16*singleton::mpi().getSize();
#else
const int noOfCuboids = 7;
#endif
CuboidGeometry2D<T> cuboidGeometry(cuboid, converter.getPhysDeltaX(), noOfCuboids);

// cuboidGeometry.setPeriodicity(true, false);

HeuristicLoadBalancer<T> loadBalancer(cuboidGeometry);

SuperGeometry2D<T> superGeometry(cuboidGeometry, loadBalancer, 2);

prepareGeometry(superGeometry, converter);