OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Value on the edge of Cuboids is zero

Viewing 2 posts - 1 through 2 (of 2 total)
• Author
Posts
• #1916
steed188
Participant

Hi everyone,

I got a problem when trying to make a function to calculate the fluid’s time average velocity.

My idea is to create two same lattices. One named slattice is the normal lattice used for collideAndStream. Another one named for example TSlattice is just used to store the sum of all step’s slattice’s velocity to calculate a time average velocity.

After every steps’s collideAndStream of slattice, the TSlattice’ velocity will plus slattice’s velocity one lattice by one lattice, and the result will be stored in TSlattice again. So that I can use TSlattice to calculate time average.

But when I write the averaged velocity of TSlattice to VTK files, I found that time averaged velocity of the whole field has been divided into many blocks because of the several Cuboids for parallel calculation. On the edge lattice of the cuboids, the value is always 0.

I thought that I should do something to combine all the Cuboids together. What should I do ?

#2629
steed188
Participant

I did it like this:
for ( int iC = 0; iC < TSlattice.getLoadBalancer().size(); iC++ ) {
int nx = sLattice.getBlockLattice( iC ).getNx();
int ny = sLattice.getBlockLattice( iC ).getNy();
int nz = sLattice.getBlockLattice( iC ).getNz();

for ( int iX = 0; iX < nx; ++iX ) {
for ( int iY = 0; iY < ny; ++iY ) {
for ( int iZ = 0; iZ < nz; ++iZ ) {
…// Do some operation to every value of Nx,Ny,Nz of TSlattice according to value of slattice;

}
}
}
}

Then ,I tried to write it to VTK files.
SuperLatticePhysVelocity3D<T, DESCRIPTOR> sumVel( TSlattice, converter );