CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

udf with spacial and time variables

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 17, 2005, 08:10
Default udf with spacial and time variables
  #1
hongxiao
Guest
 
Posts: n/a
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.
  Reply With Quote

Old   March 17, 2005, 08:19
Default Re: udf with spacial and time variables
  #2
hongxiao
Guest
 
Posts: n/a
Do you give me any suggestion to realize it? Thanks alot!
  Reply With Quote

Old   March 17, 2005, 08:50
Default Re: udf with spacial and time variables
  #3
Dirk
Guest
 
Posts: n/a
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
  Reply With Quote

Old   March 17, 2005, 09:00
Default Re: udf with spacial and time variables
  #4
hongxiao
Guest
 
Posts: n/a
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, ^_^
  Reply With Quote

Old   March 17, 2005, 09:39
Default Re: udf with spacial and time variables
  #5
Y
Guest
 
Posts: n/a
first define it spatially and then do it in time
  Reply With Quote

Old   March 17, 2005, 11:26
Default Re: udf with spacial and time variables
  #6
hongxiao
Guest
 
Posts: n/a
@_@, it does not work now. Maybe I have misunderstood the suggestion. Could you give some detail illustration? Thank you very much!
  Reply With Quote

Old   March 17, 2005, 23:46
Default Re: udf with spacial and time variables
  #7
hongxiao
Guest
 
Posts: n/a
hi, Dirk, compiling has been successful, thank you very much!
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
monitoring spacial variation of a quantity James FLUENT 1 January 10, 2008 10:45
UDF to specify a dynamic inteface in VOF Marco FLUENT 0 September 26, 2007 06:29
UDF for C_VOF variation with time and space Frederik FLUENT 4 December 19, 2005 01:53
time averaged heat transfer in oscillating flow Matthieu Ubas Main CFD Forum 2 November 5, 1999 15:20


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