CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF for temperature gradient (

A Kourm March 6, 2009 14:30

UDF for temperature gradient

im trying to run a compiled udf which I got from one of the fluent manuals (so I know it should work), Ive definitely got my c source file in the same folder as my case file, and ive chosen the header file from the fluent installation directory (udf.h), but i always get an error:

'The system cannot find the file specified. 1 file copied

and then it doesnt build a library file, so I cant open it... any ideas? Thanks a lot

kuba March 6, 2009 15:08

Re: UDF for temperature gradient
Can you place your UDF here??

A Kourm March 9, 2009 06:18

Re: UDF for temperature gradient
Hi Kuba,

the UDF im using is from the UDF users manual, so its correct, Ive checked the log file and it just has:

'cl' is not recognized as an internal or external command, operable program or batch file. NMAKE : U1077: 'cl' : return code '0x1' Stop.

I have visual studio and a c compiler so im not sure what the problem is...the source file is in the same folder as the case/dat files and im using udf.h as the header file.. Thanks again in advance.

UDF: #include "udf.h" /* Define which user-defined scalars to use. */ enum { T4, MAG_GRAD_T4, N_REQUIRED_UDS }; DEFINE_ADJUST(adjust_fcn, domain) { Thread *t; cell_t c; face_t f; /* Make sure there are enough user-defined scalars. */ if (n_uds < N_REQUIRED_UDS) Internal_Error("not enough user-defined scalars allocated"); /* Fill first UDS with temperature raised to fourth power. */ thread_loop_c (t,domain) { if (NULL != THREAD_STORAGE(t,SV_UDS_I(T4))) { begin_c_loop (c,t) { real T = C_T(c,t); C_UDSI(c,t,T4) = pow(T,4.); } end_c_loop (c,t) } } } /* Fill second UDS with magnitude of gradient. */ thread_loop_c (t,domain) { if (NULL != THREAD_STORAGE(t,SV_UDS_I(T4)) && NULL != T_STORAGE_R_NV(t,SV_UDSI_G(T4))) { begin_c_loop (c,t) { C_UDSI(c,t,MAG_GRAD_T4) = NV_MAG(C_UDSI_G(c,t,T4)); } end_c_loop (c,t) } } thread_loop_f (t,domain) { if (NULL != THREAD_STORAGE(t,SV_UDS_I(T4)) && NULL != T_STORAGE_R_NV(t->t0,SV_UDSI_G(T4))) { begin_f_loop (f,t) { F_UDSI(f,t,MAG_GRAD_T4)=C_UDSI(F_C0(f,t),t->t0,MAG_GRAD_T4); } end_f_loop (f,t) } }

All times are GMT -4. The time now is 11:49.