Time-dependent boundary condition in Palabos ?


For an acoustic application, I am trying to simulate an oscillating piston at the inlet of a tube with Palabos. So I want to define a Dirichlet boundary condition whose value changes over time.

In the user’s guide of Palabos one can read the following :
“It is not possible to override the type of a boundary…
On the other hand, the value imposed on the boundary (i.e. the velocity value on a Dirichlet velocity boundary) can be changed as often as needed.”

I have looked at the examples provided with Palabos but all of them seem to define the boundary condition once for all.

So I would like to be able to call setBoundaryVelocity(BlockLattice, Box 2D, VelocityFunction) inside of the main loop over time iterations. But then it seems necessary to pass the time information to the VelocityFunction object.

If I attempt to modify cylinder2d so that PoiseuilleVelocity() takes the iteration iT as an input, the compiler complains and refers to dataInitializerGenerics2d.h where it can be seen than SetCustomBoundaryVelocityFunctional2D takes the space coordinates into account, but not the time.

Is there any clean way to implement this time-dependence ?

Thanks in advance,


Hello again,

Well it is not that difficult actually. I guess yesterday’s question reflects that my skills in C/C++ are rusty.
I have modified the cylinder2d showcase as follows :


plint iT;

/// Velocity on the parabolic Poiseuille profile
T poiseuilleVelocity(plint iY, IncomprFlowParam const& parameters) {
T y = (T)iY / parameters.getResolution();
T t = (T)iT * parameters.getDeltaT();
return 4.* f(t) * parameters.getLatticeU() * (y-y*y); //time-dependence is in f(t)

for (iT=0; iT*parameters.getDeltaT()<maxT; ++iT) {

    setBoundaryVelocity ( lattice, 
		      PoiseuilleVelocity<T>(parameters) );

    // Lattice Boltzmann iteration step.


Now it seems that sound-like patterns combine with vortex shedding. This looks very nice !
However some instabilities show up at the end of the simulation, possibly because the fluctuations of the excitation over time are too strong. 

Still, I am eager to learn if there is a cleaner - i.e. without global variable - or more object-oriented way to do this.   

Best regards,