CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Post-Processing

Orientation tensor of 6DoF solver

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 13, 2016, 10:50
Default Orientation tensor of 6DoF solver
  #1
Member
 
Manoj
Join Date: Jun 2013
Posts: 36
Rep Power: 4
manoj_nav is on a distinguished road
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
manoj_nav is offline   Reply With Quote

Old   January 15, 2016, 14:41
Default
  #2
Member
 
Davi Barreira
Join Date: Apr 2014
Location: Fortaleza
Posts: 76
Rep Power: 4
davibarreira is on a distinguished road
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
davibarreira is offline   Reply With Quote

Old   January 19, 2016, 01:59
Default
  #3
Member
 
Manoj
Join Date: Jun 2013
Posts: 36
Rep Power: 4
manoj_nav is on a distinguished road
Quote:
Originally Posted by davibarreira View Post
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
File Type: gz cmMotion.tar.gz (9.8 KB, 3 views)
manoj_nav is offline   Reply With Quote

Old   January 19, 2016, 05:02
Default
  #4
Member
 
Manoj
Join Date: Jun 2013
Posts: 36
Rep Power: 4
manoj_nav is on a distinguished road
Quote:
Originally Posted by manoj_nav View Post
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..
manoj_nav is offline   Reply With Quote

Old   January 21, 2016, 12:38
Default
  #5
Member
 
Manoj
Join Date: Jun 2013
Posts: 36
Rep Power: 4
manoj_nav is on a distinguished road
Quote:
Originally Posted by manoj_nav View Post
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 ?


manoj_nav is offline   Reply With Quote

Old   January 21, 2016, 15:05
Default
  #6
Senior Member
 
kmooney's Avatar
 
Kyle Mooney
Join Date: Jul 2009
Location: Amherst, MA USA - San Diego, CA USA
Posts: 312
Rep Power: 9
kmooney is on a distinguished road
Quote:
Originally Posted by manoj_nav View Post
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.
kmooney is offline   Reply With Quote

Old   January 22, 2016, 10:15
Default
  #7
Member
 
Manoj
Join Date: Jun 2013
Posts: 36
Rep Power: 4
manoj_nav is on a distinguished road
Thanks a lot for the reply.

Regards,

Manoj
manoj_nav is offline   Reply With Quote

Old   January 30, 2016, 03:56
Default
  #8
Senior Member
 
Join Date: Jul 2011
Posts: 104
Rep Power: 6
haze_1986 is on a distinguished road
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;
}
The rotation function below shows that it is actually
0.5*Rx*0.5*Ry*Rz*0.5*Ry*0.5*Rx
haze_1986 is offline   Reply With Quote

Old   January 31, 2016, 12:29
Default
  #9
Member
 
Manoj
Join Date: Jun 2013
Posts: 36
Rep Power: 4
manoj_nav is on a distinguished road
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
manoj_nav is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating New Solver: For particle-laden 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


All times are GMT -4. The time now is 12:05.