|
[Sponsors] |
How to extract roll angles of 2D floating object? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 14, 2012, 11:46 |
How to extract roll angles of 2D floating object?
|
#1 |
New Member
Kie Hian
Join Date: Aug 2011
Location: Singapore
Posts: 19
Rep Power: 14 |
Hi Foamers,
I'm trying to figure out how to extract / sample the roll angle of a floating box constrained to roll only (1 DoF). It seems like a simple problem but I can't seemed to find anyway of doing it! The case I'm running is based on: Jung, K.H., Chang, K.A., Jo, H.J., Viscous Effect on the Roll Motion of a Rectangular Structure, J. of Engineering Mechanics, 2006. This was mentioned in the Eric Paterson's slides for 3rd OF workshop and seems to have been used as a demo case a few times. If anyone has ran the case before please do share some hints. Thanks in advance. Kie |
|
February 15, 2012, 23:05 |
Get sixDoFRigidBodyMoton functionObject to output "Orientation"
|
#2 |
New Member
Kie Hian
Join Date: Aug 2011
Location: Singapore
Posts: 19
Rep Power: 14 |
Posting my work-around if it's of help to anyone else:
Go to $FOAM_SRC/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyMotion Open sixDoFRigidBodyMotion.C file with your favourite editor. Near the bottom of the file: After Code:
<< "Angular velocity: " << omega() Code:
" << nl" After the angular velocity line (but before the line that says Code:
<< endl; Code:
<< "Orientation: " << Q() A bash script (e.g. extractData script found in the simple harmonic motion tutorial) can subsequently be used to extract time step and Orientation tensor value for further post-processing. I think the orientation (Q) tensor is a rotational matrix generated by rotating in X, Y, Z sequence (still figuring this out at the moment......). If this is the case, then roll (i.e. rotation about Y axis) will be given by asin of the 3,1 element which should be the #7 of the 9 values of the Q tensor. |
|
October 13, 2022, 02:15 |
How to extract roll angles of 2D floating object?
|
#3 |
New Member
Akshay
Join Date: Jun 2022
Posts: 5
Rep Power: 3 |
Dear Sir,
I also want to extract roll motion of floating body, as per your suggestions i extract orientation vector and plotted sin(3*1 element) entry w.r.t time. But my plot results are matching with experimental results. please suggest orientation vector only give rotational motion?. Thanks, Akshay |
|
October 13, 2022, 20:59 |
|
#4 |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 13 |
Hi Akshay80
The coordinate system of a floating object is defined as follows. coodinate: x -> surging y -> swaying z -> heaving The transformation from the orientation tensor to Euler angles is as follows. Orientation: (1 0 8.03123e-05 0 1 0 -8.03123e-05 0 1)->(xx xy xz yx yy yz zx zy zz) trace = xx + yy + zz s = 0.5/sqrt(trace+1) w = 0.25/s vx = (zy - yz)*s vy = (xz - zx)*s vz = (yx - xy)*s //make quaternions t11 = 2*(w*vx - vy*vz) t12 = w^2 - vx^2 - vy^2 + vz^2 s2 = 2*(vx*vz + w*vy) t31 = 2*(w*vz - vx*vy) t32 = w^2 + vx^2 - vy^2 -vz^2 //Conversion between quaternions and Euler angles angX = atan2(t11, t12) //rolling angY = asin(s2) //pitching angZ = atan2(t31, t32) //yawing See: https://en.wikipedia.org/wiki/Conver...d_Euler_angles
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/ Powered by Ennova : https://ennova-cfd.com/ Ennova's Channel Partners : http://www.wolfdynamics.com/ |
|
October 14, 2022, 02:57 |
|
#5 |
New Member
Akshay
Join Date: Jun 2022
Posts: 5
Rep Power: 3 |
Dear Sir,
Thanks for replying, I plotted the graph as per your suggestions, I got the same graph as if i choose(1*3 element) i.e 3 rd element of orientation vector. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[foam-extend.org] Error compiling OpenFOAM-1.6-ext | Canesin | OpenFOAM Installation | 137 | January 20, 2016 14:56 |
Inserting a floating object on a restart | RileyJ | FLOW-3D | 0 | October 24, 2011 16:05 |
Floating object in a fluid | benjaminm | CFX | 7 | November 14, 2009 05:46 |
Compilation error OF1.5-dev on Suse10.3 | darenyang | OpenFOAM Installation | 0 | April 29, 2009 04:55 |
[blockMesh] BlockMeshmergePatchPairs | hjasak | OpenFOAM Meshing & Mesh Conversion | 11 | August 15, 2008 07:36 |