CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Warmia and Mazury Uniwersity (https://www.cfd-online.com/Forums/fluent/49542-warmia-mazury-uniwersity.html)

wojciech October 17, 2008 11:59

Warmia and Mazury Uniwersity
 
Hello,

I try to write a UDF for Forchheimer law in porous media. Unfortunately, in this way calculated resistance is to small. When I use the original model (from GUI) the result is very good and is suitable with experiment. My UDF is bellow. Could anybody help me - what is wrong?

------------ #include "udf.h" DEFINE_SOURCE(forchheimer_z,cell,thread,dS,eqn) {

real k; real two_beta; real x[ND_ND]; real Uz; real linear; real nonlinear; real source;

/* cell geometry: */ C_CENTROID(x, cell, thread);

/* k and two_beta: */ k = 4.90987500E+08; two_beta = 36430.72;

/* z-Velocity: */ Uz = C_W(cell,thread);

/* linear: */ linear = (C_MU_L(cell,thread)/k)*0.9;

/* nonlinear: */ nonlinear = two_beta * 0.5 * C_R(cell,thread)*0.9;

/* total resistance: */ source = -(linear * Uz + nonlinear * fabs(Uz) * Uz);

/* d(total resistance): */ dS[eqn] = -(linear + 2.0 * nonlinear * fabs(Uz));

return source; }

---------

Thanks,

wojciech


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