CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   UDF for moving light beam (

ppx January 29, 2013 15:45

UDF for moving light beam
Dear All,

I'm doing a simulation about a moving light beam and i really need some help.
In my simulation the light beam should move spirally. I want to use a UDF to define the movement of the light beam. I have found a code about a Laser beam moving along y. I tried to change the code to define the movement along x and y but it didn't work. Does anyone know how can i define the x path also so that the light beam can move spirally?
Thank you all in advance.

Here the udf:

#include "udf.h"

real y[ND_ND];
real Y;
real y_0=-0.008; //starting point
real v=0.003; //velocity of the laser beam
real b=0.018; //width of the laser beam
real I_0=10000000000; //Intensity
real time=RP_Get_Real("flow-time");
face_t f;
if(Y>=y_0+time*v-b/2 && Y<=y_0+time*v+b/2) // moving along y
F_PROFILE(f,t,i) = I_0;
F_PROFILE(f,t,i) = 0;

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