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

rotate function in sixDoFRigidBodyMotionI.H

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 7, 2020, 04:54
Default rotate function in sixDoFRigidBodyMotionI.H
  #1
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
The rotate function in the file \$FOAM_SRC/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionI.H


looks as follows:


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;
}
pi is the angular momentum vector and Q the orientation matrix (it describes the transformation from the local to the global coordinate system)



What i figured out so fare the intention of this function is to compute the angle difference between the local coordinate system at the old and new time step. For this purpose one can use the equation for the angular momentum L



L = I \omega = I \frac{\Delta \phi}{\Delta t} \rightarrow \Delta \phi = \frac{L}{I}\Delta t


Beeing I the diagonal inertial tensor and phi a vector.


So my question is why the function first rotates half angle around the first axis, then half angle around the second axis, the full angle around the third axis, than half angle around the second axis and half angle around the first axis.



What is the difference to perform the full rotation around the first, second and third axis?


Best



Michael
mAlletto is offline   Reply With Quote

Old   August 10, 2020, 07:31
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 615
Rep Power: 15
mAlletto will become famous soon enough
Maybe some additional background:


What I found so far is that in OpenFoam (I checked 2006) to obtain the new orientation of the local body fixed coordinate system we first integrate the equation of motion for the angular momentum transformed to the local coordinate system:


\dot L_C = \sum M_C


The subscript C denotes that the angular momentum is computed using the center of gravity as reference point.

If we integrate this equation ones we get the angular momentum at the new time step



L^{n+1}_{C,n+1} = I_C \omega^{n+1}_{n+1}


The moment of inertia in the above equation is only diagonal if axis of the local coordinate system are aligned with the axis of inertia. The subcript n+1 denotes that the vectors are expressed in the local coordinate system at the time step n+1 and the superscript n+1 denotes the time step at which the solution is computed. Unfortunately we know only the orientation of the local coordinate system in the last time step n.




We get a first order approximation of the above equation if we express the vectors in the local coordinate system at the time step n:


L^{n+1}_{C,n} + O(\Delta t) = I_C ( \omega^{n+1}_{n} +  O(\Delta t)) = I_C \frac{\Delta \phi}{\Delta t}


\Delta \phi = (\phi_x \ \phi_y \ \phi_z) is the vector of angle differences between the orientation of the axis of the local coordinate system at the time step n and n+1.


So if we rotate the axis of the local coordinate system by the three angles increments

(\phi_x \ \phi_y \ \phi_z) we get the orientation of the local coordinate system at the new time step.



What i do not understand is why the rotate function is constructed like described in the previous post.

Last edited by mAlletto; August 10, 2020 at 10:49.
mAlletto 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
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 11:32
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
ParaView for OF-1.6-ext Chrisi1984 OpenFOAM Installation 0 December 31, 2010 06:42
Compilation errors in ThirdPartymallochoard feng_w OpenFOAM Installation 1 January 25, 2009 06:59
Problem with compile the setParabolicInlet ivanyao OpenFOAM Running, Solving & CFD 6 September 5, 2008 20:50


All times are GMT -4. The time now is 21:19.