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;

for ( int iY=0; iY<=Ly; ++iY )
{
int point;
point = iX;
point = iY;

//Store Lattice Velocity (Numerical)
T numerical_lat;

SuperLatticeVelocity2D<T, DESCRIPTOR> velocity_lat( sLattice);

velocity_lat( numerical_lat,point );

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

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

velocity_phys( numerical_phys,point );

//storing data

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

}
mfile1.close();

}