CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Rigid Body with 3-DOF rotation (https://www.cfd-online.com/Forums/openfoam/75514-rigid-body-3-dof-rotation.html)

aeropeng April 28, 2010 00:04

Rigid Body with 3-DOF rotation
 
Hi,
I wonder whether I can apply inertial coordinates, instead of rotation axis and angular velocity, to describe the rigid body with 3-DOF rotation in OF.
The inertial coordinates are transformated by a coordinate transition matrix form body-fixed coordinate system to inertial coordinate system.
If it can, I should use which Foam? InterDyMFoam or MRFFoam?:)

Best wishes
peng

Ohbuchi April 28, 2010 03:56

Please refer a paper by Dr. Jasak.
http://powerlab.fsb.hr/ped/kturbo/Op...h_AIAA2009.pdf

But detail setup procedure does not described in this paper.
The appropriate solver is turbDyMFoam of OF-1.5-dev, I think.
But I'm afraid you need some custom mesh changer class.

aeropeng April 28, 2010 06:18

Quote:

Originally Posted by Ohbuchi (Post 256611)
Please refer a paper by Dr. Jasak.
http://powerlab.fsb.hr/ped/kturbo/Op...h_AIAA2009.pdf

But detail setup procedure does not described in this paper.
The appropriate solver is turbDyMFoam of OF-1.5-dev, I think.
But I'm afraid you need some custom mesh changer class.

Hi, Ohbuchi
Thank you for your valuable suggestion.
I must point that my study object involves a large scale mesh deformation. I want to simplify it depending on the whole field rotation and just get the near field details.
Thank you again for your kind help.

Best wishes
Peng


paul b June 28, 2011 04:43

To be able to use 3D rotation you need to modify the mesh class.
In src/dynamicMesh/dynamicFvMesh/ you will find the mesh class mixerGgiFvMesh.

Here, coordinates are defined in a cylindrical coordinate system, the coordinate system object cs which is initialized in the constructor method.
If you delete those lines the whole thing will be specified in cartesian coordinates. Then you need to adjust the part where the mesh is moved, the update() method:

Here it says:
Code:

        csPtr_->globalPosition
    movePoints
    (
            csPtr_->localPosition(allPoints())
          + vector(0, rpm_*360.0*time().deltaT().value()/60.0, 0)
            *movingPointsMask()
    )

Here the inner part says:
- get the pointer to the coordinate system and convert all points of to local coordinates relative to the origin
- add a vector which holds the values (radius, angle, height), thus all points of the mesh are rotated by rpm_*360.0*time().deltaT().value()/60.0
- apply a mask which holds a value of 0 or 1 for each point of the mesh. For rotor points the value is 1, for stator points it is 0. Thereby the motion is restricted to the rotor part.
- the enclosing csPtr_->globalPosition transfers the points back to global coordinates.

What you need here is a 3D rotation matrix instead.
You already got rid of the cylindrical coordinates, so all you need to do next is something like:
Code:

movePoints(
(((allPoints() - origin) ^ rotationMatrix) - origin) * movingPointsMask;
);

The rotation matrix has to be specified before using the rotation angles around your coordinate axes.


Ah, you also need to delete a "cs.()" somewhere around line 80 where it says:
Code:

    label originRegion = rs[findNearestCell(cs().origin())];
Here the rotating mesh region is determined by the fact that it contains the origin. You will need to specify the origin in your dynamicMeshDict and read it from there...


As a solver you can use anything that incorporates moving meshes, I think they all have a "DyM" in their name.


Hope this helps a bit.
Paul


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