CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Sliding Mesh or rotor stator model implimentation (

kid April 11, 2012 07:58

Sliding Mesh or rotor stator model implimentation
Hi Fomers,
This a very serious question guys, and would appreciate suggestions from every one.

What is state of implementing sliding mesh in OpenFOAM ( or with OpenFOAM201)?

We require to implement VAWT ( Vertical Axis Wind Turbine), Fixing the outer domain and rotating a cylindrical Mesh inside it having blade.stl .
Now another question comes up:
What should be the approach ? ( in getting 2 meshes ie cylinder with stl blades and outer domain)


PS: Any other suggestions !!!!

lovecraft22 April 11, 2012 09:41

I would suggest you to have a look at the following tutorials:
Multi Reference Frames: tutorials/incompressible/MRFSimpleFoam/mixerVessel2D
Moving mesh: tutorials/incompressible/pimpleDyMFoam/propeller

kid April 12, 2012 02:30


Was using openFOAM201 , @/tutorial/incompressible/pimpleDyFoam did not find propeller case. Checked out by upgrading to openFoam210 and found the propeller case, working on it now. Will come up with question soon.
Also i decided to go for sliding mesh instead of moving Frame of Reference i.e the two case you suggested, i am trying out propeller one with pimpleDyFoam.
Is my decision ok ??


lovecraft22 April 12, 2012 04:02

Yep, the propeller tutorial came out with the latest version of OF.
About your decision, it really depend on whether you want to run a steady or unsteady simulation.

kid April 12, 2012 06:19

I am just doing that propeller case, but things would get prity complicated for me if i implement a similar case.
Few questions!!!
1. What is the role of importing geometry , i do not know if at all it is required? ( At least the object which has to rotate ( suppose a turbine)).

2. How to i create the innerCylinder and innerCylinderSmall? (the sliding faces that would separate Rotor and Stator part of CFD domain)

3.How to create mesh

I use slome for geometry and mesh creation + simpleFoam GUI in CAELinux to for the OpenFoam case directory.
else I use discritizer.

But how should i approach for this case, really stuck man.

lovecraft22 April 12, 2012 06:31

Have you looked already at the allRun script? That's all you need to run…

kid April 12, 2012 06:41

Yes i did dig inside. Also ran the case.
Everything fine with that case.

But if i want to implement another similar case.
Like a rotating cube in a regular inlet ---> outlet domain.

Now if you see that question of mine above, you would understand what i intended to ask.


lovecraft22 April 12, 2012 07:16

The easiest way is probably to enclose the mesh you want to rotate within a .stl cylinder then, in snappyHexMeshDict you'll need something like this:


            level      (2 2);
            cellZone    cylinder;
            faceZone    cylinder;
            cellZoneInside  inside;


and then in your dynamicMeshDict:


    cellZone        cylinder;

    solidBodyMotionFunction  rotatingMotion;
        CofG        (0 0 0);
        radialVelocity (0 0 34); // deg/s

kid April 12, 2012 07:26

That means , if we have a small cube to be rotated, we need to create a mesh file and enclose that mesh in cylindrical stl file. Then import that stl with mesh in OpenFoam and carry out the step you said.

lovecraft22 April 12, 2012 08:51

Yes. I would you snappyHexMesh.

kid April 16, 2012 07:01

1 Attachment(s)
Man, used snappyHexMesh to generate this cube with cylindrical mesh around mvCube.stl ( should have named it rotatingCube!! forgot).

mvCube.stl was made using Salome and stl binary was placed in /constant/ triSurface/
and accordingly changes were made in snappyHexMeshDict::geometry

Now is it sufficient and should i move to edit dynamicMeshDict? Or something missing?


Thanks a ton man , this helpped me to learn snaapyHexMesh , though rotating a cube is still pending.

lovecraft22 April 16, 2012 08:11

Are you sure you enclosed your cube within a cylindrical surface? Cannot see it in the image you attached…

kid April 16, 2012 08:31


Originally Posted by lovecraft22 (Post 354870)
Are you sure you enclosed your cube within a cylindrical surface? Cannot see it in the image you attached…

************************************************** *************
type triSurfaceMesh;
name mvCube;

cylinder1 //This cylinder is used.
type searchableCylinder;
point1 (100 50 0);
point2 (100 50 10);
radius 30;
{ mvCube
level (2 4);


mode inside;
levels ((1e+15 2));

This is what was used.
When you say covering the cube with cylinder. I am interpreting the one implimented.
But if you differ from this implementation. How to go about it ? (enclosed your cube within a cylindrical surface)


kid April 16, 2012 08:40

1 Attachment(s)
Were you talking about this cylinder in the image attached. Now i could see it.
The patch you mentioned in your previous reply, stuck me now after your reply.
Is it correct now?


lovecraft22 April 16, 2012 08:48

1 Attachment(s)
Yes, should be ok now. I'm running a similar case, I'll enclose it here in case you wanted to have a look. Unfortunately I'm struggling with it because it keeps blowing up… anyway the setup should be ok.
My cube is called cubo.stl and my cylinder is called cylinder.stl.

Refer to the allRun file for the commands I ran.

kid April 17, 2012 03:30

Correct man, it is blowing up.

Help man. But do not know why?


| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.0 |
| \\ / A nd | Web: |
| \\/ M anipulation | |
Build : 2.1.0-0bc225064152
Exec : pimpleDyMFoam
Date : Apr 17 2012
Time : 12:34:13
Host :
PID : 26986
Case :open-foam/mvCube
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh solidBodyMotionFvMesh
Selecting solid-body motion function rotatingMotion
Applying solid body motion to cellZone cylinder1
#0 Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/"
#1 Foam::sigSegv::sigHandler(int) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/"
#2 in "/lib/"
#3 Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh (Foam::IOobject const&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/"
#4 Foam::dynamicFvMesh::addIOobjectConstructorToTable <Foam::solidBodyMotionFvMesh>::New(Foam::IOobjec t const&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/"
#5 Foam::dynamicFvMesh::New(Foam::IOobject const&) in "/opt/openfoam210/platforms/linux64GccDPOpt/lib/"
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/pimpleDyMFoam"
#7 __libc_start_main in "/lib/"
in "/opt/openfoam210/platforms/linux64GccDPOpt/bin/pimpleDyMFoam"
Segmentation fault

lovecraft22 April 17, 2012 04:41

Don't know… is your setup the same as mine?

kid April 17, 2012 05:16

My setup was not same as your will try again.
Why pimpleDyFoam is so challenging to implement
Also looking at the thesis mentioned in this thread. (

Should we also explore AMI feature , which i suppose should be implimented, as GGi is no longer present in
Do not know if atall these two things are related to this case, we are solving.
In propeller tutorial saw some commands in Allrun.pre which we have not implemented.
Could be because of that solver is crashing.


lovecraft22 April 17, 2012 17:28

Hi, seems like my setup was wrong.

Have a look here:

and especially here:

Sorry about that…

kid April 18, 2012 00:41

Seeing that discussion in a flash. This is cool man, need to put lot of effort
from my side.

Thanks a lot and great guiding line , now it feels this is right track.
Would work now and let you know the status soon.


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