CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Udf segmentation violation (https://www.cfd-online.com/Forums/fluent-udf/121157-udf-segmentation-violation.html)

dany_@ July 23, 2013 03:32

Udf segmentation violation
 
Hello everybody, I'm a new student of CFD code. I'm trying to solve a simple equation such as dx/dt=-10 in a porous zone. I succeed in compiling the UDF and hooking it in the cell zone conditions of the porous zone as source term, but when I try to lauch the simulation, it give me "Error: fluent.13.0.0 received a fatal signal (SEGMENTATION VIOLATION). Error object: #f."
I don't understand why...
Can anybody help me?

Here my UDF:

#include "udf.h"



DEFINE_SOURCE(uds_source,c,t,ds,eqn)
{
real source;
{
source = -10;
ds[eqn] = 0;

C_UDMI(c,t,1) = source;

return source;
}
}

blackmask July 23, 2013 04:40

So you do not allocate memory for UDM in the FLUENT GUI? It should be in
Define -> User-Defined -> Memory...

It is a good idea to test whether the storage has been allocated before accessing them by
Code:

if (NNULLP(THREAD_STORAGE(t,SV_UDM_I))) {

}


dany_@ July 23, 2013 05:00

Quote:

Originally Posted by blackmask (Post 441398)
So you do not allocate memory for UDM in the FLUENT GUI? It should be in
Define -> User-Defined -> Memory...

It is a good idea to test whether the storage has been allocated before accessing them by
Code:

if (NNULLP(THREAD_STORAGE(t,SV_UDM_I))) {

}



I tried..but it still doesn't work..


All times are GMT -4. The time now is 12:56.