CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Wankel Engine UDF Problem (https://www.cfd-online.com/Forums/fluent-udf/129290-wankel-engine-udf-problem.html)

Kxt908 February 2, 2014 08:15

Wankel Engine UDF Problem
 
I am modelling a Wankel Engine for a University project in Fluent 14.5.
I first tried the method of creating the entire geometry and running a simulation which causes problems of negative cell volumes. This seems inherent to Fluent and to the Wankel Engine problem. Many people on this forum have tried this method with limited success.

Therefore I am looking at the problem from a different angle.
I have just created one chamber and plan to rotate that through 360 degrees to simulate one cycle of a Wankel Rotary Engine.

I decided to test the problem by simplifying it to a semi-circular geometry - the centreline just rotates about its midpoint using DEFINE_CG_MOTION UDF. Then I have tried to generate the circular arc for any given rotational angle of the straight line part of the semi-circle using a DEFINE_GEOM UDF:

#include "udf.h"
#define NCOORDS 360
#define r 50
#define its 180
#define pi 3.1415926

DEFINE_CG_MOTION(eccentric, dt, vel, omega, time, dtime)
{
NV_S (vel, =, 0.0);
NV_S (omega, =, 0.0);
omega[2] = -1.0;
}


DEFINE_GEOM(housing, domain, dt, position)
{
int i,j;
real rad, x, y;
int start=0;

for(i=0;i<=NCOORDS;i++)
{
for(j=start;j<=start+its;j++)
{
j=j%360;
rad = ((j * pi )/ 180);
position[0] = r * cos(rad);
position[1] = r * sin(rad);
}
start=start+1;
}
}


I know this seems an overly complicated way of rotating a semi-circle but it is required when the problem includes the correct Wankel geometry.

This UDF compiles fine with no errors. When I calculate the solution, the whole program freezes with no error messages. I have to close Fluent from the Task Manager.
It would be much appreciated if someone could provide some insight.

Kieran


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