
[Sponsors] 
January 13, 2016, 10:50 
Orientation tensor of 6DoF solver

#1 
Member
Manoj
Join Date: Jun 2013
Posts: 39
Rep Power: 5 
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. 6DoF 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: 76
Rep Power: 4 
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  
Member
Manoj
Join Date: Jun 2013
Posts: 39
Rep Power: 5 
Quote:
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 

January 19, 2016, 05:02 

#4  
Member
Manoj
Join Date: Jun 2013
Posts: 39
Rep Power: 5 
Quote:
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 
Member
Manoj
Join Date: Jun 2013
Posts: 39
Rep Power: 5 

January 21, 2016, 15:05 

#6  
Senior Member
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA  San Diego, CA USA
Posts: 320
Rep Power: 10 
Quote:
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 
Member
Manoj
Join Date: Jun 2013
Posts: 39
Rep Power: 5 
Thanks a lot for the reply.
Regards, Manoj 

January 30, 2016, 03:56 

#8 
Senior Member
Join Date: Jul 2011
Posts: 105
Rep Power: 7 
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::tensor, Foam::vector> Foam::sixDoFRigidBodyMotion::rotate ( const tensor& Q0, const vector& pi0, const scalar deltaT ) const { Tuple2<tensor, vector> 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; } 0.5*Rx*0.5*Ry*Rz*0.5*Ry*0.5*Rx 

January 31, 2016, 12:29 

#9 
Member
Manoj
Join Date: Jun 2013
Posts: 39
Rep Power: 5 
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 yaxis. But in my simulations, I am getting this number nonzero. Can you confirm? Thanks and Regards, Manoj 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Creating New Solver: For particleladen compressible jets  sankarv  OpenFOAM Running, Solving & CFD  17  December 3, 2014 20:41 
Quarter Burner mesh with periosic condition  SamCanuck  FLUENT  2  August 31, 2011 11:34 
Working directory via command line  Luiz  CFX  4  March 6, 2011 21:02 
why the solver reject it? Anyone with experience?  bearcat  CFX  6  April 28, 2008 14:08 
Error during Solver  cfd guy  CFX  4  May 8, 2001 06:04 