CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Interpreting Multiple UDFs (http://www.cfd-online.com/Forums/fluent-udf/109045-interpreting-multiple-udfs.html)

Sarah.Tiani November 7, 2012 19:43

Interpreting Multiple UDFs
 
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,

ghost82 November 8, 2012 03:55

Quote:

Originally Posted by Sarah.Tiani (Post 390913)
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

Sarah.Tiani November 9, 2012 14:21

Quote:

Originally Posted by ghost82 (Post 390937)
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.

Thomashoffmann January 17, 2013 09:36

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;
}

ghost82 January 17, 2013 10:05

Quote:

Originally Posted by Thomashoffmann (Post 402442)
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;
}


Thomashoffmann January 18, 2013 05:52

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!


All times are GMT -4. The time now is 05:18.