CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   interpret several UDF (https://www.cfd-online.com/Forums/fluent/81603-interpret-several-udf.html)

eddiegolpesar November 1, 2010 08:23

interpret several UDF
 
Hi
I prepared the following UDF for Darcy term in DC casting, for velocity in x direction. It was interpreted successfully. I want use some other UDFs like this for velocity in y direction, k and epsilon. But I see only the last interpreted UDF and I can't see all of them in the graphical panel in source terms part. Please help me....

/*EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEE

UDF that adds Darcy source term for U in the X direction

DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD DDDDDDDDDDDDDDDDD*/

#include "udf.h"

#define FST 0.3
#define TL 903
#define TS 743
#define TF 933
#define kp 0.16
#define shi 1.0e-15
#define visc 0.001
#define K0 2.0e-11

real TEMP, DEPVAR, SDEPVAR, PERM, FL, FS;
/*real DEPVAR;
real SDEPVAR;
real PERM;
real FL;
real FS;*/

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

TEMP= C_T(c,t);
DEPVAR= C_U(c,t);
SDEPVAR= 0. ;

/***** cacculation of FL & FS *****/
if (TEMP >= TL)
{
FL=1. ;
}
if ((TEMP > TS) && (TEMP < TL))
{
FL= 1.-1./(1.-kp)*(TL-TEMP)/(TF-TEMP);
}
if (TEMP <= TS)
{
FL= 0. ;
}

/***** cacculation Permeability & Darcy term *****/
if (FS==0.)
{
source = dS[eqn] = 0. ;
}
if ((FS>0.) && (FS<=FST))
{
source = dS[eqn] = 0. ;
}
if ((FS>=FST) && (FS<1.))
{
PERM=K0*pow((1.-FS),3.)/pow(FS,2.);
source = -visc/(PERM+shi)*DEPVAR + visc/(PERM+shi)*SDEPVAR ;
dS[eqn]= visc/(PERM+shi) ;
}
return source;
}


All times are GMT -4. The time now is 19:04.