# Orientation tensor of 6DoF solver

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 January 13, 2016, 10:50 Orientation tensor of 6DoF solver #1 New Member   Manoj Join Date: Jun 2013 Posts: 20 Rep Power: 4 Hi All I am trying to use interDyMfoam solver for doing dynamic trim and sinkage simulation of a ship. Following is an extract from the log.interDyMfoam file. 6-DoF rigid body motion Centre of rotation: (2.59 0 0.296454) Centre of mass: (2.59 0 0.296454) Orientation: (0.99971 0 -0.02408 0 1 0 0.02408 0 0.99971) Linear velocity: (0 0 -0.0128308) Angular velocity: (0 0.00336935 0) What is this orientation tensor? How do we get trim (rotation about y axis) and sinkage ( translation about z axis) information out of it? Regards, Manoj

 January 15, 2016, 14:41 #2 Member   Davi Barreira Join Date: Apr 2014 Location: Fortaleza Posts: 67 Rep Power: 3 When you run your simulation, save the log file. In the log file you will have the information that you want, so it's just a matter of writing a little script to extract it. Here is a little bash to get the center of mass. Code: ```#!/bin/bash grep 'Centre of mass' \$1 | cut -d '(' -f 2 | tr -d ")" > centreMass_Extract grep -e "^Time = " \$1 | cut -d " " -f 3 > times_Extract paste times_Extract centreMass_Extract > cmMotion_parcial sed -e 's/ [ ]*/\t/g' cmMotion_parcial > cmMotion rm cmMotion_parcial rm times_Extract rm centreMass_Extract```

January 19, 2016, 01:59
#3
New Member

Manoj
Join Date: Jun 2013
Posts: 20
Rep Power: 4
Quote:
 Originally Posted by davibarreira When you run your simulation, save the log file. In the log file you will have the information that you want, so it's just a matter of writing a little script to extract it. Here is a little bash to get the center of mass. Code: ```#!/bin/bash grep 'Centre of mass' \$1 | cut -d '(' -f 2 | tr -d ")" > centreMass_Extract grep -e "^Time = " \$1 | cut -d " " -f 3 > times_Extract paste times_Extract centreMass_Extract > cmMotion_parcial sed -e 's/ [ ]*/\t/g' cmMotion_parcial > cmMotion rm cmMotion_parcial rm times_Extract rm centreMass_Extract```
Thank you for the reply. It works very well.

But I am facing 2 issues .

1) Because I am having 3 nOuterCorrectors loops inside PIMPLE, so it seems 6DOF solvers also runs the same number of time for every time step. So in the cmmotion file, center of mass data is 3 times the time data. I am attaching the files with the message. If you can help me to correct it. I am new to writing these scripts.

2) What is the orientation tensor? There is 9 values in it. What are these values?

Thanks again.

Regards,

Manoj
Attached Files
 cmMotion.tar.gz (9.8 KB, 0 views)

January 19, 2016, 05:02
#4
New Member

Manoj
Join Date: Jun 2013
Posts: 20
Rep Power: 4
Quote:
 Originally Posted by manoj_nav 1) Because I am having 3 nOuterCorrectors loops inside PIMPLE, so it seems 6DOF solvers also runs the same number of time for every time step. So in the cmmotion file, center of mass data is 3 times the time data. I am attaching the files with the message. If you can help me to correct it. I am new to writing these scripts.
Got this working by including,

awk 'NR == 1 || NR % 3 == 0' centreMass_Extract > centreMass_Extract1

But I still dont understand what are these 9 values of orientation tensor..

January 21, 2016, 12:38
#5
New Member

Manoj
Join Date: Jun 2013
Posts: 20
Rep Power: 4
Quote:
 Originally Posted by manoj_nav But I still dont understand what are these 9 values of orientation tensor..
Can anyone confirm if the orientation tensor is give by below matrix, where the rotations are about the , and axes with angles , and ?

January 21, 2016, 15:05
#6
Senior Member

Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 310
Rep Power: 9
Quote:
 Originally Posted by manoj_nav Can anyone confirm if the orientation tensor is give by below matrix, where the rotations are about the , and axes with angles , and ?
Looking at this:
http://planning.cs.uiuc.edu/node102.html

and this:
http://foam.sourceforge.net/docs/cpp/a09729_source.html

It indeed appears that that is the correct summation of the Rx Ry and Rz tensors.

 January 22, 2016, 10:15 #7 New Member   Manoj Join Date: Jun 2013 Posts: 20 Rep Power: 4 Thanks a lot for the reply. Regards, Manoj

 January 30, 2016, 03:56 #8 Senior Member   Join Date: Jul 2011 Posts: 104 Rep Power: 6 For interDyMFoam, if you are using sixDoFRigidBodyMotionI.H: Code: ```inline Foam::tensor Foam::sixDoFRigidBodyMotion::rotationTensorX ( scalar phi ) const { return tensor ( 1, 0, 0, 0, Foam::cos(phi), -Foam::sin(phi), 0, Foam::sin(phi), Foam::cos(phi) ); } inline Foam::tensor Foam::sixDoFRigidBodyMotion::rotationTensorY ( scalar phi ) const { return tensor ( Foam::cos(phi), 0, Foam::sin(phi), 0, 1, 0, -Foam::sin(phi), 0, Foam::cos(phi) ); } inline Foam::tensor Foam::sixDoFRigidBodyMotion::rotationTensorZ ( scalar phi ) const { return tensor ( Foam::cos(phi), -Foam::sin(phi), 0, Foam::sin(phi), Foam::cos(phi), 0, 0, 0, 1 ); } inline Foam::Tuple2 Foam::sixDoFRigidBodyMotion::rotate ( const tensor& Q0, const vector& pi0, const scalar deltaT ) const { Tuple2 Qpi(Q0, pi0); tensor& Q = Qpi.first(); vector& pi = Qpi.second(); tensor R = rotationTensorX(0.5*deltaT*pi.x()/momentOfInertia_.xx()); pi = pi & R; Q = Q & R; R = rotationTensorY(0.5*deltaT*pi.y()/momentOfInertia_.yy()); pi = pi & R; Q = Q & R; R = rotationTensorZ(deltaT*pi.z()/momentOfInertia_.zz()); pi = pi & R; Q = Q & R; R = rotationTensorY(0.5*deltaT*pi.y()/momentOfInertia_.yy()); pi = pi & R; Q = Q & R; R = rotationTensorX(0.5*deltaT*pi.x()/momentOfInertia_.xx()); pi = pi & R; Q = Q & R; return Qpi; }``` The rotation function below shows that it is actually 0.5*Rx*0.5*Ry*Rz*0.5*Ry*0.5*Rx

 January 31, 2016, 12:29 #9 New Member   Manoj Join Date: Jun 2013 Posts: 20 Rep Power: 4 Hi Haze If the orientation tensor is 0.5*Rx*0.5*Ry*Rz*0.5*Ry*0.5*Rx , then the 7th member of the tensor becomes zero for rotation about only y-axis. But in my simulations, I am getting this number non-zero. Can you confirm? Thanks and Regards, Manoj

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sankarv OpenFOAM Running, Solving & CFD 17 December 3, 2014 20:41 SamCanuck FLUENT 2 August 31, 2011 11:34 Luiz CFX 4 March 6, 2011 21:02 bearcat CFX 6 April 28, 2008 14:08 cfd guy CFX 4 May 8, 2001 06:04

All times are GMT -4. The time now is 11:37.

 Contact Us - CFD Online - Top