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/)
-   -   maxwell boundary condition (https://www.cfd-online.com/Forums/fluent-udf/127075-maxwell-boundary-condition.html)

gashti December 3, 2013 01:31

maxwell boundary condition
 
Hi, I write this UDF for slip flow for fluent 6.3 but i receive this error15Error: FLUENT received fatal signal (ACCESS_VIOLATION)1. Note exact events leading to error.2. Save case/data under new name.3. Exit program and restart to continue.4. Report error to your distributor.Error Object: ()15I write my UDF by your suggestion, please guide me for this errorthanksmy UDF:

#include "udf.h" /* must be at the beginning of every UDF */
#include "mem.h" /* must be at the beginning of this UDF */
#include "math.h" /* must be at the beginning of this UDF */
#include "metric.h" /* must be at the beginning of this UDF */
#define k_B 1.3805e-23 /* Boltzman constant (j/K)*/
#define sigma 419e-12 /* molecular diameter*/
#define sigma_v 1 /* Tangential momentum accommodation coefficient*/
#define sigma_T 1 /*Thermal accommodation coefficient*/
#define pi 3.14159 /* pi number*/
#define sqrt_2 1.41421 /* sqrt(2) number */
DEFINE_PROFILE(wall_slip_velocity, t , index )
{
double T , P, density , MU , K , landa ,a_m , du_da , dT_dx ,u_f ;
double A[ND_ND] ;
face_t f;
Thread *t0;
cell_t c0;

begin_f_loop(f,t)
{
t0 = THREAD_T0(t); /* adjacent cell thread to f */
c0 = F_C0(f, t); /* adjacent cell to f */
T=C_T(c0,t0); /* temperature of the cell */
P=C_P(c0,t0); /* peressure of the cell */
density=C_R(c0,t0); /* density of the cell*/
MU = C_MU_L(c0,t0); /* laminar viscosity of the cell */
K = C_K_L(c0,t0); /* thermal conductivity of the cell */
landa=(k_B*T)/(sqrt_2*pi*sigma*sigma*P); /* mean free path line */

F_AREA(A,f,t);
a_m = NV_MAG(A); /* magnitude of the cell area vector */
du_da=NV_DOT(A,A)/a_m; /* n- component of the cell x-velocity reconstruction gradient(RG) vector */
dT_dx=1 ; /* x-component of the cell temperature reconstruction gradient(RG) vector */

F_PROFILE(f,t,index) = ((2-sigma_v)/sigma_v)*landa * du_da + 0.75*(MU/(density*T))*dT_dx ;
}

end_f_loop(f, t)
}


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