CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF direction (https://www.cfd-online.com/Forums/fluent/89598-udf-direction.html)

Rowing June 17, 2011 05:25

UDF direction
 
Hi all!

Can someone give me guidance how to change the velocity in the preceding udf from a x-velocity to a y-velocity....I'n really new to udf writing

Thanks

#include "udf.h"
#include "dynamesh_tools.h"

DEFINE_CG_MOTION(trans, dt, vel, omega, time, dtime)
{
/*reset velocities*/
NV_S(vel, =, 0.0);
NV_S(omega, =, 0.0);

if (!Data_Valid_P ())

{
Message0("\n\nNo data->No mesh motion!!!\n\n");
return;
}
/*set x-component velocity*/
vel[0] = 1;
}

coglione June 17, 2011 06:09

x-component velocity = vel[0]
y-component velocity = vel[1]
z-component velocity = vel[2]

cheers

Rowing June 17, 2011 08:33

Hahaha thanks! Wish I knew this sooner!


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