CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   user defined functions (

mike2 August 20, 2012 03:40

user defined functions
1 Attachment(s)
hi to everyone. i have a problem, i have to create an user defined function for an heat flow along z axis in a 3D geometry.the equation of the flow is a bell shape (see the image).the code that i wrote is :

DEFINE_PROFILE(flusso_radiativo, thread, position)
real x[ND_ND]; /* this will hold the position vector */
real z;
face_t f;
begin_f_loop(f, thread)
z = x[2];
F_PROFILE(f, thread, position) = 149529572.*1./(sqrt((2.*3.141593*(0.051*0.051))))*exp((-(z-0.2)*(z-0.2))/(2.*(0.051*0.051)));
end_f_loop(f, thread)

is it well written?thanks for help

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