Some puzzles of MultiGrid3D


I’m trying to implement MultiGrid3D to flow around the bluff body in a channel. I have some puzzles on it.

  1. I understand that for many output operations, such as VTK output, we need to point a level to convert the MultiGridLattice3D to this level, then operate is as a common MultiBlockLattice3D. But what if I want to do some operations to modify some variables related to the lattice? E.g., modify local omega or density, How can I do it? I tried to operate the MultiBlockLattice at every level like this:

for (plint iLevel = 0; iLevel < lattice.getNumLevels(); ++iLevel) {
applyProcessingFunctional(new OperateLocalOmegaFunctional3D<T, DESCRIPTOR>(parameters[iLevel]), lattice.getComponent(iLevel).getBoundingBox(), lattice.getComponent(iLevel));

But the simulation didn’t work.

  1. I implemented the bounceback BC to the obstacle at every level, as:

for (plint iLevel = 0; iLevel < lattice.getNumLevels(); ++iLevel) {
plint nx = parameters[iLevel].getNx();
plint ny = parameters[iLevel].getNy();
plint nz = parameters[iLevel].getNz();

Box3D obstacle = Box3D(startPos[0] / X_Length * nx, endPos[0] / X_Length * nx,
                                          startPos[1] / Y_Length * ny, endPos[1]) / Y_Length * ny,
                                          startPos[2] / Z_Length * nz, endPos[2]) / Z_Length * nz);

defineDynamics(lattice.getComponent(iLevel), obstacle, new plb::BounceBack<T, DESCRIPTOR>);

But the results show that there is an abnormal velocity value on the boundary grids, and the value is not tiny, as shown in the picture. In addition, inside the obstacle, there occurred velocity values, even though it is small. But the inside of the bluff body should be insolated from the outside flow and there should be no velocity there.


Thank you in advance!



the MultiGrid3d should not be used anymore. Please use the new grid refinement. See the exmaple:


for the “new” grid refinement.

Hi orestis,
Thank you for your reply. I’m learning the octree refinment method. It seems not so easy to understand quickly. Is there any publication for the introduction of this new method?

Thank you.


Well the octree algorithm is not a real novelty so you can find a ton of ressources online. In this context the octree (representing the grid levels) is constructed with respect to a grid density function: the gridDensityFunction.dat in the gridRefinement3d example. It is just a scalar field representing your computational with values between 0 and 1 (the larger the more grid points you want locally). The octree algorithm then decides when to add grid points (subdivide itself) based on this quantity to construct the grid.