CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent Multiphase (
-   -   access violation when initializing step (

pouya.mehrdel June 9, 2014 04:21

access violation when initializing step
hi everyone

I'm trying to model a specie transport problem by using fluent. I have two horizontally flows, up and down, which are being separated by a thin wall in the middle. I have written the below UDF to apply mass flux on the middle wall for specie transport. But after interpreting the UDF and selecting the boundary condition, in the initializing step the fluent shows access violation error. Can anyone help me with this problem?:confused:


#include "udf.h"

#define del_y 1e-5
#define Diff_coef 0.00012

real c1, c2 , i1;
real x[ND_ND], y;
face_t f;
cell_t c;
Domain *domain;

int wall_ID = 8;
Thread *wall = Lookup_Thread(domain,wall_ID); /*introducing the wall(membrane) thread to the fluent*/

int fluid1_ID = 2;
Thread *fluid1 = Lookup_Thread(domain,fluid1_ID); /*introducing the fluid1 thread to the fluent*/

int fluid2_ID = 3;
Thread *fluid2 = Lookup_Thread(domain,fluid2_ID); /*introducing the fluid2 thread to the fluent*/

real i1 = 0; /*introducing the specie's index to the fluent*/

begin_f_loop(f , t)
y = x[1];

c1 = F_YI(f, fluid1, i1); /*reading the specie mass fraction from fluid1*/
c2 = F_YI(f, fluid2, i1); /*reading the specie mass fraction from fluid2*/

F_PROFILE(f,wall,i) = Diff_coef * (c1 - c2)/ del_y; /*applying the mass fraction*/
end_f_loop(f, thread)

All times are GMT -4. The time now is 15:56.