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/)
-   -   Udf...define_profile (http://www.cfd-online.com/Forums/fluent-udf/113518-udf-define_profile.html)

jsjjangs February 21, 2013 04:12

Udf...define_profile
 
Dear users.
i am student at the postech in korea

i hope to know solution how to exchange UDF C code.


/* neutral */
#include "udf.h"
#define ro 1.225 /* constants */
#define K 0.41
#define mu 1.7894e-05
#define C_p 1006.43
#define L 10000000000 /* Monin-Obukhov length */
#define z_0 0.02
#define q 0
#define u_fric 0.3899
#define g 9.81
#define T_w 292
#define C_mu 0.09

/* profile for kinetic energy */
DEFINE_PROFILE(k_profile,t,i)
{
real x[ND_ND];
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
F_PROFILE(f,t,i)=pow(u_fric,2.)/sqrt(C_mu);
}
end_f_loop(f,t)
}
DEFINE_PROFILE(dissip_profile,t,i)
{
real x[ND_ND];
real height;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
height=x[1];
F_PROFILE(f,t,i)=u_fric/(sqrt(C_mu)*K*height);
}
end_f_loop(f,t)
}

DEFINE_PROFILE(velo_profile,t,i)
{
real x[ND_ND];
real height;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
height=x[1];
F_PROFILE(f,t,i) = u_fric/K*(log(height/z_0));
}
end_f_loop(f,t)


it is 2D C code.. i want to exchange from 2D to 3D...

help me .... Dear Users ...^^

flotus1 February 21, 2013 10:59

Where exactly do you see the problem?
Do the formulas you used change in 3D?
Or is your 3D domain not aligned with the cartesian coordinates?

jsjjangs February 21, 2013 21:06

Quote:

Originally Posted by flotus1 (Post 409329)
Where exactly do you see the problem?
Do the formulas you used change in 3D?
Or is your 3D domain not aligned with the cartesian coordinates?


the problem is not match the cartesian coortinates !!

VBM in CFD Fluent is 3D coordinate system.

flotus1 February 22, 2013 05:00

I recommend you review the chapter about coordinate transformations from your maths or mechanics lessons.

Or perhaps you could introduce local coordinate systems for each of the boundaries affected.


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