CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Obtaining wallShearStress as lineplot with OpenFoam (https://www.cfd-online.com/Forums/openfoam-post-processing/244439-obtaining-wallshearstress-lineplot-openfoam.html)

Tim_solver August 8, 2022 11:26

Obtaining wallShearStress as lineplot with OpenFoam
 
Hi all,

I am performing a series of simulations in CFD and in order to pinpoint the location of separation on my body I would like to plot the skin friction coefficient (and thus the wall shear stress) as a lineplot (x-axis: x/c location, y-axis: Cf) such that it is clear where the crossover point is (i.e. the wall shear stress changes sign).

I want to circumvent Paraview entirely since quite some configurations have to be run which means that manual post-processing is time intensive. Essentially, I would like to generate a file (preferably .txt or .raw or similar format) with the x,y,z coordinates and the wall shear stress (preferably as a vector) such that it can be post-processed in python.

I've already tried to sample the wallShearStress on the surface after using postProcess -func wallShearStress -latestTime. This does return a file in the format I want, however, since it samples the volume values (which are zero for the wallshearstress) it returns a vector which is zero in all directions.



Does anybody know a way to obtain the desired result? Scouring the internet turned out to be fruitless unfortunately.


Many thanks in advance!

Tim_solver August 15, 2022 04:00

Solution
 
Hi all,

For whoever might be interested later on, I've found a solution.

First one need to calculate wallShearStress with the appropriate post process function.

Then after reconstructing (if multiple cores are used) one can use the foamToVTK function to write the coordinates and the wallshearstress vector at each coordinate. Depending on the imported geometry one might need to order the data such that a lineplot can be made (suggestion: just find the nearest point). If you don't like to bother ordering the data, you can also make a scatter plot as a quick and dirty fix.


All times are GMT -4. The time now is 20:16.