CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   udf with spacial and time variables (https://www.cfd-online.com/Forums/fluent/36050-udf-spacial-time-variables.html)

hongxiao March 17, 2005 08:10

udf with spacial and time variables
 
Hello,everyone,I want to know if "udf" can define the spacial variable and time variable simutaneously. Actually, I want to impose a velocity profile on the inlet which varies with space and time. In my udf file, I use both "F_CENTROID(x,f,thread);y=x[1], z=x[2]" and "real t=RP_Get_Real("flow-time"); --- line29" in the loop; But when I try to interpret the *.c, some errors arise, such as "line 29: parse error.""t, undeclared variable".

Thanks for your attention.

hongxiao March 17, 2005 08:19

Re: udf with spacial and time variables
 
Do you give me any suggestion to realize it? Thanks alot!

Dirk March 17, 2005 08:50

Re: udf with spacial and time variables
 
You should declare the variable t outside the DEFINE_PROFILE function. I had the same problem and it works this way (but I don't know why).

Dirk

hongxiao March 17, 2005 09:00

Re: udf with spacial and time variables
 
Dirk, thank you very much. you mean I declare the variable "t" in the same way as it in the DEFINE_PROFILE, or just declare it as "real t". I'll try it now, ^_^

Y March 17, 2005 09:39

Re: udf with spacial and time variables
 
first define it spatially and then do it in time

hongxiao March 17, 2005 11:26

Re: udf with spacial and time variables
 
@_@, it does not work now. Maybe I have misunderstood the suggestion. Could you give some detail illustration? Thank you very much!

hongxiao March 17, 2005 23:46

Re: udf with spacial and time variables
 
hi, Dirk, compiling has been successful, thank you very much!


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