CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF in z curvature (http://www.cfd-online.com/Forums/fluent/49541-udf-z-curvature.html)

leo October 17, 2008 11:06

UDF in z curvature
 
hello here,

I just want to assign a negative pressure along the interface to account for z curvature through UDF.

although the negative pressure is successfully assigned to the interface, the underfill does not flow from the top to bottom of the chip as expected.

here it is,

UDF used to cover the volume fraction as a UDS

# include "udf.h" # define domain_ID 3

DEFINE_ADJUST(adjust_gradient, domain) { Thread *t; cell_t c; face_t f;

domain = Get_Domain(domain_ID);

/* Fill UDS with the variable. */ thread_loop_c (t,domain)

{

begin_c_loop (c,t)

{

C_UDSI(c,t,0) = C_VOF(c,t);

}

end_c_loop (c,t)

}

}

UDF for specifying an x-momentum source term for z resistance

#include "udf.h"

DEFINE_SOURCE(xs,c,t,dS,eqn) {

real source; real C2; C2 = 244897959; //12viscosity/(h^2) if (THREAD_SUB_THREAD(t,1)!=NULL)

{

if (C_VOF(c,THREAD_SUB_THREAD(t,1))>0.9)

{

if (NV_MAG(C_UDSI_G(c,t,0))>1000)

{

source = -C2*C_U(c,t)+C_UDSI_G(c,t,0)[0]*844;

dS[eqn] = -C2;

}

else

{

source = -C2*C_U(c,t);

dS[eqn] = -C2;

}

}

else

{

if (NV_MAG(C_UDSI_G(c,t,0))>1000)

{

source = C_UDSI_G(c,t,0)[0]*844;

}

else

{

source =0

}

}

return source;

}

}

Can anyone help me to settle this problem?

best regards,



All times are GMT -4. The time now is 22:57.