CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Dynamic mesh within a dynamic mesh (

louisgag October 8, 2013 15:33

Dynamic mesh within a dynamic mesh
Hello all,

I've sucessfully used GGI and AMI in the past to simulate a rotating part within a fixed domain.

Now, I want to know if it is possible to have a rotating mesh embed within another rotating mesh. Has anyone achieved this?



minger October 8, 2013 21:24

Wow, I was actually getting ready to post the same question. I have looked through the mixer2d tutorials in pimpleDyMFoam and think I have a decent grasp of what's going on there. However, I am hoping to be able to "nest" a rotating zone within another.

louisgag October 29, 2013 09:30

For those wondering if it works, yes it does. I had to do a tiny C++ modification to ensure that the origin of the internal AMI zone rotates with the external one and voilą.

minger October 31, 2013 21:12

Would you mind attaching a case zipped up?

louisgag November 6, 2013 17:25

The project is confidential so I can't put all the data online, but it should be fairly easy to replicate.

In my case I modified oscillatingRotatingMotion.C as such,

transformation() const
    scalar t = time_.value();

    vector eulerAngles = amplitude_*sin(omega_*t);

    // Convert the rotational motion from deg to rad
    eulerAngles *= pi/180.0;

    scalar omegaBlop_ =  73.304; // outter AMI zone info
    scalar originBlop_ =  3.048;
    scalar radBlop_ =  0.6096;
    scalar omgOffsetBlop = pi/2; // offset from the right hand axis when simulation starts

    vector blop_ = vector (originBlop_+radBlop_*cos(omegaBlop_*t + omgOffsetBlop),
            originBlop_+radBlop_*sin(omegaBlop_*t + omgOffsetBlop), 0);

//    Info<< "LOUIS: " << blop_ << endl;

    quaternion R(eulerAngles.x(), eulerAngles.y(), eulerAngles.z());
//    septernion TR(septernion(origin_)*R*septernion(-origin_));
    septernion TR(septernion(blop_)*R*septernion(-blop_));

    Info<< "solidBodyMotionFunctions::oscillatingRotatingMotion::"
        << "transformation(): "
        << "Time = " << t << " transformation: " << TR << endl;

And in the dynamic mesh dictionary I ensure that the outer AMI zone angular velocity matches the modified one in the C++ file...

louisgag February 26, 2014 07:03

1 Attachment(s)
here is the code for OpenFoam 2.3.x, copy in your user folder and


wmake libso

louisgag February 26, 2014 07:14

Along with a test case from which I removed the confidential data... You will need to change the foil U boundary condition because it is a one I've coded myself...

any feedback is welcome !

diego_angeli March 28, 2014 07:34

Hi Louis,

here Diego from UNIMORE. We don't know each other but I think we will soon

I just downloaded your myOscillatingRotatingMotion and the test case, thanks for sharing and congratulations for the nice work.

If it's ok for you I will try to use them on a similar case as yours, for CROP..

I'll let you know ASAP how are we faring on that.


louisgag April 2, 2014 13:13

Hello Diego,
It will be a pleasure to collaborate with you. Please use this thread to communicate with me so that everyone can follow. Obviously we'll have to avoid confidential project data.

diego_angeli April 14, 2014 07:47

Hi Louis,
thanks for the support.
So, Andrea and me managed to reproduce a moving mesh analogous to your case, starting from a mesh generated from us with another meshing tool. The workflow is ok on the mesh side.
Now we should work on the boundary condition for U on the foils, then maybe we will come back to you to agree on the case setup.

Best regards

louisgag December 11, 2015 04:23

The link for the test case I had posted above is broken. Please use the following instead:


bullmut September 23, 2016 07:13

Hi Louis
from what i read in this thread i think i am trying to achieve the same thing.
I am trying to implement you test case and have compiled your
However when i run the case it is trying to load "", to allow for the definition of your foils as patch type myMovingWallSlip. Can you explain your modification in the making of this patch type of supply files for the wmake of the latter .so ?


louisgag September 23, 2016 09:20

Hi Gareth,

I choose to use a boundary condition that imposes a slip and respects the moving wall velocity for my simulation:

You can use another boundary condition if you prefer...



bullmut September 24, 2016 05:27

Hi Louis

Thanks for the info and explanation.
I was trying to run the code as is, with minimal alterations. But i get what you mean by a different BC. :)

Thanks again for the code. Kinda what i needed, but definitely a step in the right direction.


All times are GMT -4. The time now is 07:29.