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

Interpreting Multiple UDFs

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

Reply
 
LinkBack Thread Tools Display Modes
Old   November 7, 2012, 19:43
Default Interpreting Multiple UDFs
  #1
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Really seems silly if multiple UDFs cannot be interpreted. I saw all the posts at this field and mostly people said to use single UDF. However, based on the type of UDF maybe it is preferable to use multiple UDFs.

Can somebody help me how to interpret multiple UDFs?

Thanks,
Sarah.Tiani is offline   Reply With Quote

Old   November 8, 2012, 03:55
Default
  #2
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 908
Rep Power: 15
ghost82 will become famous soon enough
Quote:
Originally Posted by Sarah.Tiani View Post
Really seems silly if multiple UDFs cannot be interpreted. I saw all the posts at this field and mostly people said to use single UDF. However, based on the type of UDF maybe it is preferable to use multiple UDFs.

Can somebody help me how to interpret multiple UDFs?

Thanks,
You have to write all udfs in a single file, obviously with different names, and interpret it.
If you have problems attach your udfs here.

Daniele
ghost82 is offline   Reply With Quote

Old   November 9, 2012, 14:21
Default
  #3
New Member
 
yes
Join Date: Nov 2012
Posts: 12
Rep Power: 4
Sarah.Tiani is on a distinguished road
Quote:
Originally Posted by ghost82 View Post
You have to write all udfs in a single file, obviously with different names, and interpret it.
If you have problems attach your udfs here.

Daniele
Thanks Daniele for your attention,
I have solved the issue.
Sarah.Tiani is offline   Reply With Quote

Old   January 17, 2013, 09:36
Default
  #4
Member
 
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 4
Thomashoffmann is on a distinguished road
Hi, I've had the exact same problem. But I have never coded in C before. can you help me write these 2 UDFs into one file?
Thanks!

#include "udf.h"
DEFINE_PROFILE(inlet_velocity_x, t, i)
{
real x[ND_ND]; /* this will hold the position vector*/
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i) = 0.001474*(1-pow(((0.024-y)/0.024),3));
}
end_f_loop(f,t)
}


and


#include "udf.h"

DEFINE_PROPERTY(pl_visc, c, t)
{
real mu;
real temp = C_T(c,t);
real gamma_dot=(4*0.000016)/(3.14159*0.024*0.024*0.024);
{

mu = (2*exp(-0.7*temp))*gamma_dot*-2;

}
return mu;
}
Thomashoffmann is offline   Reply With Quote

Old   January 17, 2013, 10:05
Default
  #5
Senior Member
 
ghost82's Avatar
 
Daniele
Join Date: Oct 2010
Location: Italy
Posts: 908
Rep Power: 15
ghost82 will become famous soon enough
Quote:
Originally Posted by Thomashoffmann View Post
Hi, I've had the exact same problem. But I have never coded in C before. can you help me write these 2 UDFs into one file?
Thanks!

#include "udf.h"
DEFINE_PROFILE(inlet_velocity_x, t, i)
{
real x[ND_ND]; /* this will hold the position vector*/
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i) = 0.001474*(1-pow(((0.024-y)/0.024),3));
}
end_f_loop(f,t)
}


and


#include "udf.h"

DEFINE_PROPERTY(pl_visc, c, t)
{
real mu;
real temp = C_T(c,t);
real gamma_dot=(4*0.000016)/(3.14159*0.024*0.024*0.024);
{

mu = (2*exp(-0.7*temp))*gamma_dot*-2;

}
return mu;
}
Ju st join them:

Code:
#include "udf.h"
DEFINE_PROFILE(inlet_velocity_x, t, i)
{
real x[ND_ND]; /* this will hold the position vector*/
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i) = 0.001474*(1-pow(((0.024-y)/0.024),3));
}
end_f_loop(f,t)
}

DEFINE_PROPERTY(pl_visc, c, t)
{
real mu;
real temp = C_T(c,t);
real gamma_dot=(4*0.000016)/(3.14159*0.024*0.024*0.024);
{

mu = (2*exp(-0.7*temp))*gamma_dot*-2;

}
return mu;
}
ghost82 is offline   Reply With Quote

Old   January 18, 2013, 05:52
Default
  #6
Member
 
Thomas Hoffmann
Join Date: Oct 2012
Posts: 67
Rep Power: 4
Thomashoffmann is on a distinguished road
Thanks!
for some reason it didn't work for me. maybe I forgot to remove '#include "udf.h"' as i Copied it togheter?
but it works now - Thanks!
Thomashoffmann is offline   Reply With Quote

Reply

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
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 05:11
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
how can i use multiple udfs hami9293 Fluent UDF and Scheme Programming 11 February 23, 2010 07:20
Multiple udfs? David Harris FLUENT 1 April 23, 2006 02:34
Multiple UDFs Graeme FLUENT 4 August 28, 2004 15:47


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