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

multiple UDFs

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 1, 2009, 15:36
Default multiple UDFs
  #1
New Member
 
mmdmov
Join Date: Apr 2009
Posts: 4
Rep Power: 8
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, 03:21
Default
  #2
Senior Member
 
Max
Join Date: Mar 2009
Posts: 133
Rep Power: 8
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, 05:58
Default
  #3
New Member
 
Marcin
Join Date: Apr 2009
Posts: 6
Rep Power: 8
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, 07:35
Default
  #4
New Member
 
mmdmov
Join Date: Apr 2009
Posts: 4
Rep Power: 8
mmdmov is on a distinguished road
remove the second #include udf.h

mmdmov
mmdmov is offline   Reply With Quote

Old   April 21, 2009, 07:42
Default
  #5
New Member
 
Marcin
Join Date: Apr 2009
Posts: 6
Rep Power: 8
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

Thread Tools
Display Modes

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 On
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 02:34
Multiple UDFs Graeme FLUENT 4 August 28, 2004 15: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 18:58.