|
[Sponsors] |
How to plot pitch motion for free decay test? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 2, 2016, 07:15 |
How to plot pitch motion for free decay test?
|
#1 |
Member
Mona
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 10 |
Hi all,
I am simulating a floating body in pitch motion and I would like to do a free decay test to compare with experimental results. I am using a moving mesh and the log file contains information like this: Code:
6-DoF rigid body motion Centre of rotation: (0 0 0) Centre of mass: (0.58783434026 0 -0.181372871211) Orientation: (0.995632340385 0 0.0933608203665 0 1 0 -0.0933608203665 0 0.995632340385) Linear velocity: (0 0 0) Angular velocity: (0 0.0586546346079 0) Cheers, Mona |
|
May 23, 2016, 05:27 |
|
#2 | |
Member
Hao Chen
Join Date: Aug 2014
Posts: 66
Rep Power: 0 |
Hi Mona:
Did you manage to do it? Best regards Hao Quote:
|
||
May 24, 2016, 05:40 |
|
#3 |
Member
Mona
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 10 |
Hi Hao,
no I havn't managed yet. Do you have an idea how to do it or do you want me to tell you as soon as I figured it out? Cheers, Mona |
|
May 27, 2016, 07:45 |
Ideas
|
#4 |
Member
Mona
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 10 |
Hi all,
I have some ideas now how to do it but I am not quite there yet. In this thread simon-2 describes a way to obtain sixDoFRigidBodyMotionState files for each timestep: http://www.cfd-online.com/Forums/ope...tml#post601930 He said it was just a matter of batch processing to write all the information into one file so you obtain a file like this: Code:
#time centreOfMass orientation velocity acceleration angularMomentum Torque 80.0199 ( 3.3 0 0.1386375 ) ( 0.99807619 0 0.061999301 0 1 0 -0.061999301 0 0.99807619 ) ( 0 0 0.0045163445 ) ( 1.3211615 -2.6233042 0.84606626 ) ( 0 -0.2529557 0 ) ( 1109.8274 99.511973 -24.488035 ) 80.0298 ( ... ... ... ) (.. ... ... .. .. .. .. .. ..) (.. .. ..) (.. .. ..) (... .. ..) 80.0398 ( ... ... ... ) (.. ... ... .. .. .. .. .. ..) (.. .. ..) (.. .. ..) (... .. ..) 80.0497 ( ... ... ... ) (.. ... ... .. .. .. .. .. ..) (.. .. ..) (.. .. ..) (... .. ..) I also found this python-script: https://github.com/kodejak/openfoam-data-extractor This script extracts searched datas from the OpenFOAM project generated files e.g. gravity, centreOfMass etc. The datas will be stored as a CSV file located at the directory of the script, named like the command line search pattern. But then I still need to do this for every single sixDoFRigidBodyMotionState file and thats a lot. Any ideas? Cheers, Mona |
|
June 1, 2016, 11:51 |
Solved
|
#5 |
Member
Mona
Join Date: Mar 2016
Location: Berlin
Posts: 49
Rep Power: 10 |
Hey,
for everyone struggling with the same issue: I found a shell script that writes out data from the logfile and modified it a little bit to match my needs: Code:
#!/bin/bash PFAD=log EXCL=10 # cat list a files content on a screen / in a pipeline (using "|") # grep returns all lines matching a certain string # cut cuts out e.g. fields "-f" (here 3rd until END [-]) specified through delminiter "-d' '" (here blanks) # sed remove complete lines containing a certain string (here "ClockTime") # sed-i includes Header # head deletes last 10 lines (for scaling reasons, as last lines are often already diverged) # tr remove certain strings (here "(" and ")") #paste merge two files line by line ################ CLEAR OLD DATA ################ rm -r data ##################### TIME ##################### cat $PFAD | grep 'Time = ' | cut -d' ' -f3- | sed '/ClockTime/d' > Time.dat ############### ORIENTATION ############### cat $PFAD | grep 'Orientation' | cut -d' ' -f3- | tr -d '(' | tr -d ')'| tr -d 'Orientation:' | sed -e 's/[\\ \\]/ /g' > orientationTemp.dat ############### LINEAR VELOCITY ################ cat $PFAD | grep 'Linear velocity' | cut -d' ' -f3- | tr -d '(' | tr -d ')' | sed -e 's/[\\ \\]/ /g' > linearVelocityTemp.dat ############### ANGULAR VELOCITY ############### cat $PFAD | grep 'Angular velocity' | cut -d' ' -f3- | tr -d '(' | tr -d ')' | sed -e 's/[\\ \\]/ /g' > angularVelocityTemp.dat ########## MERGE FILES & ADD HEADER ############ mkdir data paste Time.dat orientationTemp.dat > data/orientationTemp.dat sed -i '1i#Time, cos, 0, sin, 0, 1, 0, -sin, 0, cos' data/orientationTemp.dat head -n -$EXCL data/orientationTemp.dat > data/orientation.dat paste Time.dat linearVelocityTemp.dat > data/linearVelocityTemp.dat sed -i '1i#Time, u, v, w' data/linearVelocityTemp.dat head -n -$EXCL data/linearVelocityTemp.dat > data/linearVelocity.dat paste Time.dat angularVelocityTemp.dat > data/angularVelocityTemp.dat sed -i '1i#Time, p, q, r' data/angularVelocityTemp.dat head -n -$EXCL data/angularVelocityTemp.dat > data/angularVelocity.dat rm Time.dat rm orientationTemp.dat rm data/orientationTemp.dat rm linearVelocityTemp.dat rm data/linearVelocityTemp.dat rm angularVelocityTemp.dat rm data/angularVelocityTemp.dat rm plot/*.png Code:
bash data.sh I hoped this will help someone! Cheers, Mona |
|
November 23, 2016, 06:04 |
|
#6 |
New Member
Håvard B. Refvik
Join Date: Jun 2015
Location: Norway
Posts: 17
Rep Power: 11 |
Exactly what I have been searching for. Thanks!
Last edited by havref; November 24, 2016 at 07:10. |
|
October 16, 2018, 13:09 |
|
#7 |
New Member
Adri
Join Date: Sep 2017
Posts: 24
Rep Power: 9 |
Hi Mona,
I am using the new rigidBodyDynamics library instead of the classical sixDofRigidBodyMotion ? The problem is that I do not understand how to explore the log file info since the CoG is not logged out anymore. What we have instead is a "center of rotation" but it is not the kind of point I am looking for, a CoG or a manually point to follow would be better. Here you have an example : Code:
Courant Number mean: 0.000365065 max: 0.934088 Interface Courant Number mean: 1.39805e-05 max: 0.301043 deltaT = 0.00981865 Time = 2.43733 PIMPLE: iteration 1 forces forces: Not including porosity effects Rigid-body motion of the BOAT Centre of rotation: (0.148519 -3.25435e-06 -0.00757061) Orientation: (0.999997 2.91458e-07 0.0022597 -2.91323e-07 1 -6.00382e-08 -0.0022597 5.93798e-08 0.999997) Linear velocity: (0.0538253 3.10699e-06 0.0702008) If you have some info about the way to extract CoG info, please share it Adri |
|
December 22, 2018, 09:38 |
|
#8 | |
New Member
Luo_Bingjun
Join Date: Oct 2018
Location: CHINA
Posts: 14
Rep Power: 8 |
Quote:
Hi, Mona! I also try to plot the heave motion of a floating body. I follow your ideas above. After running the case, I creat a file named data.sh and copy the script into the this file. Then I run the command bash data.sh in the terminal. However, some errors happen and I get three .dat files without nothong in these files. I don't know if I am right to do so. Did I do someting wrong so that I can't get the data. I am new here. I wish your rely, thank you! |
||
February 27, 2019, 11:27 |
|
#9 |
New Member
Laurent Fieschi
Join Date: Aug 2017
Posts: 6
Rep Power: 9 |
Hi Robin86,
Try to personalise the data file by modifying the following line : Code:
PFAD=log Code:
PFAD=log.interFoam Laurent. |
|
March 19, 2019, 21:28 |
|
#10 |
New Member
Luo_Bingjun
Join Date: Oct 2018
Location: CHINA
Posts: 14
Rep Power: 8 |
Thank you for your reply. I already fix the problem.
|
|
September 30, 2019, 08:01 |
|
#11 | |
New Member
Arun Kumar
Join Date: Sep 2019
Location: Dundee, Scotland
Posts: 15
Rep Power: 7 |
Quote:
For instance: 1.34587e-18 becomes 1.34587-18. Any help would be greatly appreciated in this regard. Thanks, Arun. |
||
February 4, 2022, 21:31 |
|
#12 | |
Senior Member
TWB
Join Date: Mar 2009
Posts: 414
Rep Power: 19 |
Quote:
Just saw your msg. Actually the reason this occurs is due to: Code:
tr -d 'Orientation:' |
||
March 18, 2022, 12:31 |
|
#13 |
Member
Tony Zhang
Join Date: Nov 2019
Location: soton
Posts: 45
Rep Power: 7 |
Dear all,
I have the same question about this pitch and heave plot. I think the sin(pitch) is the third component of the orientation vector but I have no idea how to derive the heave. Please let me know if you have any ideas. Many thanks, Tony |
|
February 19, 2023, 22:31 |
|
#14 | |
New Member
Yanning Chen
Join Date: Feb 2023
Posts: 3
Rep Power: 3 |
Quote:
Many thanks, Brandon |
||
February 25, 2024, 09:57 |
|
#15 | |
New Member
Ramesh Mukkund
Join Date: Oct 2023
Posts: 4
Rep Power: 3 |
forgot
Quote:
I'm running floatingObject (2d case) using olaFlow and I'm able to run simulation successfully. while i was trying to plot surge, heave plot i used your script with just modifying 'log' to 'olaDyMFoam.log' , and then running ' bash data.sh' , i got this msg. I couldn't get this msg what I'm doing wrong. can u please help me to figure it out. this is what i got after running 'bash data.sh' Last edited by Ramesh mukkund; February 25, 2024 at 09:59. Reason: forgot attach an image |
||
February 25, 2024, 10:00 |
|
#16 | |
New Member
Ramesh Mukkund
Join Date: Oct 2023
Posts: 4
Rep Power: 3 |
Quote:
cat: olaDyMFlow.log: No such file or directory cat: olaDyMFlow.log: No such file or directory cat: olaDyMFlow.log: No such file or directory cat: olaDyMFlow.log: No such file or directory cat: olaDyMFlow.log: No such file or directory paste: CentreofmassTemp.dat: No such file or directory rm: cannot remove 'CentreofmassTemp.dat': No such file or directory rm: cannot remove 'plot/*.png': No such file or directory |
||
February 25, 2024, 16:29 |
|
#17 | |
New Member
Ramesh Mukkund
Join Date: Oct 2023
Posts: 4
Rep Power: 3 |
Quote:
|
||
Tags |
dynamic mesh, pitching |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem with p_rgh with interDyMFoam in a ship roll decay test | karmo | OpenFOAM Running, Solving & CFD | 1 | August 23, 2012 18:07 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |
OF 1.6 | Ubuntu 9.10 (64bit) | GLIBCXX_3.4.11 not found | piprus | OpenFOAM Installation | 22 | February 25, 2010 14:43 |
Problems in compiling paraview in Suse 10.3 platform | chiven | OpenFOAM Installation | 3 | December 1, 2009 08:21 |
Automatic Mesh Motion solver | michele | OpenFOAM Running, Solving & CFD | 10 | September 26, 2005 09:21 |