CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   udf_DEFINE ADJUST (https://www.cfd-online.com/Forums/fluent-udf/125514-udf_define-adjust.html)

ahmadi October 27, 2013 06:27

udf_DEFINE ADJUST
 
hi
I want to investigate natural convection heat transfer of liquid in a square enclosure with acoustic cavitation. In order to model the effect of sound field,a prescribed periodic change pressure is imposed on liquid in the region with ultrasonic beam.
Ps = PAcos[s(ًt+y/c)]

for this purpose i writed below udf and I hooked adjust UDFs to my model:

#include "udf.h"
#define pi 3.1415
#define f 18000
#define v 1480
DEFINE_ADJUST(my_adjust,d)
{
Thread *t;
real time;
real xc[ND_ND];
real y;
real pa=1e5;
real s=2*pi*f;
cell_t c;
time = CURRENT_TIME;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_CENTROID(xc, c, t);

if ((xc[0]> -0.005 && xc[0]<0.005) && (xc[1]> -0.05 && xc[1]< 0) )
{
y =xc[1];
C_P(c,t)= pa*cos(s*(time+y/v));
}
if ((xc[0]> -0.005 && xc[0]<0.005) && ( xc[1]== 0) )
{

C_P(c,t)= pa*cos(s*time);
}
if ((xc[0]> -0.005 && xc[0]<0.005) && ( xc[1]== -0.05) )
{

C_P(c,t)= pa*cos(s*(time-0.05/v));
}
if ((xc[0]== -0.005) && (xc[1]<= 0))
{
C_P(c,t)= 0;
}
if ((xc[0]== 0.005) && (xc[1]<= 0))
{
C_P(c,t)= 0;
}
end_c_loop(c,t)
}
}
}
my solution not converge(Specially contiuity) with every change in under relaxtion factor.
can anyone help me in regarding with above problem….
thanks



All times are GMT -4. The time now is 11:31.