Hello everyone,
I’m working on reading a boundary u and rho from outside data. I did it like this:
- 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;
- 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.
steed188