CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   CURRENT_TIME error (http://www.cfd-online.com/Forums/fluent/32825-current_time-error.html)

Johan January 9, 2004 04:05

CURRENT_TIME error
 
Hi,

When i try to compile the example (se below) from the UDF manual for transient velocity profile i get a error that say that CURRENT_TIME is not declared.

/************************************************** **

unsteady.c

UDF for specifying a transient velocity profile boundary condition

************************************************** ***/

#include "udf.h"

DEFINE_PROFILE(unsteady_velocity, thread, position) { face_t f; real t = CURRENT_TIME;

begin_f_loop(f, thread)

{

F_PROFILE(f, thread, position) = 4. + 2*sin(3.*t);

} end_f_loop(f, thread)

Anyone who have a solution for the problem?

/Johan

emma January 9, 2004 05:44

Re: CURRENT_TIME error
 
Hi,

I think the line including the time "t" might be written as: real t = RP_Get_Real(CURRENT_TIME). Hope it helps!

Emma

Johan January 9, 2004 05:58

Re: CURRENT_TIME error
 
Have tried it now and I still get the error that looks like this: unsteady.c: line 12: CURRENT_TIME: undeclared variable

/************************************************

unsteady.c

UDF for specifying a transient velocity profile boundary condition ***********************************************/

#include "udf.h"

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

real t = RP_Get_Real(CURRENT_TIME);

begin_f_loop(f, thread)

{

F_PROFILE(f, thread, position) = 4. + 2*sin(3.*t);

} end_f_loop(f, thread) }

/Johan

emma January 9, 2004 06:30

Re: CURRENT_TIME error
 
sorry, I wrote something wrong! The current physical flow time can be obtained eihter directly by the solver macro "CURRENT_TIME" or indirectly by RP_Get_Real("flow-time")macro. hope it works!

Emma

Johan January 9, 2004 06:46

Re: CURRENT_TIME error
 
It seems to compile now. Thanks

/Johan


All times are GMT -4. The time now is 02:11.