CFD Online Discussion Forums

CFD Online Discussion Forums (
-   ANSYS Meshing & Geometry (
-   -   [ANSYS Meshing] Dynamic mesh on rotary engine (

mark yoe March 24, 2011 02:37

Dynamic mesh on rotary engine
I'm newbie here. I got prob with dynamic mesh in FLUENT
can anybody help me on doing udf in order to make the rotor of the rotary engine cycle continuously in 360 degree

fergie_cannon May 24, 2011 16:18

hey, i had a really similar problem this semester for my final project which unfortunately i havent been able to complete. The udf wouldnt compile for me when i was trying to set up the library, twas a bit of a bummer but i guess this would be more of a phd thing than a bachelors degree project. Anyways, have you had a look at the fluent UDF manual? it pretty much says that you can use the define_cg_motion macro to tell fluent the linear or rotational velocity of the rotor though i think you've picked a rough one trying to do rotary engines what with the eccentric shaft mounting, assuming its like a wankel engine that is. From the example in the manual, it looks like you can use pressures on faces of the rotor/piston to calculate accelerations and thus given a starting velocity of zero and a given time step you can calculate the velocity at a given time. After that i think you just have to tell it where the centre of rotation is in fluent and smash in all the various dynamic meshing properties. How have you been getting on with this project anyways?

Catthan September 4, 2011 12:42

Hi guys!

Mark yoe have you had any luck with the UDF?

I'm having the same problem myself..

Please post if you figured it out..

Best wishes,

sonia.majd November 15, 2012 15:32

Please help me
Hi to all
I am also trying to model the gas circuit in a Wankel engine,I cannot figure out the proper UDF to move the rotor CG along the eccentricity path and then rotate the rotor around its CG.
I have find a UDF (following code) that describe rotating of rotor respect to the geometric center of housing, but Iím cannot Define rotation of rotor respect to its own geometric center.

#include "udf.h"
#define r -0.0116 /*Eccentricity*/
float beta;
DEFINE_CG_MOTION(rotor, dt, vel, omega,time, dtime)
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);
omega[2] = 314.16; /*angular velocity in rad/sec*/
beta = 942.48; /*angular velocity of rotor in rad/sec*/
vel[0] = -beta*r*sin(beta*time);
vel[1] = beta*r*cos(beta*time);
vel[2]= 0;

Can anybody please give me some guidance?
Best regards.
Sonia majd

Catthan November 16, 2012 04:53

Hi Sonia,

the UDF you've found is the one everyone seems to be using.
It should be OK.

The velocity expressions are the obtained by differentiating the x and y coordinates equations as you know.

These include a part that "says" that the CG of the rotor moves on the periphery of a circle and the other part "says" that the tips follow the path of the peritrochoid.

So, differentiating those you get 2 velocity equations that should be all you need.

Check that your rotor has the proper dimensions, eccentricity particularly, and make sure you define you dynamic mesh settings correctly.

There's a lot to read about that in the users guide and the manual.

Make sure you compile the UDF correctly and that "rotor" appears in the rigid body drop down list for mesh motion. Have your rotor center coordinates in hand and you may need to play with the orientation angle.

Is your problem with meshing error (negative volumes etc) or is it that the rotor is not moving at all??

There are other Wankel threads in the Fluent and possibly UDF sections of the forum that would be a good read for you.

Also make sure that the tips or seals don't touch the housing. There needs to be a gap..
The issue with the gap at tips is that the bigger, the less problems you have in solving.. However, depending on the pressure gradients developed, there will be backflow and pressure loss. So you need to keep the gap small.
But you can worry about that later..

sonia.majd November 21, 2012 17:23

Hi Catthan, I appreciate your attention and thanks for your guidance.
Iím solving three-dimensional flow in Wankel engine.
After compiling the user defined function (UDF) in Fluent and setting all the dynamic parameters and dynamic zones parameterís when I check the dynamic mesh motion it is giving me the message of NEGATIVE VOLUME DETECTED .i.e. dynamic mesh update failed. What exactly it mean? How to minimize the negative volume?
I guess rotor center coordinates and its orientation angle is properly selected and I am using smoothing and remeshing and not layering.
Maximum cell skewness is 0.8 and Iím using two zones in dynamic mesh setting, rotor as rigid body motion and housing as stationary zone.
But I donít know how to define cell height?
I would be pleased more, if you help me in this regard.

amin. November 17, 2014 12:21

Same problem
Hi All
I have the same problem of how to define the mesh moving for wankel engine with fluent.
I think this post is old but if it is possible, some one help me on this
Thank all

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