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. |
Re: udf with spacial and time variables
Do you give me any suggestion to realize it? Thanks alot!
|
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 |
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, ^_^
|
Re: udf with spacial and time variables
first define it spatially and then do it in time
|
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!
|
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. |