CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Grid-rotation with UDF Files (https://www.cfd-online.com/Forums/fluent/76523-grid-rotation-udf-files.html)

Titasse May 27, 2010 12:21

Grid-rotation with UDF Files
 
Hi,

I need to simulate a sort of grid-rotation with UDF Files. To simplify, just imagine a circle with a radius equal to 1.1m and its origin on (-1.5, 0, 0) which have to turn around the origin (0, 0, 0) in z-direction. In real, there is two parts of fluid separate by a sliding mesh interface.

This is my UDF File :

#include"udf.h"

DEFINE_GRID_MOTION(motion,domain,dt,time,dtime)
{
Thread *tf = DT_THREAD(dt);
face_t f;
Node *v;
real NV_VEC(axis_1);
real NV_VEC(axis_2);
real displx;
real disply;
int n;

displx=-1.5*(cos(10.47*(time+dtime))-cos(10.47*(time)));
disply=-1.5*(sin(10.47*(time+dtime))-sin(10.47*(time)));
NV_D(axis_1, =, 1.0, 0.0, 0.0);
NV_D(axis_2, =, 0.0, 1.0, 0.0);


begin_f_loop(f,tf)
{
f_node_loop(f,tf,n)
{
v = F_NODE(f,tf,n);
/* update node if the current node has not been previously
visited when looping through previous faces */
if ( NODE_POS_NEED_UPDATE (v))
{
/* indicate that node position has been update
so that it's not updated more than once */
NODE_POS_UPDATED(v);
NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis_1,*,displx);
NV_V_VS(NODE_COORD(v), =, NODE_COORD(v), +, axis_2,*,disply);
}
}
}
end_f_loop(f,tf);
}

The number 10.47 represents the angular velocity (100 rpm = 10.47 rad/s)

I am pretty close to fix this problem. I just don't know how inplement that on Fluent.

I try with Define -> Dynamic Mesh -> Zones and under type i choose User-defined. The thing is i don't know if i have to choose the fluid, the interface or the both of them. All the test i did create en Error on Fluent :

Error : Update dynamic mesh failed. Negative cell volume detected.

or

Note : zone-surface : cannot create surface from sliding interface zone. Creating empty surface.

If someone could help me,

Thank you,

Regards,

Titasse,

Titasse May 27, 2010 13:23

That works now, but i only have the translation in the y-direction. I need the translation in x-direction too. If someone see where i made a mistake on my UDF File.

Cheers,

Titasse

aerospain July 15, 2010 10:59

Hi Titasse,

did you sort your problem out? Could you tell me how? I have been using a UDF for a single rotating domain but using the velocity as the sinusoidal function, but your way of using displacement every time-step may work better for me.

Do you have PDF files with infor about UDF? Besides the ANSYS "official" ones.

cheers!


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