|
[Sponsors] |
UDF "Define_On_Demand" error: "Segmentation Violation" |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 3, 2015, 03:23 |
UDF "Define_On_Demand" error: "Segmentation Violation"
|
#1 |
Member
Anh
Join Date: Sep 2014
Posts: 69
Rep Power: 11 |
Hi, Fluent UDF user,
This is the same question as previous thread: Hooking On_Demand error. I re-wrote new code, the compiler and loading UDF is OK. But when the code hooked, It showed the proplem as in the picture below (pic.12 is the compiler successful, pic.11 is the error). Could you please help me solve this problem?? Thank you very much. #include "udf.h" #include "math.h" DEFINE_ON_DEMAND(contour) { Domain *d; Thread *t; cell_t c; Node *v; d=Get_Domain(1); int i,j,k,n,m; real dx,dy,dz,delta,Cdes=0.65,Lt,Ldes; thread_loop_c(t,d) /*loops over all cell threads in domain*/ { begin_c_loop(c,t) /* loops over cells in a cell thread */ { c_node_loop(c,t,n) /* loops over node in a cell thread */ { v=C_NODE(c,t,n); NODE_MARK(v)=0; } } end_c_loop(c,t) begin_c_loop(c,t) /* loops over cells in a cell thread */ { k=C_NNODES(c,t); real x[k],y[k],z[k]; real delx1=0,dely1=0,delz1=0; for (m=0;m<=k;m++) { c_node_loop(c,t,n) /* loops over node in a cell thread */ { v=C_NODE(c,t,n); x[m]=NODE_X(v); y[m]=NODE_Y(v); z[m]=NODE_Z(v); if (NODE_MARK(v)==0) NODE_MARK(v)=1; } } for (i=0;i<=k;i++) { for (j=0;j<=k;j++) { dx=MAX(delx1,fabs(x[i]-x[j])); dy=MAX(dely1,fabs(y[i]-y[j])); dz=MAX(delz1,fabs(z[i]-z[j])); delta=MAX(dx,dy); delta=MAX(delta,dz); } } Lt=sqrt(C_K(c,t))/0.09/C_O(c,t); Ldes=Cdes*delta; if(Lt>Ldes) { C_UDMI(c,t,1)=1; } if(Lt<=Ldes) { C_UDMI(c,t,1)=0; } } end_c_loop(c,t) } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
specified shear at wall - temperature gradient - UDF - access violation error | senD | Fluent UDF and Scheme Programming | 9 | September 18, 2014 07:29 |
UDF for Mass Flow at the Outlet: ERROR ACCESS VIOLATION | I-mech | Fluent UDF and Scheme Programming | 1 | May 23, 2014 12:37 |
udf segmentation violation when hooked | jjchristophe | Fluent UDF and Scheme Programming | 9 | June 25, 2012 05:46 |
udf error : access violation | butterfly007 | Fluent UDF and Scheme Programming | 2 | June 1, 2012 11:01 |
UDF Access violation | therandomestname | FLUENT | 0 | April 15, 2011 17:31 |