CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

A problem on the "rotate" function of sixDoF module

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 18, 2019, 04:59
Default A problem on the "rotate" function of sixDoF module
  #1
Member
 
Dongxu Wang
Join Date: Sep 2018
Location: China
Posts: 33
Rep Power: 8
wdx_cfd is on a distinguished road
Dear guys,

I am a new FOAMer who aims at using interFoam to solve the problem of wave-structure interactions. Recently, I spend a lot of time to study functions in the sixDof module of OFv6. I have finished learning most parts of this module, but there is still a small problem.

In sixDofRigidBodyMotion.H, there is a function:
Code:
        //- Apply rotation tensors to Q0 for the given torque (pi) and deltaT
        //  and return the rotated Q and pi as a tuple
        inline Tuple2<tensor, vector> rotate
        (
            const tensor& Q0,
            const vector& pi,
            const scalar deltaT
        ) const;
It uses the angular momentum(pi) of the present time step to form the rotate matrix to update the orientation (Q0). For example, if the CN method is applied (voc_ = 0.5):

Code:
    // Correct orientation
    Tuple2<tensor, vector> Qpi =
        rotate(Q0(), (voc_*pi() + (1 - voc_)*pi0()), deltaT);
    Q() = Qpi.first();
The defination of this function:
Code:
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;
}
From the defination it can be concluded that the orientation and the angular momentum have been rotated around the x-axis with a angle of 0.5*deltaT*pi.x()/momentOfInertia_.xx(), then 0.5*deltaT*pi.y()/momentOfInertia_.yy() around the y-axis, then deltaT*pi.z()/momentOfInertia_.zz() around the z-axis, then 0.5*deltaT*pi.y()/momentOfInertia_.yy() around the y-axis, and finally 0.5*deltaT*pi.x()/momentOfInertia_.xx() around the x-axis.

This rotation process makes me confused. I am wondering that why this operate can get the new orientation of the rigid body. Why not just rotate three times around the x, y and z-axis with the angle of deltaT*pi.x()/momentOfInertia_.xx(), deltaT*pi.y()/momentOfInertia_.yy() and deltaT*pi.z()/momentOfInertia_.zz()?

Some useful references are OK if this problem is too comlicated to explain.

Thanks in advance.
wdx_cfd is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with MHD module and writing the UDF aminrahmat Fluent UDF and Scheme Programming 5 March 2, 2020 08:33
[snappyHexMesh] How to define to right point for locationInMesh Mirage12 OpenFOAM Meshing & Mesh Conversion 7 March 13, 2016 15:07
[swak4Foam] installation problem with version 0.2.3 Claudio87 OpenFOAM Community Contributions 9 May 8, 2013 11:20
latest OpenFOAM-1.6.x from git failed to compile phsieh2005 OpenFOAM Bugs 25 February 9, 2010 05:37
Version 15 on Mac OS X gschaider OpenFOAM Installation 113 December 2, 2009 11:23


All times are GMT -4. The time now is 00:26.