CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   plotting center of Mass over time (http://www.cfd-online.com/Forums/openfoam-post-processing/118287-plotting-center-mass-over-time.html)

mcathela May 24, 2013 05:35

plotting center of Mass over time
 
Dear all,

I run the case of a vertical free decay of a floating object in a still water. This case is similar to the floatingObject tutorial, it's just different initial conditions.
My floating object's type is a sixDoFRigidDisplacement and I set the "report" on in the pointDisplacement file. In my .log file, I have at each time step the coordinates of the center of mass.
I would like to plot the z-coordinate over time.
I tried in gnuplot something like plot "<cat log | grep 'Centre of mass:' ... That works but it plots heave over iteration. As i want to compare different cases (they don't have the same time-steps since my simulations run with the adjustTimeStep on in the controlDict), this solution doesn't work for me.
I heard about pyFoam, I saw that it can plot a lot of things but it seems to be only residuals... Is it possible to plot the center of mass over time (using the datas extracted from my log file)?

Thank you for your help

Marie

gschaider June 5, 2013 19:06

Quote:

Originally Posted by mcathela (Post 429726)
Dear all,

I run the case of a vertical free decay of a floating object in a still water. This case is similar to the floatingObject tutorial, it's just different initial conditions.
My floating object's type is a sixDoFRigidDisplacement and I set the "report" on in the pointDisplacement file. In my .log file, I have at each time step the coordinates of the center of mass.
I would like to plot the z-coordinate over time.
I tried in gnuplot something like plot "<cat log | grep 'Centre of mass:' ... That works but it plots heave over iteration. As i want to compare different cases (they don't have the same time-steps since my simulations run with the adjustTimeStep on in the controlDict), this solution doesn't work for me.
I heard about pyFoam, I saw that it can plot a lot of things but it seems to be only residuals... Is it possible to plot the center of mass over time (using the datas extracted from my log file)?

Thank you for your help

Marie

Yes you can with a customRegexp (you've got to specify the pattern in the log-file):
http://openfoamwiki.net/index.php/Co...omRegexp-files

Maimouna October 16, 2014 07:34

[QUOTE]
Quote:

Originally Posted by mcathela (Post 429726)
Dear all,

I run the case of a vertical free decay of a floating object in a still water. This case is similar to the floatingObject tutorial, it's just different initial conditions.
My floating object's type is a sixDoFRigidDisplacement and I set the "report" on in the pointDisplacement file. In my .log file, I have at each time step the coordinates of the center of mass.
I would like to plot the z-coordinate over time.
I tried in gnuplot something like plot "<cat log | grep 'Centre of mass:' ... That works but it plots heave over iteration. As i want to compare different cases (they don't have the same time-steps since my simulations run with the adjustTimeStep on in the controlDict), this solution doesn't work for me.
I heard about pyFoam, I saw that it can plot a lot of things but it seems to be only residuals... Is it possible to plot the center of mass over time (using the datas extracted from my log file)?

Dear Marie,

I'm looking exactly what you were looking for, plot centre of mass over time from the data in the log file. Could you help me please how to plot that?

Kind regards

Maimouna

Thank you for your help


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