|
[Sponsors] |
December 30, 2009, 01:01 |
Why the value of C_VOLUME(c,t) is zero?
|
#1 |
New Member
qiang xia
Join Date: Mar 2009
Posts: 8
Rep Power: 17 |
Hi everyone:
In my problem ,the computer domain is divided into 2 zones(both of them are fluids),now i wanna add a momentum source into a zone,My udf is as following: #include "udf.h" DEFINE_SOURCE(xmom_source, cell, thread, dS, eqn) { const real c2=100.0; real x[ND_ND]; real con, source; C_CENTROID(x, cell, thread); con = c2*0.5*C_R(cell, thread)*x[1]; source = - con*fabs(C_U(cell, thread))*C_U(cell, thread); dS[eqn] = - 2.*con*fabs(C_U(cell, thread)); Message( "%f\n",C_VOLUME(cell,thread)); C_UDMI(cell,thread,0)=source; return source; } Before I compiled it, I have defined 1 UDM, then i hooked the udf in Boundary conditions, however, when i iterate, Why the value of C_VOLUME(c,t) is zero? Can anyone help me,big thanks. |
|
|
|