CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Segmentation Error (

Leo November 5, 2005 12:31

Segmentation Error

Would like someone to advice me on a problem I encountered. I interpreted the following ON_DEMAND UDF (to store temp grad in y direction) and no error message was shown. When I activated under the "Execute on demand" panel, a segmentation error message appeared. I've check everythin and nothing seems to be wrong. I have allocated a memory for my udm (i.e. udm-0). Can anyone advice me? Is Get_Domain(1) necessary if I am simulating a single phase flow? Thank you.

===== #include "udf.h"

DEFINE_ON_DEMAND(define_grad) {

Domain *d;

cell_t c;

Thread *t;

d = Get_Domain(1);

thread_loop_c (t,d)


begin_c_loop (c,t)


C_UDMI(c,t,0) = C_T_G(c,t)[1];


end_c_loop (c,t)



Alec Eiffel November 5, 2005 14:56

Re: Segmentation Error
try doing one iteration before loading the UDF in the "Execute on demand" panel. I think its because FLUENT hasnt allocated the temperature gradients until an iteration has been completed.

Leo November 7, 2005 04:07

Re: Segmentation Error

Thanks a lot, Alec.

I've tried your method, but apparently the error message still appeared. I'm using FLUENT under a UNIX environment. Could this error be related to the environment I'm using FLUENT in?

Thank you

RoM November 7, 2005 09:02

Re: Segmentation Error
You could try the text command solve/set/expert and then answering yes to the question "Keep temporary solver memory from being freed?". Do some iterations and then run the udf. If the problem still persist try to store NV_MAG(C_T_G(c,t)), maybe its aproblem with the index.

Good Luck RoM

All times are GMT -4. The time now is 02:58.