Extract data from log file OpenFOAM

OpenFOAM version 2.3.0 has a new feature for its sixDoFRigidBodyMotion solver. There is no celldisplacement field in the time steps so we cannot use probe to extract data of the mesh displacement. But, if we like to extract the data, we can use extractData command.

Example, In the ./case/extractData

grep “Centre of mass” $1 | cut -d “:” -f 2 | cut -d ” ” -f 3 | tr -d “)” > cM
grep “Linear velocity” $1 | cut -d “:” -f 2 | cut -d ” ” -f 4 | tr -d “)” > lV
grep -e “^Time = ” $1 | cut -d ” ” -f 3 > times

paste times cM > t_vs_cm
paste times lV > t_vs_lv

rm cM lV times

After run the case, example: >> mpirun -np 2 pimpleDyMFoam -parallel > log &
Then type >> ./extractData log

You can find new files are created that contain you needed data.


Vortex Induced Vibration

For the last few days I’ve tried to simulate flow over a circular cylinder at Re=22k using OpenFOAM. The cylinder is attached to a mass-damping system in one degree of freedom (cross-stream). The simulation only success when the natural frequency of the system is high, omega_o >= 2 x vortex shedding frequency. I believe that I need to work out on the resonant response of the system.