|
[Sponsors] |
Segmentation fault when execute on demand udf |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 8, 2015, 23:15 |
Segmentation fault when execute on demand udf
|
#1 |
New Member
Dantong Shi
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Hello,
I'm calculating dimensionless temperature using a udf (shown in the following). After I interpreted it, I click the execute on demand. Then the error appear. It says "Segmentation fault". I don't know how to solve it? Where is the fault in my udf? The following is my udf. Thanks! #include "udf.h" DEFINE_ON_DEMAND(dimentionless_temperature) { Domain *d; real dimentionless_t; real twall = 400; real temp; real xmin = 0; real xmax = 0.2667; real deltax = 0.01; //int n= (xmax-xmin)/deltax; real tbulk[27]; Thread *t; cell_t c; real x[ND_ND]; int i; C_CENTROID(x,c,t); d = Get_Domain(1); /* Get the domain using ANSYS Fluent utility */ thread_loop_c(t,d) { for(i=0; i<=26; i++) { begin_c_loop(c,t) { if (x[0]>=xmin+i*deltax && x[0]<=xmin+(i+1)*deltax) {tbulk[i] += (C_T(c,t)*C_U(c,t)*C_VOLUME(c,t))/(C_U(c,t)*C_VOLUME(c,t)); temp = C_T(c,t); dimentionless_t = (temp-twall)/(tbulk[i]-twall); C_UDMI(c,t,0) = (temp-twall)/(tbulk[i]-twall); } end_c_loop(c,t) } } } } |
|
November 9, 2015, 04:36 |
|
#2 |
Member
Join Date: Jul 2013
Posts: 80
Rep Power: 13 |
When you write C_CENTROID(x,c,t);, neither c nor t are initialized.
C_CENTROID(x,c,t); must be included in the loop of cells, such as: d = Get_Domain(1); /* Get the domain using ANSYS Fluent utility */ thread_loop_c(t,d) { for(i=0; i<=26; i++) { begin_c_loop(c,t) { C_CENTROID(x,c,t); if ((x[0]>=xmin+i*deltax) && (x[0]<=xmin+(i+1)*deltax))//better write more parentheses {tbulk[i] += (C_T(c,t)*C_U(c,t)*C_VOLUME(c,t))/(C_U(c,t)*C_VOLUME(c,t)); temp = C_T(c,t); dimentionless_t = (temp-twall)/(tbulk[i]-twall); C_UDMI(c,t,0) = (temp-twall)/(tbulk[i]-twall); } end_c_loop(c,t) } } |
|
November 9, 2015, 11:29 |
|
#3 |
New Member
Dantong Shi
Join Date: Nov 2015
Posts: 6
Rep Power: 11 |
Thank you for your help. I revised the udf as you suggested. Then I interpreted it and execute on demand. Another error appear.
It says: Node 0: Process 7280: Recieved signal SIGSEGV. Node 1: Process 7288: Recieved signal SIGSEGV. MPI Application rank 1 exited before MPI_finalize() with status 2 The f1 process could not be started. Fatal error in one of the compute processes. Do you know what's wrong this time? Thank you very much! |
|
November 16, 2015, 09:20 |
|
#4 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
If you are working in parallel, first try to get it working in serial. Only if that works, go to parallel.
|
|
June 19, 2017, 06:20 |
|
#5 |
Member
Shravan
Join Date: Mar 2017
Posts: 77
Rep Power: 9 |
Hello,
I dont know if this might help you now. But usually we get segmentation error in UDM when we have used it in a UDF but havent set the number of UDMs in fluent GUI. When we compile a UDF in which we use a UDM, before compiling we should go to DEFINE->User Defined->Memory and Set the number as you wish Just make sure you have done this before clicking Execute on Demand. Thanks |
|
June 30, 2017, 04:03 |
Received a fatal Signal ( Segmentation fault )
|
#6 |
Member
|
Hi everyone !
I hope you are fine. I am using UDF in VOF model in ANSYS FLUENT, although, my VOF model without UDF is running fine. The UDF is written by my friend used it successfully. He has graduated last year after getting the results from same UDF. The UDF was working well on his server. He was using Fluent 6.3 on Linux system. When I am using same case, date and UDF on my laptop the case is not running, although UDF compilation is very fine. I also check it on Linux system too. During or after initialization, Error occurred segmentation fault error. It is very strange that same case and UDF is not working on his office now. Main error occurred when I am hooking ADJUST and EXECUTE-AT-END UDFs. May be there is some problem of writing/calling style is different in Windows and Linux system with 32bit and 64bit. ( this is just my opinion). I hope you can understand the situation and have a try to fix the problem. I would be highly thankful if you guide me that where is the problem. I can send UDF by email if needed.. Thanks in Advance, Regards, M. F. ALi |
|
Tags |
execute on demand, fluent, segmentation fault, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Segmentation fault when running dieselFoam or dieselEngineFoam in parallel | francesco | OpenFOAM Bugs | 4 | May 2, 2017 22:59 |
Segmentation fault when running in parallel | Pj. | OpenFOAM Running, Solving & CFD | 3 | April 8, 2015 09:12 |
execute on demand --> (segmentation fault) | fasc6813 | Fluent UDF and Scheme Programming | 1 | June 6, 2014 03:27 |
Segmentation Fault w/ compiled OF 2.2.0 - motorBike example | sudo | OpenFOAM Running, Solving & CFD | 3 | April 2, 2013 18:27 |
segmentation fault when installing OF-2.1.1 on a cluster | Rebecca513 | OpenFOAM Installation | 9 | July 31, 2012 16:06 |