Reply To: Extract Pressure On the Surface of Cylinder on Cylinder2D
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Extract Pressure On the Surface of Cylinder on Cylinder2D › Reply To: Extract Pressure On the Surface of Cylinder on Cylinder2D
Hello Navid,
you could write your own pressure functor that will print out the values in the needed cells. You need to take the cells laying on the cylinder radius and take their pressure values. The easiest way is to print them in the terminal output.
´template
void compute(SuperLattice
CuboidGeometry<...>& cuboidG,
UnitConverter<...>& converter){
//compute physical X and Y coordinste depending on cylinder coordinate
T cylCoord = ….;
T X = f(cylCoord);
T Y = f(cylCoord);
T physR[2] = {X,Y};
int latticeR[3] = {0.};
cuboidG.getLatticeR(latticeR,physR);
auto cell = sLattice.getBlock(latticeR[0]).get(latticeR[1],latticeR[2]);
T latticePressure = ( cell.computeRho() – 1.0 ) / descriptors::invCs2
T physPressure = converter.getPhysPressure(latticePressure);
std::cout << "Cylinder coordinate: " cylCoord << " Pressure: " << physPressure << std::endl;
}´
Adapt this code to your case.
Greeting
Fedor