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

Leapfrog orientation adjustment in sixDoFRigidBodyMotion.C

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 6, 2015, 03:25
Default Leapfrog orientation adjustment in sixDoFRigidBodyMotion.C
  #1
Senior Member
 
Join Date: Jul 2011
Posts: 120
Rep Power: 14
haze_1986 is on a distinguished road
Hi all, I am trying to understand the idea behind the leapfrog motion and orientation adjustments and I am not sure why during the adjustments. Q() from the previous time step Q0() is used with pi() from the current time step, is there any reason for this?
Code:
       // Leapfrog orientation adjustment
        Tuple2<tensor, vector> Qpi = rotate(Q0(), pi(), deltaT, deltaT0);
        Q() = Qpi.first();
        pi() = rConstraints_ & Qpi.second();
As we can see the leapfrog translation part uses the current velocity v()
Code:
        // Leapfrog move part
        centreOfRotation() = centreOfRotation0() + deltaT*v();
Details regarding rotate()

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;
}
Any help is appreciated, thanks!
haze_1986 is offline   Reply With Quote

Reply


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
Coordinate System Orientation ryancoe STAR-CCM+ 7 November 4, 2014 03:46
Changing orientation of object in Paraview Jochem OpenFOAM 0 July 28, 2010 04:52
Face orientation in blockMesh WiWo OpenFOAM 0 March 18, 2010 11:10
Multicomponent fluid Andrea CFX 2 October 11, 2004 05:12
Y+ orientation Ashish Siemens 1 April 22, 2003 03:58


All times are GMT -4. The time now is 02:14.