CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF - Source Term Question (http://www.cfd-online.com/Forums/fluent/50002-udf-source-term-question.html)

Jacques December 8, 2008 14:40

UDF - Source Term Question
 
Hi folks,

I wrote a UDF to add a source term to my second phase (euler-euler model). Now I am not sure if the velocitys (and other variables) I use in the code are the right ones. The source must be calculated with the velocitys of the second phase, not the first one. I hook the UDF to the fluid-regions second phase via FLUENT-GUI. Is this enough or do I have to implement it in the UDF?

###################### Here is the UDF I wrote so far:

#include "udf.h"

DEFINE_SOURCE(neg_source,c,t,dS,eqn) { Domain *d; real source = 0.0; real uvf, vvf; real A[ND_ND]; face_t f; Thread *t0;

int Zone_ID=6; d=Get_Domain(1);

t0=Lookup_Thread(d,Zone_ID);

F_AREA(A,f,t0);

uvf = C_U(c,t); vvf = C_V(c,t); source = -(1/C_VOLUME(c,t))*C_VOF(c,t)*C_R(c,t)*sqrt(((NVD_DOT( A,uvf,vvf,0)))*((NVD_DOT(A,uvf,vvf,0))));

return source;

} ##########################


All times are GMT -4. The time now is 00:54.