|
[Sponsors] |
February 11, 2010, 12:34 |
DEFINE_GRID_MOTION crash without any info??
|
#1 |
New Member
Join Date: Apr 2009
Posts: 11
Rep Power: 17 |
This is my code to run DEFINE_GRID_MOTION. However, it crashed whenever I run "dynamic mesh preview" more than 1 time step. If I run 1 step each time I restart fluent, it works.
Maybe it is because of the stack pointer I add. But I've already free it after use. Would you please help me out? Note: The pointer value is used to receive a udf loadinterp and it works well (I checked that inside Fluent). BTW, how to use Macro to compile UDF step by step? Thanks a lot! Code:
DEFINE_GRID_MOTION(DefineGridMotionTest, domain, dt, time, dtime) { Thread *tf = DT_THREAD (dt); face_t f; Node *v; float *value= (float *)malloc(3*sizeof(float)); float NV_VEC (dx); int n; char str [ FILENAME_MAX ]; sprintf_s(str,FILENAME_MAX, "c:\\BoundGrid_%d.txt", N_TIME+1); // set deforming flag on adjacent cell zone SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf)); Message ("time = %f %d\n", time,N_TIME); begin_f_loop (f, tf) { f_node_loop (f, tf, n) { v = F_NODE (f, tf, n); // update node if x position is greater than 0.02 // and that the current node has not been previously // visited when looping through previous faces if (NODE_POS_NEED_UPDATE (v)) { // indicate that node position has been update // so that it's not updated more than once NODE_POS_UPDATED (v); value = loadinterp(str, NODE_COORD (v)[0], NODE_COORD (v)[1],NODE_COORD (v)[2]); NV_DS (dx, =, *value,*(value+1),*(value+2),*,dtime); NV_V (NODE_COORD (v), +=, dx); } } } end_f_loop (f, tf); free(value); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Code_Saturne info? | phsieh2005 | Main CFD Forum | 5 | November 7, 2007 07:20 |
mesh scale info | Dave | FLUENT | 1 | July 9, 2007 14:33 |
OpenFOAM with Cygwin | kitchener | OpenFOAM Installation | 6 | April 24, 2006 23:09 |
Where to get these info.. | Jas | Phoenics | 2 | January 15, 2004 06:02 |
Accessing Neighbouring Cell info | Murali | Siemens | 1 | December 9, 2002 06:10 |