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

multiple UDFs

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 1, 2009, 16:36
Default multiple UDFs
  #1
New Member
 
mmdmov
Join Date: Apr 2009
Posts: 4
Rep Power: 17
mmdmov is on a distinguished road
Hi,

I want to have an "initialization" and an "adjust" udf. when I interpret both, the first one is removed from the list.

For example my udfs are "my_init" and "my_adjust". First I interpret "my_init". Then I interpret "my_adjust", at this time "my_init" is removed from the list when I want to hook udfs.

Any ideas?

Thank you
mmdmov is offline   Reply With Quote

Old   April 2, 2009, 04:21
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 17
coglione is on a distinguished road
Are both UDF's embodied in one single c-file? If not put them together.

cheers
coglione is offline   Reply With Quote

Old   April 21, 2009, 06:58
Default
  #3
New Member
 
Marcin
Join Date: Apr 2009
Posts: 6
Rep Power: 17
Chicken is on a distinguished road
Quote:
Originally Posted by coglione View Post
Are both UDF's embodied in one single c-file? If not put them together.

cheers

Hi!
I have a question. You said that both codes should be in the same file. I am using UDF for transient velocity inlet (Y axis) and it is working, so I tried to add second UDF for parabolic velocity profile (steady flow along X axis) but still there is a problem... "Error: udfconfig.h: line 22: parse error."

Could somebody tell me how to "put them together" because it is my first time with UDF...

This is the code:

/************************************************** *********************
vprofile.c
UDF for specifying steady-state velocity profile boundary condition
************************************************** **********************/
#include "udf.h"
DEFINE_PROFILE(inlet_y_velocity, thread, position)
{
float x;
float y[3];
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(y,f,thread);
x = y[1];
F_PROFILE(f, thread, position) = 0.028 + x*x;
}
end_f_loop(f, thread)
}

/************************************************** ********************
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) = 1.0*sin(10.*t);
}
end_f_loop(f, thread)
}


Thanks a lot.
Marcin

p.s. Separated codes work normally but together - error :|
Chicken is offline   Reply With Quote

Old   April 21, 2009, 08:35
Default
  #4
New Member
 
mmdmov
Join Date: Apr 2009
Posts: 4
Rep Power: 17
mmdmov is on a distinguished road
remove the second #include udf.h

mmdmov
mmdmov is offline   Reply With Quote

Old   April 21, 2009, 08:42
Default
  #5
New Member
 
Marcin
Join Date: Apr 2009
Posts: 6
Rep Power: 17
Chicken is on a distinguished road
Thank you very much!
It was so simple... Now it works

Thank you one more time.
Marcin
Chicken is offline   Reply With Quote

Reply

Tags
multiple udf


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
Unsteady and Flux UDFs for UDSs tom FLUENT 0 February 13, 2009 11:27
multiple UDFs at the same time bharti FLUENT 0 November 2, 2006 11:45
Multiple udfs? David Harris FLUENT 1 April 23, 2006 03:34
Multiple UDFs Graeme FLUENT 4 August 28, 2004 16:47
Experimental Repository for UDFs, Journal Files and Scheme Scripts Jonas Larsson FLUENT 0 March 5, 2000 16:36


All times are GMT -4. The time now is 14:42.