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:


All times are GMT -4. The time now is 01:50.