Problem of reading the U and Rho data of a plane

Hello everyone,
I’m working on reading a boundary u and rho from outside data. I did it like this:

  1. First, run a whole simulation case (case 1) of a flow channel, and save the u and rho data of a plane in the channel every time step, as

plb_ofstream outUFile(filename);
plb_ofstream outRhoFile(filename);
ofUFile << setprecision(12) << *extractSubDomain(velocity, plane) << endl;
outRhoFile << setprecision(12) << *extractSubDomain(density, plane) << endl;

  1. Second,in a new simulation (case 2), Read the u and rho data into MultiScalarField/MultiTensorField and set them to the inlet boundary (its type is setVelocityConditionOnBlockBoundaries) every step, as

plb_ifstream ufile(filename);
plb_ifstream rhofile(filename);
rhofile >> rhoField;
ufile >> uField;
setBoundaryDensity(lattice, boundaryPlane, setRhoBoundaryFunction(rhoField));
setBoundaryVelocity(lattice, boundaryPlane, setUBoundaryFunction( uField));

All the parameters (dx,dt, boundary size, SmagorinskyMRTdynamics) of the two cases are the same. For case 2, the mean and standard deviation of velocity is as same as them in case 1, which may indicate that the boundary data have been read and set correctly. But I found that in the flow domain, although the mean velocity is correct, the standard deviation is significantly overestimated everywhere.

I don’t know what is wrong. Is the idea that I read boundary data correct? Do I need some special operation after reading and setting u and rho for the boundary?

Thank you.


I need a bit of context here. Why do you want to read from the boundary planes to redo the simulation afterwards?

Hello orestis,

This is a popular method in the architecture and urban field when using FVM-LES. For example, in an LES simulation we set a lot of building models in the domain to generate specific turbulence data, and save the data of a section behind all the building models. Then we use the data as the boundary data for other cases that have the same inflow turbulence characteristic.
This is what I want to realize in the LBM. So now I’m trying the simplest case. I simulated a channel, and save the turbulence data of the middle section of the channel, and I set a new case which is just as same as the latter part of the channel and use the data as the inlet (see the pic). I found that the standard deviations of the new cases are overestimated compared to the original channel case.

Thank you.