Segmentation fault at the end of timestep
Hai..
I am trying to add an energy source term to a fluid flow problem.I wrote a UDF and interpret. But I am getting a segmentation fault at the end of the first-time step. I allocated 3 memory locations. I believe the error occurs because of the error in executing at the end macro region. Please help me DEFINE_ON_DEMAND(solid) { Domain *d=Get_Domain(1); int zone_id=11; Thread *t = Lookup_Thread(d,zone_id); cell_t c; begin_c_loop(c,t) { C_UDMI(c,t,0) = 0.1; } end_c_loop(c,t) } DEFINE_EXECUTE_AT_END(source_calculation) { Domain *d; Thread *t; cell_t c; real dt=CURRENT_TIMESTEP; int zone_id=11; thread_loop_c(t,d) { begin_c_loop(c,t) { C_UDMI(c,t,1)=C_T(c,t)/some constant; C_UDMI(c,t,2)=0.01; C_UDMI(c,t,0)=C_UDMI(c,t,0)+(C_UDMI(c,t,2)*dt); } end_c_loop(c,t) } } DEFINE_SOURCE(energy, c, t, dS, eqn) { real x[ND_ND]; real source; source = some constant* C_UDMI(c,t,2); dS[eqn] = 0; return source; } |
Quote:
|
All times are GMT -4. The time now is 00:32. |