|
[Sponsors] |
A problem on the "rotate" function of sixDoF module |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 18, 2019, 04:59 |
A problem on the "rotate" function of sixDoF module
|
#1 |
Member
Dongxu Wang
Join Date: Sep 2018
Location: China
Posts: 33
Rep Power: 8 |
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; Code:
// Correct orientation Tuple2<tensor, vector> Qpi = rotate(Q0(), (voc_*pi() + (1 - voc_)*pi0()), deltaT); Q() = Qpi.first(); 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; } 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. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |