OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Extract velocity, pressure, and density data on lattices without interpolation Reply To: Extract velocity, pressure, and density data on lattices without interpolation

#5925
achodankar
Participant

Hello Julius,
I tried this out, but I obtain zero values for velocity in all files. Also, the points passed out as input are lattice coordinates, Correct?

{

int Ly = converter.getLatticeLength( ly );
int Lx = converter.getLatticeLength( lx );

for (int iX=0; iX<Lx; iX++)
{

ofstream mfile1;

mfile1.open(“v_nointerpolate_lat_”+ std::to_string(iX)+ “_”+ std::to_string(iT) + “.csv”);
mfile1 <<“x,” << “y_lattice,” << “U_lattice,”<< “y_phys,”<<“U_phys,”<<std::endl;

T num_phys[Ly],num_lat[Ly];
int y[Ly],x[1];

for ( int iY=0; iY<=Ly; ++iY )
{
int point[2];
point[0] = iX;
point[1] = iY;

//Store Lattice Velocity (Numerical)
T numerical_lat[2];

SuperLatticeVelocity2D<T, DESCRIPTOR> velocity_lat( sLattice);

velocity_lat( numerical_lat,point );

//Store Physical Velocity (Numerical and Analytical)
T numerical_phys[2];

SuperLatticePhysVelocity2D<T, DESCRIPTOR> velocity_phys( sLattice, converter );

velocity_phys( numerical_phys,point );

//storing data

mfile1 << point[0] <<“,”<< point[1]<<“,” <<numerical_lat[0]<<“,”<<point[1]*converter.getConversionFactorLength()<<“,”<<numerical_phys[0]<<endl;

}
mfile1.close();

}