Skip to content

Reply To: Neumann temperature boundary

#6780
steed188
Participant

Hello Johanna and Antoniowu,
I’m also writing the Neumann BC for ADlattice. I created a LocalPostProcessor3D and its corresponding PostProcessorGenerator3D. In LocalPostProcessor3D, the core is to calculate the density of the adjacent grid and assign it directly to the boundary grid. But it doesn’t seem to work.

The core code of LocalPostProcessor3D is like this

template <typename T, typename descriptor>
void AdNeumannBoundaryProcessor3D<T, descriptor>::
processSubDomain(BlockLattice<T, descriptor> &blockLattice, int x0_, int x1_, int y0_,
int y1_, int z0_, int z1_)
{
int newX0, newX1, newY0, newY1, newZ0, newZ1;
if (util::intersect(
x0, x1, y0, y1, z0, z1,
x0_, x1_, y0_, y1_, z0_, z1_,
newX0, newX1, newY0, newY1, newZ0, newZ1))
{

#ifdef PARALLEL_MODE_OMP
#pragma omp parallel for
#endif
T temperature = 0;

for (int iX = newX0; iX <= newX1; ++iX)
{
for (int iY = newY0; iY <= newY1; ++iY)
{
for (int iZ = newZ0; iZ <= newZ1; ++iZ)
{
temperature = blockLattice.get(iX – direction[0], iY – direction[1], iZ – direction[2]).computeRho();
blockLattice.get(iX, iY, iZ).defineRho(temperature);
}
}
}
}
}

And I call it like this:

PostProcessorGenerator3D<T, ADDESCRIPTOR> *ImplementADNeumann = new AdNeumannBoundaryProcessorGenerator3D<T, ADDESCRIPTOR>(x0, x1, y0, y1, z0, z1, directionX, directionY, directionZ);
adLattice.addPostProcessor(*ImplementOutletADNeumann);

Do you have any ideas that what is wrong?

best wishes,
steed188