|
[Sponsors] |
October 17, 2008, 12:59 |
Warmia and Mazury Uniwersity
|
#1 |
Guest
Posts: n/a
|
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UNIVERSITY OF WARMIA AND MAZURY IN OLSZTYN | wojciech | FLUENT | 0 | October 2, 2008 08:53 |