CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)

 Eliasjal March 6, 2012 12:45

Please, help in compiling my UDF !!!!!!

Hi,

I'm trying to implement a modified k-epsilon model written by Heschl, Sanz, and Klanatsky. My experience with UDFs is limited to a simple parabolic velocity inlet (the one in the FLUENT UDF User Guide,) so this complex turbulence model UDF is above my head. Can anyone tell me the process of implementing the UDF?

I can get as far as compiling the UDF. Beyond that, I'm lost.

the UDF code is
-------------------------------------------------------------------------------------------------------------------------------------------------------
#include "udf.h"
#include "math.h"

/* Turbulence model constants */
const real CE_1=1.44;
const real CE_2=1.92;
const real SIG_K=1.0;
const real SIG_E=1.3;
const real C_MU=0.09;
const real a_d=0.0022;
const real a_e=0.263;
const real a_mu=0.016;
const real kappa=0.4187;
const real C_1_new=2.5;
const real C_2_new=0.39;
const real C_3_new=1.25;
const real C_4_new=0.45;
const real C_8_s_new=-1.0;
const real A1=0.5*0.39-2./3.;//A1=0.5*C_2_new-2./3.;
const real A2=0.5*0.45-1.0;//A2=0.5*C_4_new-1.0;
const real A3=0.5*1.25-1.0;//A3=0.5*C_3_new-1.0;

/* User-defined scalars */
enum
{
UU,
VV,
WW,
UV,
UW,
VW
};

DEFINE_SOURCE(u_source, c, t, dS, eqn)
{
real source;

dS[eqn]=0.0;
source= - C_R(c,t) * ( C_UDSI_G(c,t,UU)[0] + C_UDSI_G(c,t,UV)[1] + C_UDSI_G(c,t,UW)[2] );

return source;
}

DEFINE_SOURCE(v_source, c, t, dS, eqn)
{
real source;

dS[eqn]= 0.0;
source= - C_R(c,t) * ( C_UDSI_G(c,t,UV)[0] + C_UDSI_G(c,t,VV)[1] + C_UDSI_G(c,t,VW)[2] );

return source;
}

DEFINE_SOURCE(w_source, c, t, dS, eqn)
{
real source;

dS[eqn]= 0.0;
source= - C_R(c,t) * ( C_UDSI_G(c,t,UW)[0] + C_UDSI_G(c,t,VW)[1] + C_UDSI_G(c,t,WW)[2] );

return source;
}

DEFINE_TURBULENT_VISCOSITY(user_mu_t,c,t)
{
real mu_t, R_k, fmu;

R_k=sqrt(MAX(C_K(c,t),0.0))*C_UDMI(c,t,7)/(C_MU_L(c,t)/C_R(c,t));
fmu=(1.0-exp(-a_mu*R_k))/(1.0-exp(-a_e*R_k));

mu_t=C_MU*fmu*pow(C_K(c,t),2.0)/C_D(c,t);

return mu_t;
}

{

cell_t c;
real T1;
real mu_t;
real b11, b12, b13, b21, b22, b23, b31, b32, b33;
real S11, S12, S13, S21, S22, S23, S31, S32, S33;
real W11, W12, W13, W21, W22, W23, W31, W32, W33;
real S, W, eta1, eta2, eta3;
real beta1, beta2, beta3, beta5, beta8, gamma1, cmu1, cmu2, cmu3;
real A1,A2,A3,g,C_1_new,C_2_new,C_3_new,C_4_new,C_8_s_n ew;
real P11, P22, P33, Pkk;
real R_k, CMU, fmu;

/* Set the turbulent viscosity */
{
begin_c_loop(c,t)
{

R_k=sqrt(MAX(C_K(c,t),0.0))*C_UDMI(c,t,7)/(C_MU_L(c,t)/C_R(c,t));
fmu=(1.0-exp(-a_mu*R_k))/(1.0-exp(-a_e*R_k));

mu_t=C_MU*fmu*pow(C_K(c,t),2.0)/C_D(c,t);

S11 = 0.5*( C_DUDX(c,t)+C_DUDX(c,t) );
S12 = 0.5*( C_DUDY(c,t)+C_DVDX(c,t) );
S13 = 0.5*( C_DUDZ(c,t)+C_DWDX(c,t) );
S21 = 0.5*( C_DVDX(c,t)+C_DUDY(c,t) );
S22 = 0.5*( C_DVDY(c,t)+C_DVDY(c,t) );
S23 = 0.5*( C_DVDZ(c,t)+C_DWDY(c,t) );
S31 = 0.5*( C_DWDX(c,t)+C_DUDZ(c,t) );
S32 = 0.5*( C_DWDY(c,t)+C_DVDZ(c,t) );
S33 = 0.5*( C_DWDZ(c,t)+C_DWDZ(c,t) );
W11 = 0.5*( C_DUDX(c,t)-C_DUDX(c,t) );
W12 = 0.5*( C_DUDY(c,t)-C_DVDX(c,t) );
W13 = 0.5*( C_DUDZ(c,t)-C_DWDX(c,t) );
W21 = 0.5*( C_DVDX(c,t)-C_DUDY(c,t) );
W22 = 0.5*( C_DVDY(c,t)-C_DVDY(c,t) );
W23 = 0.5*( C_DVDZ(c,t)-C_DWDY(c,t) );
W31 = 0.5*( C_DWDX(c,t)-C_DUDZ(c,t) );
W32 = 0.5*( C_DWDY(c,t)-C_DVDZ(c,t) );
W33 = 0.5*( C_DWDZ(c,t)-C_DWDZ(c,t) );

S=S11*S11+S12*S12+S13*S13+S21*S21+S22*S22+S23*S23+ S31*S31+S32*S32+S33*S33;
W=W11*W11+W12*W12+W13*W13+W21*W21+W22*W22+W23*W23+ W31*W31+W32*W32+W33*W33;

eta1=C_K(c,t)/C_D(c,t)*C_K(c,t)/C_D(c,t)*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+ S23*S32+S31*S13+S32*S23+S33*S33);
eta2=C_K(c,t)/C_D(c,t)*C_K(c,t)/C_D(c,t)*(W11*W11+W12*W21+W13*W31+W21*W12+W22*W22+ W23*W32+W31*W13+W32*W23+W33*W33);
eta3=C_K(c,t)/C_D(c,t)*C_K(c,t)/C_D(c,t)*C_K(c,t)/C_D(c,t)*
(S11*S11*S11+S21*S11*S12+S31*S11*S13+S11*S12*S21+S 21*S12*S22+S31*S12*S23+S11*S13*S31+S21*S13*S32+S31 *S13*S33
+S12*S21*S11+S22*S21*S12+S32*S21*S13+S12*S22*S21+S 22*S22*S22+S32*S22*S23+S12*S23*S31+S22*S23*S32+S32 *S23*S33
+S13*S31*S11+S23*S31*S12+S33*S31*S13+S13*S32*S21+S 23*S32*S22+S33*S32*S23+S13*S33*S31+S23*S33*S32+S33 *S33*S33);

g=C_UDMI(c,t,6);
CMU=-A1*g/(g*g-2./3.*A3*A3*eta1-2.*A2*A2*eta2);

b11=-CMU*C_K(c,t)/C_D(c,t)*S11;
b22=-CMU*C_K(c,t)/C_D(c,t)*S22;
b33=-CMU*C_K(c,t)/C_D(c,t)*S33;
b12=-CMU*C_K(c,t)/C_D(c,t)*S12;
b13=-CMU*C_K(c,t)/C_D(c,t)*S13;
b21=-CMU*C_K(c,t)/C_D(c,t)*S21;
b23=-CMU*C_K(c,t)/C_D(c,t)*S23;
b31=-CMU*C_K(c,t)/C_D(c,t)*S31;
b32=-CMU*C_K(c,t)/C_D(c,t)*S32;

C_1_new=2.5;
C_2_new=0.39;
C_3_new=1.25;
C_4_new=0.45;
C_8_s_new=-1.0;

g=C_1_new-2.0*C_K(c,t)/C_D(c,t)*(b11*S11+b12*S21+b13*S31+b21*S12+b22*S22+ b23*S32+b31*S13+b32*S23+b33*S33)-1.0;
A1=0.5*C_2_new-2./3.;
A2=0.5*C_4_new-1.0;
A3=0.5*C_3_new-1.0;

beta2=-A2/g;
beta3=-2.0*A3/g;
beta5=(-6.0*A2*(A3-A2*(sqrt(MAX(-eta2/eta1,0.0)))))/(-2.0*g*g+A3*A3*eta1+A2*A2*eta2);
beta8=-6.0*C_8_s_new*A2/(eta1*g);

T1=C_K(c,t)/C_D(c,t);

C_UDSI(c,t,UU)= -2.0*C_K(c,t)*CMU*T1*(
beta2*T1*(S11*W11+W12*W21+S13*W31-W11*S11-W12*S21-W13*S31)
-beta3*T1*(S11*S11+S12*S21+S13*S31-1./3.*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S3 2+S31*S13+S32*S23+S33*S33))
+beta5*T1*T1*(W11*S11*S11+W12*S21*S11+W13*S31*S11+ W11*S12*S21+W12*S22*S21+W13*S32*S21+W11*S13*S31+W1 2*S23*S31+W13*S33*S31-
(S11*S11*W11+S12*S21*W11+S13*S31*W11+S11*S12*W21+S 12*S22*W21+S13*S32*W21+S11*S13*W31+S12*S23*W31+S13 *S33*W31))
+beta8*T1*T1*T1*(S11*W11*S11*S11+S12*W21*S11*S11+S 13*W31*S11*S11+
S11*W11*S12*S21+S12*W21*S12*S21+S13*W31*S12*S21+
S11*W11*S13*S31+S12*W21*S13*S31+S13*W31*S13*S31+
S11*W12*S21*S11+S12*W22*S21*S11+S13*W32*S21*S11+
S11*W12*S22*S21+S12*W22*S22*S21+S13*W32*S22*S21+
S11*W12*S23*S31+S12*W22*S23*S31+S13*W32*S23*S31+
S11*W13*S31*S11+S12*W23*S31*S11+S13*W33*S31*S11+
S11*W13*S32*S21+S12*W23*S32*S21+S13*W33*S32*S21+
S11*W13*S33*S31+S12*W23*S33*S31+S13*W33*S33*S31

-(S11*S11*W11*S11+S12*S21*W11*S11+S13*S31*W11*S11+
S11*S11*W12*S21+S12*S21*W12*S21+S13*S31*W12*S21+
S11*S11*W13*S31+S12*S21*W13*S31+S13*S31*W13*S31+
S11*S12*W21*S11+S12*S22*W21*S11+S13*S32*W21*S11+
S11*S12*W22*S21+S12*S22*W22*S21+S13*S32*W22*S21+
S11*S12*W23*S31+S12*S22*W23*S31+S13*S32*W23*S31+
S11*S13*W31*S11+S12*S23*W31*S11+S13*S33*W31*S11+
S11*S13*W32*S21+S12*S23*W32*S21+S13*S33*W32*S21+
S11*S13*W33*S31+S12*S23*W33*S31+S13*S33*W33*S31)
-0.5*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S 32+S31*S13+S32*S23+S33*S33)*(S11*W11+W12*W21+S13*W 31-W11*S11-W12*S21-W13*S31))
);

C_UDSI(c,t,VV)= -2.0*C_K(c,t)*CMU*T1*(
beta2*T1*(S21*W12+W22*W22+S23*W32-W21*S12-W22*S22-W23*S32)
-beta3*T1*(S21*S12+S22*S22+S23*S32-1./3.*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S3 2+S31*S13+S32*S23+S33*S33))
+beta5*T1*T1*(W21*S11*S12+W22*S21*S12+W23*S31*S12+ W21*S12*S22+W22*S22*S22+W23*S32*S22+W21*S13*S32+W2 2*S23*S32+W23*S33*S32-
(S21*S11*W12+S22*S21*W12+S23*S31*W12+S21*S12*W22+S 22*S22*W22+S23*S32*W22+S21*S13*W32+S22*S23*W32+S23 *S33*W32))
+beta8*T1*T1*T1*(S21*W11*S11*S12+S22*W21*S11*S12+S 23*W31*S11*S12+
S21*W11*S12*S22+S22*W21*S12*S22+S23*W31*S12*S22+
S21*W11*S13*S32+S22*W21*S13*S32+S23*W31*S13*S32+
S21*W12*S21*S12+S22*W22*S21*S12+S23*W32*S21*S12+
S21*W12*S22*S22+S22*W22*S22*S22+S23*W32*S22*S22+
S21*W12*S23*S32+S22*W22*S23*S32+S23*W32*S23*S32+
S21*W13*S31*S12+S22*W23*S31*S12+S23*W33*S31*S12+
S21*W13*S32*S22+S22*W23*S32*S22+S23*W33*S32*S22+
S21*W13*S33*S32+S22*W23*S33*S32+S23*W33*S33*S32

-(S21*S11*W11*S12+S22*S21*W11*S12+S23*S31*W11*S12+
S21*S11*W12*S22+S22*S21*W12*S22+S23*S31*W12*S22+
S21*S11*W13*S32+S22*S21*W13*S32+S23*S31*W13*S32+
S21*S12*W21*S12+S22*S22*W21*S12+S23*S32*W21*S12+
S21*S12*W22*S22+S22*S22*W22*S22+S23*S32*W22*S22+
S21*S12*W23*S32+S22*S22*W23*S32+S23*S32*W23*S32+
S21*S13*W31*S12+S22*S23*W31*S12+S23*S33*W31*S12+
S21*S13*W32*S22+S22*S23*W32*S22+S23*S33*W32*S22+
S21*S13*W33*S32+S22*S23*W33*S32+S23*S33*W33*S32)
-0.5*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S 32+S31*S13+S32*S23+S33*S33)*(S21*W12+W22*W22+S23*W 32-W21*S12-W22*S22-W23*S32))
);

C_UDSI(c,t,WW)= -2.0*C_K(c,t)*CMU*T1*(
beta2*T1*(S31*W13+W32*W23+S33*W33-W31*S13-W32*S23-W33*S33)
-beta3*T1*(S31*S13+S32*S23+S33*S33-1./3.*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S3 2+S31*S13+S32*S23+S33*S33))
+beta5*T1*T1*(W31*S11*S13+W32*S21*S13+W33*S31*S13+ W31*S12*S23+W32*S22*S23+W33*S32*S23+W31*S13*S33+W3 2*S23*S33+W33*S33*S33-
(S31*S11*W13+S32*S21*W13+S33*S31*W13+S31*S12*W23+S 32*S22*W23+S33*S32*W23+S31*S13*W33+S32*S23*W33+S33 *S33*W33))
+beta8*T1*T1*T1*(S31*W11*S11*S13+S32*W21*S11*S13+S 33*W31*S11*S13+
S31*W11*S12*S23+S32*W21*S12*S23+S33*W31*S12*S23+
S31*W11*S13*S33+S32*W21*S13*S33+S33*W31*S13*S33+
S31*W12*S21*S13+S32*W22*S21*S13+S33*W32*S21*S13+
S31*W12*S22*S23+S32*W22*S22*S23+S33*W32*S22*S23+
S31*W12*S23*S33+S32*W22*S23*S33+S33*W32*S23*S33+
S31*W13*S31*S13+S32*W23*S31*S13+S33*W33*S31*S13+
S31*W13*S32*S23+S32*W23*S32*S23+S33*W33*S32*S23+
S31*W13*S33*S33+S32*W23*S33*S33+S33*W33*S33*S33

-(S31*S11*W11*S13+S32*S21*W11*S13+S33*S31*W11*S13+
S31*S11*W12*S23+S32*S21*W12*S23+S33*S31*W12*S23+
S31*S11*W13*S33+S32*S21*W13*S33+S33*S31*W13*S33+
S31*S12*W21*S13+S32*S22*W21*S13+S33*S32*W21*S13+
S31*S12*W22*S23+S32*S22*W22*S23+S33*S32*W22*S23+
S31*S12*W23*S33+S32*S22*W23*S33+S33*S32*W23*S33+
S31*S13*W31*S13+S32*S23*W31*S13+S33*S33*W31*S13+
S31*S13*W32*S23+S32*S23*W32*S23+S33*S33*W32*S23+
S31*S13*W33*S33+S32*S23*W33*S33+S33*S33*W33*S33)
-0.5*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S 32+S31*S13+S32*S23+S33*S33)*(S31*W13+W32*W23+S33*W 33-W31*S13-W32*S23-W33*S33))
);

C_UDSI(c,t,UV)= -2.0*C_K(c,t)*CMU*T1*(
beta2*T1*(S11*W12+W12*W22+S13*W32-W11*S12-W12*S22-W13*S32)
-beta3*T1*(S11*S12+S12*S22+S13*S32)
+beta5*T1*T1*(W11*S11*S12+W12*S21*S12+W13*S31*S12+ W11*S12*S22+W12*S22*S22+W13*S32*S22+W11*S13*S32+W1 2*S23*S32+W13*S33*S32-
(S11*S11*W12+S12*S21*W12+S13*S31*W12+S11*S12*W22+S 12*S22*W22+S13*S32*W22+S11*S13*W32+S12*S23*W32+S13 *S33*W32))
+beta8*T1*T1*T1*(S11*W11*S11*S12+S12*W21*S11*S12+S 13*W31*S11*S12+
S11*W11*S12*S22+S12*W21*S12*S22+S13*W31*S12*S22+
S11*W11*S13*S32+S12*W21*S13*S32+S13*W31*S13*S32+
S11*W12*S21*S12+S12*W22*S21*S12+S13*W32*S21*S12+
S11*W12*S22*S22+S12*W22*S22*S22+S13*W32*S22*S22+
S11*W12*S23*S32+S12*W22*S23*S32+S13*W32*S23*S32+
S11*W13*S31*S12+S12*W23*S31*S12+S13*W33*S31*S12+
S11*W13*S32*S22+S12*W23*S32*S22+S13*W33*S32*S22+
S11*W13*S33*S32+S12*W23*S33*S32+S13*W33*S33*S32

-(S11*S11*W11*S12+S12*S21*W11*S12+S13*S31*W11*S12+
S11*S11*W12*S22+S12*S21*W12*S22+S13*S31*W12*S22+
S11*S11*W13*S32+S12*S21*W13*S32+S13*S31*W13*S32+
S11*S12*W21*S12+S12*S22*W21*S12+S13*S32*W21*S12+
S11*S12*W22*S22+S12*S22*W22*S22+S13*S32*W22*S22+
S11*S12*W23*S32+S12*S22*W23*S32+S13*S32*W23*S32+
S11*S13*W31*S12+S12*S23*W31*S12+S13*S33*W31*S12+
S11*S13*W32*S22+S12*S23*W32*S22+S13*S33*W32*S22+
S11*S13*W33*S32+S12*S23*W33*S32+S13*S33*W33*S32)
-0.5*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S 32+S31*S13+S32*S23+S33*S33)*(S11*W12+W12*W22+S13*W 32-W11*S12-W12*S22-W13*S32))
);

C_UDSI(c,t,UW)= -2.0*C_K(c,t)*CMU*T1*(
beta2*T1*(S11*W13+W12*W23+S13*W33-W11*S13-W12*S23-W13*S33)
-beta3*T1*(S11*S13+S12*S23+S13*S33)
+beta5*T1*T1*(W11*S11*S13+W12*S21*S13+W13*S31*S13+ W11*S12*S23+W12*S22*S23+W13*S32*S23+W11*S13*S33+W1 2*S23*S33+W13*S33*S33-
(S11*S11*W13+S12*S21*W13+S13*S31*W13+S11*S12*W23+S 12*S22*W23+S13*S32*W23+S11*S13*W33+S12*S23*W33+S13 *S33*W33))
+beta8*T1*T1*T1*(S11*W11*S11*S13+S12*W21*S11*S13+S 13*W31*S11*S13+
S11*W11*S12*S23+S12*W21*S12*S23+S13*W31*S12*S23+
S11*W11*S13*S33+S12*W21*S13*S33+S13*W31*S13*S33+
S11*W12*S21*S13+S12*W22*S21*S13+S13*W32*S21*S13+
S11*W12*S22*S23+S12*W22*S22*S23+S13*W32*S22*S23+
S11*W12*S23*S33+S12*W22*S23*S33+S13*W32*S23*S33+
S11*W13*S31*S13+S12*W23*S31*S13+S13*W33*S31*S13+
S11*W13*S32*S23+S12*W23*S32*S23+S13*W33*S32*S23+
S11*W13*S33*S33+S12*W23*S33*S33+S13*W33*S33*S33

-(S11*S11*W11*S13+S12*S21*W11*S13+S13*S31*W11*S13+
S11*S11*W12*S23+S12*S21*W12*S23+S13*S31*W12*S23+
S11*S11*W13*S33+S12*S21*W13*S33+S13*S31*W13*S33+
S11*S12*W21*S13+S12*S22*W21*S13+S13*S32*W21*S13+
S11*S12*W22*S23+S12*S22*W22*S23+S13*S32*W22*S23+
S11*S12*W23*S33+S12*S22*W23*S33+S13*S32*W23*S33+
S11*S13*W31*S13+S12*S23*W31*S13+S13*S33*W31*S13+
S11*S13*W32*S23+S12*S23*W32*S23+S13*S33*W32*S23+
S11*S13*W33*S33+S12*S23*W33*S33+S13*S33*W33*S33)
-0.5*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S 32+S31*S13+S32*S23+S33*S33)*(S11*W13+W12*W23+S13*W 33-W11*S13-W12*S23-W13*S33))
);

C_UDSI(c,t,VW)= -2.0*C_K(c,t)*CMU*T1*(
beta2*T1*(S21*W13+W22*W23+S23*W33-W21*S13-W22*S23-W23*S33)
-beta3*T1*(S21*S13+S22*S23+S23*S33)
+beta5*T1*T1*(W21*S11*S13+W22*S21*S13+W23*S31*S13+ W21*S12*S23+W22*S22*S23+W23*S32*S23+W21*S13*S33+W2 2*S23*S33+W23*S33*S33-
(S21*S11*W13+S22*S21*W13+S23*S31*W13+S21*S12*W23+S 22*S22*W23+S23*S32*W23+S21*S13*W33+S22*S23*W33+S23 *S33*W33))
+beta8*T1*T1*T1*(S21*W11*S11*S13+S22*W21*S11*S13+S 23*W31*S11*S13+
S21*W11*S12*S23+S22*W21*S12*S23+S23*W31*S12*S23+
S21*W11*S13*S33+S22*W21*S13*S33+S23*W31*S13*S33+
S21*W12*S21*S13+S22*W22*S21*S13+S23*W32*S21*S13+
S21*W12*S22*S23+S22*W22*S22*S23+S23*W32*S22*S23+
S21*W12*S23*S33+S22*W22*S23*S33+S23*W32*S23*S33+
S21*W13*S31*S13+S22*W23*S31*S13+S23*W33*S31*S13+
S21*W13*S32*S23+S22*W23*S32*S23+S23*W33*S32*S23+
S21*W13*S33*S33+S22*W23*S33*S33+S23*W33*S33*S33

-(S21*S11*W11*S13+S22*S21*W11*S13+S23*S31*W11*S13+
S21*S11*W12*S23+S22*S21*W12*S23+S23*S31*W12*S23+
S21*S11*W13*S33+S22*S21*W13*S33+S23*S31*W13*S33+
S21*S12*W21*S13+S22*S22*W21*S13+S23*S32*W21*S13+
S21*S12*W22*S23+S22*S22*W22*S23+S23*S32*W22*S23+
S21*S12*W23*S33+S22*S22*W23*S33+S23*S32*W23*S33+
S21*S13*W31*S13+S22*S23*W31*S13+S23*S33*W31*S13+
S21*S13*W32*S23+S22*S23*W32*S23+S23*S33*W32*S23+
S21*S13*W33*S33+S22*S23*W33*S33+S23*S33*W33*S33)
-0.5*(S11*S11+S12*S21+S13*S31+S21*S12+S22*S22+S23*S 32+S31*S13+S32*S23+S33*S33)*(S21*W13+W22*W23+S23*W 33-W21*S13-W22*S23-W23*S33))
);

C_UDMI(c,t,0)= -2.*mu_t*S11 + 2./3.*C_K(c,t) + C_UDSI(c,t,UU);
C_UDMI(c,t,1)= -2.*mu_t*S22 + 2./3.*C_K(c,t) + C_UDSI(c,t,VV);
C_UDMI(c,t,2)= -2.*mu_t*S33 + 2./3.*C_K(c,t) + C_UDSI(c,t,WW);
C_UDMI(c,t,3)= -2.*mu_t*S12 + C_UDSI(c,t,UV);
C_UDMI(c,t,4)= -2.*mu_t*S13 + C_UDSI(c,t,UW);
C_UDMI(c,t,5)= -2.*mu_t*S23 + C_UDSI(c,t,VW);

C_UDMI(c,t,6)=g;

}
end_c_loop(c,t)
}
}

------------------------------------------------------------------------------------------------------------------------------------------------------

 Amir March 7, 2012 12:11

Hi,

These are general steps:
1) compile your UDF and ensure it doesn't have any bugs and then load it.
2) prepare extra memories or scalars if you have any. (e.g. UDSs or UDMs) in (define->user define-> memory or scalar)
3) hook each UDF macros in appropriate places (refer to manual)
4) and Enjoy!

Bests,

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