Segmentation Error in Compiling UDF
Hello every one
I wanna see the concentration of bacterial particles as a water species ( like pressure and velocity ) in contours. my system is just in 1 phase. I used to write a UDF. After I build and load the library and hook it and allocate the number of UDM locations, unfortunately when I try to start the calculation, segmentation fault will appear. Please help me get rid of this problem. My UDF code is: #include <udf.h> DEFINE_ADJUST(bacterial_growth, d) { Domain *domain;/*domain points to domain Thread*/ int ID = 9;/*Number of interior (Fluid) zone*/ Thread *t = Lookup_Thread(domain, ID);/*t points to Thread*/ cell_t c;/*An integer data type that identifies a particular cell within a cell thread that names "c"*/ real s1 = 2, s2 = 3; const real ks1 = 1, ks2 = 2, mumax = 3;/*Using These 3 Orders to declare consistent*/ thread_loop_c(t, domain)/*Looping over Cell threads (e.g. fluid and solid) in Domain*/ { { begin_c_loop(c, t)/*Loops Over Cells in a Cell Thread*/ { C_UDMI(c, t, 0) = mumax * (s1 / (ks1 + s1)) * (s2 / (ks2 + s2)); } end_c_loop(c, t) } } } Thanks in advance. |
Code:
#include <udf.h> |
Quote:
Best regards. |
All times are GMT -4. The time now is 20:48. |