|
[Sponsors] |
![]() |
![]() |
#1 |
New Member
Shakib
Join Date: Mar 2019
Posts: 10
Rep Power: 7 ![]() |
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. |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 ![]() ![]() |
Code:
#include <udf.h> DEFINE_ADJUST(bacterial_growth, d) { int ID = 9;/*Number of interior (Fluid) zone*/ Thread *t = Lookup_Thread(d, 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, d)/*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) } } |
|
![]() |
![]() |
![]() |
![]() |
#3 | |
New Member
Shakib
Join Date: Mar 2019
Posts: 10
Rep Power: 7 ![]() |
Quote:
Best regards. |
||
![]() |
![]() |
![]() |
Tags |
segmentation fault, udf code |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling the customized UDF code for PEMFC | dmfo | Fluent UDF and Scheme Programming | 2 | October 1, 2017 18:30 |
Error when compiling UDF | bobdorm14 | Fluent UDF and Scheme Programming | 1 | September 19, 2016 06:03 |
DPM Segmentation Fault in UDF | jhlee9622 | FLUENT | 0 | July 1, 2016 03:21 |
compiling udf at window Nt(64BIT) | noa | FLUENT | 3 | July 29, 2014 23:01 |
ERROR in compiling UDF | stefanos | Fluent UDF and Scheme Programming | 1 | April 25, 2012 07:37 |