CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF about transient case (https://www.cfd-online.com/Forums/fluent/33704-udf-about-transient-case.html)

Jason May 12, 2004 04:12

UDF about transient case
 
Hi! This is my first time to use UDF. I want to define the inlet velocity as v=v0*sin(2*pi*f*t)in 3d tube. I read the fluent documentation (4.3.12 DEFINE_PROFILE). But the example is steady state. I confused how to add the time variable in my DEFINE_PROFILE macros.

Thanks in advance!!

mateus May 12, 2004 05:05

Re: UDF about transient case
 
How about something like that?

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f;

begin_f_loop(f, thread)

{

real t = RP_Get_Real("flow-time");

F_PROFILE(f, thread, position) = v0*sin(2*pi*f*t);

} end_f_loop(f, thread) }

Have fun MATEUS


All times are GMT -4. The time now is 17:50.