Thank you for your answer, I understand, so here is the code :

#include "udf.h"

DEFINE_ON_DEMAND(on_demand_calc)

{

real u;

real uavg=0.;

int i;

int ph_index_gas = 3; /* This is the phase ID that has my gas in Fluent (foud in "phase") */

cell_t c;

Thread *mix_th, *subth; /* I believe mix_th is the mixture level thread pointer */

subth = THREAD_SUB_THREAD(mix_th, ph_index_gas);

printf("n test1");

i=0;

/* Loop over all cells */

begin_c_loop(c,mix_th)

{

printf("n test2");

u = C_U(c,mix_th); /* get cell velocity */

uavg = uavg+u;

i = i+1;

}

end_c_loop(c,mix_th)

uavg = uavg/i;

printf("n uavg = %g u = %g i = %gn",uavg,u,i);

}

The error is a "received signal SIGSEGV" type.

I am using a multiphase VOF model and the energy equation. The study is in 2D and the solver planar (so the bubble is more of an infinite cylinder).

Best regards,

Hugo