how to set the time-dependent boundaries

[size=medium]Hi,

In the manual of OpenLb (Page14), I got that “the chioce of the velocity/density value is not static: it can be adapted at ever time step to modelize time-dependent boundaried”. So I want to try to set the time-dependent boundaries. In the cylinder case, I define the outlet BC is a time-dependent boundaries, but I failed. The code is as below.[/size]


int main(int argc, char* argv[]) { . . . for (int iT=0; iT<maxT; ++iT) {

if(iT==300) {
           for (int iY=0; iY<ny; ++iY) {
           lattice.get(nx-1,iY).defineRho(0.9);
			 }

    if (iT%tSave==0 && iT !=0) {
        cout << iT << endl;
        cout << "av energy="
             << lattice.getStatistics().getAverageEnergy()
             << "; av rho="
             << lattice.getStatistics().getAverageRho() << endl;

.
.
.
}
lattice.collideAndStream();
}
delete boundaryCondition;
}


[size=medium]Could you give me some hint how to set the time-dependent boundaries. Thank you in advance!

Wei[/size]

Hi,

Your code looks right to me. At least, it shows that you got the idea.

What makes you think that your attempt failed?

[size=medium]Hi,

After t>=300, the results of rho and u are nan. The code is cylinder.cpp in olb-5.0. What I add to the code is the sentences labeled in yellow background in the last message. I think there is some problem. Do I need to modify the code in somewhere?
Thank you!

Wei[/size]

Hi,

I get the feeling that your simulation is unstable, not because there’s an error in the implementation, but because you are stressing the model too much from a physics view point. If I understand right, the pressure on the outlet jumps from 1 to 0.9 from one time step to the next, which represents a strong discontinuity in the time evolution of the pressure. At your place, I’d try decreasing the pressure continuously over a large range of time steps.