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/)
-   -   Space- and time-dependant heat flux via UDF (https://www.cfd-online.com/Forums/fluent-udf/103646-space-time-dependant-heat-flux-via-udf.html)

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=I_0*[step(x-x_0-t*v)-step(x-x_0-b-t*v)]

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:

Code:

#include "udf.h"

DEFINE_PROFILE(laser_beam,t,i)
{
    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;
    begin_f_loop(f,t)
    {
        F_CENTROID(x,f,t);            //liest Koordinate aus
        X=x[0];
        if(X>=x_0+time*v-b/2 && X<=x_0+time*v+b/2)
            F_PROFILE(f,t,i) = I_0;
        else
            F_PROFILE(f,t,i) = 0;
    }
    end_f_loop(f,th);
}


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 21:28.