CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   ACCESS_VIOLATION Error (

Sourav_Dwaipayan August 21, 2009 05:00

Basically we are trying to solve a problem on UF. But the main problem arises with the following UDF code when we interpret it.
In the UDF we are trying to sum up the previous cell value and the next cell value in reference to the current cell.

#include "udf.h"
int i ,id = 2;
real flux, Cbulk = 1, k = 7.85*pow(10,-6);
real conc_solids, rho;
face_t f;
cell_t c;
Domain *d = Get_Domain(1);
Thread *t = Lookup_Thread(domain, id);
real timestep = RP_Get_Real("physical-time-step");
if (CURRENT_TIME>timestep)


rho = ((C_R(F_C0(f,t),THREAD_T0(t)+C_R(F_C1(f,t),THREAD_ T1(t))) / 2.0);

conc_solids = rho * (C_YI(F_C0(f,t),THREAD_T0(t),i)+C_YI(F_C1(f,t),THR EAD_T1(t),i));

flux = k*log(conc_solids/Cbulk);

printf("Current Time = %g:Flux = %g:Membrane Concentration = %g:density = %g",CURRENT_TIME, flux,conc_solids,rho);

We are trying to skip the first iteration with this condition (CURRENT_TIME>timestep).

But when get ACCESS_VIOLATION error when the solver goes for the iteration either with NITA or with Frozen Flux method for the second time step.

Please give us some valuable ideas and solution in this regard at the earliest possible. We are in deep trouble with the UDF.

All times are GMT -4. The time now is 04:48.