CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   Space- and time-dependant heat flux via UDF (

flotus1 June 22, 2012 04:58

Space- and time-dependant heat flux via UDF
Hi there,
I am currently trying to simulate a laser beam moving along the surface of a flat plate.
For this purpose, the heat flux at the boundary has to be a function of time and space.
As a first try, I would like to set up a quasi-2-dimensional test case.

Thus the heat flux should follow the equation


I_0: intensity of the beam
x: direction of the movement of the laser beam
x_0: starting point of the laser beam
t: simulation time
v: speed at which the beam is moved across the surface
b: width of the laser beam

I found a few examples of UDFs varying a variable in time OR space, but not both at the same time.
Since I am new to UDF programming I would really appreciate your help.

flotus1 June 25, 2012 07:13

Really? No ideas or suggestions?

flotus1 June 26, 2012 12:33

For those who might be searching for something similar:

Some of the signs in my equation were wrong, the UDF now looks like this:


#include "udf.h"

    real x[ND_ND];                    //Ortsvektor; ND liest aus ob 2D oder 3D-Fall
    real X;                        //Ortskoordinate
    real x_0=0.05;                    //Startpunkt des Strahls
    real v=0.05;                    //Geschwindigkeit des Strahls
    real b=0.02;                    //Breite des Strahls
    real I_0=10000000;                //maximale Intensitšt des Strahls
    real time=RP_Get_Real("flow-time");        //der Variable time wird die Simulationszeit zugewiesen
    face_t f;
        F_CENTROID(x,f,t);            //liest Koordinate aus
        if(X>=x_0+time*v-b/2 && X<=x_0+time*v+b/2)
            F_PROFILE(f,t,i) = I_0;
            F_PROFILE(f,t,i) = 0;

flotus1 June 27, 2012 08:58

The UDF in my last post does what I need.

But thanks a lot for your offer.

tmeysam92 September 10, 2012 08:00

Hi Flotus1,

i want to model a heat transfer process in which the heat flux of the wall varies with time.

do you have any example?

i am new in udf.

thanks in advance.

All times are GMT -4. The time now is 22:20.